NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
lib/59247: pthread_cancelstub.c is inadequately tested
>Number: 59247
>Category: lib
>Synopsis: pthread_cancelstub.c is inadequately tested
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: lib-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Apr 02 17:30:00 +0000 2025
>Originator: Taylor R Campbell
>Release: current
>Organization:
The TestCancelD Foundation
>Environment:
>Description:
In my attempt to make accept4() a cancellation point for PR lib/59240: POSIX.1-2024: cancellation point audit, I wrote the wrong signature for the _sys_paccept symbol (the libc symbol that invokes the paccept syscall, which libpthread wraps with cancellation tests).
This led anyone using accept4 to get EFAULT, Bad address, which broke all kinds of applications.
Unfortunately, it did not break any automatic tests. I wrote new automatic tests for all the cancellation points -- but only for their nature as cancellation points, not for their ordinary functionality. And while we have automatic tests that call accept4(), they aren't linked against libpthread so we aren't testing the pthread_cancelstub.c logic.
>How-To-Repeat:
1. break a pthread cancel stub
2. watch the test run succeed
3. try to use a real application like python or dbus
>Fix:
Yes, please!
1. Maybe declare _sys_paccept with typeof(paccept) _sys_paccept; instead of copying & pasting the signature.
2. Make sure each cancellation stub has an automatic test of its ordinary functionality too.
Home |
Main Index |
Thread Index |
Old Index