xref: /linux/include/uapi/linux/binfmts.h (revision b9cba7ebfe539f3e4bbdd03a1e0efa3b30b3f592)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _UAPI_LINUX_BINFMTS_H
3 #define _UAPI_LINUX_BINFMTS_H
4 
5 #include <linux/capability.h>
6 
7 struct pt_regs;
8 
9 /*
10  * These are the maximum length and maximum number of strings passed to the
11  * execve() system call.  MAX_ARG_STRLEN is essentially random but serves to
12  * prevent the kernel from being unduly impacted by misaddressed pointers.
13  * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
14  */
15 #define MAX_ARG_STRLEN (PAGE_SIZE * 32)
16 #define MAX_ARG_STRINGS 0x7FFFFFFF
17 
18 /* sizeof(linux_binprm->buf) */
19 #define BINPRM_BUF_SIZE 256
20 
21 /* preserve argv0 for the interpreter  */
22 #define AT_FLAGS_PRESERVE_ARGV0_BIT 0
23 #define AT_FLAGS_PRESERVE_ARGV0 (1 << AT_FLAGS_PRESERVE_ARGV0_BIT)
24 
25 /*
26  * The interpreter runs transparently: the argument vector and the exe
27  * link belong to the binary passed in AT_EXECFD.
28  */
29 #define AT_FLAGS_TRANSPARENT_INTERP_BIT 1
30 #define AT_FLAGS_TRANSPARENT_INTERP (1 << AT_FLAGS_TRANSPARENT_INTERP_BIT)
31 
32 #endif /* _UAPI_LINUX_BINFMTS_H */
33