Skip to content

fix the missing underflow in memory operation function

Walter Wu linux-arm-kernel linux-mediatek linux-mm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 13 repliesIn review All 2 applied
  2. v12 patches 7 repliesSuperseded

Changes in v4 from the cover letter

modify negative size condition
modify comments
modify the fixed code about early stages of boot

Patches in v4 All 2 applied

#Subject and filesSizeRepliesApplied
1/2kasan: detect negative size in memory operation functioninclude/linux/kasan.h mm/kasan/common.c mm/kasan/generic.c +5 more+53 -219 repliesApplied
2/2kasan: add test for invalid size in memmovelib/test_kasan.c+18 -04 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchDmitry VyukovAndrey Ryabinin
1/2R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/2] fix the missing underflow in memory operation function

The patchsets help to produce KASAN report when size is negative numbers in memory operation function. It is helpful for programmer to solve the undefined behavior issue. Patch 1 based on Dmitry's review and suggestion, patch 2 is a test in order to verify the patch 1.

[1]https://bugzilla.kernel.org/show_bug.cgi?id=199341 [2]https://lore.kernel.org/linux-arm-kernel/[email protected]/

Walter Wu (2):
kasan: detect negative size in memory operation function
kasan: add test for invalid size in memmove
---
Changes in v2:
fix the indentation, thanks for the reminder Matthew.

Changes in v3:
Add a confition for memory operation function, need to avoid the false alarm when KASAN un-initialized.

Changes in v4:
modify negative size condition
modify comments
modify the fixed code about early stages of boot

---
 include/linux/kasan.h     |  2 +-
 lib/test_kasan.c          | 18 ------------------
 mm/kasan/common.c         | 25 +++++++------------------
 mm/kasan/generic.c        |  9 ++++-----
 mm/kasan/generic_report.c | 11 -----------
 mm/kasan/kasan.h          |  2 +-
 mm/kasan/report.c         |  5 ++++-
 mm/kasan/tags.c           |  9 ++++-----
 mm/kasan/tags_report.c    | 11 -----------
 9 files changed, 21 insertions(+), 71 deletions(-)
Signature · 1 line
2.18.0