freebsd-skq/sys/geom/eli
cem edd80ade51 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
2017-09-09 01:41:01 +00:00
..
g_eli_crypto.c Make additional parts of sys/geom/eli more usable in userspace 2016-01-07 05:47:34 +00:00
g_eli_ctl.c Hide length of geli passphrase during boot. 2017-08-26 14:07:24 +00:00
g_eli_hmac.c improve PBKDF2 performance 2017-02-19 19:30:31 +00:00
g_eli_integrity.c Fix information leak in geli(8) integrity mode 2017-09-09 01:41:01 +00:00
g_eli_key_cache.c sys/geom/eli: Switch bzero() to explicit_bzero() for sensitive data 2017-03-31 00:07:03 +00:00
g_eli_key.c sys/geom/eli: Switch bzero() to explicit_bzero() for sensitive data 2017-03-31 00:07:03 +00:00
g_eli_privacy.c
g_eli.c Hide length of geli passphrase during boot. 2017-08-26 14:07:24 +00:00
g_eli.h Hide length of geli passphrase during boot. 2017-08-26 14:07:24 +00:00
pkcs5v2.c improve PBKDF2 performance 2017-02-19 19:30:31 +00:00
pkcs5v2.h