Skip to content

sysfs: Unconditionally use vmalloc for buffer

Kees Cook linux-fsdevel linux-hardening linux-kselftest lkml oe-lkp 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 2 repliesIn review
  2. v31 patch 9 repliesSuperseded
  3. v21 patch 22 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch3 repliesSuperseded

Changes in v4 from the cover letter

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3lkdtm/heap: Add vmalloc linear overflow testdrivers/misc/lkdtm/core.c drivers/misc/lkdtm/heap.c drivers/misc/lkdtm/lkdtm.h +1 more+26 -40 replies
2/3seq_file: Fix clang warning for NULL pointer arithmeticfs/kernfs/file.c fs/seq_file.c include/linux/seq_file.h+16 -40 replies
3/3sysfs: Unconditionally use vmalloc for bufferfs/sysfs/file.c+29 -02 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchChristoph HellwigNathan Chancellor
1/3
2/3R-b R-b
3/3

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/3] sysfs: Unconditionally use vmalloc for buffer

This series improves the defensive posture of sysfs's use of seq_file to gain the vmap guard pages at the end of vmalloc buffers to stop a class of recurring flaw[1]. The long-term goal is to switch sysfs from a buffer to using seq_file directly, but this will take time to refactor.

Included is also a Clang fix for NULL arithmetic and an LKDTM test to validate vmalloc guard pages.

v4:
- fix NULL arithmetic (Arnd)
- add lkdtm test
- reword commit message
v3: https://lore.kernel.org/lkml/[email protected]/
v2: https://lore.kernel.org/lkml/[email protected]/
v1: https://lore.kernel.org/lkml/[email protected]/

Thanks!

-Kees

Arnd Bergmann (1):
seq_file: Fix clang warning for NULL pointer arithmetic

Kees Cook (2):
lkdtm/heap: Add vmalloc linear overflow test
sysfs: Unconditionally use vmalloc for buffer

 drivers/misc/lkdtm/core.c               |  3 ++-
 drivers/misc/lkdtm/heap.c               | 21 +++++++++++++++++-
 drivers/misc/lkdtm/lkdtm.h              |  3 ++-
 fs/kernfs/file.c                        |  9 +++++---
 fs/seq_file.c                           |  5 ++++-
 fs/sysfs/file.c                         | 29 +++++++++++++++++++++++++
 include/linux/seq_file.h                |  6 +++++
 tools/testing/selftests/lkdtm/tests.txt |  3 ++-
 8 files changed, 71 insertions(+), 8 deletions(-)
Signature · 1 line
2.25.1