Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jun 2017 08:19:27 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 220035] [ufs] sys/ufs/ufs/ufs_vnops.c: a sleep-under-mutex bug in acl_alloc
Message-ID:  <bug-220035-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D220035

            Bug ID: 220035
           Summary: [ufs] sys/ufs/ufs/ufs_vnops.c: a sleep-under-mutex bug
                    in acl_alloc
           Product: Base System
           Version: 11.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: baijiaju1990@163.com

The ufs program may sleep under a mutex, and the code path in file
"sys/ufs/ufs/ufs_vnops.c" in FreeBSD 11.0 is:
ufs_accessx [line 363: acquire the mutex]
ufs_accessx [line 369]
ufs_accessx [line 372]
ufs_accessx [line 374]
ufs_accessx [line 376]
ufs_accessx [line 379]
ufs_accessx [line 383]
ufs_accessx [line 389]
ufs_accessx [line 394]
ufs_accessx [line 395]
ufs_accessx [line 398]
  acl_alloc(M_WAITOK) [line 400] --> may sleep

The possible fix of these bugs is to set the parameter in acl_alloc to
"M_NOWAIT".

This bug is found by a static analysis tool written by myself, and it is
checked by my review of the FreeBSD code.

By the way, I am a freshman in developing FreeBSD drivers, and I am willing=
 to
submit a patch. But I do not know how to write and submit a patch, and wher=
e to
submit, so I am looking forward to useful advice :)

Jia-Ju Bai

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-220035-8>