Files
android_kernel_fxtec_sm6115/include/linux
Linus Torvalds 216284c4a1 make 'user_access_begin()' do 'access_ok()'
commit 594cc251fdd0d231d342d88b2fdff4bc42fb0690 upstream.

Originally, the rule used to be that you'd have to do access_ok()
separately, and then user_access_begin() before actually doing the
direct (optimized) user access.

But experience has shown that people then decide not to do access_ok()
at all, and instead rely on it being implied by other operations or
similar.  Which makes it very hard to verify that the access has
actually been range-checked.

If you use the unsafe direct user accesses, hardware features (either
SMAP - Supervisor Mode Access Protection - on x86, or PAN - Privileged
Access Never - on ARM) do force you to use user_access_begin().  But
nothing really forces the range check.

By putting the range check into user_access_begin(), we actually force
people to do the right thing (tm), and the range check vill be visible
near the actual accesses.  We have way too long a history of people
trying to avoid them.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-22 09:04:58 +02:00
..
2019-12-13 08:51:18 +01:00
2019-12-17 20:35:45 +01:00
2019-10-05 13:10:03 +02:00
2019-07-03 13:14:48 +02:00
2018-08-22 10:52:48 -07:00
2019-11-24 08:19:14 +01:00
2020-05-20 08:18:45 +02:00
2020-03-25 08:06:14 +01:00
2019-05-31 06:46:18 -07:00
2019-10-17 13:45:42 -07:00
2019-12-13 08:52:43 +01:00
2019-12-31 16:35:38 +01:00
2018-08-22 10:52:45 -07:00
2020-03-18 07:14:17 +01:00
2018-08-22 10:52:46 -07:00
2019-06-11 12:20:52 +02:00
2020-04-17 10:48:47 +02:00
2020-04-02 15:28:22 +02:00
2018-08-16 12:14:42 -07:00
2019-04-17 08:38:45 +02:00
2018-11-13 11:08:51 -08:00
2019-06-17 19:51:56 +02:00
2020-05-20 08:18:45 +02:00
2020-04-02 15:28:23 +02:00