[PATCH 18/26] kexec: Fix zeroing of higher bits of flags parameter in kexec_load

Eugene Syromyatnikov evgsyr at gmail.com
Mon Oct 24 03:02:13 UTC 2016


* kexec.c (SYS_FUNC(kexec_load)): Perform type conversion before
negation in order to properly negate higher bits of KEXEC_ARCH_MASK.
---
 kexec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec.c b/kexec.c
index 9ced015..d27bfe1 100644
--- a/kexec.c
+++ b/kexec.c
@@ -91,7 +91,7 @@ SYS_FUNC(kexec_load)
 	/* flags */
 	unsigned long n = tcp->u_arg[3];
 	printxval_long(kexec_arch_values, n & KEXEC_ARCH_MASK, "KEXEC_ARCH_???");
-	n &= ~KEXEC_ARCH_MASK;
+	n &= ~(unsigned long) KEXEC_ARCH_MASK;
 	if (n) {
 		tprints("|");
 		printflags_long(kexec_load_flags, n, "KEXEC_???");
-- 
1.7.10.4





More information about the Strace-devel mailing list