NetBSD-Bugs archive

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

lib/59225: sysconf(3) is not async-signal-safe for some inputs



>Number:         59225
>Category:       lib
>Synopsis:       sysconf(3) is not async-signal-safe for some inputs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 27 00:45:00 +0000 2025
>Originator:     Taylor R Campbell
>Release:        current, 10, 9, ...
>Organization:
The SignalBSD Sysconfiguration
>Environment:
>Description:
For certain inputs, such as _SC_AIO_LISTIO_MAX, sysconf(3) internally calls sysctlgetmibinfo(3), which is not async-signal-safe (see PR lib/59147: sysctl: bounded-memory lookups by name <https://gnats.NetBSD.org/59147>).
>How-To-Repeat:
1. code inspection
2. call sysconf(3) from a signal handler that interrupts malloc(3)
>Fix:
Either:

1. Assign static numbers to all the sysctl nodes that sysconf(3) might query.
2. Fix PR 59147, either making sysctlgetmibinfo(3) async-signal-safe or adding an alternative that is async-signal-safe at the cost of lookup cache performance.



Home | Main Index | Thread Index | Old Index