Re: [PATCH 04/14] x86: use more conventional access_ok() definition

From: Arnd Bergmann
Date: Mon Feb 14 2022 - 16:01:12 EST


On Mon, Feb 14, 2022 at 6:02 PM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
> On Mon, Feb 14, 2022 at 05:34:42PM +0100, Arnd Bergmann wrote:
> > +#define __range_not_ok(addr, size, limit) (!__access_ok(addr, size))
> > +#define __chk_range_not_ok(addr, size, limit) (!__access_ok((void __user *)addr, size))
>
> Can we just kill these off insted of letting themm obsfucate the code?

As Al pointed out, they turned out to be necessary on sparc64, but the only
definitions are on sparc64 and x86, so it's possible that they serve a similar
purpose here, in which case changing the limit from TASK_SIZE to
TASK_SIZE_MAX is probably wrong as well.

So either I need to revert the original definition as I did on sparc64, or
they can be removed completely. Hopefully Al or the x86 maintainers
can clarify.

Arnd