Skip to content

kcov: improve mmap processing

Aleksandr Nogikh lkml 2 versions – Applied

Status from this message: [merged] kcov-split-ioctl-handling-into-locked-and-unlocked-parts.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 6 repliesApplied 2/2
  2. v22 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- The first commit now implements purely non-functional changes.
- No extra function is introduced in the first commit.

Patches in v3 All 2 applied

#Subject and filesSizeRepliesApplied
1/2kcov: split ioctl handling into locked and unlocked partskernel/kcov.c+37 -313 repliesApplied
2/2kcov: properly handle subsequent mmap callskernel/kcov.c+15 -193 repliesApplied

Reviews trailers per patch

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

PatchDmitry VyukovAndrey Konovalov
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 v3 thread

Cover letter [PATCH v3 0/2] kcov: improve mmap processing

Subsequent mmaps of the same kcov descriptor currently do not update the virtual memory of the task and yet return 0 (success). This is counter-intuitive and may lead to unexpected memory access errors.

Also, this unnecessarily limits the functionality of kcov to only the simplest usage scenarios. Kcov instances are effectively forever attached to their first address spaces and it becomes impossible to e.g. reuse the same kcov handle in forked child processes without mmapping the memory first. This is exactly what we tried to do in syzkaller and inadvertently came upon this behavior.

This patch series addresses the problem described above.

v1 of the patch:
https://lore.kernel.org/lkml/[email protected]/

Changes from v1 to v2:
- Split into 2 commits.
- Minor coding style changes.

v2 of the patch:
https://lore.kernel.org/lkml/[email protected]/T/

Changes from v2 to v3:
- The first commit now implements purely non-functional changes.
- No extra function is introduced in the first commit.

Aleksandr Nogikh (2):
kcov: split ioctl handling into locked and unlocked parts
kcov: properly handle subsequent mmap calls

 kernel/kcov.c | 98 ++++++++++++++++++++++++++-------------------------
 1 file changed, 50 insertions(+), 48 deletions(-)
Signature · 1 line
2.34.1.703.g22d0c6ccf7-goog