NetBSD-Bugs archive

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

lib/59101: cpuset.c bugs



>Number:         59101
>Category:       lib
>Synopsis:       cpuset.c bugs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 24 22:00:00 +0000 2025
>Originator:     Taylor R Campbell
>Release:        current, 10, 9, ...
>Organization:
The NetCPU Foundaset
>Environment:
>Description:
1. common/lib/libc/sys/cpuset.c is all under #ifndef _KERNEL, so it has no reason to live there; it should live instead in lib/libc/

2. missing memory barriers
>How-To-Repeat:
code inspection
>Fix:
1. move from common/lib/libc/ to lib/libc/

2. change `if (cpuset_size == 0) { ...; cpuset_size = CPUSET_SIZE(cpuset_nentries); }' to `if (atomic_load_acquire(&cpuset_size) == 0) { ...; atomic_store_release(&cpuset_size, CPUSET_SIZE(cpuset_nentries)); }' (except we don't have atomic_store_release or atomic_load_acquire exposed in userland yet)



Home | Main Index | Thread Index | Old Index