xref: /linux/include/uapi/linux/binfmts.h (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2607ca46eSDavid Howells #ifndef _UAPI_LINUX_BINFMTS_H
3607ca46eSDavid Howells #define _UAPI_LINUX_BINFMTS_H
4607ca46eSDavid Howells 
5607ca46eSDavid Howells #include <linux/capability.h>
6607ca46eSDavid Howells 
7607ca46eSDavid Howells struct pt_regs;
8607ca46eSDavid Howells 
9607ca46eSDavid Howells /*
10607ca46eSDavid Howells  * These are the maximum length and maximum number of strings passed to the
11607ca46eSDavid Howells  * execve() system call.  MAX_ARG_STRLEN is essentially random but serves to
12607ca46eSDavid Howells  * prevent the kernel from being unduly impacted by misaddressed pointers.
13607ca46eSDavid Howells  * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
14607ca46eSDavid Howells  */
15607ca46eSDavid Howells #define MAX_ARG_STRLEN (PAGE_SIZE * 32)
16607ca46eSDavid Howells #define MAX_ARG_STRINGS 0x7FFFFFFF
17607ca46eSDavid Howells 
18607ca46eSDavid Howells /* sizeof(linux_binprm->buf) */
196eb3c3d0SOleg Nesterov #define BINPRM_BUF_SIZE 256
20607ca46eSDavid Howells 
21*2347961bSLaurent Vivier /* preserve argv0 for the interpreter  */
22*2347961bSLaurent Vivier #define AT_FLAGS_PRESERVE_ARGV0_BIT 0
23*2347961bSLaurent Vivier #define AT_FLAGS_PRESERVE_ARGV0 (1 << AT_FLAGS_PRESERVE_ARGV0_BIT)
24*2347961bSLaurent Vivier 
25607ca46eSDavid Howells #endif /* _UAPI_LINUX_BINFMTS_H */
26