Re: [PATCH v2] x86: Allow user accesses to the base of the guard page
From: Linus Torvalds
Date: Sun Nov 24 2024 - 17:03:47 EST
On Sun, 24 Nov 2024 at 12:49, David Laight <David.Laight@xxxxxxxxxx> wrote:
>
> Doesn't that just need a <= changed to < ?
> (And possibly of name)
Well, more importantly, it means that we can't use the same helper
function at all.
> > but I suspect that I'm too chicken to actually do that.
> >
> > Please somebody convince me.
>
> I didn't know you really had a 'chicken streak' :-)
Actually, looking at some of the users of access_ok(), my chicken
streak just got wider.
Most of them are trivial, but when masking out the pure 'sizeof(x)'
things (that the "statically smaller than one page" case will filter
out anyway), there's a few scary ones in the vhost code and the drm
code that makes me go "those are checking ring buffer sizes and may
not access the end result in any order".
So trying to optimize access_ok() is probably not worth the heartburn. Oh well.
Linus