All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libuuid: use explicit_bzero() in uuid_clear() when possible
@ 2017-10-16 21:37 Sami Kerola
  2017-10-18  7:15 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Sami Kerola @ 2017-10-16 21:37 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

This ensures value is blanked.  It is possible compiler optimization removed
earlier uuid_clear() calls as unnecessary if value was not used after clear.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 libuuid/src/clear.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libuuid/src/clear.c b/libuuid/src/clear.c
index 2d91fee93..5b1392464 100644
--- a/libuuid/src/clear.c
+++ b/libuuid/src/clear.c
@@ -38,6 +38,10 @@
 
 void uuid_clear(uuid_t uu)
 {
+#ifdef HAVE_EXPLICIT_BZERO
+	explicit_bzero(uu, 16);
+#else
 	memset(uu, 0, 16);
+#endif
 }
 
-- 
2.14.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-24  9:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16 21:37 [PATCH] libuuid: use explicit_bzero() in uuid_clear() when possible Sami Kerola
2017-10-18  7:15 ` Christoph Hellwig
2017-10-23 19:38   ` Sami Kerola
2017-10-24  9:30     ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.