Go to file
kamil 7806b47917 Rework perform_arith_op() in expr(1) to omit Undefined Behavior
The current implementation of operations - + * / % could cause Undefined
Behavior and in narrow cases (INT64_MIN / -1 and INT64_MIN % -1) SIGFPE
and crash duping core.

Detected with MKSANITIZER enabled for the Undefined Behavior variation:
# eval expr '4611686018427387904 + 4611686018427387904'
/public/src.git/bin/expr/expr.y:315:12: runtime error: signed integer overflow: 4611686018427387904 + 4611686018427387904 cannot be represented in type 'long'

All bin/t_expr ATF tests pass now in a sanitized userland.

Sponsored by <The NetBSD Foundation>
2018-06-12 18:12:18 +00:00
bin Rework perform_arith_op() in expr(1) to omit Undefined Behavior 2018-06-12 18:12:18 +00:00
common Complete previous by complteley removing the _DIAGASSERT from memmove - 2018-02-12 11:14:15 +00:00
compat fix a comment. 2018-02-06 10:00:00 +00:00
crypto Disable loading XMSS keys by default too. 2018-06-07 15:26:09 +00:00
dist/pf fix two issues found by GCC 6.4: 2018-02-04 08:44:36 +00:00
distrib Fix the MKGROFF=no MKCXX=yes build 2018-06-10 17:17:46 +00:00
doc note virtio(4) now attaching to fdt(4) w/ MMIO transport 2018-06-07 12:36:45 +00:00
etc Prior to ZFSv15, volinit was an undocumented command which could be used to 2018-06-08 14:44:21 +00:00
external Do not use index out of bounds in nawk 2018-06-12 13:24:28 +00:00
extsrc
games Restore the MKGROFF=bo MKCXX=yes build 2018-06-11 14:18:16 +00:00
include Mark in string.h: memccpy(3) and strdup(3) as _POSIX_C_SOURCE >= 2001 2018-02-20 02:35:24 +00:00
lib Avoid left-shifting a negative number in the non-compat case, too. 2018-06-11 20:28:23 +00:00
libexec We can't build those three with MKSANITIZER, they are used too early. 2018-06-09 22:41:55 +00:00
regress Don't test call gates, they are not supported anymore. 2017-08-30 15:46:19 +00:00
rescue Add progress(1) into /rescue. 2018-04-11 00:26:38 +00:00
sbin Correct Undefined Behavior in ifconfig(8) 2018-06-11 17:45:50 +00:00
share Handle more objdir variations for MKREPRO (untested) 2018-06-11 01:34:03 +00:00
sys When initiating a transfer, if a device isn't present, we won't 2018-06-12 13:18:48 +00:00
tests Add tests of vlan with bridge 2018-06-12 04:21:22 +00:00
tools Add configure check and fallback definition for u_longlong_t 2018-06-11 18:48:24 +00:00
usr.bin remove extra quotes. 2018-06-12 15:41:35 +00:00
usr.sbin use SUBDIR.roff suggested by uwe@ 2018-06-10 17:55:11 +00:00
BUILDING Re-add files that were accidentally deleted in my previous commit. 2018-05-02 07:34:44 +00:00
Makefile Re-add files that were accidentally deleted in my previous commit. 2018-05-02 07:34:44 +00:00
Makefile.inc Re-add files that were accidentally deleted in my previous commit. 2018-05-02 07:34:44 +00:00
UPDATING Re-add files that were accidentally deleted in my previous commit. 2018-05-02 07:34:44 +00:00
build.sh Re-add files that were accidentally deleted in my previous commit. 2018-05-02 07:34:44 +00:00