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)
Wed, Jun 17, 2:16 AM
Unknown Object (File)
Thu, Jun 4, 12:11 AM
Unknown Object (File)
May 17 2026, 9:39 AM
Unknown Object (File)
May 17 2026, 5:28 AM
Unknown Object (File)
May 17 2026, 3:43 AM
Unknown Object (File)
May 13 2026, 5:45 PM
Unknown Object (File)
May 11 2026, 9:55 PM
Unknown Object (File)
May 11 2026, 9:00 PM
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