# Re: \[RFC v2 07/10\] landlock: Add errno check

- From: Andy Lutomirski \<luto@amacapital.net\>
- Date: 2016-08-25 11:15:25 
- List: linux-api
- Page: https://ratatoskr.run/linux-api/2016/08/4822247
- Thread: https://ratatoskr.run/linux-api/2016/08/4822232/t.md

```text
On Thu, Aug 25, 2016 at 3:32 AM, Mickaël Salaün [ref] wrote:
> Add a max errno value.
>
> This is not strictly needed but should improve reliability.
>
> Signed-off-by: Mickaël Salaün <mic@digikod.net>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Serge E. Hallyn <serge@hallyn.com>
> Cc: James Morris <redacted>
> Cc: Kees Cook <redacted>
> ---
>  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.
```
