Page MenuHomeFreeBSD

sh: Fix job pointer invalidation with trapsasync
ClosedPublic

Authored by jilles on Nov 17 2025, 6:27 PM.
Tags
None
Referenced Files
F166885550: D53793.id166800.diff
Mon, Aug 17, 12:54 PM
F166849181: D53793.diff
Mon, Aug 17, 2:21 AM
Unknown Object (File)
Sat, Aug 15, 8:53 AM
Unknown Object (File)
Thu, Aug 13, 8:37 AM
Unknown Object (File)
Wed, Aug 12, 11:18 PM
Unknown Object (File)
Mon, Aug 10, 2:28 PM
Unknown Object (File)
Sun, Aug 9, 7:09 PM
Unknown Object (File)
Sun, Aug 9, 4:34 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