freebsd-skq/bin/sh/tests
Jilles Tjoelker 6bc7175f31 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. As
of r360452, it causes the shell to abort when it would unsafely allocate or
free memory in certain ways.

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
Reported by:	jbeich
MFC after:	2 weeks
2020-05-16 16:29:23 +00:00
..
builtins sh: Don't treat % specially in CDPATH 2018-07-15 21:55:17 +00:00
errors sh: Use 126 and 127 exit status for failures opening a script 2018-11-27 21:49:59 +00:00
execution sh: Fix double INTON with vfork 2020-05-16 16:29:23 +00:00
expansion sh/tests: Improve failure messages of expansion/arith15.0 2019-03-07 22:51:58 +00:00
invocation DIRDEPS_BUILD: Connect new directories. 2017-10-31 00:04:07 +00:00
parameters
parser sh/tests: Test some obscure cases with aliasing keywords 2020-05-12 21:59:21 +00:00
set-e
functional_test.sh
Makefile sh: Add tests for sh -c that already pass. 2017-08-12 19:17:48 +00:00
Makefile.depend