Skip to content

overflow: Refactor open-coded arithmetic wrap-around

Kees Cook bpf cocci dm-devel dri-devel intel-gfx kvm kvmarm linux-acpi linux-arm-kernel linux-bcachefs linux-btrfs linux-cifs linux-crypto linux-doc linux-ext4 linux-f2fs-devel linux-fpga linux-fsdevel linux-hardening linux-kbuild linux-kselftest linux-m68k linux-media linux-mm linux-pci linux-perf-users linux-rdma linux-remoteproc linux-s390 linux-scsi linux-sgx linux-sh linux-snps-arc linux-staging linux-wireless linuxppc-dev lkml llvm netdev netfilter-devel nouveau ntfs3 ocfs2-devel virtualization workflows xen-devel 1 version NAK

Status from this message: NAK.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest82 patches 80 repliesNAK

Patches in v1

#Subject and filesSizeRepliesApplied
1/82overflow: Expand check_add_overflow() for pointer additioninclude/linux/compiler_types.h include/linux/overflow.h lib/overflow_kunit.c+121 -102 replies
2/82overflow: Introduce add_would_overflow()include/linux/overflow.h+16 -02 replies
3/82overflow: Introduce add_wrap()include/linux/overflow.h+16 -04 replies
4/82docs: deprecated.rst: deprecate open-coded arithmetic wrap-aroundDocumentation/process/deprecated.rst+32 -00 replies
5/82cocci: Refactor open-coded arithmetic wrap-aroundscripts/coccinelle/misc/add_would_overflow.cocci+70 -00 replies
6/82overflow: Reintroduce signed and unsigned overflow sanitizersDocumentation/process/deprecated.rst include/linux/compiler_types.h lib/Kconfig.ubsan +4 more+159 -13 replies
7/82overflow: Introduce CONFIG_UBSAN_POINTER_WRAPDocumentation/process/deprecated.rst include/linux/compiler_types.h lib/Kconfig.ubsan +4 more+71 -20 replies
8/82iov_iter: Avoid wrap-around instrumentation in copy_compat_iovec_from_userlib/iov_iter.c+3 -20 replies
9/82select: Avoid wrap-around instrumentation in do_sys_poll()fs/select.c+7 -61 reply
10/82locking/atomic/x86: Silence intentional wrapping additionarch/x86/include/asm/atomic.h+1 -12 replies
11/82arm64: atomics: lse: Silence intentional wrapping additionarch/arm64/include/asm/atomic_lse.h+4 -41 reply
12/82ipv4: Silence intentional wrapping additionnet/ipv4/route.c+4 -40 replies
13/82btrfs: Refactor intentional wrap-around calculationfs/btrfs/extent_map.c fs/btrfs/extent_map.h+8 -41 reply
14/82smb: client: Refactor intentional wrap-around calculationfs/smb/client/readdir.c+3 -20 replies
15/82dma-buf: Refactor intentional wrap-around calculationdrivers/dma-buf/dma-buf.c+4 -30 replies
16/82drm/nouveau/mmu: Refactor intentional wrap-around calculationdrivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c+4 -20 replies
17/82drm/vc4: Refactor intentional wrap-around calculationdrivers/gpu/drm/vc4/vc4_validate.c+3 -20 replies
18/82ext4: Refactor intentional wrap-around calculationfs/ext4/extents.c+3 -20 replies
19/82fs: Refactor intentional wrap-around calculationfs/read_write.c+5 -31 reply
20/82fpga: dfl: Refactor intentional wrap-around calculationdrivers/fpga/dfl.c+3 -20 replies
21/82drivers/fsi: Refactor intentional wrap-around calculationdrivers/fsi/fsi-core.c+4 -20 replies
22/82x86/sgx: Refactor intentional wrap-around calculationarch/x86/kernel/cpu/sgx/ioctl.c+4 -21 reply
23/82KVM: Refactor intentional wrap-around calculationvirt/kvm/coalesced_mmio.c+4 -21 reply
24/82KVM: arm64: vgic: Refactor intentional wrap-around calculationarch/arm64/kvm/vgic/vgic-kvm-device.c arch/arm64/kvm/vgic/vgic-v2.c+10 -62 replies
25/82KVM: SVM: Refactor intentional wrap-around calculationarch/x86/kvm/svm/sev.c+3 -21 reply
26/82buildid: Refactor intentional wrap-around calculationlib/buildid.c+4 -20 replies
27/82m68k: Refactor intentional wrap-around calculationarch/m68k/kernel/sys_m68k.c+3 -24 replies
28/82niu: Refactor intentional wrap-around calculationdrivers/net/ethernet/sun/niu.c+3 -20 replies
29/82rds: Refactor intentional wrap-around calculationnet/rds/info.c+4 -20 replies
30/82s390/kexec_file: Refactor intentional wrap-around calculationarch/s390/include/asm/stacktrace.h arch/s390/kernel/machine_kexec_file.c+7 -42 replies
31/82ARC: dw2 unwind: Refactor intentional wrap-around calculationarch/arc/kernel/unwind.c+3 -20 replies
32/82vringh: Refactor intentional wrap-around calculationdrivers/vhost/vringh.c+5 -32 replies
33/82mm/vmalloc: Refactor intentional wrap-around calculationmm/vmalloc.c+3 -24 replies
34/82ipc: Refactor intentional wrap-around calculationipc/shm.c+4 -24 replies
35/82ACPI: custom_method: Refactor intentional wrap-around testdrivers/acpi/custom_method.c+1 -12 replies
36/82agp: Refactor intentional wrap-around testdrivers/char/agp/generic.c+1 -10 replies
37/82aio: Refactor intentional wrap-around testfs/aio.c+1 -12 replies
38/82arm: 3117/1: Refactor intentional wrap-around testarch/arm/nwfpe/softfloat.c+1 -12 replies
39/82crypto: Refactor intentional wrap-around testdrivers/crypto/axis/artpec6_crypto.c+1 -10 replies
40/82arm64: stacktrace: Refactor intentional wrap-around testarch/arm64/include/asm/stacktrace/common.h+1 -11 reply
41/82wil6210: Refactor intentional wrap-around testdrivers/net/wireless/ath/wil6210/wmi.c+1 -13 replies
42/82bcachefs: Refactor intentional wrap-around testfs/bcachefs/bkey.c fs/bcachefs/fs.c fs/bcachefs/quota.c +1 more+5 -51 reply
43/82bpf: Refactor intentional wrap-around testkernel/bpf/verifier.c+6 -63 replies
44/82btrfs: Refactor intentional wrap-around testfs/btrfs/ordered-data.c+1 -11 reply
45/82cifs: Refactor intentional wrap-around testfs/smb/client/smb2pdu.c+2 -20 replies
46/82crypto: Refactor intentional wrap-around testcrypto/adiantum.c drivers/crypto/amcc/crypto4xx_alg.c+2 -22 replies
47/82dm verity: Refactor intentional wrap-around testdrivers/md/dm-switch.c drivers/md/dm-verity-target.c drivers/md/dm-writecache.c+3 -31 reply
48/82drm/nouveau/mmu: Refactor intentional wrap-around testdrivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c+1 -10 replies
49/82drm/i915: Refactor intentional wrap-around testdrivers/gpu/drm/i915/i915_vma.c+1 -10 replies
50/82drm/vc4: Refactor intentional wrap-around testdrivers/gpu/drm/vc4/vc4_validate.c+1 -10 replies
51/82ext4: Refactor intentional wrap-around testfs/ext4/block_validity.c fs/ext4/resize.c+2 -20 replies
52/82f2fs: Refactor intentional wrap-around testfs/f2fs/file.c fs/f2fs/verity.c+2 -20 replies
53/82fs: Refactor intentional wrap-around testfs/remap_range.c+1 -11 reply
54/82hpfs: Refactor intentional wrap-around testfs/hpfs/alloc.c+1 -10 replies
55/82kasan: Refactor intentional wrap-around testmm/kasan/generic.c mm/kasan/sw_tags.c+2 -21 reply
56/82usercopy: Refactor intentional wrap-around testmm/usercopy.c+1 -10 replies
57/82KVM: arm64: vgic-v3: Refactor intentional wrap-around testarch/arm64/kvm/vgic/vgic-mmio-v3.c+1 -12 replies
58/82s390/mm: Refactor intentional wrap-around testarch/s390/mm/gmap.c+2 -20 replies
59/82lib/scatterlist: Refactor intentional wrap-around testlib/scatterlist.c+1 -10 replies
60/82powerpc: Refactor intentional wrap-around testarch/powerpc/platforms/powernv/opal-prd.c arch/powerpc/xmon/xmon.c+2 -21 reply
61/82scsi: mpt3sas: Refactor intentional wrap-around testdrivers/scsi/mpt3sas/mpt3sas_ctl.c+1 -10 replies
62/82mwifiex: pcie: Refactor intentional wrap-around testdrivers/net/wireless/marvell/mwifiex/pcie.c+3 -31 reply
63/82mm: Refactor intentional wrap-around testmm/memory.c mm/mmap.c mm/mremap.c +2 more+7 -70 replies
64/82netfilter: Refactor intentional wrap-around testnet/netfilter/xt_u32.c+2 -21 reply
65/82nios2: Refactor intentional wrap-around testarch/nios2/kernel/sys_nios2.c+1 -11 reply
66/82fs/ntfs3: Refactor intentional wrap-around testfs/ntfs3/record.c+2 -20 replies
67/82ocfs2: Refactor intentional wrap-around testfs/ocfs2/resize.c+1 -10 replies
68/82PCI: Refactor intentional wrap-around testdrivers/pci/pci.c+1 -10 replies
69/82perf tools: Refactor intentional wrap-around testtools/perf/util/dso.c tools/perf/util/unwind-libdw.c tools/perf/util/unwind-libunwind-local.c+3 -32 replies
70/82remoteproc: Refactor intentional wrap-around testdrivers/remoteproc/pru_rproc.c drivers/remoteproc/remoteproc_elf_loader.c drivers/remoteproc/remoteproc_virtio.c+4 -41 reply
71/82s390/mm: Refactor intentional wrap-around testarch/s390/mm/vmem.c+1 -10 replies
72/82scsi: sd_zbc: Refactor intentional wrap-around testdrivers/scsi/sd_zbc.c+1 -10 replies
73/82sh: Refactor intentional wrap-around testarch/sh/kernel/sys_sh.c+1 -11 reply
74/82ARC: dw2 unwind: Refactor intentional wrap-around testarch/arc/kernel/unwind.c+1 -10 replies
75/82timekeeping: Refactor intentional wrap-around testkernel/time/timekeeping.c+1 -12 replies
76/82udf: Refactor intentional wrap-around testfs/udf/balloc.c+2 -21 reply
77/82virtio: Refactor intentional wrap-around testdrivers/virtio/virtio_pci_modern_dev.c+2 -21 reply
78/82mm/vmalloc: Refactor intentional wrap-around testmm/vmalloc.c+1 -11 reply
79/82staging: vme_user: Refactor intentional wrap-around testdrivers/staging/vme_user/vme.c+1 -10 replies
80/82xen-netback: Refactor intentional wrap-around testdrivers/net/xen-netback/hash.c+1 -12 replies
81/82lib: zstd: Refactor intentional wrap-around testlib/zstd/decompress/zstd_decompress.c+2 -20 replies
82/82mqueue: Refactor intentional wrap-around testipc/mqueue.c+1 -10 replies

