Page MenuHomeFreeBSD

sh: Fix job pointer invalidation with trapsasync
ClosedPublic

Authored by jilles on Nov 17 2025, 6:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 3, 5:00 PM
Unknown Object (File)
Sat, Dec 27, 1:12 AM
Unknown Object (File)
Dec 22 2025, 8:02 PM
Unknown Object (File)
Dec 20 2025, 10:31 PM
Unknown Object (File)
Dec 19 2025, 9:55 AM
Unknown Object (File)
Dec 15 2025, 12:14 AM
Unknown Object (File)
Dec 11 2025, 4:08 PM
Unknown Object (File)
Dec 7 2025, 3:57 AM
Subscribers

Details

Summary

Calling dotrap() can do almost anything, including reallocating the
jobtab array. Convert the job pointer to an index before calling
dotrap() and then restore a proper job pointer afterwards.

PR: 290330
Reported by: bdrewery

Test Plan

Install patched sh with new tests, cd /usr/tests/bin/sh && kyua test and reboot (all within a virtual machine).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable