FreeBSD Bugzilla – Attachment 254918 Details for
Bug 282478
[ipfilter] Silence a lock upon service stop
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
ipfilter: Avoid stopping with a lock held
0001-ipfilter-Avoid-stopping-with-a-lock-held.patch (text/plain), 2.44 KB, created by
Jose Luis Duran
on 2024-11-03 21:52:04 UTC
(
hide
)
Description:
ipfilter: Avoid stopping with a lock held
Filename:
MIME Type:
Creator:
Jose Luis Duran
Created:
2024-11-03 21:52:04 UTC
Size:
2.44 KB
patch
obsolete
>From a5c23090b616c391995f02351da8c1829fe63736 Mon Sep 17 00:00:00 2001 >From: Jose Luis Duran <jlduran@FreeBSD.org> >Date: Sat, 2 Nov 2024 17:58:59 +0000 >Subject: [PATCH] ipfilter: Avoid stopping with a lock held > >Avoid calling _callout_stop_safe with a non-sleepable lock held when >detaching by initializing callout_init_rw() with CALLOUT_SHAREDLOCK. > >It avoids the following WITNESS warning when stopping the service: > > # service ipfilter stop > calling _callout_stop_safe with the following non-sleepable locks held: > shared rw ipf filter load/unload mutex (ipf filter load/unload mutex) r = 0 (0xffff0000417c7530) locked @ /usr/src/sys/netpfil/ipfilter/netinet/fil.c:7926 > stack backtrace: > #0 0xffff00000052d394 at witness_debugger+0x60 > #1 0xffff00000052e620 at witness_warn+0x404 > #2 0xffff0000004d4ffc at _callout_stop_safe+0x8c > #3 0xffff0000f7236674 at ipfdetach+0x3c > #4 0xffff0000f723fa4c at ipf_ipf_ioctl+0x788 > #5 0xffff0000f72367e0 at ipfioctl+0x144 > #6 0xffff00000034abd8 at devfs_ioctl+0x100 > #7 0xffff0000005c66a0 at vn_ioctl+0xbc > #8 0xffff00000034b2cc at devfs_ioctl_f+0x24 > #9 0xffff0000005331ec at kern_ioctl+0x2e0 > #10 0xffff000000532eb4 at sys_ioctl+0x140 > #11 0xffff000000880480 at do_el0_sync+0x604 > #12 0xffff0000008579ac at handle_el0_sync+0x4c > >PR: 282478 >Suggested by: markj >--- > sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c >index bcde0d2c7323..b3dea40c3d8c 100644 >--- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c >+++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c >@@ -181,7 +181,7 @@ ipf_timer_func(void *arg) > #if 0 > softc->ipf_slow_ch = timeout(ipf_timer_func, softc, hz/2); > #endif >- callout_init(&softc->ipf_slow_ch, 1); >+ callout_init_rw(&softc->ipf_slow_ch, &softc->ipf_global.ipf_lk, CALLOUT_SHAREDLOCK); > callout_reset(&softc->ipf_slow_ch, > (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT, > ipf_timer_func, softc); >@@ -221,7 +221,7 @@ ipfattach(ipf_main_softc_t *softc) > softc->ipf_slow_ch = timeout(ipf_timer_func, softc, > (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT); > #endif >- callout_init(&softc->ipf_slow_ch, 1); >+ callout_init_rw(&softc->ipf_slow_ch, &softc->ipf_global.ipf_lk, CALLOUT_SHAREDLOCK); > callout_reset(&softc->ipf_slow_ch, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT, > ipf_timer_func, softc); > return (0); >-- >Jose Luis Duran >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 282478
:
254881
|
254890
|
254917
| 254918