rpms/kernel/F-10 linux-2.6-x86-64-fix-int-0x80-enosys-return.patch, NONE, 1.1.2.1 kernel.spec, 1.1206.2.27, 1.1206.2.28 linux-2.6-x86-mtrr-kill-bogus-warning.patch, 1.1, 1.1.6.1

Chuck Ebbert cebbert at fedoraproject.org
Wed Feb 18 07:57:40 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25390

Modified Files:
      Tag: private-fedora-10-2_6_27
	kernel.spec linux-2.6-x86-mtrr-kill-bogus-warning.patch 
Added Files:
      Tag: private-fedora-10-2_6_27
	linux-2.6-x86-64-fix-int-0x80-enosys-return.patch 
Log Message:
Fix bug in x86-64 syscall error handling (#484871)
Replace x86 MTRR warning patch with better upstream fix.

linux-2.6-x86-64-fix-int-0x80-enosys-return.patch:

--- NEW FILE linux-2.6-x86-64-fix-int-0x80-enosys-return.patch ---
From: Roland McGrath <roland at redhat.com>
Date: Sat, 7 Feb 2009 02:15:18 +0000 (-0800)
Subject: x86-64: fix int $0x80 -ENOSYS return
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=c09249f8d1b84344eca882547afdbffee8c09d14

x86-64: fix int $0x80 -ENOSYS return

One of my past fixes to this code introduced a different new bug.
When using 32-bit "int $0x80" entry for a bogus syscall number,
the return value is not correctly set to -ENOSYS.  This only happens
when neither syscall-audit nor syscall tracing is enabled (i.e., never
seen if auditd ever started).  Test program:

	/* gcc -o int80-badsys -m32 -g int80-badsys.c
	   Run on x86-64 kernel.
	   Note to reproduce the bug you need auditd never to have started.  */

	#include <errno.h>
	#include <stdio.h>

	int
	main (void)
	{
	  long res;
	  asm ("int $0x80" : "=a" (res) : "0" (99999));
	  printf ("bad syscall returns %ld\n", res);
	  return res != -ENOSYS;
	}

The fix makes the int $0x80 path match the sysenter and syscall paths.

Reported-by: Dmitry V. Levin <ldv at altlinux.org>
Signed-off-by: Roland McGrath <roland at redhat.com>
---

diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 256b00b..5a0d76d 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -418,9 +418,9 @@ ENTRY(ia32_syscall)
 	orl   $TS_COMPAT,TI_status(%r10)
 	testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
 	jnz ia32_tracesys
-ia32_do_syscall:	
 	cmpl $(IA32_NR_syscalls-1),%eax
-	ja  int_ret_from_sys_call	/* ia32_tracesys has set RAX(%rsp) */
+	ja ia32_badsys
+ia32_do_call:
 	IA32_ARG_FIXUP
 	call *ia32_sys_call_table(,%rax,8) # xxx: rip relative
 ia32_sysret:
@@ -435,7 +435,9 @@ ia32_tracesys:
 	call syscall_trace_enter
 	LOAD_ARGS32 ARGOFFSET  /* reload args from stack in case ptrace changed it */
 	RESTORE_REST
-	jmp ia32_do_syscall
+	cmpl $(IA32_NR_syscalls-1),%eax
+	ja  int_ret_from_sys_call	/* ia32_tracesys has set RAX(%rsp) */
+	jmp ia32_do_call
 END(ia32_syscall)
 
 ia32_badsys:


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-10/kernel.spec,v
retrieving revision 1.1206.2.27
retrieving revision 1.1206.2.28
diff -u -r1.1206.2.27 -r1.1206.2.28
--- kernel.spec	17 Feb 2009 20:14:02 -0000	1.1206.2.27
+++ kernel.spec	18 Feb 2009 07:57:09 -0000	1.1206.2.28
@@ -585,6 +585,7 @@
 Patch21: linux-2.6-utrace.patch
 Patch22: linux-2.6-x86-tracehook.patch
 Patch23: linux-2.6.27-x86-tracehook-syscall-arg-order.patch
+Patch24: linux-2.6-x86-64-fix-int-0x80-enosys-return.patch
 
 Patch30: linux-2.6-x86-mtrr-kill-bogus-warning.patch
 
@@ -1112,6 +1113,7 @@
 ApplyPatch linux-2.6-utrace.patch
 ApplyPatch linux-2.6-x86-tracehook.patch
 ApplyPatch linux-2.6.27-x86-tracehook-syscall-arg-order.patch
+ApplyPatch linux-2.6-x86-64-fix-int-0x80-enosys-return.patch
 
 ApplyPatch linux-2.6-x86-mtrr-kill-bogus-warning.patch
 
@@ -1939,6 +1941,10 @@
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Wed Feb 18 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.27.18-170.2.28
+- Fix bug in x86-64 syscall error handling (#484871)
+- Replace x86 MTRR warning patch with better upstream fix.
+
 * Tue Feb 17 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.27.18-170.2.27
 - Fix e1000e Tx unit hang, enable ECC on parts that support it.
 

linux-2.6-x86-mtrr-kill-bogus-warning.patch:

Index: linux-2.6-x86-mtrr-kill-bogus-warning.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-10/Attic/linux-2.6-x86-mtrr-kill-bogus-warning.patch,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -r1.1 -r1.1.6.1
--- linux-2.6-x86-mtrr-kill-bogus-warning.patch	31 Oct 2008 08:07:10 -0000	1.1
+++ linux-2.6-x86-mtrr-kill-bogus-warning.patch	18 Feb 2009 07:57:09 -0000	1.1.6.1
@@ -1,21 +1,41 @@
-Kill bogus MTRR warning when running under vmware:
+From: Ingo Molnar <mingo at elte.hu>
+Date: Thu, 29 Jan 2009 10:45:35 +0000 (+0100)
+Subject: x86: tone down mtrr_trim_uncached_memory() warning
+X-Git-Tag: v2.6.29-rc5~34^2~22
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=bf3647c44bc76c43c4b2ebb4c37a559e899ac70e
 
-https://bugzilla.redhat.com/show_bug.cgi?id=468845
+x86: tone down mtrr_trim_uncached_memory() warning
 
-Index: linux-2.6.27.noarch/arch/x86/kernel/cpu/mtrr/main.c
-===================================================================
---- linux-2.6.27.noarch.orig/arch/x86/kernel/cpu/mtrr/main.c
-+++ linux-2.6.27.noarch/arch/x86/kernel/cpu/mtrr/main.c
-@@ -1495,11 +1495,8 @@ int __init mtrr_trim_uncached_memory(uns
- 	}
+kerneloops.org is reporting a lot of these warnings that come due to
+vmware not setting up any MTRRs for emulated CPUs:
+
+| Reported 709 times (14696 total reports)
+| BIOS bug (often in VMWare) where the MTRR's are set up incorrectly
+| or not at all
+|
+| This warning was last seen in version 2.6.29-rc2-git1, and first
+| seen in 2.6.24.
+|
+| More info:
+|   http://www.kerneloops.org/searchweek.php?search=mtrr_trim_uncached_memory
+
+Keep a one-liner KERN_INFO about it - so that we have so notice if empty
+MTRRs are caused by native hardware/BIOS weirdness.
+
+Signed-off-by: Ingo Molnar <mingo at elte.hu>
+---
+
+diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
+index d259e5d..236a401 100644
+--- a/arch/x86/kernel/cpu/mtrr/main.c
++++ b/arch/x86/kernel/cpu/mtrr/main.c
+@@ -1594,8 +1594,7 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
  
  	/* kvm/qemu doesn't have mtrr set right, don't trim them all */
--	if (!highest_pfn) {
+ 	if (!highest_pfn) {
 -		WARN(!kvm_para_available(), KERN_WARNING
 -				"WARNING: strange, CPU MTRRs all blank?\n");
-+	if (!highest_pfn)
++		printk(KERN_INFO "CPU MTRRs all blank - virtualized system.\n");
  		return 0;
--	}
+ 	}
  
- 	/* check entries number */
- 	memset(num, 0, sizeof(num));




More information about the fedora-extras-commits mailing list