]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Jul 2014 05:07:08 +0000 (22:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Jul 2014 05:07:08 +0000 (22:07 -0700)
added patches:
ahci-add-support-for-the-promise-fasttrak-tx8660-sata-hba-ahci-mode.patch
x86_32-entry-store-badsys-error-code-in-eax.patch

queue-3.4/ahci-add-support-for-the-promise-fasttrak-tx8660-sata-hba-ahci-mode.patch [new file with mode: 0644]
queue-3.4/series
queue-3.4/x86_32-entry-store-badsys-error-code-in-eax.patch [new file with mode: 0644]

diff --git a/queue-3.4/ahci-add-support-for-the-promise-fasttrak-tx8660-sata-hba-ahci-mode.patch b/queue-3.4/ahci-add-support-for-the-promise-fasttrak-tx8660-sata-hba-ahci-mode.patch
new file mode 100644 (file)
index 0000000..b842643
--- /dev/null
@@ -0,0 +1,35 @@
+From b32bfc06aefab61acc872dec3222624e6cd867ed Mon Sep 17 00:00:00 2001
+From: Romain Degez <romain.degez@gmail.com>
+Date: Fri, 11 Jul 2014 18:08:13 +0200
+Subject: ahci: add support for the Promise FastTrak TX8660 SATA HBA (ahci mode)
+
+From: Romain Degez <romain.degez@gmail.com>
+
+commit b32bfc06aefab61acc872dec3222624e6cd867ed upstream.
+
+Add support of the Promise FastTrak TX8660 SATA HBA in ahci mode by
+registering the board in the ahci_pci_tbl[].
+
+Note: this HBA also provide a hardware RAID mode when activated in
+BIOS but specific drivers from the manufacturer are required in this
+case.
+
+Signed-off-by: Romain Degez <romain.degez@gmail.com>
+Tested-by: Romain Degez <romain.degez@gmail.com>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/ata/ahci.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/ata/ahci.c
++++ b/drivers/ata/ahci.c
+@@ -446,6 +446,7 @@ static const struct pci_device_id ahci_p
+       /* Promise */
+       { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci },   /* PDC42819 */
++      { PCI_VDEVICE(PROMISE, 0x3781), board_ahci },   /* FastTrak TX8660 ahci-mode */
+       /* Asmedia */
+       { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci },   /* ASM1060 */
index 4c53e0ad790f41603512f60dbdddb3944201c029..0c7aedfb8a53d7ce8c6adf33873c2a69140e18f0 100644 (file)
@@ -2,3 +2,5 @@ block-don-t-assume-last-put-of-shared-tags-is-for-the-host.patch
 libata-support-the-ata-host-which-implements-a-queue-depth-less-than-32.patch
 libata-introduce-ata_host-n_tags-to-avoid-oops-on-sas-controllers.patch
 s390-ptrace-fix-psw-mask-check.patch
+ahci-add-support-for-the-promise-fasttrak-tx8660-sata-hba-ahci-mode.patch
+x86_32-entry-store-badsys-error-code-in-eax.patch
diff --git a/queue-3.4/x86_32-entry-store-badsys-error-code-in-eax.patch b/queue-3.4/x86_32-entry-store-badsys-error-code-in-eax.patch
new file mode 100644 (file)
index 0000000..b0a8baa
--- /dev/null
@@ -0,0 +1,89 @@
+From 8142b215501f8b291a108a202b3a053a265b03dd Mon Sep 17 00:00:00 2001
+From: Sven Wegener <sven.wegener@stealer.net>
+Date: Tue, 22 Jul 2014 10:26:06 +0200
+Subject: x86_32, entry: Store badsys error code in %eax
+
+From: Sven Wegener <sven.wegener@stealer.net>
+
+commit 8142b215501f8b291a108a202b3a053a265b03dd upstream.
+
+Commit 554086d ("x86_32, entry: Do syscall exit work on badsys
+(CVE-2014-4508)") introduced a regression in the x86_32 syscall entry
+code, resulting in syscall() not returning proper errors for undefined
+syscalls on CPUs supporting the sysenter feature.
+
+The following code:
+
+> int result = syscall(666);
+> printf("result=%d errno=%d error=%s\n", result, errno, strerror(errno));
+
+results in:
+
+> result=666 errno=0 error=Success
+
+Obviously, the syscall return value is the called syscall number, but it
+should have been an ENOSYS error. When run under ptrace it behaves
+correctly, which makes it hard to debug in the wild:
+
+> result=-1 errno=38 error=Function not implemented
+
+The %eax register is the return value register. For debugging via ptrace
+the syscall entry code stores the complete register context on the
+stack. The badsys handlers only store the ENOSYS error code in the
+ptrace register set and do not set %eax like a regular syscall handler
+would. The old resume_userspace call chain contains code that clobbers
+%eax and it restores %eax from the ptrace registers afterwards. The same
+goes for the ptrace-enabled call chain. When ptrace is not used, the
+syscall return value is the passed-in syscall number from the untouched
+%eax register.
+
+Use %eax as the return value register in syscall_badsys and
+sysenter_badsys, like a real syscall handler does, and have the caller
+push the value onto the stack for ptrace access.
+
+Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
+Link: http://lkml.kernel.org/r/alpine.LNX.2.11.1407221022380.31021@titan.int.lan.stealer.net
+Reviewed-and-tested-by: Andy Lutomirski <luto@amacapital.net>
+Signed-off-by: H. Peter Anvin <hpa@zytor.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kernel/entry_32.S |    9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+--- a/arch/x86/kernel/entry_32.S
++++ b/arch/x86/kernel/entry_32.S
+@@ -428,8 +428,8 @@ sysenter_do_call:
+       cmpl $(NR_syscalls), %eax
+       jae sysenter_badsys
+       call *sys_call_table(,%eax,4)
+-      movl %eax,PT_EAX(%esp)
+ sysenter_after_call:
++      movl %eax,PT_EAX(%esp)
+       LOCKDEP_SYS_EXIT
+       DISABLE_INTERRUPTS(CLBR_ANY)
+       TRACE_IRQS_OFF
+@@ -510,6 +510,7 @@ ENTRY(system_call)
+       jae syscall_badsys
+ syscall_call:
+       call *sys_call_table(,%eax,4)
++syscall_after_call:
+       movl %eax,PT_EAX(%esp)          # store the return value
+ syscall_exit:
+       LOCKDEP_SYS_EXIT
+@@ -678,12 +679,12 @@ syscall_fault:
+ END(syscall_fault)
+ syscall_badsys:
+-      movl $-ENOSYS,PT_EAX(%esp)
+-      jmp syscall_exit
++      movl $-ENOSYS,%eax
++      jmp syscall_after_call
+ END(syscall_badsys)
+ sysenter_badsys:
+-      movl $-ENOSYS,PT_EAX(%esp)
++      movl $-ENOSYS,%eax
+       jmp sysenter_after_call
+ END(syscall_badsys)
+       CFI_ENDPROC