ports/149674: [patch] fusefs-kmod: ftruncate() sycall on FUSE filesystems cause panic
Dmitrij Tejblum
dt at yandex.ru
Sun Aug 15 14:00:05 UTC 2010
>Number: 149674
>Category: ports
>Synopsis: [patch] fusefs-kmod: ftruncate() sycall on FUSE filesystems cause panic
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Aug 15 14:00:04 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: Dmitrij Tejblum
>Release: 8.1-STABLE
>Organization:
>Environment:
>Description:
At early days of FreeBSD 8.x a field named `fo_truncate' was added `struct fileops' in sys/file.h, and ftruncate() syscall was made to use it. FUSE module has its own instance of `struct fileops', but it was not adapted to this change.
(It seems that FreeBSD 7.x and earlier aren't affected by this bug.)
>How-To-Repeat:
On a FUSE filesystem (e.g. ntfs-3g) do
dd if=/dev/zero count=1 oseek=1000000 of=SOMEFILE
The system will panic.
>Fix:
The attached patch can be added to the files/ directory of the sysutils/fusefs-kmod port as patch-fuse_module__fuse_main.c
Patch attached with submission follows:
--- fuse_module/fuse_main.c.00 2010-08-15 14:40:29.000000000 +0400
+++ fuse_module/fuse_main.c 2010-08-15 15:56:56.000000000 +0400
@@ -108,6 +108,9 @@
switch (what) {
case MOD_LOAD: /* kldload */
+#if __FreeBSD_version > 800009
+ fuse_fileops.fo_truncate = vnops.fo_truncate;
+#endif
fuse_fileops.fo_ioctl = vnops.fo_ioctl;
fuse_fileops.fo_poll = vnops.fo_poll;
fuse_fileops.fo_kqfilter = vnops.fo_kqfilter;
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list