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: <1406299397-30077-2-git-send-email-jeffrey.t.kirsher@intel.com>
Date:	Fri, 25 Jul 2014 07:43:17 -0700
From:	Jeff Kirsher <jeffrey.t.kirsher@...el.com>
To:	tglx@...utronix.de, mingo@...hat.com, hpa@...or.com, x86@...nel.org
Cc:	Mark Rustad <mark.d.rustad@...el.com>,
	linux-kernel@...r.kernel.org,
	Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Subject: [PATCH 2/2] x86: Resolve some shadow warnings

From: Mark Rustad <mark.d.rustad@...el.com>

Resolve some shadow warnings and also eliminate some hazards
for possible name clashes on local variables declared in inner
blocks produced by those macros. Passing an outer variable with
the same name as an inner variable would cause serious confusion,
so prepend the inner variables with underscores to reduce the
exposure.

Signed-off-by: Mark Rustad <mark.d.rustad@...el.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
---
 arch/x86/ia32/ia32_signal.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index f9e181a..11e4987 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -135,7 +135,7 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
 #define loadsegment_ds(v)	loadsegment(ds, v)
 #define loadsegment_es(v)	loadsegment(es, v)
 
-#define get_user_seg(seg)	({ unsigned int v; savesegment(seg, v); v; })
+#define get_user_seg(seg)	({ unsigned int _v; savesegment(seg, _v); _v; })
 #define set_user_seg(seg, v)	loadsegment_##seg(v)
 
 #define COPY(x)			{		\
@@ -143,9 +143,9 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
 }
 
 #define GET_SEG(seg)		({			\
-	unsigned short tmp;				\
-	get_user_ex(tmp, &sc->seg);			\
-	tmp;						\
+	unsigned short _tmp;				\
+	get_user_ex(_tmp, &sc->seg);			\
+	_tmp;						\
 })
 
 #define COPY_SEG_CPL3(seg)	do {			\
@@ -153,11 +153,11 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
 } while (0)
 
 #define RELOAD_SEG(seg)		{		\
-	unsigned int pre = GET_SEG(seg);	\
-	unsigned int cur = get_user_seg(seg);	\
-	pre |= 3;				\
-	if (pre != cur)				\
-		set_user_seg(seg, pre);		\
+	unsigned int _pre = GET_SEG(seg);	\
+	unsigned int _cur = get_user_seg(seg);	\
+	_pre |= 3;				\
+	if (_pre != _cur)			\
+		set_user_seg(seg, _pre);	\
 }
 
 static int ia32_restore_sigcontext(struct pt_regs *regs,
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