Reviews trailers per patch

29 of 82 patches have a Reviewed-by or Acked-by.

PatchJohn StultzDavid SterbaLiam R. HowlettYonghong SongKalle ValoKent OverstreetJohn Paul Adrian GlaubitzGeert UytterhoevenJarkko SakkinenMark RutlandMarc ZyngierDinh NguyenJan KaraFlorian WestphalEric AugerThomas GleixnerAndrey KonovalovEugenio PérezJustin StittLorenzo StoakesMike SnitzerBjorn AnderssonMichael Ellerman
1/82R-b
2/82
3/82
4/82
5/82
6/82
7/82
8/82
9/82R-b
10/82
11/82
12/82
13/82A-b
14/82
15/82
16/82
17/82
18/82
19/82R-b
20/82
21/82
22/82R-b
23/82
24/82A-b R-b
25/82
26/82
27/82R-b R-b A-b
28/82
29/82
30/82
31/82
32/82A-b
33/82R-b
34/82
35/82
36/82
37/82R-b
38/82
39/82
40/82A-b
41/82A-b
42/82A-b
43/82A-b
44/82A-b
45/82
46/82
47/82R-b
48/82
49/82
50/82
51/82
52/82
53/82R-b
54/82
55/82A-b
56/82
57/82A-b R-b
58/82
59/82
60/82A-b
61/82
62/82A-b
63/82
64/82A-b
65/82A-b
66/82
67/82
68/82
69/82
70/82A-b
71/82
72/82
73/82A-b
74/82
75/82A-b R-b
76/82R-b
77/82R-b
78/82R-b
79/82
80/82
81/82
82/82

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 23 reviewers.

