lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-7b659ee3e1fe0e8eb39730afb903c64e25490ec4@git.kernel.org>
Date:   Tue, 21 Nov 2017 00:41:21 -0800
From:   tip-bot for Dave Hansen <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     dvlasenk@...hat.com, torvalds@...ux-foundation.org,
        tglx@...utronix.de, luto@...nel.org, jpoimboe@...hat.com,
        mingo@...nel.org, brgerst@...il.com, peterz@...radead.org,
        dave.hansen@...ux.intel.com, linux-kernel@...r.kernel.org,
        hpa@...or.com, bp@...en8.de
Subject: [tip:x86/urgent] x86/pkeys/selftests: Fix protection keys write()
 warning

Commit-ID:  7b659ee3e1fe0e8eb39730afb903c64e25490ec4
Gitweb:     https://git.kernel.org/tip/7b659ee3e1fe0e8eb39730afb903c64e25490ec4
Author:     Dave Hansen <dave.hansen@...ux.intel.com>
AuthorDate: Fri, 10 Nov 2017 16:12:32 -0800
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 21 Nov 2017 09:34:52 +0100

x86/pkeys/selftests: Fix protection keys write() warning

write() is marked as having a must-check return value.  Check it and
abort if we fail to write an error message from a signal handler.

Signed-off-by: Dave Hansen <dave.hansen@...ux.intel.com>
Acked-by: Thomas Gleixner <tglx@...utronix.de>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Link: http://lkml.kernel.org/r/20171111001232.94813E58@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 tools/testing/selftests/x86/pkey-helpers.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/x86/pkey-helpers.h b/tools/testing/selftests/x86/pkey-helpers.h
index 3818f25..b3cb767 100644
--- a/tools/testing/selftests/x86/pkey-helpers.h
+++ b/tools/testing/selftests/x86/pkey-helpers.h
@@ -30,6 +30,7 @@ static inline void sigsafe_printf(const char *format, ...)
 	if (!dprint_in_signal) {
 		vprintf(format, ap);
 	} else {
+		int ret;
 		int len = vsnprintf(dprint_in_signal_buffer,
 				    DPRINT_IN_SIGNAL_BUF_SIZE,
 				    format, ap);
@@ -39,7 +40,9 @@ static inline void sigsafe_printf(const char *format, ...)
 		 */
 		if (len > DPRINT_IN_SIGNAL_BUF_SIZE)
 			len = DPRINT_IN_SIGNAL_BUF_SIZE;
-		write(1, dprint_in_signal_buffer, len);
+		ret = write(1, dprint_in_signal_buffer, len);
+		if (ret < 0)
+			abort();
 	}
 	va_end(ap);
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