Andrey Ryabinin 1a3241ff10 lib/strscpy: Shut up KASAN false-positives in strscpy()
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>
2018-02-01 12:20:21 -08:00
..
2017-12-22 19:39:09 +11:00
2017-08-15 09:02:08 -07:00
2017-12-01 13:09:40 -08:00
2017-12-01 13:09:40 -08:00
2015-11-23 09:44:58 +01:00
2017-12-01 13:09:40 -08:00
2014-04-30 19:49:37 +01:00
2017-10-07 10:45:14 -06:00
2017-02-24 17:46:57 -08:00
2017-11-17 16:10:01 -08:00
2014-08-08 15:57:25 -07:00
2017-12-01 13:09:40 -08:00
2017-12-01 13:09:40 -08:00
2016-12-06 10:17:03 +02:00
2015-09-08 14:35:59 -07:00
2017-09-19 15:18:33 -07:00
2016-08-02 17:31:41 -04:00
2017-12-01 13:09:40 -08:00
2017-08-15 09:02:07 -07:00