sudo-project / sudo

Utility to execute a command as another user
https://www.sudo.ws
Other
1.17k stars 208 forks source link

EM_ARM undeclared #232

Closed navinagaraj closed 1 year ago

navinagaraj commented 1 year ago

./exec_ptrace.c: In function 'set_exec_filter': ./exec_ptrace.h:102:29: error: 'EM_ARM' undeclared (first use in this function)

define SECCOMP_AUDIT_ARCH AUDIT_ARCH_ARM

./exec_ptrace.c:1180:38: note: in expansion of macro 'SECCOMP_AUDIT_ARCH' BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SECCOMP_AUDIT_ARCH, 0, 6),

./exec_ptrace.h:102:29: note: each undeclared identifier is reported only once for each function it appears in

define SECCOMP_AUDIT_ARCH AUDIT_ARCH_ARM

./exec_ptrace.c:1180:38: note: in expansion of macro 'SECCOMP_AUDIT_ARCH' BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SECCOMP_AUDIT_ARCH, 0, 6),

millert commented 1 year ago

This should be addressed by 82150340a6fd7906ddb4dd45350f637b6ec20b13, can you check whether changing the include of elf.h in src/exec_ptrace.h to linux/elf.h fixes the problem?

navinagaraj commented 1 year ago

Hi yes i have changed those src/exec_ptrace.h to linux/elf.h but still i am facing the issue

millert commented 1 year ago

EM_ARM should be defined by /usr/include/linux/elf-em.h which is included by /usr/include/linux/elf.h

navinagaraj commented 1 year ago

Hi i am using 3.10 kernel version https://github.com/torvalds/linux/blob/v3.10/include/uapi/linux/elf-em.h .That's why I am getting this error: "EM_ARM undeclared ". I manually declared the macro in exec_ptrace.h. The error got suppressed. Is that any other way to clear the error ?

millert commented 1 year ago

Is EM_ARM defined by /usr/include/libaudit.h on your system? If so, we can use that.

millert commented 1 year ago

It would also be nice to know if /usr/include/elf.h on your system defines EM_ARM.