[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.0.5 04/66] checkpatch: add qemu_bh_new/aio_bh_new checks
From: |
Michael Tokarev |
Subject: |
[Stable-8.0.5 04/66] checkpatch: add qemu_bh_new/aio_bh_new checks |
Date: |
Wed, 13 Sep 2023 16:17:28 +0300 |
From: Alexander Bulekov <alxndr@bu.edu>
Advise authors to use the _guarded versions of the APIs, instead.
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Message-Id: <20230427211013.2994127-4-alxndr@bu.edu>
Signed-off-by: Thomas Huth <thuth@redhat.com>
(cherry picked from commit ef56ffbdd6b0605dc1e305611287b948c970e236)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d768171dcf..eeaec436eb 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2865,6 +2865,14 @@ sub process {
if ($line =~ /\bsignal\s*\(/ && !($line =~ /SIG_(?:IGN|DFL)/)) {
ERROR("use sigaction to establish signal handlers;
signal is not portable\n" . $herecurr);
}
+# recommend qemu_bh_new_guarded instead of qemu_bh_new
+ if ($realfile =~ /.*\/hw\/.*/ && $line =~ /\bqemu_bh_new\s*\(/) {
+ ERROR("use qemu_bh_new_guarded() instead of
qemu_bh_new() to avoid reentrancy problems\n" . $herecurr);
+ }
+# recommend aio_bh_new_guarded instead of aio_bh_new
+ if ($realfile =~ /.*\/hw\/.*/ && $line =~ /\baio_bh_new\s*\(/) {
+ ERROR("use aio_bh_new_guarded() instead of aio_bh_new()
to avoid reentrancy problems\n" . $herecurr);
+ }
# check for module_init(), use category-specific init macros explicitly please
if ($line =~ /^module_init\s*\(/) {
ERROR("please use block_init(), type_init() etc.
instead of module_init()\n" . $herecurr);
--
2.39.2
- [Stable-8.0.5 00/66] v2 Patch Round-up for stable 8.0.5, freeze on 2023-09-19, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 01/66] memory: prevent dma-reentracy issues, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 02/66] async: Add an optional reentrancy guard to the BH API, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 03/66] async: avoid use-after-free on re-entrancy guard, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 04/66] checkpatch: add qemu_bh_new/aio_bh_new checks,
Michael Tokarev <=
- [Stable-8.0.5 05/66] hw: replace most qemu_bh_new calls with qemu_bh_new_guarded, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 06/66] lsi53c895a: disable reentrancy detection for script RAM, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 07/66] lsi53c895a: disable reentrancy detection for MMIO region, too, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 08/66] bcm2835_property: disable reentrancy detection for iomem, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 10/66] apic: disable reentrancy detection for apic-msi, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 09/66] raven: disable reentrancy detection for iomem, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 11/66] loongarch: mark loongarch_ipi_iocsr re-entrnacy safe, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 12/66] pnv_lpc: disable reentrancy detection for lpc-hc, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 57/66] arm64: Restore trapless ptimer access, Michael Tokarev, 2023/09/13
- [Stable-8.0.5 56/66] virtio: Drop out of coroutine context in virtio_load(), Michael Tokarev, 2023/09/13