NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-evbarm/58683: pthread_setaffinity_np() results on SIGSEGV on aarch64



>Number:         58683
>Category:       port-evbarm
>Synopsis:       pthread_setaffinity_np() results on SIGSEGV on aarch64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-evbarm-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 20 16:45:01 +0000 2024
>Originator:     Sad Clouds
>Release:        10.0_STABLE
>Organization:
>Environment:
>Description:
Check if user_set_cpu_affinity is disabled:
# sysctl security.models.extensions.user_set_cpu_affinity
security.models.extensions.user_set_cpu_affinity = 0

Run some program which calls pthread_setaffinity_np() as unprivileged user:
$ ./a.out
...
$ gdb ...
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000ffffeed77f30 in _rtld_symlook_obj () from /usr/libexec/ld.elf_so
[Current thread is 1 (process 3112)]
(gdb) bt
#0  0x0000ffffeed77f30 in _rtld_symlook_obj () from /usr/libexec/ld.elf_so
#1  0x0000ffffeed784e4 in _rtld_symlook_list () from /usr/libexec/ld.elf_so
#2  0x0000ffffeed78938 in _rtld_symlook_default () from /usr/libexec/ld.elf_so
#3  0x0000ffffeed78d98 in _rtld_find_plt_symdef () from /usr/libexec/ld.elf_so
#4  0x0000ffffeed71350 in _rtld_bind () from /usr/libexec/ld.elf_so
#5  0x0000ffffeed70b5c in _rtld_bind_start () from /usr/libexec/ld.elf_so
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

If I add this line to /etc/sysctl.conf and reboot:
security.models.extensions.user_set_cpu_affinity=1

Then all is good, but that's not the issue. Unprivileged user should get EPERM error from the function call, not SIGSEGV.
>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index