freebsd-src/sbin
Alan Somers 69be211061 MFC r323314, r323338, r328849
r323314:
Audit userspace geom code for leaking memory to disk

Any geom class using g_metadata_store, as well as geom_virstor which
duplicated g_metadata_store internally, would dump sectorsize - mdsize bytes
of userspace memory following the metadata block stored. This is most or all
geom classes (gcache, gconcat, geli, gjournal, glabel, gmirror, gmultipath,
graid3, gshsec, gstripe, and geom_virstor).

PR:		222077 (comment #3)
Reported by:	Maxim Khitrov <max AT mxcrypt.com>
Reviewed by:	des
Security:	yes
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12269

r323338:
Fix information leak in geli(8) integrity mode

In integrity mode, a larger logical sector (e.g., 4096 bytes) spans several
physical sectors (e.g., 512 bytes) on the backing device.  Due to hash
overhead, a 4096 byte logical sector takes 8.5625 512-byte physical sectors.
This means that only 288 bytes (256 data + 32 hash) of the last 512 byte
sector are used.

The memory allocation used to store the encrypted data to be written to the
physical sectors comes from malloc(9) and does not use M_ZERO.

Previously, nothing initialized the final physical sector backing each
logical sector, aside from the hash + encrypted data portion.  So 224 bytes
of kernel heap memory was leaked to every block :-(.

This patch addresses the issue by initializing the trailing portion of the
physical sector in every logical sector to zeros before use.  A much simpler
but higher overhead fix would be to tag the entire allocation M_ZERO.

PR:		222077
Reported by:	Maxim Khitrov <max AT mxcrypt.com>
Reviewed by:	emaste
Security:	yes
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12272

r328849:
geom: don't write stack garbage in disk labels

Most consumers of g_metadata_store were passing in partially unallocated
memory, resulting in stack garbage being written to disk labels. Fix them by
zeroing the memory first.

gvirstor repeated the same mistake, but in the kernel.

Also, glabel's label contained a fixed-size string that wasn't
initialized to zero.

PR:		222077
Reported by:	Maxim Khitrov <max@mxcrypt.com>
Reviewed by:	cem
X-MFC-With:	323314
X-MFC-With:	323338
Differential Revision:	https://reviews.freebsd.org/D14164
2018-03-10 04:17:01 +00:00
..
adjkerntz MFC r267667: 2016-10-16 22:02:50 +00:00
atm MFC r306723: 2016-10-16 23:27:03 +00:00
badsect
bsdlabel MFC r306724: 2016-10-16 23:28:58 +00:00
camcontrol MFC r319337: 2017-07-07 15:22:29 +00:00
ccdconfig MFC r306598 2016-10-10 16:11:51 +00:00
clri MFC r306725: 2016-10-16 23:32:35 +00:00
comcontrol
conscontrol
ddb
devd MFC r320165-r320166 2017-07-31 22:28:33 +00:00
devfs MFC r314924: 2017-03-16 01:59:43 +00:00
dhclient MFC r330085: 2018-03-09 14:39:28 +00:00
dmesg MFC r306599: 2016-10-08 21:19:44 +00:00
dump MFC r306600: 2016-10-10 16:14:00 +00:00
dumpfs
dumpon MFC r306601: 2016-10-10 16:17:14 +00:00
etherswitchcfg
fdisk MFC r306731: 2016-10-16 23:39:15 +00:00
fdisk_pc98 MFC r306732: 2016-10-16 23:44:02 +00:00
ffsinfo MFC r267667: 2016-10-16 22:02:50 +00:00
fsck MFC r306733 2017-03-30 02:38:38 +00:00
fsck_ffs MFC of 329749. 2018-02-23 23:07:41 +00:00
fsck_msdosfs MFC r326391: Prevent OOB access on corrupted msdos directories. 2017-12-14 07:55:11 +00:00
fsdb MFC r306603: 2016-10-10 16:25:05 +00:00
fsirand MFC of 276737, 322200, 322201, 322271, and 322297 2017-08-24 21:44:23 +00:00
gbde MFC r292782: Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c 2017-02-27 08:27:38 +00:00
geom MFC r323314, r323338, r328849 2018-03-10 04:17:01 +00:00
ggate MFC r267667: 2016-10-16 22:02:50 +00:00
growfs MFC r324478: 2017-10-17 15:49:36 +00:00
gvinum MFC r267667: 2016-10-16 22:02:50 +00:00
hastctl MFC r267667: 2016-10-16 22:02:50 +00:00
hastd MFC r267667: 2016-10-16 22:02:50 +00:00
ifconfig MFC r317755, r317758 2017-05-30 22:45:01 +00:00
init MFC r320761: 2017-08-02 05:47:26 +00:00
ipf
ipfw MFC r319900: 2017-07-07 15:35:42 +00:00
iscontrol MFC r300547 2016-07-06 17:45:38 +00:00
kldconfig MFC r267667: 2016-10-16 22:02:50 +00:00
kldload MFC r313273: 2017-02-12 09:27:34 +00:00
kldstat MFC r267667: 2016-10-16 22:02:50 +00:00
kldunload MFC r267667: 2016-10-16 22:02:50 +00:00
ldconfig
mca
md5 MFH (r314554): fix date in previous commit 2017-03-12 13:20:07 +00:00
mdconfig MFC r289172,r290254: 2017-02-09 22:49:48 +00:00
mdmfs
mknod MFC r306606: 2016-10-10 16:32:55 +00:00
mksnap_ffs MFC r306607: 2016-10-10 16:36:14 +00:00
mount MFC r316611: 2017-05-30 22:36:24 +00:00
mount_cd9660 MFC r315775: 2017-05-22 06:20:58 +00:00
mount_fusefs MFC r306610: 2016-10-10 16:38:07 +00:00
mount_msdosfs MFC r306276, but don't remove findwin95 2016-10-21 17:39:05 +00:00
mount_nfs MFC: r317931 2017-05-22 21:52:06 +00:00
mount_nullfs MFC r306612: 2016-10-16 22:27:16 +00:00
mount_udf
mount_unionfs MFC r306613: 2016-10-16 22:31:51 +00:00
nandfs
natd MFC r306735: 2016-10-16 23:50:09 +00:00
newfs MFC of 276737, 322200, 322201, 322271, and 322297 2017-08-24 21:44:23 +00:00
newfs_msdos MFC of 276737, 322200, 322201, 322271, and 322297 2017-08-24 21:44:23 +00:00
newfs_nandfs MFC r314671 (by cem): 2017-04-13 17:11:50 +00:00
nfsiod
nos-tun MFC r306736: 2016-10-16 23:53:10 +00:00
nvmecontrol MFC r267667: 2016-10-16 22:02:50 +00:00
pfctl MFC r328497: 2018-02-01 02:00:36 +00:00
pflogd
ping
ping6
quotacheck
rcorder MFC r309625 2016-12-13 23:13:03 +00:00
reboot MFC r267667: 2016-10-16 22:02:50 +00:00
recoverdisk MFC r267667: 2016-10-16 22:02:50 +00:00
resolvconf MFC r304652: 2016-08-31 22:18:50 +00:00
restore
route MFC r329930: route(8): make it possible to manually delete pinned route 2018-03-05 12:06:41 +00:00
routed
rtsol
savecore Relnotes: yes (subtle output/behavior change) 2017-07-19 16:38:55 +00:00
sconfig MFC r306615: 2016-10-16 22:52:05 +00:00
setkey MFC r306616 2017-03-30 02:32:38 +00:00
shutdown MFC r306617 2017-03-30 02:28:49 +00:00
spppcontrol
sunlabel
swapon MFC r315242: Fix late and noauto with geli swap 2017-03-28 10:43:20 +00:00
sysctl MFC r302174 2016-07-12 22:19:25 +00:00
tests MFC r289172,r290254: 2017-02-09 22:49:48 +00:00
tunefs
umount MFC: r308871 2016-12-03 21:56:46 +00:00
zfsbootcfg MFC r308089: zfsbootcfg: a simple tool to set next boot (one time) 2016-11-21 10:14:36 +00:00
Makefile MFC r322951: 2017-09-30 20:44:25 +00:00
Makefile.amd64
Makefile.arm
Makefile.i386
Makefile.ia64
Makefile.inc
Makefile.mips
Makefile.pc98
Makefile.sparc64