Read the v1 thread

Cover letter [PATCH 00/82] overflow: Refactor open-coded arithmetic wrap-around

Hi,

In our continuing effort to eliminate root causes of flaws in the kernel, this series is the start to providing a way to have sensible coverage for catching unexpected arithmetic wrap-around.

A quick word on language: while discussing[1] the finer details of the C standard's view on arithmetic, I was disabused of using the term "overflow" when what I really mean is "wrap-around". When describing security vulnerabilities, "overflow" is the common term and often used interchangeably with "wrap-around". Strictly speaking, though, "overflow" applies only to signed[2] and pointer[3] types, and "wrap-around" is for unsigned[4]. An arithmetic "overflow" is considered undefined behavior, which has caused our builds pain in the past, since "impossible" conditions might get elided by the compiler. As a result, we build with -fno-strict-overflow which coverts all "overflow" conditions into "wrap-around" (i.e. 2s complement), regardless of type.

All this is to say I am discussing arithmetic wrap-around, which is the condition where the value exceeds a type's maximum value (or goes below its minimum value) and wraps around. I'm not interested in the narrow definition of "undefined behavior" -- we need to stamp out the _unexpected_ behavior, where the kernel operates on a pathological value that wrapped around without the code author's intent.

As always, this is about being able disambiguate the intent of arithmetic in the kernel. We intentionally use wrapping arithmetic in all kinds of places, but we need to be able to annotate it as such going forward so the compiler can distinguish when it needs to perform instrumentation (when such instrumentation is enabled).

