1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-30 08:19:09 +00:00
freebsd/bin/dd
Konstantin Belousov 8dad5ece49 dd(1): neutralize SIGINT while non-async-signal safe code is executing
making the SIGINT handler (the terminate() function) safe to execute at
any interruption moment.  This fixes a race in
5807f35c54 where SIGINT delivered right
after the check_terminate() but before a blocking syscall would not
cause abort.

Do it by setting the in_io flag around potentially blocking io syscalls.
If handler sees the flag, it terminates the program.  Otherwise,
termination is delegated to the before_io/after_io fences.

Reviewed by:	Andrew Gierth <andrew@tao146.riddles.org.uk>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D40281
2023-06-03 01:06:27 +03:00
..
tests dd: Fix SIGINT handling. 2023-05-05 12:42:32 +00:00
args.c Add O_DIRECT flag to DD for cache bypass 2020-06-04 20:47:11 +00:00
conv_tab.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
conv.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
dd.1 Add O_DIRECT flag to DD for cache bypass 2020-06-04 20:47:11 +00:00
dd.c dd(1): neutralize SIGINT while non-async-signal safe code is executing 2023-06-03 01:06:27 +03:00
dd.h Add O_DIRECT flag to DD for cache bypass 2020-06-04 20:47:11 +00:00
extern.h dd(1): neutralize SIGINT while non-async-signal safe code is executing 2023-06-03 01:06:27 +03:00
gen.c
Makefile dd: Incorporate some changes from imp for status=progress 2018-08-15 19:46:13 +00:00
Makefile.depend Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
misc.c dd(1): neutralize SIGINT while non-async-signal safe code is executing 2023-06-03 01:06:27 +03:00
position.c dd(1): neutralize SIGINT while non-async-signal safe code is executing 2023-06-03 01:06:27 +03:00
ref.ascii
ref.ebcdic
ref.ibm
ref.lcase
ref.obs_zeroes
ref.oldascii
ref.oldebcdic
ref.oldibm
ref.pareven
ref.parnone
ref.parodd
ref.parset
ref.swab
ref.ucase