Page MenuHomeFreeBSD

sh: Fix job pointer invalidation with trapsasync
ClosedPublic

Authored by jilles on Nov 17 2025, 6:27 PM.
Tags
None
Referenced Files
F170102883: D53793.diff
Thu, Sep 3, 12:43 PM
Unknown Object (File)
Wed, Sep 2, 7:54 PM
Unknown Object (File)
Wed, Sep 2, 2:09 AM
Unknown Object (File)
Tue, Sep 1, 12:57 PM
Unknown Object (File)
Mon, Aug 31, 7:39 PM
Unknown Object (File)
Sat, Aug 29, 6:55 PM
Unknown Object (File)
Thu, Aug 27, 6:23 PM
Unknown Object (File)
Tue, Aug 25, 6:24 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