From: Linus Torvalds Date: Fri, 5 May 2023 19:29:57 +0000 (-0700) Subject: Merge branch 'x86-uaccess-cleanup': x86 uaccess header cleanups X-Git-Tag: v6.6.17~4911 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5ed10bb80bb376501cb56015a47457647efaabf;p=platform%2Fkernel%2Flinux-rpi.git Merge branch 'x86-uaccess-cleanup': x86 uaccess header cleanups Merge my x86 uaccess updates branch. The LAM ("Linear Address Masking") updates in this release made me unhappy about how "access_ok()" was done, and it actually turned out to have a couple of small bugs in it too. This is my cleanup of the code: - use the sign bit of the __user pointer rather than masking the address and checking it against the TASK_SIZE range. We already did this part for the get/put_user() side, but 'access_ok()' did the naïve "mask and range check" thing, which not only generates nasty code, but also ended up meaning that __access_ok itself didn't do a good job, and so copy_from_user_nmi() didn't get the check right. - move all the code that is 64-bit only into the 64-bit version of the header file, so that we don't unnecessarily pollute the shared x86 code and make it look like LAM might work in 32-bit too. - fix a bug in the address masking (that doesn't end up mattering: in this case the fix was to just remove the buggy code entirely). - a couple of trivial cleanups and added commentary about the access_ok() rules. * x86-uaccess-cleanup: x86-64: mm: clarify the 'positive addresses' user address rules x86: mm: remove 'sign' games from LAM untagged_addr*() macros x86: uaccess: move 32-bit and 64-bit parts into proper header x86: mm: remove architecture-specific 'access_ok()' define x86-64: make access_ok() independent of LAM --- d5ed10bb80bb376501cb56015a47457647efaabf