Re: [PATCH v3 1/2] sysctl: handle overflow in proc_get_long

From: Kees Cook
Date: Tue Oct 16 2018 - 22:19:42 EST


On Tue, Oct 16, 2018 at 5:24 PM, Christian Brauner <christian@xxxxxxxxxx> wrote:
> Right, but if you write a value that exceeds the buffer of 22 chars that is used
> to parse you already get EINVAL back on current kernels.
> So it didn't feel like returning EOVERFLOW or ERANGE might make sense.
> I saw a change in 4.10 or 4.11 as well that used EINVAL on UINT_MAX overflow
> or something. EINVAL might be enough information for userspace here ?/.

I'd agree: I think there is more precedent for EINVAL.

-Kees

--
Kees Cook
Pixel Security