Undefined Behaviour Sanititizer support
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest23 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/23 | UBSAN: run-time undefined behavior sanity checkerDocumentation/ Makefile arch/ +14 more | +692 | 0 replies | |
| 2/23 | ubsan: cosmetic fix to Kconfig textlib/ | +3 | 0 replies | |
| 3/23 | PM / sleep: declare __tracedata symbols as char[] rather than chardrivers/ | +2 | 0 replies | |
| 4/23 | x86/microcode/intel: Change checksum variables to u32arch/ | +4 | 0 replies | |
| 5/23 | mm/page-writeback: fix dirty_ratelimit calculationmm/ | +6 | 0 replies | |
| 6/23 | perf/core: Fix Undefined behaviour in rb_alloc()kernel/ | +4 | 0 replies | |
| 7/23 | ubsan: fix tree-wide -Wmaybe-uninitialized false positiveslib/ scripts/ | +9 | 0 replies | |
| 8/23 | mm/filemap: generic_file_read_iter(): check for zero reads unconditionallymm/ | +4 | 0 replies | |
| 9/23 | perf/x86/amd: Set the size of event map array to PERF_COUNT_HW_MAXarch/ | +1 | 0 replies | |
| 10/23 | drm/radeon: don't include RADEON_HPD_NONE in HPD IRQ enable bitsetsdrivers/ drivers/ drivers/ +1 more | +16 | 0 replies | |
| 11/23 | btrfs: fix int32 overflow in shrink_delalloc().fs/ | +1 | 0 replies | |
| 12/23 | blk-mq: fix undefined behaviour in order_to_size()block/ | +1 | 0 replies | |
| 13/23 | batman-adv: Fix integer overflow in batadv_iv_ogm_calc_tqnet/ | +3 | 0 replies | |
| 14/23 | signal: move the "sig < SIGRTMIN" check into siginmask(sig)include/ | +7 | 0 replies | |
| 15/23 | mmc: dw_mmc: remove UBSAN warning in dw_mci_setup_bus()drivers/ drivers/ | +5 | 0 replies | |
| 16/23 | UBSAN: fix typo in format stringlib/ | +1 | 0 replies | |
| 17/23 | rhashtable: fix shift by 64 when shrinkinglib/ | +4 | 0 replies | |
| 18/23 | time: Avoid undefined behaviour in ktime_add_safe()include/ kernel/ | +8 | 0 replies | |
| 19/23 | pwm: samsung: Fix to use lowest div for large enough modulation bitsdrivers/ | +12 | 0 replies | |
| 20/23 | drm: fix signed integer overflowdrivers/ | +1 | 0 replies | |
| 21/23 | xfs: fix signed integer overflowfs/ | +2 | 0 replies | |
| 22/23 | net: get rid of an signed integer overflow in ip_idents_reserve()net/ | +8 | 0 replies | |
| 23/23 | mlx4: remove unused fieldsdrivers/ drivers/ | +0 | 0 replies |
Reviews trailers per patch
8 of 23 patches have a Reviewed-by or Acked-by.
| Patch | Andrey Ryabinin | Jan Kara | David Sterba | Herbert Xu | Krzysztof Kozlowski | Dave Chinner | Eric Dumazet | Tariq Toukan |
|---|---|---|---|---|---|---|---|---|
| 1/23 | ||||||||
| 2/23 | A-b | |||||||
| 3/23 | ||||||||
| 4/23 | ||||||||
| 5/23 | ||||||||
| 6/23 | ||||||||
| 7/23 | ||||||||
| 8/23 | R-b | |||||||
| 9/23 | ||||||||
| 10/23 | ||||||||
| 11/23 | R-b | |||||||
| 12/23 | ||||||||
| 13/23 | ||||||||
| 14/23 | ||||||||
| 15/23 | ||||||||
| 16/23 | A-b | |||||||
| 17/23 | A-b | |||||||
| 18/23 | ||||||||
| 19/23 | R-b | |||||||
| 20/23 | ||||||||
| 21/23 | R-b | |||||||
| 22/23 | ||||||||
| 23/23 | A-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 8 reviewers.
Cover letter [cip-dev] [PATCH 4.4-cip 00/23] Undefined Behaviour Sanititizer support
This is a backport of changes in 4.5 to add support for GCC's Undefined Behaviour Sanitizer (UBSAN), and fixes for undefined behaviour that it has found (that are not already in 4.4.30).
UBSAN detects (at run time) many operations that will result in
undefined behaviour, i.e. unpredictable results. These include overflow
of signed integer calculations, bitwise shifts by too many places, and
some array bounds errors. (KASAN detects other kinds of address
errors, but is currently only supported on arm64 and x86_64.) See
<http://developerblog.redhat.com/2014/10/16/gcc-undefined-behavior-sanitizer-ubsan/> for more information.
UBSAN can be enabled globally on x86 (CONFIG_UBSAN_SANITIZE_ALL), but must be enabled selectively on arm (add 'UBSAN_SANITIZE := y' to the Makefile in each directory you want to apply it to). I assume there are a few critical regions of code that must to be avoided.
It has a significant performance cost, so it is unlikely to be suitable for use in production builds.
For this and other backports, I'm looking for feedback like:
- Did I miss a follow-up fix or an earlier dependency?
- Does this cause a regression (other than as explained above)?
- Are you likely to use it?
- Are there related features you want in 4.4?
Ben.
Adam Borowski (2):
perf/x86/amd: Set the size of event map array to PERF_COUNT_HW_MAX
btrfs: fix int32 overflow in shrink_delalloc().
Andrey Ryabinin (3):
UBSAN: run-time undefined behavior sanity checker mm/page-writeback: fix dirty_ratelimit calculation ubsan: fix tree-wide -Wmaybe-uninitialized false positives
Bartlomiej Zolnierkiewicz (1):
blk-mq: fix undefined behaviour in order_to_size()
Chris Bainbridge (1):
x86/microcode/intel: Change checksum variables to u32
David Decotigny (1):
mlx4: remove unused fields
Eric Biggers (1):
PM / sleep: declare __tracedata symbols as char[] rather than char
Eric Dumazet (1):
net: get rid of an signed integer overflow in ip_idents_reserve()
Nicolai Stange (2):
mm/filemap: generic_file_read_iter(): check for zero reads
unconditionally
drm/radeon: don't include RADEON_HPD_NONE in HPD IRQ enable bitsets
Nicolas Iooss (1):
UBSAN: fix typo in format string
Oleg Nesterov (1):
signal: move the "sig < SIGRTMIN" check into siginmask(sig)
Peter Zijlstra (1):
perf/core: Fix Undefined behaviour in rb_alloc()
Seung-Woo Kim (2):
mmc: dw_mmc: remove UBSAN warning in dw_mci_setup_bus()
pwm: samsung: Fix to use lowest div for large enough modulation bits
Sven Eckelmann (1):
batman-adv: Fix integer overflow in batadv_iv_ogm_calc_tq
Vegard Nossum (2):
rhashtable: fix shift by 64 when shrinking
time: Avoid undefined behaviour in ktime_add_safe()
Xie XiuQi (2):
drm: fix signed integer overflow
xfs: fix signed integer overflow
Yang Shi (1):
ubsan: cosmetic fix to Kconfig text
Documentation/ubsan.txt | 84 ++++++ Makefile | 3 +- arch/x86/Kconfig | 1 + arch/x86/boot/Makefile | 1 + arch/x86/boot/compressed/Makefile | 1 + arch/x86/entry/vdso/Makefile | 1 + arch/x86/kernel/cpu/microcode/intel_lib.c | 8 +- arch/x86/kernel/cpu/perf_event_amd.c | 2 +- arch/x86/realmode/rm/Makefile | 1 + block/blk-mq.c | 2 +- drivers/base/power/trace.c | 4 +- drivers/firmware/efi/libstub/Makefile | 1 + drivers/gpu/drm/drm_hashtab.c | 2 +- drivers/gpu/drm/radeon/evergreen.c | 6 +- drivers/gpu/drm/radeon/r100.c | 6 +- drivers/gpu/drm/radeon/r600.c | 6 +- drivers/gpu/drm/radeon/rs600.c | 6 +- drivers/mmc/host/dw_mmc.c | 14 +- drivers/mmc/host/dw_mmc.h | 4 - drivers/net/ethernet/mellanox/mlx4/fw.c | 4 - drivers/net/ethernet/mellanox/mlx4/fw.h | 2 - drivers/pwm/pwm-samsung.c | 15 +- fs/btrfs/extent-tree.c | 2 +- fs/xfs/xfs_buf_item.c | 4 +- include/linux/ktime.h | 7 + include/linux/sched.h | 3 + include/linux/signal.h | 16 +- kernel/events/ring_buffer.c | 6 +- kernel/time/hrtimer.c | 2 +- lib/Kconfig.debug | 1 + lib/Kconfig.ubsan | 36 +++ lib/Makefile | 3 + lib/rhashtable.c | 6 +- lib/ubsan.c | 456 ++++++++++++++++++++++++++++++ lib/ubsan.h | 84 ++++++ mm/filemap.c | 7 +- mm/kasan/Makefile | 1 + mm/page-writeback.c | 11 +- net/batman-adv/bat_iv_ogm.c | 5 +- net/ipv4/route.c | 10 +- scripts/Makefile.lib | 6 + scripts/Makefile.ubsan | 21 ++ 42 files changed, 792 insertions(+), 69 deletions(-) create mode 100644 Documentation/ubsan.txt create mode 100644 lib/Kconfig.ubsan create mode 100644 lib/ubsan.c create mode 100644 lib/ubsan.h create mode 100644 scripts/Makefile.ubsan
Signature · 6 lines
2.10.2 -- Ben Hutchings Software Developer, Codethink Ltd.