Getting back to my earlier mention of -fno-strict-overflow, the bulk of the series is refactoring for a common code pattern in the kernel where to test for potentially overflowing addition, the addition is performed, and wrap-around is tested for. This is what originally[5] caused us to enable -fno-strict-overflow:

var + offset < var

For these cases we can use either check_add_overflow() or add_would_overflow(). These helpers will not trip the wrap-around instrumentation, and do not depend on the whims of the compiler options. (Note that I have no intention of removing -fno-strict-overflow any time soon, if ever. As with all these kinds of changes, we need to evolve our support for it, and we can't introduce undefined behavior into the kernel.)

This series is mainly 3 parts:

- documentation, a coccinelle script, and new/improved helpers
- (re)introduction of the overflow sanitizers
- refactoring the "please wrap around to see if I wrapped around" tests

While this work is underway in the kernel, there will be complementary work happening in GCC and Clang to expand the existing sanitizers to behave correctly with -fno-strict-overflow. In the meantime, the sanitizers are excluded from CONFIG_COMPILE_TEST.

-Kees

[1] https://gcc.gnu.org/pipermail/gcc-patches/2023-September/630578.html
[2] https://github.com/KSPP/linux/issues/26
[3] https://github.com/KSPP/linux/issues/344
[4] https://github.com/KSPP/linux/issues/27
[5] https://bugzilla.kernel.org/show_bug.cgi?id=12597

Kees Cook (82):
overflow: Expand check_add_overflow() for pointer addition
overflow: Introduce add_would_overflow()
overflow: Introduce add_wrap()
docs: deprecated.rst: deprecate open-coded arithmetic wrap-around
cocci: Refactor open-coded arithmetic wrap-around
overflow: Reintroduce signed and unsigned overflow sanitizers
overflow: Introduce CONFIG_UBSAN_POINTER_WRAP
iov_iter: Avoid wrap-around instrumentation in
copy_compat_iovec_from_user
select: Avoid wrap-around instrumentation in do_sys_poll() locking/atomic/x86: Silence intentional wrapping addition
arm64: atomics: lse: Silence intentional wrapping addition
ipv4: Silence intentional wrapping addition
btrfs: Refactor intentional wrap-around calculation
smb: client: Refactor intentional wrap-around calculation
dma-buf: Refactor intentional wrap-around calculation drm/nouveau/mmu: Refactor intentional wrap-around calculation drm/vc4: Refactor intentional wrap-around calculation
ext4: Refactor intentional wrap-around calculation
fs: Refactor intentional wrap-around calculation
fpga: dfl: Refactor intentional wrap-around calculation drivers/fsi: Refactor intentional wrap-around calculation x86/sgx: Refactor intentional wrap-around calculation
KVM: Refactor intentional wrap-around calculation
KVM: arm64: vgic: Refactor intentional wrap-around calculation
KVM: SVM: Refactor intentional wrap-around calculation
buildid: Refactor intentional wrap-around calculation
m68k: Refactor intentional wrap-around calculation
niu: Refactor intentional wrap-around calculation
rds: Refactor intentional wrap-around calculation s390/kexec_file: Refactor intentional wrap-around calculation
ARC: dw2 unwind: Refactor intentional wrap-around calculation
vringh: Refactor intentional wrap-around calculation mm/vmalloc: Refactor intentional wrap-around calculation
ipc: Refactor intentional wrap-around calculation
ACPI: custom_method: Refactor intentional wrap-around test
agp: Refactor intentional wrap-around test
aio: Refactor intentional wrap-around test
arm: 3117/1: Refactor intentional wrap-around test
crypto: Refactor intentional wrap-around test
arm64: stacktrace: Refactor intentional wrap-around test
wil6210: Refactor intentional wrap-around test
bcachefs: Refactor intentional wrap-around test
bpf: Refactor intentional wrap-around test
btrfs: Refactor intentional wrap-around test
cifs: Refactor intentional wrap-around test
crypto: Refactor intentional wrap-around test
dm verity: Refactor intentional wrap-around test drm/nouveau/mmu: Refactor intentional wrap-around test drm/i915: Refactor intentional wrap-around test drm/vc4: Refactor intentional wrap-around test
ext4: Refactor intentional wrap-around test
f2fs: Refactor intentional wrap-around test
fs: Refactor intentional wrap-around test
hpfs: Refactor intentional wrap-around test
kasan: Refactor intentional wrap-around test
usercopy: Refactor intentional wrap-around test
KVM: arm64: vgic-v3: Refactor intentional wrap-around test s390/mm: Refactor intentional wrap-around test lib/scatterlist: Refactor intentional wrap-around test
powerpc: Refactor intentional wrap-around test
scsi: mpt3sas: Refactor intentional wrap-around test
mwifiex: pcie: Refactor intentional wrap-around test
mm: Refactor intentional wrap-around test
netfilter: Refactor intentional wrap-around test
nios2: Refactor intentional wrap-around test
fs/ntfs3: Refactor intentional wrap-around test
ocfs2: Refactor intentional wrap-around test
PCI: Refactor intentional wrap-around test
perf tools: Refactor intentional wrap-around test
remoteproc: Refactor intentional wrap-around test s390/mm: Refactor intentional wrap-around test
scsi: sd_zbc: Refactor intentional wrap-around test
sh: Refactor intentional wrap-around test
ARC: dw2 unwind: Refactor intentional wrap-around test
timekeeping: Refactor intentional wrap-around test
udf: Refactor intentional wrap-around test
virtio: Refactor intentional wrap-around test mm/vmalloc: Refactor intentional wrap-around test
staging: vme_user: Refactor intentional wrap-around test
xen-netback: Refactor intentional wrap-around test
lib: zstd: Refactor intentional wrap-around test
mqueue: Refactor intentional wrap-around test

 Documentation/process/deprecated.rst          | 36 ++++++++
 arch/arc/kernel/unwind.c                      |  7 +-
 arch/arm/nwfpe/softfloat.c                    |  2 +-
 arch/arm64/include/asm/atomic_lse.h           |  8 +-
 arch/arm64/include/asm/stacktrace/common.h    |  2 +-
 arch/arm64/kvm/vgic/vgic-kvm-device.c         |  6 +-
 arch/arm64/kvm/vgic/vgic-mmio-v3.c            |  2 +-
 arch/arm64/kvm/vgic/vgic-v2.c                 | 10 ++-
 arch/m68k/kernel/sys_m68k.c                   |  5 +-
 arch/nios2/kernel/sys_nios2.c                 |  2 +-
 arch/powerpc/platforms/powernv/opal-prd.c     |  2 +-
 arch/powerpc/xmon/xmon.c                      |  2 +-
 arch/s390/include/asm/stacktrace.h            |  6 +-
 arch/s390/kernel/machine_kexec_file.c         |  5 +-
 arch/s390/mm/gmap.c                           |  4 +-
 arch/s390/mm/vmem.c                           |  2 +-
 arch/sh/kernel/sys_sh.c                       |  2 +-
 arch/x86/include/asm/atomic.h                 |  2 +-
 arch/x86/kernel/cpu/sgx/ioctl.c               |  6 +-
 arch/x86/kvm/svm/sev.c                        |  5 +-
 crypto/adiantum.c                             |  2 +-
 drivers/acpi/custom_method.c                  |  2 +-
 drivers/char/agp/generic.c                    |  2 +-
 drivers/crypto/amcc/crypto4xx_alg.c           |  2 +-
 drivers/crypto/axis/artpec6_crypto.c          |  2 +-
 drivers/dma-buf/dma-buf.c                     |  7 +-
 drivers/fpga/dfl.c                            |  5 +-
 drivers/fsi/fsi-core.c                        |  6 +-
 drivers/gpu/drm/i915/i915_vma.c               |  2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c |  8 +-
 drivers/gpu/drm/vc4/vc4_validate.c            |  7 +-
 drivers/md/dm-switch.c                        |  2 +-
 drivers/md/dm-verity-target.c                 |  2 +-
 drivers/md/dm-writecache.c                    |  2 +-
 drivers/net/ethernet/sun/niu.c                |  5 +-
 drivers/net/wireless/ath/wil6210/wmi.c        |  2 +-
 drivers/net/wireless/marvell/mwifiex/pcie.c   |  6 +-
 drivers/net/xen-netback/hash.c                |  2 +-
 drivers/pci/pci.c                             |  2 +-
 drivers/remoteproc/pru_rproc.c                |  2 +-
 drivers/remoteproc/remoteproc_elf_loader.c    |  2 +-
 drivers/remoteproc/remoteproc_virtio.c        |  4 +-
 drivers/scsi/mpt3sas/mpt3sas_ctl.c            |  2 +-
 drivers/scsi/sd_zbc.c                         |  2 +-
 drivers/staging/vme_user/vme.c                |  2 +-
 drivers/vhost/vringh.c                        |  8 +-
 drivers/virtio/virtio_pci_modern_dev.c        |  4 +-
 fs/aio.c                                      |  2 +-
 fs/bcachefs/bkey.c                            |  4 +-
 fs/bcachefs/fs.c                              |  2 +-
 fs/bcachefs/quota.c                           |  2 +-
 fs/bcachefs/util.c                            |  2 +-
 fs/btrfs/extent_map.c                         |  6 +-
 fs/btrfs/extent_map.h                         |  6 +-
 fs/btrfs/ordered-data.c                       |  2 +-
 fs/ext4/block_validity.c                      |  2 +-
 fs/ext4/extents.c                             |  5 +-
 fs/ext4/resize.c                              |  2 +-
 fs/f2fs/file.c                                |  2 +-
 fs/f2fs/verity.c                              |  2 +-
 fs/hpfs/alloc.c                               |  2 +-
 fs/ntfs3/record.c                             |  4 +-
 fs/ocfs2/resize.c                             |  2 +-
 fs/read_write.c                               |  8 +-
 fs/remap_range.c                              |  2 +-
 fs/select.c                                   | 13 +--
 fs/smb/client/readdir.c                       |  5 +-
 fs/smb/client/smb2pdu.c                       |  4 +-
 fs/udf/balloc.c                               |  4 +-
 include/linux/compiler_types.h                | 29 +++++-
 include/linux/overflow.h                      | 76 +++++++++++++++-
 ipc/mqueue.c                                  |  2 +-
 ipc/shm.c                                     |  6 +-
 kernel/bpf/verifier.c                         | 12 +--
 kernel/time/timekeeping.c                     |  2 +-
 lib/Kconfig.ubsan                             | 27 ++++++
 lib/buildid.c                                 |  6 +-
 lib/iov_iter.c                                |  5 +-
 lib/overflow_kunit.c                          | 77 ++++++++++++++--
 lib/scatterlist.c                             |  2 +-
 lib/test_ubsan.c                              | 82 +++++++++++++++++
 lib/ubsan.c                                   | 89 +++++++++++++++++++
 lib/ubsan.h                                   |  5 ++
 lib/zstd/decompress/zstd_decompress.c         |  4 +-
 mm/kasan/generic.c                            |  2 +-
 mm/kasan/sw_tags.c                            |  2 +-
 mm/memory.c                                   |  4 +-
 mm/mmap.c                                     |  2 +-
 mm/mremap.c                                   |  2 +-
 mm/nommu.c                                    |  4 +-
 mm/usercopy.c                                 |  2 +-
 mm/util.c                                     |  2 +-
 mm/vmalloc.c                                  |  7 +-
 net/ipv4/route.c                              |  8 +-
 net/netfilter/xt_u32.c                        |  4 +-
 net/rds/info.c                                |  6 +-
 scripts/Makefile.ubsan                        |  3 +
 .../coccinelle/misc/add_would_overflow.cocci  | 70 +++++++++++++++
 tools/perf/util/dso.c                         |  2 +-
 tools/perf/util/unwind-libdw.c                |  2 +-
 tools/perf/util/unwind-libunwind-local.c      |  2 +-
 virt/kvm/coalesced_mmio.c                     |  6 +-
 102 files changed, 680 insertions(+), 167 deletions(-)
 create mode 100644 scripts/coccinelle/misc/add_would_overflow.cocci
Signature · 1 line
2.34.1