Date: Wed, 14 Jun 2017 14:30:32 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 219988] [kernel] sys/kern/kern_sysctl.c:a sleep-under-rmlock bug in sysctl_add_oid Message-ID: <bug-219988-8@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D219988 Bug ID: 219988 Summary: [kernel] sys/kern/kern_sysctl.c:a sleep-under-rmlock bug in sysctl_add_oid Product: Base System Version: 11.0-RELEASE Hardware: i386 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: baijiaju1990@163.com The kernel may sleep under a rmlock, and the function call path in file "sys/kern/kern_sysctl.c" in FreeBSD 11.0 is: sysctl_add_oid [line 706: acquire the rmlock] malloc(M_WAITOK) [line 722] --> may sleep The possible fix of this bug is to replace "M_WAITOK" with "M_NOWAIT" in malloc. This bug is found by a static analysis tool written by myself, and it is checked by my review of the FreeBSD code. 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-219988-8>