]> Gentwo Git Trees - linux/.git/commit
mm: remove the access_ok() call from gup_fast_fallback()
authorDavid Laight <david.laight.linux@gmail.com>
Sun, 9 Feb 2025 17:47:11 +0000 (17:47 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 23 Feb 2025 06:25:19 +0000 (22:25 -0800)
commit170bc57ee87653b4bc0f8557ea6814ae78997d43
tree3d48efa05adcda249fe8e5911eed2bca1ac9d738
parent0a8d6c05937f48ef2351b6f4937d9eb748373120
mm: remove the access_ok() call from gup_fast_fallback()

Historiaclly the code relied on access_ok() to validate the address range.
Commit 26f4c328079d7 added an explicit wrap check before access_ok().
Commit c28b1fc70390d then changed the wrap test to use check_add_overflow().
Commit 6014bc27561f2 relaxed the checks in x86-64's access_ok() and added
  an explicit check for TASK_SIZE here to make up for it.
That left a pointless access_ok() call with its associated 'lfence' that
can never actually fail.

So just delete the test.

Link: https://lkml.kernel.org/r/20250209174711.60889-1-david.laight.linux@gmail.com
Signed-off-by: David Laight <david.laight.linux@gmail.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirks^H^Hski <luto@kernel.org>
Cc: Borislav Betkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jan Kara <jack@suse.cz>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Xu <peterx@redhat.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/gup.c