[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220117153634.150357-1-nogikh@google.com>
Date: Mon, 17 Jan 2022 15:36:32 +0000
From: Aleksandr Nogikh <nogikh@...gle.com>
To: kasan-dev@...glegroups.com, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org
Cc: dvyukov@...gle.com, andreyknvl@...il.com, elver@...gle.com,
glider@...gle.com, tarasmadan@...gle.com, bigeasy@...utronix.de,
nogikh@...gle.com
Subject: [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/20211220152153.910990-1-nogikh@google.com/
Changes from v1 to v2:
- Split into 2 commits.
- Minor coding style changes.
v2 of the patch:
https://lore.kernel.org/lkml/20211221170348.1113266-1-nogikh@google.com/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(-)
--
2.34.1.703.g22d0c6ccf7-goog
Powered by blists - more mailing lists