From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758145AbcHYLPZ (ORCPT ); Thu, 25 Aug 2016 07:15:25 -0400 Received: from mail-ua0-f180.google.com ([209.85.217.180]:35838 "EHLO mail-ua0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753030AbcHYLPV (ORCPT ); Thu, 25 Aug 2016 07:15:21 -0400 MIME-Version: 1.0 In-Reply-To: <1472121165-29071-8-git-send-email-mic@digikod.net> References: <1472121165-29071-1-git-send-email-mic@digikod.net> <1472121165-29071-8-git-send-email-mic@digikod.net> From: Andy Lutomirski Date: Thu, 25 Aug 2016 04:13:48 -0700 Message-ID: Subject: Re: [RFC v2 07/10] landlock: Add errno check To: =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= Cc: "linux-kernel@vger.kernel.org" , Alexei Starovoitov , Arnd Bergmann , Casey Schaufler , Daniel Borkmann , Daniel Mack , David Drysdale , "David S . Miller" , Elena Reshetova , James Morris , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Will Drewry , "kernel-hardening@lists.openwall.com" , Linux API , LSM List , Network Development Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id u7PBFht2004017 On Thu, Aug 25, 2016 at 3:32 AM, Mickaël Salaün wrote: > Add a max errno value. > > This is not strictly needed but should improve reliability. > > Signed-off-by: Mickaël Salaün > Cc: Arnd Bergmann > Cc: Serge E. Hallyn > Cc: James Morris > Cc: Kees Cook > --- > include/uapi/asm-generic/errno-base.h | 1 + > security/landlock/lsm.c | 6 +++--- > 2 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/include/uapi/asm-generic/errno-base.h b/include/uapi/asm-generic/errno-base.h > index 65115978510f..43407a403e72 100644 > --- a/include/uapi/asm-generic/errno-base.h > +++ b/include/uapi/asm-generic/errno-base.h > @@ -35,5 +35,6 @@ > #define EPIPE 32 /* Broken pipe */ > #define EDOM 33 /* Math argument out of domain of func */ > #define ERANGE 34 /* Math result not representable */ > +#define _ERRNO_LAST ERANGE At the very least this needs a more sensible name.