Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jan 2019 13:08:05 -0500
From:      Arjan van der Velde <vandervelde.ag@gmail.com>
To:        freebsd-geom@freebsd.org
Subject:   arc4random rather than zero padding in geom_eli
Message-ID:  <22BD67F7-079F-4528-8C9F-27C7B0878B7C@gmail.com>

next in thread | raw e-mail | index | archive | help
Hi!

Surprised by seeing streaks of zeros every 4k on my geli encrypted =
drive, I realized they are zero-padded sectors (i.e. the 9th sector =
underlying every encrypted 4K). I was wondering if it=E2=80=99d be a =
good idea to do this instead:

[freebsd .../geom/eli]$ svn diff
Index: g_eli_integrity.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- g_eli_integrity.c	(revision 343023)
+++ g_eli_integrity.c	(working copy)
@@ -472,7 +472,7 @@
 			 * only partially filled.
 			 */
 			if (bp->bio_cmd =3D=3D BIO_WRITE)
-				memset(data + sc->sc_alen + =
data_secsize, 0,
+				arc4random_buf(data + sc->sc_alen + =
data_secsize,
 				    encr_secsize - sc->sc_alen - =
data_secsize);
 		}

[freebsd .../geom/eli]$

Thanks!

=E2=80=94 Arjan




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?22BD67F7-079F-4528-8C9F-27C7B0878B7C>