]> www.infradead.org Git - users/jedix/linux-maple.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>
Fri, 28 Feb 2025 00:59:56 +0000 (16:59 -0800)
commiteeba9dd09bf19b0a2743f90c938c3bf787767903
treed27c4aa3d31fff1135442d5e13e937cfc39780d8
parent8f817606a719dca5df1a3dc13ed4214134a54334
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