freebsd-dev/sys/fs/msdosfs
Pedro F. Giffuni c820acbf0a msdosfs: fixes for Undefined Behavior.
These were found by the Undefined Behaviour GsoC project at NetBSD:

Do not change signedness bit with left shift.
While there avoid signed integer overflow.
Address both issues with using unsigned type.

msdosfs_fat.c:512:42, left shift of 1 by 31 places cannot be represented
in type 'int'
msdosfs_fat.c:521:44, left shift of 1 by 31 places cannot be represented
in type 'int'
msdosfs_fat.c:744:14, left shift of 1 by 31 places cannot be represented
in type 'int'
msdosfs_fat.c:744:24, signed integer overflow: -2147483648 - 1 cannot be
represented in type 'int [20]'
msdosfs_fat.c:840:13, left shift of 1 by 31 places cannot be represented
in type 'int'
msdosfs_fat.c:840:36, signed integer overflow: -2147483648 - 1 cannot be
represented in type 'int [20]'

Detected with micro-UBSan in the user mode.

Hinted from:	NetBSD (CVS 1.33)
MFC after:	2 weeks
Differenctial Revision:	https://reviews.freebsd.org/D16615
2018-08-08 15:08:22 +00:00
..
bootsect.h msdosfs: use C99 types 2017-05-19 18:13:41 +00:00
bpb.h msdosfs: use C99 types 2017-05-19 18:13:41 +00:00
denode.h msdosfs: use same max filesize #define as NetBSD and move to header 2018-07-30 20:36:51 +00:00
direntry.h Revert msdosfs MAKEFS #ifdef changes from r319870 2018-07-24 21:10:17 +00:00
fat.h Revert msdosfs MAKEFS #ifdef changes from r319870 2018-07-24 21:10:17 +00:00
msdosfs_conv.c msdosfs: trim EOL whitespace 2018-07-31 12:44:28 +00:00
msdosfs_denode.c msdosfs: trim EOL whitespace 2018-07-31 12:44:28 +00:00
msdosfs_fat.c msdosfs: fixes for Undefined Behavior. 2018-08-08 15:08:22 +00:00
msdosfs_iconv.c sys/fs: further adoption of SPDX licensing ID tags. 2017-11-27 15:15:37 +00:00
msdosfs_lookup.c msdosfs: trim EOL whitespace 2018-07-31 12:44:28 +00:00
msdosfs_vfsops.c msdosfs: trim EOL whitespace 2018-07-31 12:44:28 +00:00
msdosfs_vnops.c msdosfs: trim EOL whitespace 2018-07-31 12:44:28 +00:00
msdosfsmount.h sys/fs: further adoption of SPDX licensing ID tags. 2017-11-27 15:15:37 +00:00