From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kees Cook Subject: Re: [PATCH v3 1/2] sysctl: handle overflow in proc_get_long Date: Tue, 16 Oct 2018 19:19:35 -0700 Message-ID: References: <20181016223322.16844-1-christian@brauner.io> <20181016223322.16844-2-christian@brauner.io> <877eihjw0n.fsf@xmission.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Christian Brauner Cc: "Eric W . Biederman" , LKML , "Luis R. Rodriguez" , Andrew Morton , Joe Lawrence , Waiman Long , Dominik Brodowski , Al Viro , Alexey Dobriyan , Linux API List-Id: linux-api@vger.kernel.org On Tue, Oct 16, 2018 at 5:24 PM, Christian Brauner 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