HomeFreeBSD

MFC r361112,r361117: sh: Fix double INTON with vfork

Description

MFC r361112,r361117: sh: Fix double INTON with vfork

The shell maintains a count of the number of times SIGINT processing has
been disabled via INTOFF, so SIGINT processing resumes when all disables
have enabled again (INTON).

If an error occurs in a vfork() child, the processing of the error enables
SIGINT processing again, and the INTON in vforkexecshell() causes the count
to become negative.

As a result, a later INTOFF may not actually disable SIGINT processing. This
might cause memory corruption if a SIGINT arrives at an inopportune time.

Note that various places such as errors in non-special builtins
unconditionally reset the count to 0, so the problem might still not always
be visible.

PR: 246497

Details

Provenance
jillesAuthored on
Parents
rS361645: Direct commit to stable/12: Only install ebsnvme-id on amd64 for now.
Branches
Unknown
Tags
Unknown