diff options
author | Andrey Ryabinin <aryabinin@virtuozzo.com> | 2018-02-01 21:00:50 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-04 09:33:32 +0200 |
commit | 8dd8b4d7a00d9795e4451c170f5e2aaac2f5aaef (patch) | |
tree | 39b529a15bf65bb4b910695e153294d0926b8934 /lib/build_OID_registry | |
parent | 4b5d4bdfd1ea2c2946f55ba309e17440b4ddada2 (diff) | |
download | linux-stable-8dd8b4d7a00d9795e4451c170f5e2aaac2f5aaef.tar.gz linux-stable-8dd8b4d7a00d9795e4451c170f5e2aaac2f5aaef.tar.bz2 linux-stable-8dd8b4d7a00d9795e4451c170f5e2aaac2f5aaef.zip |
lib/strscpy: Shut up KASAN false-positives in strscpy()
[ Upstream commit 1a3241ff10d038ecd096d03380327f2a0b5840a6 ]
strscpy() performs the word-at-a-time optimistic reads. So it may may
access the memory past the end of the object, which is perfectly fine
since strscpy() doesn't use that (past-the-end) data and makes sure the
optimistic read won't cross a page boundary.
Use new read_word_at_a_time() to shut up the KASAN.
Note that this potentially could hide some bugs. In example bellow,
stscpy() will copy more than we should (1-3 extra uninitialized bytes):
char dst[8];
char *src;
src = kmalloc(5, GFP_KERNEL);
memset(src, 0xff, 5);
strscpy(dst, src, 8);
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib/build_OID_registry')
0 files changed, 0 insertions, 0 deletions