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]
Date:	Mon, 16 May 2016 03:39:35 -0700
From:	tip-bot for Borislav Petkov <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	jolsa@...hat.com, alexander.shishkin@...ux.intel.com,
	luto@...capital.net, linux-kernel@...r.kernel.org,
	linux@...ck-us.net, tglx@...utronix.de, dvlasenk@...hat.com,
	brgerst@...il.com, hpa@...or.com, acme@...hat.com, bp@...e.de,
	bp@...en8.de, vincent.weaver@...ne.edu,
	torvalds@...ux-foundation.org, peterz@...radead.org,
	mingo@...nel.org, eranian@...gle.com
Subject: [tip:locking/rwsem] locking/rwsem: Fix comment on register
 clobbering

Commit-ID:  4544ba8c6b1743499cabb682897a469911845f15
Gitweb:     http://git.kernel.org/tip/4544ba8c6b1743499cabb682897a469911845f15
Author:     Borislav Petkov <bp@...e.de>
AuthorDate: Mon, 16 May 2016 11:34:28 +0200
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 16 May 2016 12:35:40 +0200

locking/rwsem: Fix comment on register clobbering

Document explicitly that %edx can get clobbered on the slow path, on
32-bit kernels. Something I learned the hard way. :-\

Suggested-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Borislav Petkov <bp@...e.de>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: Guenter Roeck <linux@...ck-us.net>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Vince Weaver <vincent.weaver@...ne.edu>
Cc: linux-next@...r.kernel.org
Link: http://lkml.kernel.org/r/20160516093428.GA26108@pd.tnic
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 arch/x86/lib/rwsem.S | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/lib/rwsem.S b/arch/x86/lib/rwsem.S
index a37462a..bf2c607 100644
--- a/arch/x86/lib/rwsem.S
+++ b/arch/x86/lib/rwsem.S
@@ -29,8 +29,10 @@
  * there is contention on the semaphore.
  *
  * %eax contains the semaphore pointer on entry. Save the C-clobbered
- * registers (%eax, %edx and %ecx) except %eax whish is either a return
- * value or just clobbered..
+ * registers (%eax, %edx and %ecx) except %eax which is either a return
+ * value or just gets clobbered. Same is true for %edx so make sure GCC
+ * reloads it after the slow path, by making it hold a temporary, for
+ * example see ____down_write().
  */
 
 #define save_common_regs \

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