3.2.67-rc1 review
PATCH 134/152 vm: add VM_FAULT_SIGSEGV handling support
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit 33692f27597fcab536d7cbbcc8f52905133e4aa7 upstream.
The core VM already knows about VM_FAULT_SIGBUS, but cannot return a "you should SIGSEGV" error, because the SIGSEGV case was generally handled by the caller - usually the architecture fault handler.
That results in lots of duplication - all the architecture fault handlers end up doing very similar "look up vma, check permissions, do retries etc" - but it generally works. However, there are cases where the VM actually wants to SIGSEGV, and applications _expect_ SIGSEGV.
In particular, when accessing the stack guard page, libsigsegv expects a SIGSEGV. And it usually got one, because the stack growth is handled by that duplicated architecture fault handler.
However, when the generic VM layer started propagating the error return from the stack expansion in commit fee7e49d4514 ("mm: propagate error from stack expansion even for guard page"), that now exposed the existing VM_FAULT_SIGBUS result to user space. And user space really expected SIGSEGV, not SIGBUS.
To fix that case, we need to add a VM_FAULT_SIGSEGV, and teach all those duplicate architecture fault handlers about it. They all already have the code to handle SIGSEGV, so it's about just tying that new return value to the existing code, but it's all a bit annoying.
This is the mindless minimal patch to do this. A more extensive patch would be to try to gather up the mostly shared fault handling logic into one generic helper routine, and long-term we really should do that cleanup.
Just from this patch, you can generally see that most architectures just copied (directly or indirectly) the old x86 way of doing things, but in the meantime that original x86 model has been improved to hold the VM semaphore for shorter times etc and to handle VM_FAULT_RETRY and other "newer" things, so it would be a good idea to bring all those improvements to the generic case and teach other architectures about them too.
[bwh: Backported to 3.2:
- Adjust filenames, context
- Drop arc, metag, nios2 and lustre changes
- For sh, patch both 32-bit and 64-bit implementations to use goto bad_area
- For s390, pass int_code and trans_exc_code as arguments to do_no_context() and do_sigsegv()]
---
arch/alpha/mm/fault.c +2 -0
@@ -150,6 +150,8 @@ do_page_fault(unsigned long address, unsif (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/avr32/mm/fault.c +2 -0
@@ -136,6 +136,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/cris/mm/fault.c +2 -0
@@ -166,6 +166,8 @@ do_page_fault(unsigned long address, strif (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/frv/mm/fault.c +2 -0
@@ -167,6 +167,8 @@ asmlinkage void do_page_fault(int datammif (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/ia64/mm/fault.c +2 -0
@@ -163,6 +163,8 @@ ia64_do_page_fault (unsigned long addres*/ if (fault &VM_FAULT_OOM ) { goto out_of_memory; + }else if (fault &VM_FAULT_SIGSEGV ) { + goto bad_area; }else if (fault &VM_FAULT_SIGBUS ) { signal =SIGBUS ; goto bad_area;
arch/m32r/mm/fault.c +2 -0
@@ -199,6 +199,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/m68k/mm/fault.c +2 -0
@@ -147,6 +147,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto map_err;else if (fault &VM_FAULT_SIGBUS ) goto bus_err;BUG ();
arch/microblaze/mm/fault.c +2 -0
@@ -215,6 +215,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/mips/mm/fault.c +2 -0
@@ -149,6 +149,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/mn10300/mm/fault.c +2 -0
@@ -256,6 +256,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/openrisc/mm/fault.c +2 -0
@@ -163,6 +163,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/parisc/mm/fault.c +2 -0
@@ -210,6 +210,8 @@ good_area:*/ if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto bad_area;BUG ();
arch/powerpc/platforms/cell/spu_fault.c +1 -1
@@ -75,7 +75,7 @@ int spu_handle_mm_fault(struct mm_structif (*flt &VM_FAULT_OOM ) { ret = -ENOMEM ; goto out_unlock; - }else if (*flt &VM_FAULT_SIGBUS ) { + }else if (*flt & (VM_FAULT_SIGBUS |VM_FAULT_SIGSEGV )) { ret = -EFAULT ; goto out_unlock; }
arch/powerpc/mm/fault.c +2 -0
@@ -312,6 +312,8 @@ good_area:*/ ret =handle_mm_fault (mm, vma, address, is_write ?FAULT_FLAG_WRITE :0 );if (unlikely (ret &VM_FAULT_ERROR )) { +if (ret &VM_FAULT_SIGSEGV ) + goto bad_area;if (ret &VM_FAULT_OOM ) goto out_of_memory;else if (ret &VM_FAULT_SIGBUS )
arch/s390/mm/fault.c +7 -0
@@ -249,6 +249,13 @@ static noinline void do_fault_error(strudo_no_context (regs, int_code, trans_exc_code); elsepagefault_out_of_memory (); + }else if (fault &VM_FAULT_SIGSEGV ) { +/* Kernel mode? Handle exceptions or die */ +if (!user_mode (regs)) +do_no_context (regs, int_code, trans_exc_code); +else +do_sigsegv (regs, int_code,SEGV_MAPERR , + trans_exc_code); }else if (fault &VM_FAULT_SIGBUS ) {/* Kernel mode? Handle exceptions or die */ if (!(regs->psw.mask &PSW_MASK_PSTATE ))
arch/score/mm/fault.c +2 -0
@@ -110,6 +110,8 @@ survive:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/sh/mm/fault_32.c +2 -0
@@ -206,6 +206,8 @@ good_area: goto out_of_memory; else if (fault & VM_FAULT_SIGBUS) goto do_sigbus; + else if (fault & VM_FAULT_SIGSEGV) + goto bad_area;BUG (); }if (fault &VM_FAULT_MAJOR ) {
arch/sh/mm/tlbflush_64.c +2 -0
@@ -195,6 +195,8 @@ good_area: goto out_of_memory; else if (fault & VM_FAULT_SIGBUS) goto do_sigbus; + else if (fault & VM_FAULT_SIGSEGV) + goto bad_area;BUG (); }
arch/sparc/mm/fault_32.c +2 -0
@@ -294,6 +294,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/sparc/mm/fault_64.c +2 -0
@@ -435,6 +435,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/tile/mm/fault.c +2 -0
@@ -424,6 +424,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/um/kernel/trap.c +2 -0
@@ -69,6 +69,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) { goto out_of_memory; + }else if (fault &VM_FAULT_SIGSEGV ) { + goto out; }else if (fault &VM_FAULT_SIGBUS ) { err = -EACCES ; goto out;
arch/x86/mm/fault.c +2 -0
@@ -877,6 +877,8 @@ mm_fault_error(struct pt_regs *regs, unsif (fault & (VM_FAULT_SIGBUS |VM_FAULT_HWPOISON |VM_FAULT_HWPOISON_LARGE ))do_sigbus (regs, error_code, address, fault); +else if (fault &VM_FAULT_SIGSEGV ) +bad_area_nosemaphore (regs, error_code, address);else BUG (); }
arch/xtensa/mm/fault.c +2 -0
@@ -109,6 +109,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
include/linux/mm.h +3 -2
@@ -840,6 +840,7 @@ static inline int page_mapped(struct pag#define VM_FAULT_WRITE 0x0008/* Special case for get_user_pages */ #define VM_FAULT_HWPOISON 0x0010/* Hit poisoned small page */ #define VM_FAULT_HWPOISON_LARGE 0x0020/* Hit poisoned large page. Index encoded in upper bits */ +#define VM_FAULT_SIGSEGV 0x0040#define VM_FAULT_NOPAGE 0x0100/* ->fault installed the pte, not return page */ #define VM_FAULT_LOCKED 0x0200/* ->fault locked the returned page */
@@ -847,8 +848,8 @@ static inline int page_mapped(struct pag#define VM_FAULT_HWPOISON_LARGE_MASK 0xf000/* encodes hpage index for large hwpoison */ -#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_HWPOISON | \ - VM_FAULT_HWPOISON_LARGE) +#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV | \ + VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE)/* Encode hstate index for a hwpoisoned large page */ #define VM_FAULT_SET_HINDEX (x) ((x) << 12)
mm/memory.c +2 -2
@@ -1767,7 +1767,7 @@ int __get_user_pages(struct task_structelse return -EFAULT ; } -if (ret &VM_FAULT_SIGBUS ) +if (ret & (VM_FAULT_SIGBUS |VM_FAULT_SIGSEGV ))return i ? i : -EFAULT ;BUG (); }
@@ -1871,7 +1871,7 @@ int fixup_user_fault(struct task_structreturn -ENOMEM ;if (ret & (VM_FAULT_HWPOISON |VM_FAULT_HWPOISON_LARGE ))return -EHWPOISON ; -if (ret &VM_FAULT_SIGBUS ) +if (ret & (VM_FAULT_SIGBUS |VM_FAULT_SIGSEGV ))return -EFAULT ;BUG (); }
mm/ksm.c +1 -1
@@ -342,7 +342,7 @@ static int break_ksm(struct vm_area_struelse ret =VM_FAULT_WRITE ;put_page (page); - }while (!(ret & (VM_FAULT_WRITE |VM_FAULT_SIGBUS |VM_FAULT_OOM ))); + }while (!(ret & (VM_FAULT_WRITE |VM_FAULT_SIGBUS |VM_FAULT_SIGSEGV |VM_FAULT_OOM )));/* * We must loop because handle_mm_fault() may back out if there's * any difficulty e.g. if pte accessed bit gets updated concurrently.
PATCH 135/152 vm: make stack guard page errors return VM_FAULT_SIGSEGV rather than SIGBUS
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit 9c145c56d0c8a0b62e48c8d71e055ad0fb2012ba upstream.
The stack guard page error case has long incorrectly caused a SIGBUS rather than a SIGSEGV, but nobody actually noticed until commit fee7e49d4514 ("mm: propagate error from stack expansion even for guard page") because that error case was never actually triggered in any normal situations.
Now that we actually report the error, people noticed the wrong signal that resulted. So far, only the test suite of libsigsegv seems to have actually cared, but there are real applications that use libsigsegv, so let's not wait for any of those to break.
--- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory.c +1 -1
@@ -3155,7 +3155,7 @@ static int do_anonymous_page(struct mm_s/* Check if we need to add a guard page to the stack */ if (check_stack_guard_page (vma, address) <0 ) -return VM_FAULT_SIGBUS ; +return VM_FAULT_SIGSEGV ;/* Use the zero-page for reads */ if (!(flags &FAULT_FLAG_WRITE )) {
PATCH 136/152 Revert "x86, mm: Set NX across entire PMD at boot"
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
This reverts commit a5c187d92d2ce30315f333b9dff33af832e8b443 which was commit 45e2a9d4701d8c624d4a4bcdd1084eae31e92f58 upstream.
The previous commit caused suspend/resume to stop working on at least some systems - specifically, the system would reboot when woken.
---
arch/x86/mm/init_64.c +1 -10
@@ -778,7 +778,7 @@ void mark_rodata_ro(void)unsigned long text_end =PAGE_ALIGN ((unsigned long ) &__stop___ex_table);unsigned long rodata_end =PAGE_ALIGN ((unsigned long ) &__end_rodata);unsigned long data_start = (unsigned long ) &_sdata; -unsigned long all_end; +unsigned long all_end =PFN_ALIGN (&_end);printk (KERN_INFO "Write protecting the kernel read-only data: %luk\n" , (end - start) >>10 );
@@ -789,16 +789,7 @@ void mark_rodata_ro(void)/* * The rodata/data/bss/brk section (but not the kernel text!) * should also be not-executable. -* -* We align all_end to PMD_SIZE because the existing mapping -* is a full PMD. If we would align _brk_end to PAGE_SIZE we -* split the PMD and the reminder between _brk_end and the end -* of the PMD will remain mapped executable. -* -* Any PMD which was setup after the one which covers _brk_end -* has been zapped already via cleanup_highmem(). */ - all_end =roundup ((unsigned long )_brk_end,PMD_SIZE );set_memory_nx (rodata_start, (all_end - rodata_start) >>PAGE_SHIFT );rodata_test ();
PATCH 137/152 Revert "x86, 64bit, mm: Mark data/bss/brk to nx"
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
This reverts commit e105c8187b7101e8a8a54ac0218c9d9c9463c636 which was commit 72212675d1c96f5db8ec6fb35701879911193158 upstream.
This caused suspend/resume to stop working on at least some systems - specifically, the system would reboot when woken.
---
arch/x86/mm/init_64.c +3 -4
@@ -778,7 +778,6 @@ void mark_rodata_ro(void)unsigned long text_end =PAGE_ALIGN ((unsigned long ) &__stop___ex_table);unsigned long rodata_end =PAGE_ALIGN ((unsigned long ) &__end_rodata);unsigned long data_start = (unsigned long ) &_sdata; -unsigned long all_end =PFN_ALIGN (&_end);printk (KERN_INFO "Write protecting the kernel read-only data: %luk\n" , (end - start) >>10 );
@@ -787,10 +786,10 @@ void mark_rodata_ro(void) kernel_set_to_readonly =1 ;/* -* The rodata/data/bss/brk section (but not the kernel text!) -* should also be not-executable. +* The rodata section (but not the kernel text!) should also be +* not-executable. */ -set_memory_nx (rodata_start, (all_end - rodata_start) >>PAGE_SHIFT ); +set_memory_nx (rodata_start, (end - rodata_start) >>PAGE_SHIFT );rodata_test ();
PATCH 138/152 ACPI / EC: Fix regression due to conflicting firmware behavior between Samsung and Acer.
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Lv Zheng <[email protected]>
commit 79149001105f18bd2285ada109f9229ea24a7571 upstream.
It is reported that Samsung laptops that need to poll events are broken by the following commit:
Commit 3afcf2ece453e1a8c2c6de19cdf06da3772a1b08
Subject: ACPI / EC: Add support to disallow QR_EC to be issued when SCI_EVT isn't set
The behaviors of the 2 vendor firmwares are conflict:
1. Acer: OSPM shouldn't issue QR_EC unless SCI_EVT is set, firmware automatically sets SCI_EVT as long as there is event queued up.
2. Samsung: OSPM should issue QR_EC whatever SCI_EVT is set, firmware returns 0 when there is no event queued up.
This patch is a quick fix to distinguish the behaviors to make Acer behavior only effective for Acer EC firmware so that the breakages on Samsung EC firmware can be avoided.
--- drivers/acpi/ec.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
drivers/acpi/ec.c +18 -7
@@ -129,6 +129,7 @@ static int EC_FLAGS_MSI; /* Out-of-specstatic int EC_FLAGS_VALIDATE_ECDT ;/* ASUStec ECDTs need to be validated */ static int EC_FLAGS_SKIP_DSDT_SCAN ;/* Not all BIOS survive early DSDT scan */ static int EC_FLAGS_CLEAR_ON_RESUME ;/* Needs acpi_ec_clear() on boot/resume */ +static int EC_FLAGS_QUERY_HANDSHAKE ;/* Needs QR_EC issued when SCI_EVT set */ /* -------------------------------------------------------------------------- Transaction Management
@@ -206,13 +207,8 @@ static bool advance_transaction(struct a }return wakeup; }else { -/* -* There is firmware refusing to respond QR_EC when SCI_EVT -* is not set, for which case, we complete the QR_EC -* without issuing it to the firmware. -* https://bugzilla.kernel.org/show_bug.cgi?id=86211 -*/ -if (!(status &ACPI_EC_FLAG_SCI ) && +if (EC_FLAGS_QUERY_HANDSHAKE && + !(status &ACPI_EC_FLAG_SCI ) && (t->command ==ACPI_EC_COMMAND_QUERY )) { t->flags |=ACPI_EC_COMMAND_POLL ; t->rdata[t->ri++] =0x00 ;
@@ -987,6 +983,18 @@ static int ec_enlarge_storm_threshold(co }/* +* Acer EC firmware refuses to respond QR_EC when SCI_EVT is not set, for +* which case, we complete the QR_EC without issuing it to the firmware. +* https://bugzilla.kernel.org/show_bug.cgi?id=86211 +*/ +static int ec_flag_query_handshake (const struct dmi_system_id *id) +{ +pr_debug ("Detected the EC firmware requiring QR_EC issued when SCI_EVT set\n" ); +EC_FLAGS_QUERY_HANDSHAKE =1 ; +return 0 ; +} + +/* * On some hardware it is necessary to clear events accumulated by the EC during * sleep. These ECs stop reporting GPEs until they are manually polled, if too * many events are accumulated. (e.g. Samsung Series 5/9 notebooks)
@@ -1052,6 +1060,9 @@ static struct dmi_system_id __initdata e { ec_clear_on_resume, "Samsung hardware", { DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD.")}, NULL}, + { + ec_flag_query_handshake, "Acer hardware", { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), }, NULL}, {}, };
PATCH 139/152 s390/3215: fix tty output containing tabs
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Martin Schwidefsky <[email protected]>
commit e512d56c799517f33b301d81e9a5e0ebf30c2d1e upstream.
git commit 37f81fa1f63ad38e16125526bb2769ae0ea8d332 "n_tty: do O_ONLCR translation as a single write" surfaced a bug in the 3215 device driver. In combination this broke tab expansion for tty ouput.
The cause is an asymmetry in the behaviour of tty3215_ops->write vs tty3215_ops->put_char. The put_char function scans for '\t' but the write function does not.
As the driver has logic for the '\t' expansion remove XTABS from c_oflag of the initial termios as well.
--- drivers/s390/char/con3215.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)
drivers/s390/char/con3215.c +17 -3
@@ -993,12 +993,26 @@ static int tty3215_write(struct tty_stru const unsigned char *buf, int count) {struct raw3215_info *raw; +int i, written;if (!tty)return 0 ; raw = (struct raw3215_info *) tty->driver_data; -raw3215_write (raw, buf, count); -return count; + written = count; +while (count >0 ) { +for (i =0 ; i < count; i++) +if (buf[i] =='\t' || buf[i] =='\n' ) +break ; +raw3215_write (raw, buf, i); + count -= i; + buf += i; +if (count >0 ) { +raw3215_putchar (raw, *buf); + count--; + buf++; + } + } +return written; }/*
@@ -1146,7 +1160,7 @@ static int __init tty3215_init(void) driver->subtype =SYSTEM_TYPE_TTY ; driver->init_termios = tty_std_termios; driver->init_termios.c_iflag =IGNBRK |IGNPAR ; - driver->init_termios.c_oflag =ONLCR |XTABS ; + driver->init_termios.c_oflag =ONLCR ; driver->init_termios.c_lflag =ISIG ; driver->flags =TTY_DRIVER_REAL_RAW ;tty_set_operations (driver, &tty3215_ops);
PATCH 140/152 x86, cpu, amd: Add workaround for family 16h, erratum 793
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Borislav Petkov <[email protected]>
commit 3b56496865f9f7d9bcb2f93b44c63f274f08e3b6 upstream.
This adds the workaround for erratum 793 as a precaution in case not every BIOS implements it. This addresses CVE-2013-6885.
Erratum text:
[Revision Guide for AMD Family 16h Models 00h-0Fh Processors, document 51810 Rev. 3.04 November 2013]
793 Specific Combination of Writes to Write Combined Memory Types and Locked Instructions May Cause Core Hang
Description
Under a highly specific and detailed set of internal timing conditions, a locked instruction may trigger a timing sequence whereby the write to a write combined memory type is not flushed, causing the locked instruction to stall indefinitely.
Potential Effect on System
Processor core hang.
Suggested Workaround
BIOS should set MSR
C001_1020[15] = 1b.
Fix Planned
No fix planned
[ hpa: updated description, fixed typo in MSR name ]
[bwh: Backported to 3.2:
- Adjust filename
- Venkatesh Srinivas pointed out we should use {rd,wr}msrl_safe() to avoid crashing on KVM. This was fixed upstream by commit 8f86a7373a1c ("x86, AMD: Convert to the new bit access MSR accessors") but that's too much trouble to backport. Here we must use {rd,wr}msrl_amd_safe().]
--- arch/x86/include/asm/msr-index.h | 1 + arch/x86/kernel/cpu/amd.c | 10 ++++++++++ 2 files changed, 11 insertions(+)
arch/x86/include/asm/msr-index.h +1 -0
@@ -123,6 +123,7 @@#define MSR_AMD64_PATCH_LOADER 0xc0010020#define MSR_AMD64_OSVW_ID_LENGTH 0xc0010140#define MSR_AMD64_OSVW_STATUS 0xc0010141 +#define MSR_AMD64_LS_CFG 0xc0011020#define MSR_AMD64_DC_CFG 0xc0011022#define MSR_AMD64_IBSFETCHCTL 0xc0011030#define MSR_AMD64_IBSFETCHLINAD 0xc0011031
arch/x86/kernel/cpu/amd.c +10 -0
@@ -408,6 +408,16 @@ static void __cpuinit early_init_amd_mc( c->x86_coreid_bits = bits;#endif + +/* F16h erratum 793, CVE-2013-6885 */ +if (c->x86 ==0x16 && c->x86_model <=0xf ) { +u64 val; + +if (!rdmsrl_amd_safe (MSR_AMD64_LS_CFG , &val) && + !(val &BIT (15 ))) +wrmsrl_amd_safe (MSR_AMD64_LS_CFG , val |BIT (15 )); + } + }static void __cpuinit bsp_init_amd (struct cpuinfo_x86 *c)
PATCH 141/152 fsnotify: next_i is freed during fsnotify_unmount_inodes.
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jerry Hoemann <[email protected]>
commit 6424babfd68dd8a83d9c60a5242d27038856599f upstream.
During file system stress testing on 3.10 and 3.12 based kernels, the umount command occasionally hung in fsnotify_unmount_inodes in the section of code:
spin_lock(&inode->i_lock);
if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW)) {
spin_unlock(&inode->i_lock);
continue;
}As this section of code holds the global inode_sb_list_lock, eventually the system hangs trying to acquire the lock.
Multiple crash dumps showed:
The inode->i_state == 0x60 and i_count == 0 and i_sb_list would point back at itself. As this is not the value of list upon entry to the function, the kernel never exits the loop.
To help narrow down problem, the call to list_del_init in inode_sb_list_del was changed to list_del. This poisons the pointers in the i_sb_list and causes a kernel to panic if it transverse a freed inode.
Subsequent stress testing paniced in fsnotify_unmount_inodes at the bottom of the list_for_each_entry_safe loop showing next_i had become free.
We believe the root cause of the problem is that next_i is being freed during the window of time that the list_for_each_entry_safe loop temporarily releases inode_sb_list_lock to call fsnotify and fsnotify_inode_delete.
The code in fsnotify_unmount_inodes attempts to prevent the freeing of inode and next_i by calling __iget. However, the code doesn't do the __iget call on next_i
if i_count == 0 or if i_state & (I_FREEING | I_WILL_FREE)
The patch addresses this issue by advancing next_i in the above two cases until we either find a next_i which we can __iget or we reach the end of the list. This makes the handling of next_i more closely match the handling of the variable "inode."
The time to reproduce the hang is highly variable (from hours to days.) We ran the stress test on a 3.10 kernel with the proposed patch for a week without failure.
During list_for_each_entry_safe, next_i is becoming free causing the loop to never terminate. Advance next_i in those cases where __iget is not done.
--- fs/notify/inode_mark.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
fs/notify/inode_mark.c +11 -6
@@ -282,20 +282,25 @@ void fsnotify_unmount_inodes(struct listspin_unlock (&inode->i_lock);/* In case the dropping of a reference would nuke next_i. */ -if ((&next_i->i_sb_list != list) && -atomic_read (&next_i->i_count)) { +while (&next_i->i_sb_list != list) {spin_lock (&next_i->i_lock); -if (!(next_i->i_state & (I_FREEING |I_WILL_FREE ))) { +if (!(next_i->i_state & (I_FREEING |I_WILL_FREE )) && +atomic_read (&next_i->i_count)) {__iget (next_i); need_iput = next_i; +spin_unlock (&next_i->i_lock); +break ; }spin_unlock (&next_i->i_lock); + next_i =list_entry (next_i->i_sb_list.next, + struct inode, i_sb_list); }/* -* We can safely drop inode_sb_list_lock here because we hold -* references on both inode and next_i. Also no new inodes -* will be added since the umount has begun. +* We can safely drop inode_sb_list_lock here because either +* we actually hold references on both inode and next_i or +* end of list. Also no new inodes will be added since the +* umount has begun. */ spin_unlock (&inode_sb_list_lock);
PATCH 142/152 KEYS: close race between key lookup and freeing
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <[email protected]>
commit a3a8784454692dd72e5d5d34dcdab17b4420e74c upstream.
When a key is being garbage collected, it's key->user would get put before the ->destroy() callback is called, where the key is removed from it's respective tracking structures.
This leaves a key hanging in a semi-invalid state which leaves a window open for a different task to try an access key->user. An example is find_keyring_by_name() which would dereference key->user for a key that is in the process of being garbage collected (where key->user was freed but ->destroy() wasn't called yet - so it's still present in the linked list).
This would cause either a panic, or corrupt memory.
Fixes CVE-2014-9529.
--- security/keys/gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
security/keys/gc.c +2 -2
@@ -186,12 +186,12 @@ static noinline void key_gc_unused_key(sif (test_bit (KEY_FLAG_INSTANTIATED , &key->flags))atomic_dec (&key->user->nikeys); -key_user_put (key->user); -/* now throw away the key memory */ if (key->type->destroy) key->type->destroy (key); +key_user_put (key->user); +kfree (key->description);#ifdef KEY_DEBUGGING
PATCH 143/152 netfilter: ipset: small potential read beyond the end of buffer
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 2196937e12b1b4ba139806d132647e1651d655df upstream.
We could be reading 8 bytes into a 4 byte buffer here. It seems harmless but adding a check is the right thing to do and it silences a static checker warning.
--- net/netfilter/ipset/ip_set_core.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/netfilter/ipset/ip_set_core.c +6 -0
@@ -1615,6 +1615,12 @@ ip_set_sockfn_get(struct sock *sk, int oif (*op <IP_SET_OP_VERSION ) {/* Check the version at the beginning of operations */ struct ip_set_req_version *req_version = data; + +if (*len <sizeof (struct ip_set_req_version )) { + ret = -EINVAL ; + goto done; + } +if (req_version->version !=IPSET_PROTOCOL ) { ret = -EPROTO ; goto done;
PATCH 144/152 dcache: Fix locking bugs in backported "deal with deadlock in d_walk()"
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
Steven Rostedt reported:
Quoted 44 lines
Porting -rt to the latest 3.2 stable tree I triggered this bug:
=====================================
[ BUG: bad unlock balance detected! ]
-------------------------------------
rm/1638 is trying to release lock (rcu_read_lock) at:
[<c04fde6c>]rcu_read_unlock+0x0/0x23
but there are no more locks to release!other info that might help us debug this:
2 locks held by rm/1638:
#0: (&sb->s_type->i_mutex_key#9/1){+.+.+.}, at: [<c04f93eb>]do_rmdir+0x5f/0xd2#1: (&sb->s_type->i_mutex_key#9){+.+.+.}, at: [<c04f9329>]vfs_rmdir+0x49/0xacstack backtrace: Pid: 1638, comm: rm Not tainted 3.2.66-test-rt96+ #2 Call Trace: [<c083f390>] ? printk+0x1d/0x1f [<c0463cdf>] print_unlock_inbalance_bug+0xc3/0xcd [<c04653a8>] lock_release_non_nested+0x98/0x1ec [<c046228d>] ? trace_hardirqs_off_caller+0x18/0x90 [<c0456f1c>] ? local_clock+0x2d/0x50 [<c04fde6c>] ? d_hash+0x2f/0x2f [<c04fde6c>] ? d_hash+0x2f/0x2f [<c046568e>] lock_release+0x192/0x1ad [<c04fde83>] rcu_read_unlock+0x17/0x23 [<c04ff344>] shrink_dcache_parent+0x227/0x270 [<c04f9348>] vfs_rmdir+0x68/0xac [<c04f9424>] do_rmdir+0x98/0xd2 [<c04f03ad>] ? fput+0x1a3/0x1ab [<c084dd42>] ? sysenter_exit+0xf/0x1a [<c0465b58>] ? trace_hardirqs_on_caller+0x118/0x149 [<c04fa3e0>] sys_unlinkat+0x2b/0x35 [<c084dd13>] sysenter_do_call+0x12/0x12There's a path to calling
rcu_read_unlock()without callingrcu_read_lock()inhave_submounts().goto positive;positive:
Quoted 8 lines
if (!locked && read_seqretry(&rename_lock, seq)) goto rename_retry;
rename_retry:rcu_read_unlock();in the above path,
rcu_read_lock()is never done before callingrcu_read_unlock();
I reviewed locking contexts in all three functions that I changed when backporting "deal with deadlock in d_walk()". It's actually worse than this:
- We don't hold this_parent->d_lock at the 'positive' label in have_submounts(), but it is unlocked after 'rename_retry'.
- There is an rcu_read_unlock() after the 'out' label in select_parent(), but it's not held at the 'goto out'.
Fix all three lock imbalances.
--- fs/dcache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/dcache.c +3 -1
@@ -1035,7 +1035,7 @@ ascend:return 0 ;/* No mount points found in tree */ positive:if (!locked &&read_seqretry (&rename_lock, seq)) - goto rename_retry; + goto rename_retry_unlocked;if (locked)write_sequnlock (&rename_lock);return 1 ;
@@ -1045,6 +1045,7 @@ rename_retry:rcu_read_unlock ();if (locked) goto again; +rename_retry_unlocked: locked =1 ;write_seqlock (&rename_lock); goto again;
@@ -1109,6 +1110,7 @@ resume:*/ if (found &&need_resched ()) {spin_unlock (&dentry->d_lock); +rcu_read_lock (); goto out; }
PATCH 145/152 tg3: tg3_disable_ints using uninitialized mailbox value to disable interrupts
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Prashant Sreedharan <[email protected]>
[ Upstream commit 05b0aa579397b734f127af58e401a30784a1e315 ]
During driver load in tg3_init_one, if the driver detects DMA activity before intializing the chip tg3_halt is called. As part of tg3_halt interrupts are disabled using routine tg3_disable_ints. This routine was using mailbox value which was not initialized (default value is 0). As a result driver was writing 0x00000001 to pci config space register 0, which is the vendor id / device id.
This driver bug was exposed because of the commit a7877b17a667 (PCI: Check only the Vendor ID to identify Configuration Request Retry). Also this issue is only seen in older generation chipsets like 5722 because config space write to offset 0 from driver is possible. The newer generation chips ignore writes to offset 0. Also without commit a7877b17a667, for these older chips when a GRC reset is issued the Bootcode would reprogram the vendor id/device id, which is the reason this bug was masked earlier.
Fixed by initializing the interrupt mailbox registers before calling tg3_halt.
Please queue for -stable.
--- drivers/net/ethernet/broadcom/tg3.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +17 -17
@@ -15647,23 +15647,6 @@ static int __devinit tg3_init_one(struct goto err_out_apeunmap; } -/* -* Reset chip in case UNDI or EFI driver did not shutdown -* DMA self test will enable WDMAC and we'll see (spurious) -* pending DMA on the PCI bus at that point. -*/ -if ((tr32 (HOSTCC_MODE ) &HOSTCC_MODE_ENABLE ) || - (tr32 (WDMAC_MODE ) &WDMAC_MODE_ENABLE )) { -tw32 (MEMARB_MODE ,MEMARB_MODE_ENABLE ); -tg3_halt (tp,RESET_KIND_SHUTDOWN ,1 ); - } - - err =tg3_test_dma (tp); -if (err) { -dev_err (&pdev->dev,"DMA engine test failed, aborting\n" ); - goto err_out_apeunmap; - } - intmbx =MAILBOX_INTERRUPT_0 +TG3_64BIT_REG_LOW ; rcvmbx =MAILBOX_RCVRET_CON_IDX_0 +TG3_64BIT_REG_LOW ; sndmbx =MAILBOX_SNDHOST_PROD_IDX_0 +TG3_64BIT_REG_LOW ;
@@ -15708,6 +15691,23 @@ static int __devinit tg3_init_one(struct sndmbx +=0xc ; } +/* +* Reset chip in case UNDI or EFI driver did not shutdown +* DMA self test will enable WDMAC and we'll see (spurious) +* pending DMA on the PCI bus at that point. +*/ +if ((tr32 (HOSTCC_MODE ) &HOSTCC_MODE_ENABLE ) || + (tr32 (WDMAC_MODE ) &WDMAC_MODE_ENABLE )) { +tw32 (MEMARB_MODE ,MEMARB_MODE_ENABLE ); +tg3_halt (tp,RESET_KIND_SHUTDOWN ,1 ); + } + + err =tg3_test_dma (tp); +if (err) { +dev_err (&pdev->dev,"DMA engine test failed, aborting\n" ); + goto err_out_apeunmap; + } +tg3_init_coal (tp);pci_set_drvdata (pdev, dev);
PATCH 146/152 enic: fix rx skb checksum
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Govindarajulu Varadarajan <[email protected]>
[ Upstream commit 17e96834fd35997ca7cdfbf15413bcd5a36ad448 ]
Hardware always provides compliment of IP pseudo checksum. Stack expects whole packet checksum without pseudo checksum if CHECKSUM_COMPLETE is set.
This causes checksum error in nf & ovs.
kernel: qg-19546f09-f2: hw csum failure
kernel: CPU: 9 PID: 0 Comm: swapper/9 Tainted: GF O-------------- 3.10.0-123.8.1.el7.x86_64 #1
kernel: Hardware name: Cisco Systems Inc UCSB-B200-M3/UCSB-B200-M3, BIOS B200M3.2.2.3.0.080820141339 08/08/2014
kernel: ffff881218f40000 df68243feb35e3a8 ffff881237a43ab8 ffffffff815e237b
kernel: ffff881237a43ad0 ffffffff814cd4ca ffff8829ec71eb00 ffff881237a43af0
kernel: ffffffff814c6232 0000000000000286 ffff8829ec71eb00 ffff881237a43b00
kernel: Call Trace:
kernel: <IRQ> [<ffffffff815e237b>] dump_stack+0x19/0x1b
kernel: [<ffffffff814cd4ca>] netdev_rx_csum_fault+0x3a/0x40
kernel: [<ffffffff814c6232>] __skb_checksum_complete_head+0x62/0x70
kernel: [<ffffffff814c6251>] __skb_checksum_complete+0x11/0x20
kernel: [<ffffffff8155a20c>] nf_ip_checksum+0xcc/0x100
kernel: [<ffffffffa049edc7>] icmp_error+0x1f7/0x35c [nf_conntrack_ipv4]
kernel: [<ffffffff814cf419>] ? netif_rx+0xb9/0x1d0
kernel: [<ffffffffa040eb7b>] ? internal_dev_recv+0xdb/0x130 [openvswitch]
kernel: [<ffffffffa04c8330>] nf_conntrack_in+0xf0/0xa80 [nf_conntrack]
kernel: [<ffffffff81509380>] ? inet_del_offload+0x40/0x40
kernel: [<ffffffffa049e302>] ipv4_conntrack_in+0x22/0x30 [nf_conntrack_ipv4]
kernel: [<ffffffff815005ca>] nf_iterate+0xaa/0xc0
kernel: [<ffffffff81509380>] ? inet_del_offload+0x40/0x40
kernel: [<ffffffff81500664>] nf_hook_slow+0x84/0x140
kernel: [<ffffffff81509380>] ? inet_del_offload+0x40/0x40
kernel: [<ffffffff81509dd4>] ip_rcv+0x344/0x380
Hardware verifies IP & tcp/udp header checksum but does not provide payload checksum, use CHECKSUM_UNNECESSARY. Set it only if its valid IP tcp/udp packet.
--- drivers/net/ethernet/cisco/enic/enic_main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/ethernet/cisco/enic/enic_main.c +8 -4
@@ -1272,10 +1272,14 @@ static void enic_rq_indicate_buf(structskb_put (skb, bytes_written); skb->protocol =eth_type_trans (skb, netdev); -if ((netdev->features &NETIF_F_RXCSUM ) && !csum_not_calc) { - skb->csum =htons (checksum); - skb->ip_summed =CHECKSUM_COMPLETE ; - } +/* Hardware does not provide whole packet checksum. It only +* provides pseudo checksum. Since hw validates the packet +* checksum but not provide us the checksum value. use +* CHECSUM_UNNECESSARY. +*/ +if ((netdev->features &NETIF_F_RXCSUM ) && tcp_udp_csum_ok && + ipv4_csum_ok) + skb->ip_summed =CHECKSUM_UNNECESSARY ; skb->dev = netdev;
PATCH 147/152 net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jay Vosburgh <[email protected]>
[ Upstream commit 2c26d34bbcc0b3f30385d5587aa232289e2eed8e ]
When using VXLAN tunnels and a sky2 device, I have experienced checksum failures of the following type:
[ 4297.761899] eth0: hw csum failure [...] [ 4297.765223] Call Trace: [ 4297.765224] <IRQ> [<ffffffff8172f026>] dump_stack+0x46/0x58 [ 4297.765235] [<ffffffff8162ba52>] netdev_rx_csum_fault+0x42/0x50 [ 4297.765238] [<ffffffff8161c1a0>] ? skb_push+0x40/0x40 [ 4297.765240] [<ffffffff8162325c>] __skb_checksum_complete+0xbc/0xd0 [ 4297.765243] [<ffffffff8168c602>] tcp_v4_rcv+0x2e2/0x950 [ 4297.765246] [<ffffffff81666ca0>] ? ip_rcv_finish+0x360/0x360
These are reliably reproduced in a network topology of:
container:eth0 == host(OVS VXLAN on VLAN) == bond0 == eth0 (sky2) -> switch
When VXLAN encapsulated traffic is received from a similarly
configured peer, the above warning is generated in the receive processing of the encapsulated packet. Note that the warning is associated with the container eth0.
The skbs from sky2 have ip_summed set to CHECKSUM_COMPLETE, and
because the packet is an encapsulated Ethernet frame, the checksum generated by the hardware includes the inner protocol and Ethernet headers.
The receive code is careful to update the skb->csum, except in
__dev_forward_skb, as called by dev_forward_skb. __dev_forward_skb calls eth_type_trans, which in turn calls skb_pull_inline(skb, ETH_HLEN) to skip over the Ethernet header, but does not update skb->csum when doing so.
This patch resolves the problem by adding a call toskb_postpull_rcsum to update the skb->csum after the call to eth_type_trans.
--- net/core/dev.c | 1 + 1 file changed, 1 insertion(+)
net/core/dev.c +1 -0
@@ -1616,6 +1616,7 @@ int dev_forward_skb(struct net_device *d skb->tstamp.tv64 =0 ; skb->pkt_type =PACKET_HOST ; skb->protocol =eth_type_trans (skb, dev); +skb_postpull_rcsum (skb,eth_hdr (skb),ETH_HLEN ); skb->mark =0 ;secpath_reset (skb);nf_reset (skb);
PATCH 148/152 vfs: Fix vfsmount_lock imbalance in path_init()
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
When backporting commit 4023bfc9f351 ("be careful with nd->inode in path_init() and follow_dotdot_rcu()"), I failed to account for the vfsmount_lock that is used in 3.2 but not upstream. path_init() takes the lock if performing RCU lookup, but must drop it if (and only if) it subsequently fails.
References: https://bugzilla.kernel.org/show_bug.cgi?id=92531
---
fs/namei.c +1 -0
@@ -1567,6 +1567,7 @@ static int path_init(int dfd, const charif (!(nd->flags &LOOKUP_ROOT )) nd->root.mnt =NULL ;rcu_read_unlock (); +br_read_unlock (vfsmount_lock);return -ECHILD ; fput_fail:
PATCH 149/152 splice: Apply generic position and size checks to each write
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
We need to check the position and size of file writes against various limits, using generic_write_check(). This was not being done for the splice write path. It was fixed upstream by commit 8d0207652cbe ("->splice_write() via ->write_iter()") but we can't apply that.
CVE-2014-7822
--- fs/ocfs2/file.c | 8 ++++++-- fs/splice.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-)
fs/ocfs2/file.c +6 -2
@@ -2468,9 +2468,7 @@ static ssize_t ocfs2_file_splice_write(sstruct address_space *mapping = out->f_mapping;struct inode *inode = mapping->host;struct splice_desc sd = { - .total_len = len, .flags = flags, - .pos = *ppos, .u.file = out, };
@@ -2480,6 +2478,12 @@ static ssize_t ocfs2_file_splice_write(s out->f_path.dentry->d_name.len, out->f_path.dentry->d_name.name, len); + ret =generic_write_checks (out, ppos, &len,0 ); +if (ret) +return ret; + sd.total_len = len; + sd.pos = *ppos; +if (pipe->inode)mutex_lock_nested (&pipe->inode->i_mutex,I_MUTEX_PARENT );
fs/splice.c +6 -2
@@ -1013,13 +1013,17 @@ generic_file_splice_write(struct pipe_instruct address_space *mapping = out->f_mapping;struct inode *inode = mapping->host;struct splice_desc sd = { - .total_len = len, .flags = flags, - .pos = *ppos, .u.file = out, };ssize_t ret; + ret =generic_write_checks (out, ppos, &len,S_ISBLK (inode->i_mode)); +if (ret) +return ret; + sd.total_len = len; + sd.pos = *ppos; +pipe_lock (pipe);splice_from_pipe_begin (&sd);
PATCH 150/152 netfilter: conntrack: disable generic tracking for known protocols
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
commit db29a9508a9246e77087c5531e45b2c88ec6988b upstream.
Given following iptables ruleset:
-P FORWARD DROP
-A FORWARD -m sctp --dport 9 -j ACCEPT
-A FORWARD -p tcp --dport 80 -j ACCEPT
-A FORWARD -p tcp -m conntrack -m state ESTABLISHED,RELATED -j ACCEPT
One would assume that this allows SCTP on port 9 and TCP on port 80. Unfortunately, if the SCTP conntrack module is not loaded, this allows *all* SCTP communication, to pass though, i.e. -p sctp -j ACCEPT, which we think is a security issue.
This is because on the first SCTP packet on port 9, we create a dummy "generic l4" conntrack entry without any port information (since conntrack doesn't know how to extract this information).
All subsequent packets that are unknown will then be in established state since they will fallback to proto_generic and will match the 'generic' entry.
Our originally proposed version [1] completely disabled generic protocol tracking, but Jozsef suggests to not track protocols for which a more suitable helper is available, hence we now mitigate the issue for in tree known ct protocol helpers only, so that at least NAT and direction information will still be preserved for others.
[1] http://www.spinics.net/lists/netfilter-devel/msg33430.html
Joint work with Daniel Borkmann.
--- net/netfilter/nf_conntrack_proto_generic.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
net/netfilter/nf_conntrack_proto_generic.c +25 -1
@@ -14,6 +14,30 @@static unsigned int nf_ct_generic_timeout__read_mostly =600 *HZ ; +static bool nf_generic_should_process (u8 proto) +{ +switch (proto) { +#ifdef CONFIG_NF_CT_PROTO_SCTP_MODULE +case IPPROTO_SCTP : +return false; +#endif +#ifdef CONFIG_NF_CT_PROTO_DCCP_MODULE +case IPPROTO_DCCP : +return false; +#endif +#ifdef CONFIG_NF_CT_PROTO_GRE_MODULE +case IPPROTO_GRE : +return false; +#endif +#ifdef CONFIG_NF_CT_PROTO_UDPLITE_MODULE +case IPPROTO_UDPLITE : +return false; +#endif +default : +return true; + } +} +static bool generic_pkt_to_tuple (const struct sk_buff *skb,unsigned int dataoff,struct nf_conntrack_tuple *tuple)
@@ -56,7 +80,7 @@ static int generic_packet(struct nf_conn *ct,static bool new (struct nf_conn *ct,const struct sk_buff *skb,unsigned int dataoff) { -return true; +return nf_generic_should_process (nf_ct_protonum (ct)); }#ifdef CONFIG_SYSCTL
PATCH 151/152 KVM: x86 emulator: reject SYSENTER in compatibility mode on AMD guests
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Avi Kivity <[email protected]>
commit 1a18a69b762374c423305772500f36eb8984ca52 upstream.
If the guest thinks it's an AMD, it will not have prepared the SYSENTER MSRs, and if the guest executes SYSENTER in compatibility mode, it will fails.
Detect this condition and #UD instead, like the spec says.
--- arch/x86/kvm/emulate.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
arch/x86/kvm/emulate.c +19 -0
@@ -1952,6 +1952,17 @@ setup_syscalls_segments(struct x86_emula ss->p =1 ; } +static bool vendor_intel (struct x86_emulate_ctxt *ctxt) +{ +u32 eax, ebx, ecx, edx; + + eax = ecx =0 ; +return ctxt->ops->get_cpuid (ctxt, &eax, &ebx, &ecx, &edx) + && ebx == X86EMUL_CPUID_VENDOR_GenuineIntel_ebx + && ecx == X86EMUL_CPUID_VENDOR_GenuineIntel_ecx + && edx == X86EMUL_CPUID_VENDOR_GenuineIntel_edx; +} +static bool em_syscall_is_enabled (struct x86_emulate_ctxt *ctxt) {struct x86_emulate_ops *ops = ctxt->ops;
@@ -2068,6 +2079,14 @@ static int em_sysenter(struct x86_emulatif (ctxt->mode ==X86EMUL_MODE_REAL )return emulate_gp (ctxt,0 ); +/* +* Not recognized on AMD in compat mode (but is recognized in legacy +* mode). +*/ +if ((ctxt->mode ==X86EMUL_MODE_PROT32 ) && (efer &EFER_LMA ) + && !vendor_intel (ctxt)) +return emulate_ud (ctxt); +/* XXX sysenter/sysexit have not been tested in 64bit mode. * Therefore, we inject an #UD. */
PATCH 152/152 KVM: x86: SYSENTER emulation is broken
In reply to Ben Hutchings3.2.67-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Nadav Amit <[email protected]>
commit f3747379accba8e95d70cec0eae0582c8c182050 upstream.
SYSENTER emulation is broken in several ways:
1. It misses the case of 16-bit code segments completely (CVE-2015-0239).
2. MSR_IA32_SYSENTER_CS is checked in 64-bit mode incorrectly (bits 0 and 1 can still be set without causing #GP).
3. MSR_IA32_SYSENTER_EIP and MSR_IA32_SYSENTER_ESP are not masked in legacy-mode.
4. There is some unneeded code.
Fix it.
--- arch/x86/kvm/emulate.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-)
arch/x86/kvm/emulate.c +8 -17
@@ -2083,7 +2083,7 @@ static int em_sysenter(struct x86_emulat* Not recognized on AMD in compat mode (but is recognized in legacy * mode). */ -if ((ctxt->mode ==X86EMUL_MODE_PROT32 ) && (efer &EFER_LMA ) +if ((ctxt->mode !=X86EMUL_MODE_PROT64 ) && (efer &EFER_LMA ) && !vendor_intel (ctxt))return emulate_ud (ctxt);
@@ -2096,23 +2096,13 @@ static int em_sysenter(struct x86_emulatsetup_syscalls_segments (ctxt, &cs, &ss); ops->get_msr (ctxt,MSR_IA32_SYSENTER_CS , &msr_data); -switch (ctxt->mode) { -case X86EMUL_MODE_PROT32 : -if ((msr_data &0xfffc ) ==0x0 ) -return emulate_gp (ctxt,0 ); -break ; -case X86EMUL_MODE_PROT64 : -if (msr_data ==0x0 ) -return emulate_gp (ctxt,0 ); -break ; - } +if ((msr_data &0xfffc ) ==0x0 ) +return emulate_gp (ctxt,0 ); ctxt->eflags &= ~(EFLG_VM |EFLG_IF |EFLG_RF ); - cs_sel = (u16 )msr_data; - cs_sel &= ~SELECTOR_RPL_MASK ; + cs_sel = (u16 )msr_data & ~SELECTOR_RPL_MASK ; ss_sel = cs_sel +8 ; - ss_sel &= ~SELECTOR_RPL_MASK ; -if (ctxt->mode ==X86EMUL_MODE_PROT64 || (efer &EFER_LMA )) { +if (efer &EFER_LMA ) { cs.d =0 ; cs.l =1 ; }
@@ -2121,10 +2111,11 @@ static int em_sysenter(struct x86_emulat ops->set_segment (ctxt, ss_sel, &ss,0 ,VCPU_SREG_SS ); ops->get_msr (ctxt,MSR_IA32_SYSENTER_EIP , &msr_data); - ctxt->_eip = msr_data; + ctxt->_eip = (efer &EFER_LMA ) ? msr_data : (u32 )msr_data; ops->get_msr (ctxt,MSR_IA32_SYSENTER_ESP , &msr_data); - ctxt->regs[VCPU_REGS_RSP ] = msr_data; + ctxt->regs[VCPU_REGS_RSP ] = (efer &EFER_LMA ) ? msr_data : + (u32 )msr_data;return X86EMUL_CONTINUE ; }
This is the combined patch for 3.2.67-rc1 relative to 3.2.66.
Ben.
Signature · 2 lines
Ben Hutchings Never attribute to conspiracy what can adequately be explained by stupidity.
Documentation/kernel-parameters.txt +1 -0
@@ -940,6 +940,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted. i8042.notimeout [HW] Ignore timeout condition signalled by conroller i8042.reset [HW] Reset the controller during init and cleanup i8042.unlock [HW] Unlock (ignore) the keylock + i8042.kbdreset [HW] Reset device connected to KBD port i810= [HW,DRM]
Makefile +2 -2
@@ -1,7 +1,7 @@ VERSION = 3 PATCHLEVEL = 2 -SUBLEVEL = 66 -EXTRAVERSION = +SUBLEVEL = 67 +EXTRAVERSION = -rc1 NAME = Saber-toothed Squirrel # *DOCUMENTATION*
arch/alpha/mm/fault.c +2 -0
@@ -150,6 +150,8 @@ do_page_fault(unsigned long address, unsigned long mmcsr,if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/arm/mach-omap2/omap_l3_noc.c +7 -3
@@ -121,11 +121,15 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)/* Nothing to be handled here as of now */ break ; } -/* Error found so break the for loop */ -break ; +/* Error found so break the for loop */ +return IRQ_HANDLED ; } } -return IRQ_HANDLED ; + +dev_err (l3->dev,"L3 %s IRQ not handled!!\n" , + inttype ?"debug" :"application" ); + +return IRQ_NONE ; }static int __devinit omap4_l3_probe (struct platform_device *pdev)
arch/avr32/mm/fault.c +2 -0
@@ -136,6 +136,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/cris/mm/fault.c +2 -0
@@ -166,6 +166,8 @@ do_page_fault(unsigned long address, struct pt_regs *regs,if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/frv/mm/fault.c +2 -0
@@ -167,6 +167,8 @@ asmlinkage void do_page_fault(int datammu, unsigned long esr0, unsigned long earif (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/ia64/mm/fault.c +2 -0
@@ -163,6 +163,8 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re*/ if (fault &VM_FAULT_OOM ) { goto out_of_memory; + }else if (fault &VM_FAULT_SIGSEGV ) { + goto bad_area; }else if (fault &VM_FAULT_SIGBUS ) { signal =SIGBUS ; goto bad_area;
arch/m32r/mm/fault.c +2 -0
@@ -199,6 +199,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/m68k/mm/fault.c +2 -0
@@ -147,6 +147,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto map_err;else if (fault &VM_FAULT_SIGBUS ) goto bus_err;BUG ();
arch/microblaze/mm/fault.c +2 -0
@@ -215,6 +215,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/mips/mm/fault.c +2 -0
@@ -149,6 +149,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/mn10300/mm/fault.c +2 -0
@@ -256,6 +256,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/openrisc/mm/fault.c +2 -0
@@ -163,6 +163,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/parisc/mm/fault.c +2 -0
@@ -210,6 +210,8 @@ good_area:*/ if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto bad_area;BUG ();
arch/powerpc/mm/fault.c +2 -0
@@ -312,6 +312,8 @@ good_area:*/ ret =handle_mm_fault (mm, vma, address, is_write ?FAULT_FLAG_WRITE :0 );if (unlikely (ret &VM_FAULT_ERROR )) { +if (ret &VM_FAULT_SIGSEGV ) + goto bad_area;if (ret &VM_FAULT_OOM ) goto out_of_memory;else if (ret &VM_FAULT_SIGBUS )
arch/powerpc/platforms/cell/spu_fault.c +1 -1
@@ -75,7 +75,7 @@ int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea,if (*flt &VM_FAULT_OOM ) { ret = -ENOMEM ; goto out_unlock; - }else if (*flt &VM_FAULT_SIGBUS ) { + }else if (*flt & (VM_FAULT_SIGBUS |VM_FAULT_SIGSEGV )) { ret = -EFAULT ; goto out_unlock; }
arch/s390/crypto/aes_s390.c +1 -1
@@ -972,7 +972,7 @@ static void __exit aes_s390_fini(void)module_init (aes_s390_init);module_exit (aes_s390_fini); -MODULE_ALIAS ("aes-all" ); +MODULE_ALIAS_CRYPTO ("aes-all" );MODULE_DESCRIPTION ("Rijndael (AES) Cipher Algorithm" );MODULE_LICENSE ("GPL" );
arch/s390/crypto/des_s390.c +2 -2
@@ -626,8 +626,8 @@ static void __exit des_s390_exit(void)module_init (des_s390_init);module_exit (des_s390_exit); -MODULE_ALIAS ("des" ); -MODULE_ALIAS ("des3_ede" ); +MODULE_ALIAS_CRYPTO ("des" ); +MODULE_ALIAS_CRYPTO ("des3_ede" );MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("DES & Triple DES EDE Cipher Algorithms" );
arch/s390/crypto/ghash_s390.c +1 -1
@@ -161,7 +161,7 @@ static void __exit ghash_mod_exit(void)module_init (ghash_mod_init);module_exit (ghash_mod_exit); -MODULE_ALIAS ("ghash" ); +MODULE_ALIAS_CRYPTO ("ghash" );MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("GHASH Message Digest Algorithm, s390 implementation" );
arch/s390/crypto/sha1_s390.c +1 -1
@@ -103,6 +103,6 @@ static void __exit sha1_s390_fini(void)module_init (sha1_s390_init);module_exit (sha1_s390_fini); -MODULE_ALIAS ("sha1" ); +MODULE_ALIAS_CRYPTO ("sha1" );MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA1 Secure Hash Algorithm" );
arch/s390/crypto/sha256_s390.c +2 -2
@@ -143,7 +143,7 @@ static void __exit sha256_s390_fini(void)module_init (sha256_s390_init);module_exit (sha256_s390_fini); -MODULE_ALIAS ("sha256" ); -MODULE_ALIAS ("sha224" ); +MODULE_ALIAS_CRYPTO ("sha256" ); +MODULE_ALIAS_CRYPTO ("sha224" );MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA256 and SHA224 Secure Hash Algorithm" );
arch/s390/crypto/sha512_s390.c +2 -2
@@ -86,7 +86,7 @@ static struct shash_alg sha512_alg = { } }; -MODULE_ALIAS ("sha512" ); +MODULE_ALIAS_CRYPTO ("sha512" );static int sha384_init (struct shash_desc *desc) {
@@ -126,7 +126,7 @@ static struct shash_alg sha384_alg = { } }; -MODULE_ALIAS ("sha384" ); +MODULE_ALIAS_CRYPTO ("sha384" );static int __init init (void ) {
arch/s390/kvm/intercept.c +2 -0
@@ -58,6 +58,7 @@ static int handle_lctlg(struct kvm_vcpu *vcpu)break ; reg = (reg +1 ) %16 ; }while (1 ); +kvm_make_request (KVM_REQ_TLB_FLUSH , vcpu);return 0 ; }
@@ -97,6 +98,7 @@ static int handle_lctl(struct kvm_vcpu *vcpu)break ; reg = (reg +1 ) %16 ; }while (1 ); +kvm_make_request (KVM_REQ_TLB_FLUSH , vcpu);return 0 ; }
arch/s390/mm/fault.c +7 -0
@@ -249,6 +249,13 @@ static noinline void do_fault_error(struct pt_regs *regs, long int_code,do_no_context (regs, int_code, trans_exc_code); elsepagefault_out_of_memory (); + }else if (fault &VM_FAULT_SIGSEGV ) { +/* Kernel mode? Handle exceptions or die */ +if (!user_mode (regs)) +do_no_context (regs, int_code, trans_exc_code); +else +do_sigsegv (regs, int_code,SEGV_MAPERR , + trans_exc_code); }else if (fault &VM_FAULT_SIGBUS ) {/* Kernel mode? Handle exceptions or die */ if (!(regs->psw.mask &PSW_MASK_PSTATE ))
arch/score/mm/fault.c +2 -0
@@ -110,6 +110,8 @@ survive:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/sh/mm/fault_32.c +2 -0
@@ -206,6 +206,8 @@ good_area: goto out_of_memory; else if (fault & VM_FAULT_SIGBUS) goto do_sigbus; + else if (fault & VM_FAULT_SIGSEGV) + goto bad_area;BUG (); }if (fault &VM_FAULT_MAJOR ) {
arch/sh/mm/tlbflush_64.c +2 -0
@@ -195,6 +195,8 @@ good_area: goto out_of_memory; else if (fault & VM_FAULT_SIGBUS) goto do_sigbus; + else if (fault & VM_FAULT_SIGSEGV) + goto bad_area;BUG (); }
arch/sparc/mm/fault_32.c +2 -0
@@ -294,6 +294,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/sparc/mm/fault_64.c +2 -0
@@ -435,6 +435,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/tile/mm/fault.c +2 -0
@@ -424,6 +424,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
arch/um/kernel/trap.c +2 -0
@@ -69,6 +69,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) { goto out_of_memory; + }else if (fault &VM_FAULT_SIGSEGV ) { + goto out; }else if (fault &VM_FAULT_SIGBUS ) { err = -EACCES ; goto out;
arch/x86/crypto/aes_glue.c +2 -2
@@ -67,5 +67,5 @@ module_exit(aes_fini);MODULE_DESCRIPTION ("Rijndael (AES) Cipher Algorithm, asm optimized" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("aes" ); -MODULE_ALIAS ("aes-asm" ); +MODULE_ALIAS_CRYPTO ("aes" ); +MODULE_ALIAS_CRYPTO ("aes-asm" );
arch/x86/crypto/aesni-intel_glue.c +1 -1
@@ -1380,4 +1380,4 @@ module_exit(aesni_exit);MODULE_DESCRIPTION ("Rijndael (AES) Cipher Algorithm, Intel AES-NI instructions optimized" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("aes" ); +MODULE_ALIAS_CRYPTO ("aes" );
arch/x86/crypto/blowfish_glue.c +2 -2
@@ -488,5 +488,5 @@ module_exit(fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Blowfish Cipher Algorithm, asm optimized" ); -MODULE_ALIAS ("blowfish" ); -MODULE_ALIAS ("blowfish-asm" ); +MODULE_ALIAS_CRYPTO ("blowfish" ); +MODULE_ALIAS_CRYPTO ("blowfish-asm" );
arch/x86/crypto/crc32c-intel.c +2 -2
@@ -194,5 +194,5 @@ MODULE_AUTHOR("Austin Zhang <[email protected]>, Kent Liu <[email protected]MODULE_DESCRIPTION ("CRC32c (Castagnoli) optimization using Intel Hardware." );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("crc32c" ); -MODULE_ALIAS ("crc32c-intel" ); +MODULE_ALIAS_CRYPTO ("crc32c" ); +MODULE_ALIAS_CRYPTO ("crc32c-intel" );
arch/x86/crypto/fpu.c +3 -0
@@ -17,6 +17,7 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/slab.h> +#include <linux/crypto.h> #include <asm/i387.h> struct crypto_fpu_ctx {
@@ -159,3 +160,5 @@ void __exit crypto_fpu_exit(void) {crypto_unregister_template (&crypto_fpu_tmpl); } + +MODULE_ALIAS_CRYPTO ("fpu" );
arch/x86/crypto/ghash-clmulni-intel_glue.c +1 -1
@@ -339,4 +339,4 @@ module_exit(ghash_pclmulqdqni_mod_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("GHASH Message Digest Algorithm, " "acclerated by PCLMULQDQ-NI" ); -MODULE_ALIAS ("ghash" ); +MODULE_ALIAS_CRYPTO ("ghash" );
arch/x86/crypto/salsa20_glue.c +2 -2
@@ -125,5 +125,5 @@ module_exit(fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm (optimized assembly version)" ); -MODULE_ALIAS ("salsa20" ); -MODULE_ALIAS ("salsa20-asm" ); +MODULE_ALIAS_CRYPTO ("salsa20" ); +MODULE_ALIAS_CRYPTO ("salsa20-asm" );
arch/x86/crypto/sha1_ssse3_glue.c +1 -1
@@ -237,4 +237,4 @@ module_exit(sha1_ssse3_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA1 Secure Hash Algorithm, Supplemental SSE3 accelerated" ); -MODULE_ALIAS ("sha1" ); +MODULE_ALIAS_CRYPTO ("sha1" );
arch/x86/crypto/twofish_glue.c +2 -2
@@ -97,5 +97,5 @@ module_exit(fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Twofish Cipher Algorithm, asm optimized" ); -MODULE_ALIAS ("twofish" ); -MODULE_ALIAS ("twofish-asm" ); +MODULE_ALIAS_CRYPTO ("twofish" ); +MODULE_ALIAS_CRYPTO ("twofish-asm" );
arch/x86/crypto/twofish_glue_3way.c +2 -2
@@ -468,5 +468,5 @@ module_exit(fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Twofish Cipher Algorithm, 3-way parallel asm optimized" ); -MODULE_ALIAS ("twofish" ); -MODULE_ALIAS ("twofish-asm" ); +MODULE_ALIAS_CRYPTO ("twofish" ); +MODULE_ALIAS_CRYPTO ("twofish-asm" );
arch/x86/include/asm/desc.h +14 -6
@@ -248,7 +248,8 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu) gdt[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i]; } -#define _LDT_empty (info) \ +/* This intentionally ignores lm, since 32-bit apps don't have that field. */ +#define LDT_empty (info) \ ((info)->base_addr == 0 && \ (info)->limit == 0 && \ (info)->contents == 0 && \
@@ -258,11 +259,18 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu) (info)->seg_not_present == 1 && \ (info)->useable == 0) -#ifdef CONFIG_X86_64 -#define LDT_empty (info) (_LDT_empty(info) && ((info)->lm == 0)) -#else -#define LDT_empty (info) (_LDT_empty(info)) -#endif +/* Lots of programs expect an all-zero user_desc to mean "no segment at all". */ +static inline bool LDT_zero (const struct user_desc *info) +{ +return (info->base_addr ==0 && + info->limit ==0 && + info->contents ==0 && + info->read_exec_only ==0 && + info->seg_32bit ==0 && + info->limit_in_pages ==0 && + info->seg_not_present ==0 && + info->useable ==0 ); +}static inline void clear_LDT (void ) {
arch/x86/include/asm/ldt.h +7 -0
@@ -28,6 +28,13 @@ struct user_desc { unsigned int seg_not_present:1; unsigned int useable:1;#ifdef __x86_64__ +/* +* Because this bit is not present in 32-bit user code, user +* programs can pass uninitialized values here. Therefore, in +* any context in which a user_desc comes from a 32-bit program, +* the kernel must act as though lm == 0, regardless of the +* actual value. +*/ unsigned int lm:1;#endif };
arch/x86/include/asm/msr-index.h +1 -0
@@ -123,6 +123,7 @@#define MSR_AMD64_PATCH_LOADER 0xc0010020#define MSR_AMD64_OSVW_ID_LENGTH 0xc0010140#define MSR_AMD64_OSVW_STATUS 0xc0010141 +#define MSR_AMD64_LS_CFG 0xc0011020#define MSR_AMD64_DC_CFG 0xc0011022#define MSR_AMD64_IBSFETCHCTL 0xc0011030#define MSR_AMD64_IBSFETCHLINAD 0xc0011031
arch/x86/kernel/cpu/amd.c +10 -0
@@ -408,6 +408,16 @@ static void __cpuinit early_init_amd_mc(struct cpuinfo_x86 *c) c->x86_coreid_bits = bits;#endif + +/* F16h erratum 793, CVE-2013-6885 */ +if (c->x86 ==0x16 && c->x86_model <=0xf ) { +u64 val; + +if (!rdmsrl_amd_safe (MSR_AMD64_LS_CFG , &val) && + !(val &BIT (15 ))) +wrmsrl_amd_safe (MSR_AMD64_LS_CFG , val |BIT (15 )); + } + }static void __cpuinit bsp_init_amd (struct cpuinfo_x86 *c)
arch/x86/kernel/cpu/mshyperv.c +1 -0
@@ -56,6 +56,7 @@ static struct clocksource hyperv_cs = { .rating = 400, /* use this when running on Hyperv*/ .read = read_hv_clock, .mask = CLOCKSOURCE_MASK(64), + .flags = CLOCK_SOURCE_IS_CONTINUOUS, };static void __init ms_hyperv_init_platform (void )
arch/x86/kernel/kprobes.c +15 -5
@@ -1058,6 +1058,15 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) regs->flags &= ~X86_EFLAGS_IF ;trace_hardirqs_off (); regs->ip = (unsigned long )(jp->entry); + +/* +* jprobes use jprobe_return() which skips the normal return +* path of the function, and this messes up the accounting of the +* function graph tracer to get messed up. +* +* Pause function graph tracing while performing the jprobe function. +*/ +pause_graph_tracing ();return 1 ; }
@@ -1083,24 +1092,25 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)struct kprobe_ctlblk *kcb =get_kprobe_ctlblk ();u8 *addr = (u8 *) (regs->ip -1 ); struct jprobe *jp = container_of(p, struct jprobe, kp); +void *saved_sp = kcb->jprobe_saved_sp;if ((addr > (u8 *) jprobe_return) && (addr < (u8 *) jprobe_return_end)) { -if (stack_addr (regs) != kcb->jprobe_saved_sp) { +if (stack_addr (regs) != saved_sp) {struct pt_regs *saved_regs = &kcb->jprobe_saved_regs;printk (KERN_ERR "current sp %p does not match saved sp %p\n" , -stack_addr (regs), kcb->jprobe_saved_sp); +stack_addr (regs), saved_sp);printk (KERN_ERR "Saved registers for jprobe %p\n" , jp);show_registers (saved_regs);printk (KERN_ERR "Current registers\n" );show_registers (regs);BUG (); } +/* It's OK to start function graph tracing again */ +unpause_graph_tracing (); *regs = kcb->jprobe_saved_regs; -memcpy ((kprobe_opcode_t *)(kcb->jprobe_saved_sp), - kcb->jprobes_stack, -MIN_STACK_SIZE (kcb->jprobe_saved_sp)); +memcpy (saved_sp, kcb->jprobes_stack,MIN_STACK_SIZE (saved_sp));preempt_enable_no_resched ();return 1 ; }
arch/x86/kernel/process_64.c +73 -28
138 lines not on this page · raw message
arch/x86/kernel/tls.c +39 -2
59 lines not on this page · raw message
arch/x86/kvm/emulate.c +26 -16
71 lines not on this page · raw message
arch/x86/mm/fault.c +2 -0
@@ -877,6 +877,8 @@ mm_fault_error(struct pt_regs *regs, unsigned long error_code,if (fault & (VM_FAULT_SIGBUS |VM_FAULT_HWPOISON |VM_FAULT_HWPOISON_LARGE ))do_sigbus (regs, error_code, address, fault); +else if (fault &VM_FAULT_SIGSEGV ) +bad_area_nosemaphore (regs, error_code, address);else BUG (); }
arch/x86/mm/init_64.c +3 -13
@@ -778,7 +778,6 @@ void mark_rodata_ro(void)unsigned long text_end =PAGE_ALIGN ((unsigned long ) &__stop___ex_table);unsigned long rodata_end =PAGE_ALIGN ((unsigned long ) &__end_rodata);unsigned long data_start = (unsigned long ) &_sdata; -unsigned long all_end;printk (KERN_INFO "Write protecting the kernel read-only data: %luk\n" , (end - start) >>10 );
@@ -787,19 +786,10 @@ void mark_rodata_ro(void) kernel_set_to_readonly =1 ;/* -* The rodata/data/bss/brk section (but not the kernel text!) -* should also be not-executable. -* -* We align all_end to PMD_SIZE because the existing mapping -* is a full PMD. If we would align _brk_end to PAGE_SIZE we -* split the PMD and the reminder between _brk_end and the end -* of the PMD will remain mapped executable. -* -* Any PMD which was setup after the one which covers _brk_end -* has been zapped already via cleanup_highmem(). +* The rodata section (but not the kernel text!) should also be +* not-executable. */ - all_end =roundup ((unsigned long )_brk_end,PMD_SIZE ); -set_memory_nx (rodata_start, (all_end - rodata_start) >>PAGE_SHIFT ); +set_memory_nx (rodata_start, (end - rodata_start) >>PAGE_SHIFT );rodata_test ();
arch/x86/vdso/vma.c +27 -14
57 lines not on this page · raw message
arch/xtensa/mm/fault.c +2 -0
@@ -109,6 +109,8 @@ good_area:if (unlikely (fault &VM_FAULT_ERROR )) {if (fault &VM_FAULT_OOM ) goto out_of_memory; +else if (fault &VM_FAULT_SIGSEGV ) + goto bad_area;else if (fault &VM_FAULT_SIGBUS ) goto do_sigbus;BUG ();
block/genhd.c +9 -2
@@ -1070,9 +1070,16 @@ int disk_expand_part_tbl(struct gendisk *disk, int partno)struct disk_part_tbl *old_ptbl = disk->part_tbl;struct disk_part_tbl *new_ptbl;int len = old_ptbl ? old_ptbl->len :0 ; -int target = partno +1 ; +int i, target;size_t size; -int i; + +/* +* check for int overflow, since we can get here from blkpg_ioctl() +* with a user passed 'partno'. +*/ + target = partno +1 ; +if (target <0 ) +return -EINVAL ;/* disk_max_parts() is zero during initialization, ignore if so */ if (disk_max_parts (disk) && target >disk_max_parts (disk))
crypto/aes_generic.c +2 -1
@@ -1475,4 +1475,5 @@ module_exit(aes_fini);MODULE_DESCRIPTION ("Rijndael (AES) Cipher Algorithm" );MODULE_LICENSE ("Dual BSD/GPL" ); -MODULE_ALIAS ("aes" ); +MODULE_ALIAS_CRYPTO ("aes" ); +MODULE_ALIAS_CRYPTO ("aes-generic" );
crypto/af_alg.c +3 -0
@@ -449,6 +449,9 @@ void af_alg_complete(struct crypto_async_request *req, int err) {struct af_alg_completion *completion = req->data; +if (err == -EINPROGRESS ) +return ; + completion->err = err;complete (&completion->completion); }
crypto/algapi.c +2 -2
@@ -477,8 +477,8 @@ static struct crypto_template *__crypto_lookup_template(const char *name)struct crypto_template *crypto_lookup_template (const char *name) { -return try_then_request_module (__crypto_lookup_template (name),"%s" , - name); +return try_then_request_module (__crypto_lookup_template (name), +"crypto-%s" , name); }EXPORT_SYMBOL_GPL (crypto_lookup_template);
crypto/ansi_cprng.c +2 -1
@@ -485,4 +485,5 @@ module_param(dbg, int, 0);MODULE_PARM_DESC (dbg,"Boolean to enable debugging (0/1 == off/on)" );module_init (prng_mod_init);module_exit (prng_mod_fini); -MODULE_ALIAS ("stdrng" ); +MODULE_ALIAS_CRYPTO ("stdrng" ); +MODULE_ALIAS_CRYPTO ("ansi_cprng" );
crypto/anubis.c +1 -0
@@ -705,3 +705,4 @@ module_exit(anubis_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Anubis Cryptographic Algorithm" ); +MODULE_ALIAS_CRYPTO ("anubis" );
crypto/api.c +2 -2
@@ -222,11 +222,11 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask) alg =crypto_alg_lookup (name, type, mask);if (!alg) { -request_module ("%s" , name); +request_module ("crypto-%s" , name);if (!((type ^CRYPTO_ALG_NEED_FALLBACK ) & mask &CRYPTO_ALG_NEED_FALLBACK )) -request_module ("%s-all" , name); +request_module ("crypto-%s-all" , name); alg =crypto_alg_lookup (name, type, mask); }
crypto/arc4.c +1 -0
@@ -101,3 +101,4 @@ module_exit(arc4_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("ARC4 Cipher Algorithm" );MODULE_AUTHOR ("Jon Oberheide <[email protected]>" ); +MODULE_ALIAS_CRYPTO ("arc4" );
crypto/authenc.c +1 -0
@@ -710,3 +710,4 @@ module_exit(crypto_authenc_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Simple AEAD wrapper for IPsec" ); +MODULE_ALIAS_CRYPTO ("authenc" );
crypto/authencesn.c +1 -0
@@ -833,3 +833,4 @@ module_exit(crypto_authenc_esn_module_exit);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Steffen Klassert <[email protected]>" );MODULE_DESCRIPTION ("AEAD wrapper for IPsec with extended sequence numbers" ); +MODULE_ALIAS_CRYPTO ("authencesn" );
crypto/blowfish_generic.c +2 -1
@@ -139,4 +139,5 @@ module_exit(blowfish_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Blowfish Cipher Algorithm" ); -MODULE_ALIAS ("blowfish" ); +MODULE_ALIAS_CRYPTO ("blowfish" ); +MODULE_ALIAS_CRYPTO ("blowfish-generic" );
crypto/camellia.c +1 -0
@@ -1114,3 +1114,4 @@ module_exit(camellia_fini);MODULE_DESCRIPTION ("Camellia Cipher Algorithm" );MODULE_LICENSE ("GPL" ); +MODULE_ALIAS_CRYPTO ("camellia" );
crypto/cast5.c +1 -0
@@ -806,4 +806,5 @@ module_exit(cast5_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Cast5 Cipher Algorithm" ); +MODULE_ALIAS_CRYPTO ("cast5" );
crypto/cast6.c +1 -0
@@ -545,3 +545,4 @@ module_exit(cast6_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Cast6 Cipher Algorithm" ); +MODULE_ALIAS_CRYPTO ("cast6" );
crypto/cbc.c +1 -0
@@ -289,3 +289,4 @@ module_exit(crypto_cbc_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("CBC block cipher algorithm" ); +MODULE_ALIAS_CRYPTO ("cbc" );
crypto/ccm.c +3 -2
@@ -888,5 +888,6 @@ module_exit(crypto_ccm_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Counter with CBC MAC" ); -MODULE_ALIAS ("ccm_base" ); -MODULE_ALIAS ("rfc4309" ); +MODULE_ALIAS_CRYPTO ("ccm_base" ); +MODULE_ALIAS_CRYPTO ("rfc4309" ); +MODULE_ALIAS_CRYPTO ("ccm" );
crypto/chainiv.c +1 -0
@@ -360,3 +360,4 @@ module_exit(chainiv_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Chain IV Generator" ); +MODULE_ALIAS_CRYPTO ("chainiv" );
crypto/crc32c.c +1 -0
@@ -258,3 +258,4 @@ module_exit(crc32c_mod_fini);MODULE_AUTHOR ("Clay Haapala <[email protected]>" );MODULE_DESCRIPTION ("CRC32c (Castagnoli) calculations wrapper for lib/crc32c" );MODULE_LICENSE ("GPL" ); +MODULE_ALIAS_CRYPTO ("crc32c" );
crypto/cryptd.c +1 -0
@@ -955,3 +955,4 @@ module_exit(cryptd_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Software async crypto daemon" ); +MODULE_ALIAS_CRYPTO ("cryptd" );
crypto/crypto_null.c +3 -3
@@ -156,9 +156,9 @@ static struct crypto_alg skcipher_null = { .decrypt = skcipher_null_crypt } } }; -MODULE_ALIAS ("compress_null" ); -MODULE_ALIAS ("digest_null" ); -MODULE_ALIAS ("cipher_null" ); +MODULE_ALIAS_CRYPTO ("compress_null" ); +MODULE_ALIAS_CRYPTO ("digest_null" ); +MODULE_ALIAS_CRYPTO ("cipher_null" );static int __init crypto_null_mod_init (void ) {
crypto/ctr.c +2 -1
@@ -421,4 +421,5 @@ module_exit(crypto_ctr_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("CTR Counter block mode" ); -MODULE_ALIAS ("rfc3686" ); +MODULE_ALIAS_CRYPTO ("rfc3686" ); +MODULE_ALIAS_CRYPTO ("ctr" );
crypto/cts.c +1 -0
@@ -351,3 +351,4 @@ module_exit(crypto_cts_module_exit);MODULE_LICENSE ("Dual BSD/GPL" );MODULE_DESCRIPTION ("CTS-CBC CipherText Stealing for CBC" ); +MODULE_ALIAS_CRYPTO ("cts" );
crypto/deflate.c +1 -1
@@ -223,4 +223,4 @@ module_exit(deflate_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Deflate Compression Algorithm for IPCOMP" );MODULE_AUTHOR ("James Morris <[email protected]>" ); - +MODULE_ALIAS_CRYPTO ("deflate" );
crypto/des_generic.c +4 -3
@@ -975,8 +975,6 @@ static struct crypto_alg des3_ede_alg = { .cia_decrypt = des3_ede_decrypt } } }; -MODULE_ALIAS ("des3_ede" ); -static int __init des_generic_mod_init (void ) {int ret =0 ;
@@ -1004,4 +1002,7 @@ module_exit(des_generic_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("DES & Triple DES EDE Cipher Algorithms" );MODULE_AUTHOR ("Dag Arne Osvik <[email protected]>" ); -MODULE_ALIAS ("des" ); +MODULE_ALIAS_CRYPTO ("des" ); +MODULE_ALIAS_CRYPTO ("des-generic" ); +MODULE_ALIAS_CRYPTO ("des3_ede" ); +MODULE_ALIAS_CRYPTO ("des3_ede-generic" );
crypto/ecb.c +1 -0
@@ -185,3 +185,4 @@ module_exit(crypto_ecb_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("ECB block cipher algorithm" ); +MODULE_ALIAS_CRYPTO ("ecb" );
crypto/eseqiv.c +1 -0
@@ -267,3 +267,4 @@ module_exit(eseqiv_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Encrypted Sequence Number IV Generator" ); +MODULE_ALIAS_CRYPTO ("eseqiv" );
crypto/fcrypt.c +1 -0
@@ -421,3 +421,4 @@ module_exit(fcrypt_mod_fini);MODULE_LICENSE ("Dual BSD/GPL" );MODULE_DESCRIPTION ("FCrypt Cipher Algorithm" );MODULE_AUTHOR ("David Howells <[email protected]>" ); +MODULE_ALIAS_CRYPTO ("fcrypt" );
crypto/gcm.c +4 -3
@@ -1374,6 +1374,7 @@ module_exit(crypto_gcm_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Galois/Counter Mode" );MODULE_AUTHOR ("Mikko Herranen <[email protected]>" ); -MODULE_ALIAS ("gcm_base" ); -MODULE_ALIAS ("rfc4106" ); -MODULE_ALIAS ("rfc4543" ); +MODULE_ALIAS_CRYPTO ("gcm_base" ); +MODULE_ALIAS_CRYPTO ("rfc4106" ); +MODULE_ALIAS_CRYPTO ("rfc4543" ); +MODULE_ALIAS_CRYPTO ("gcm" );
crypto/ghash-generic.c +2 -1
@@ -173,4 +173,5 @@ module_exit(ghash_mod_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("GHASH Message Digest Algorithm" ); -MODULE_ALIAS ("ghash" ); +MODULE_ALIAS_CRYPTO ("ghash" ); +MODULE_ALIAS_CRYPTO ("ghash-generic" );
crypto/hmac.c +1 -0
@@ -271,3 +271,4 @@ module_exit(hmac_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("HMAC hash algorithm" ); +MODULE_ALIAS_CRYPTO ("hmac" );
crypto/khazad.c +1 -0
@@ -881,3 +881,4 @@ module_exit(khazad_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Khazad Cryptographic Algorithm" ); +MODULE_ALIAS_CRYPTO ("khazad" );
crypto/krng.c +2 -1
@@ -63,4 +63,5 @@ module_exit(krng_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Kernel Random Number Generator" ); -MODULE_ALIAS ("stdrng" ); +MODULE_ALIAS_CRYPTO ("stdrng" ); +MODULE_ALIAS_CRYPTO ("krng" );
crypto/lrw.c +1 -0
@@ -312,3 +312,4 @@ module_exit(crypto_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("LRW block cipher mode" ); +MODULE_ALIAS_CRYPTO ("lrw" );
crypto/lzo.c +1 -0
@@ -104,3 +104,4 @@ module_exit(lzo_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("LZO Compression Algorithm" ); +MODULE_ALIAS_CRYPTO ("lzo" );
crypto/md4.c +1 -1
@@ -255,4 +255,4 @@ module_exit(md4_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("MD4 Message Digest Algorithm" ); - +MODULE_ALIAS_CRYPTO ("md4" );
crypto/md5.c +1 -0
@@ -168,3 +168,4 @@ module_exit(md5_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("MD5 Message Digest Algorithm" ); +MODULE_ALIAS_CRYPTO ("md5" );
crypto/michael_mic.c +1 -0
@@ -184,3 +184,4 @@ module_exit(michael_mic_exit);MODULE_LICENSE ("GPL v2" );MODULE_DESCRIPTION ("Michael MIC" );MODULE_AUTHOR ("Jouni Malinen <[email protected]>" ); +MODULE_ALIAS_CRYPTO ("michael_mic" );
crypto/pcbc.c +1 -0
@@ -295,3 +295,4 @@ module_exit(crypto_pcbc_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("PCBC block cipher algorithm" ); +MODULE_ALIAS_CRYPTO ("pcbc" );
crypto/pcrypt.c +1 -0
@@ -565,3 +565,4 @@ module_exit(pcrypt_exit);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Steffen Klassert <[email protected]>" );MODULE_DESCRIPTION ("Parallel crypto wrapper" ); +MODULE_ALIAS_CRYPTO ("pcrypt" );
crypto/rmd128.c +1 -0
@@ -327,3 +327,4 @@ module_exit(rmd128_mod_fini);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Adrian-Ken Rueegsegger <[email protected]>" );MODULE_DESCRIPTION ("RIPEMD-128 Message Digest" ); +MODULE_ALIAS_CRYPTO ("rmd128" );
crypto/rmd160.c +1 -0
@@ -371,3 +371,4 @@ module_exit(rmd160_mod_fini);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Adrian-Ken Rueegsegger <[email protected]>" );MODULE_DESCRIPTION ("RIPEMD-160 Message Digest" ); +MODULE_ALIAS_CRYPTO ("rmd160" );
crypto/rmd256.c +1 -0
@@ -346,3 +346,4 @@ module_exit(rmd256_mod_fini);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Adrian-Ken Rueegsegger <[email protected]>" );MODULE_DESCRIPTION ("RIPEMD-256 Message Digest" ); +MODULE_ALIAS_CRYPTO ("rmd256" );
crypto/rmd320.c +1 -0
@@ -395,3 +395,4 @@ module_exit(rmd320_mod_fini);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Adrian-Ken Rueegsegger <[email protected]>" );MODULE_DESCRIPTION ("RIPEMD-320 Message Digest" ); +MODULE_ALIAS_CRYPTO ("rmd320" );
crypto/salsa20_generic.c +2 -1
@@ -249,4 +249,5 @@ module_exit(salsa20_generic_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm" ); -MODULE_ALIAS ("salsa20" ); +MODULE_ALIAS_CRYPTO ("salsa20" ); +MODULE_ALIAS_CRYPTO ("salsa20-generic" );
crypto/seed.c +1 -0
@@ -477,3 +477,4 @@ module_exit(seed_fini);MODULE_DESCRIPTION ("SEED Cipher Algorithm" );MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Hye-Shik Chang <[email protected]>, Kim Hyun <[email protected]>" ); +MODULE_ALIAS_CRYPTO ("seed" );
crypto/seqiv.c +1 -0
@@ -363,3 +363,4 @@ module_exit(seqiv_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Sequence Number IV Generator" ); +MODULE_ALIAS_CRYPTO ("seqiv" );
crypto/serpent.c +2 -1
@@ -584,4 +584,5 @@ module_exit(serpent_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Serpent and tnepres (kerneli compatible serpent reversed) Cipher Algorithm" );MODULE_AUTHOR ("Dag Arne Osvik <[email protected]>" ); -MODULE_ALIAS ("tnepres" ); +MODULE_ALIAS_CRYPTO ("tnepres" ); +MODULE_ALIAS_CRYPTO ("serpent" );
crypto/sha1_generic.c +2 -1
@@ -153,4 +153,5 @@ module_exit(sha1_generic_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA1 Secure Hash Algorithm" ); -MODULE_ALIAS ("sha1" ); +MODULE_ALIAS_CRYPTO ("sha1" ); +MODULE_ALIAS_CRYPTO ("sha1-generic" );
crypto/sha256_generic.c +4 -2
@@ -398,5 +398,7 @@ module_exit(sha256_generic_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA-224 and SHA-256 Secure Hash Algorithm" ); -MODULE_ALIAS ("sha224" ); -MODULE_ALIAS ("sha256" ); +MODULE_ALIAS_CRYPTO ("sha224" ); +MODULE_ALIAS_CRYPTO ("sha224-generic" ); +MODULE_ALIAS_CRYPTO ("sha256" ); +MODULE_ALIAS_CRYPTO ("sha256-generic" );
crypto/sha512_generic.c +4 -2
@@ -294,5 +294,7 @@ module_exit(sha512_generic_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("SHA-512 and SHA-384 Secure Hash Algorithms" ); -MODULE_ALIAS ("sha384" ); -MODULE_ALIAS ("sha512" ); +MODULE_ALIAS_CRYPTO ("sha384" ); +MODULE_ALIAS_CRYPTO ("sha384-generic" ); +MODULE_ALIAS_CRYPTO ("sha512" ); +MODULE_ALIAS_CRYPTO ("sha512-generic" );
crypto/tea.c +3 -2
@@ -299,8 +299,9 @@ static void __exit tea_mod_fini(void)crypto_unregister_alg (&xeta_alg); } -MODULE_ALIAS ("xtea" ); -MODULE_ALIAS ("xeta" ); +MODULE_ALIAS_CRYPTO ("tea" ); +MODULE_ALIAS_CRYPTO ("xtea" ); +MODULE_ALIAS_CRYPTO ("xeta" );module_init (tea_mod_init);module_exit (tea_mod_fini);
crypto/tgr192.c +3 -2
@@ -702,8 +702,9 @@ static void __exit tgr192_mod_fini(void)crypto_unregister_shash (&tgr128); } -MODULE_ALIAS ("tgr160" ); -MODULE_ALIAS ("tgr128" ); +MODULE_ALIAS_CRYPTO ("tgr192" ); +MODULE_ALIAS_CRYPTO ("tgr160" ); +MODULE_ALIAS_CRYPTO ("tgr128" );module_init (tgr192_mod_init);module_exit (tgr192_mod_fini);
crypto/twofish_generic.c +2 -1
@@ -212,4 +212,5 @@ module_exit(twofish_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Twofish Cipher Algorithm" ); -MODULE_ALIAS ("twofish" ); +MODULE_ALIAS_CRYPTO ("twofish" ); +MODULE_ALIAS_CRYPTO ("twofish-generic" );
crypto/vmac.c +1 -0
@@ -673,4 +673,5 @@ module_exit(vmac_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("VMAC hash algorithm" ); +MODULE_ALIAS_CRYPTO ("vmac" );
crypto/wp512.c +3 -2
@@ -1194,8 +1194,9 @@ static void __exit wp512_mod_fini(void)crypto_unregister_shash (&wp256); } -MODULE_ALIAS ("wp384" ); -MODULE_ALIAS ("wp256" ); +MODULE_ALIAS_CRYPTO ("wp512" ); +MODULE_ALIAS_CRYPTO ("wp384" ); +MODULE_ALIAS_CRYPTO ("wp256" );module_init (wp512_mod_init);module_exit (wp512_mod_fini);
crypto/xcbc.c +1 -0
@@ -286,3 +286,4 @@ module_exit(crypto_xcbc_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("XCBC keyed hash algorithm" ); +MODULE_ALIAS_CRYPTO ("xcbc" );
crypto/xts.c +1 -0
@@ -289,3 +289,4 @@ module_exit(crypto_module_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("XTS block cipher mode" ); +MODULE_ALIAS_CRYPTO ("xts" );
crypto/zlib.c +1 -0
@@ -378,3 +378,4 @@ module_exit(zlib_mod_fini);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Zlib Compression Algorithm" );MODULE_AUTHOR ("Sony Corporation" ); +MODULE_ALIAS_CRYPTO ("zlib" );
drivers/acpi/ec.c +18 -7
@@ -129,6 +129,7 @@ static int EC_FLAGS_MSI; /* Out-of-spec MSI controller */static int EC_FLAGS_VALIDATE_ECDT ;/* ASUStec ECDTs need to be validated */ static int EC_FLAGS_SKIP_DSDT_SCAN ;/* Not all BIOS survive early DSDT scan */ static int EC_FLAGS_CLEAR_ON_RESUME ;/* Needs acpi_ec_clear() on boot/resume */ +static int EC_FLAGS_QUERY_HANDSHAKE ;/* Needs QR_EC issued when SCI_EVT set */ /* -------------------------------------------------------------------------- Transaction Management
@@ -206,13 +207,8 @@ static bool advance_transaction(struct acpi_ec *ec) }return wakeup; }else { -/* -* There is firmware refusing to respond QR_EC when SCI_EVT -* is not set, for which case, we complete the QR_EC -* without issuing it to the firmware. -* https://bugzilla.kernel.org/show_bug.cgi?id=86211 -*/ -if (!(status &ACPI_EC_FLAG_SCI ) && +if (EC_FLAGS_QUERY_HANDSHAKE && + !(status &ACPI_EC_FLAG_SCI ) && (t->command ==ACPI_EC_COMMAND_QUERY )) { t->flags |=ACPI_EC_COMMAND_POLL ; t->rdata[t->ri++] =0x00 ;
@@ -987,6 +983,18 @@ static int ec_enlarge_storm_threshold(const struct dmi_system_id *id) }/* +* Acer EC firmware refuses to respond QR_EC when SCI_EVT is not set, for +* which case, we complete the QR_EC without issuing it to the firmware. +* https://bugzilla.kernel.org/show_bug.cgi?id=86211 +*/ +static int ec_flag_query_handshake (const struct dmi_system_id *id) +{ +pr_debug ("Detected the EC firmware requiring QR_EC issued when SCI_EVT set\n" ); +EC_FLAGS_QUERY_HANDSHAKE =1 ; +return 0 ; +} + +/* * On some hardware it is necessary to clear events accumulated by the EC during * sleep. These ECs stop reporting GPEs until they are manually polled, if too * many events are accumulated. (e.g. Samsung Series 5/9 notebooks)
@@ -1052,6 +1060,9 @@ static struct dmi_system_id __initdata ec_dmi_table[] = { { ec_clear_on_resume, "Samsung hardware", { DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD.")}, NULL}, + { + ec_flag_query_handshake, "Acer hardware", { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), }, NULL}, {}, };
drivers/ata/libata-core.c +4 -1
@@ -4730,7 +4730,10 @@ static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)return NULL ;for (i =0 , tag = ap->last_tag +1 ; i < max_queue; i++, tag++) { - tag = tag < max_queue ? tag :0 ; +if (ap->flags &ATA_FLAG_LOWTAG ) + tag = i; +else + tag = tag < max_queue ? tag :0 ;/* the last tag is reserved for internal command. */ if (tag ==ATA_TAG_INTERNAL )
drivers/ata/libata-sff.c +12 -0
@@ -1333,7 +1333,19 @@ void ata_sff_flush_pio_task(struct ata_port *ap)DPRINTK ("ENTER\n" );cancel_delayed_work_sync (&ap->sff_pio_task); + +/* +* We wanna reset the HSM state to IDLE. If we do so without +* grabbing the port lock, critical sections protected by it which +* expect the HSM state to stay stable may get surprised. For +* example, we may set IDLE in between the time +* __ata_sff_port_intr() checks for HSM_ST_IDLE and before it calls +* ata_sff_hsm_move() causing ata_sff_hsm_move() to BUG(). +*/ +spin_lock_irq (ap->lock); ap->hsm_task_state =HSM_ST_IDLE ; +spin_unlock_irq (ap->lock); + ap->sff_pio_task_link =NULL ;if (ata_msg_ctl (ap))
drivers/ata/sata_dwc_460ex.c +12 -14
@@ -791,7 +791,7 @@ static int dma_dwc_init(struct sata_dwc_device *hsdev, int irq)if (err) {dev_err (host_pvt.dwc_dev,"%s: dma_request_interrupts returns" " %d\n" , __func__, err); - goto error_out; +return err; }/* Enabe DMA */
@@ -802,11 +802,6 @@ static int dma_dwc_init(struct sata_dwc_device *hsdev, int irq) sata_dma_regs);return 0 ; - -error_out: -dma_dwc_exit (hsdev); - -return err; }static int sata_dwc_scr_read (struct ata_link *link,unsigned int scr,u32 *val)
@@ -1634,7 +1629,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)char *ver = (char *)&versionr;u8 *base =NULL ;int err =0 ; -int irq, rc; +int irq;struct ata_host *host;struct ata_port_info pi = sata_dwc_port_info[0 ];const struct ata_port_info *ppi[] = { &pi,NULL };
@@ -1688,7 +1683,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)if (irq ==NO_IRQ ) {dev_err (&ofdev->dev,"no SATA DMA irq\n" ); err = -ENODEV ; - goto error_out; + goto error_iomap; }/* Get physical SATA DMA register base address */
@@ -1697,14 +1692,16 @@ static int sata_dwc_probe(struct platform_device *ofdev)dev_err (&ofdev->dev,"ioremap failed for AHBDMA register" " address\n" ); err = -ENODEV ; - goto error_out; + goto error_iomap; }/* Save dev for later use in dev_xxx() routines */ host_pvt.dwc_dev = &ofdev->dev;/* Initialize AHB DMAC */ -dma_dwc_init (hsdev, irq); + err =dma_dwc_init (hsdev, irq); +if (err) + goto error_dma_iomap;/* Enable SATA Interrupts */ sata_dwc_enable_interrupts (hsdev);
@@ -1722,9 +1719,8 @@ static int sata_dwc_probe(struct platform_device *ofdev)* device discovery process, invoking our port_start() handler & * error_handler() to execute a dummy Softreset EH session */ - rc =ata_host_activate (host, irq, sata_dwc_isr,0 , &sata_dwc_sht); - -if (rc !=0 ) + err =ata_host_activate (host, irq, sata_dwc_isr,0 , &sata_dwc_sht); +if (err)dev_err (&ofdev->dev,"failed to activate host" );dev_set_drvdata (&ofdev->dev, host);
@@ -1733,7 +1729,8 @@ static int sata_dwc_probe(struct platform_device *ofdev) error_out:/* Free SATA DMA resources */ dma_dwc_exit (hsdev); - +error_dma_iomap: +iounmap ((void __iomem *)host_pvt.sata_dma_regs); error_iomap:iounmap (base); error_kmalloc:
@@ -1754,6 +1751,7 @@ static int sata_dwc_remove(struct platform_device *ofdev)/* Free SATA DMA resources */ dma_dwc_exit (hsdev); +iounmap ((void __iomem *)host_pvt.sata_dma_regs);iounmap (hsdev->reg_base);kfree (hsdev);kfree (host);
drivers/ata/sata_sil24.c +1 -1
@@ -246,7 +246,7 @@ enum {/* host flags */ SIL24_COMMON_FLAGS =ATA_FLAG_SATA |ATA_FLAG_PIO_DMA |ATA_FLAG_NCQ |ATA_FLAG_ACPI_SATA | -ATA_FLAG_AN |ATA_FLAG_PMP , +ATA_FLAG_AN |ATA_FLAG_PMP |ATA_FLAG_LOWTAG ,SIL24_FLAG_PCIX_IRQ_WOC = (1 <<24 ),/* IRQ loss errata on PCI-X */ IRQ_STAT_4PORTS = 0xf,
drivers/base/bus.c +5 -3
@@ -240,13 +240,15 @@ static ssize_t store_drivers_probe(struct bus_type *bus, const char *buf, size_t count) { struct device *dev; +int err = -EINVAL ; dev =bus_find_device_by_name (bus,NULL , buf);if (!dev)return -ENODEV ; -if (bus_rescan_devices_helper (dev,NULL ) !=0 ) -return -EINVAL ; -return count; +if (bus_rescan_devices_helper (dev,NULL ) ==0 ) + err = count; +put_device (dev); +return err; }#endif
drivers/base/core.c +83 -28
135 lines not on this page · raw message
drivers/block/drbd/drbd_req.c +1 -0
@@ -1184,6 +1184,7 @@ int drbd_merge_bvec(struct request_queue *q, struct bvec_merge_data *bvm, structstruct request_queue *const b = mdev->ldev->backing_bdev->bd_disk->queue;if (b->merge_bvec_fn) { + bvm->bi_bdev = mdev->ldev->backing_bdev; backing_limit = b->merge_bvec_fn (b, bvm, bvec); limit =min (limit, backing_limit); }
drivers/bluetooth/ath3k.c +57 -35
139 lines not on this page · raw message
drivers/bluetooth/btusb.c +52 -24
135 lines not on this page · raw message
drivers/crypto/padlock-aes.c +1 -1
@@ -559,4 +559,4 @@ MODULE_DESCRIPTION("VIA PadLock AES algorithm support");MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Michal Ludvig" ); -MODULE_ALIAS ("aes" ); +MODULE_ALIAS_CRYPTO ("aes" );
drivers/crypto/padlock-sha.c +4 -4
@@ -593,7 +593,7 @@ MODULE_DESCRIPTION("VIA PadLock SHA1/SHA256 algorithms support.");MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Michal Ludvig" ); -MODULE_ALIAS ("sha1-all" ); -MODULE_ALIAS ("sha256-all" ); -MODULE_ALIAS ("sha1-padlock" ); -MODULE_ALIAS ("sha256-padlock" ); +MODULE_ALIAS_CRYPTO ("sha1-all" ); +MODULE_ALIAS_CRYPTO ("sha256-all" ); +MODULE_ALIAS_CRYPTO ("sha1-padlock" ); +MODULE_ALIAS_CRYPTO ("sha256-padlock" );
drivers/gpio/gpiolib.c +86 -61
254 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gem.c +14 -0
@@ -2248,6 +2248,13 @@ static int sandybridge_write_fence_reg(struct drm_i915_gem_object *obj,int regnum = obj->fence_reg;uint64_t val; +/* Adjust fence size to match tiled area */ +if (obj->tiling_mode !=I915_TILING_NONE ) { +uint32_t row_size = obj->stride * + (obj->tiling_mode ==I915_TILING_Y ?32 :8 ); + size = (size / row_size) * row_size; + } + val = (uint64_t )((obj->gtt_offset + size -4096 ) &0xfffff000 ) <<32 ; val |= obj->gtt_offset &0xfffff000 ;
@@ -2285,6 +2292,13 @@ static int i965_write_fence_reg(struct drm_i915_gem_object *obj,int regnum = obj->fence_reg;uint64_t val; +/* Adjust fence size to match tiled area */ +if (obj->tiling_mode !=I915_TILING_NONE ) { +uint32_t row_size = obj->stride * + (obj->tiling_mode ==I915_TILING_Y ?32 :8 ); + size = (size / row_size) * row_size; + } + val = (uint64_t )((obj->gtt_offset + size -4096 ) &0xfffff000 ) <<32 ; val |= obj->gtt_offset &0xfffff000 ;
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +2 -19
@@ -484,14 +484,7 @@ void vmw_fence_obj_flush(struct vmw_fence_obj *fence)static void vmw_fence_destroy (struct vmw_fence_obj *fence) { -struct vmw_fence_manager *fman = fence->fman; -kfree (fence); -/* -* Free kernel space accounting. -*/ -ttm_mem_global_free (vmw_mem_glob (fman->dev_priv), - fman->fence_size); } int vmw_fence_create(struct vmw_fence_manager *fman,
@@ -499,20 +492,12 @@ int vmw_fence_create(struct vmw_fence_manager *fman,uint32_t mask, struct vmw_fence_obj **p_fence) { - struct ttm_mem_global *mem_glob = vmw_mem_glob(fman->dev_priv); struct vmw_fence_obj *fence;int ret; - ret =ttm_mem_global_alloc (mem_glob, fman->fence_size, - false, false); -if (unlikely (ret !=0 )) -return ret; - fence =kzalloc (sizeof (*fence),GFP_KERNEL ); -if (unlikely (fence ==NULL )) { - ret = -ENOMEM ; - goto out_no_object; - } +if (unlikely (fence ==NULL )) +return -ENOMEM ; ret =vmw_fence_obj_init (fman, fence, seqno, mask, vmw_fence_destroy);
@@ -524,8 +509,6 @@ int vmw_fence_create(struct vmw_fence_manager *fman, out_err_init:kfree (fence); -out_no_object: -ttm_mem_global_free (mem_glob, fman->fence_size);return ret; }
drivers/hid/hid-roccat-pyra.c +6 -0
@@ -35,6 +35,8 @@ static struct class *pyra_class;static void profile_activated (struct pyra_device *pyra,unsigned int new_profile) { +if (new_profile >=ARRAY_SIZE (pyra->profile_settings)) +return ; pyra->actual_profile = new_profile; pyra->actual_cpi = pyra->profile_settings[pyra->actual_profile].y_cpi; }
@@ -303,6 +305,10 @@ static ssize_t pyra_sysfs_write_settings(struct file *fp,if (off !=0 || count !=sizeof (struct pyra_settings ))return -EINVAL ; +if (((struct pyra_settings const *)buf)->startup_profile >= +ARRAY_SIZE (pyra->profile_settings)) +return -EINVAL ; +mutex_lock (&pyra->pyra_lock); difference =memcmp (buf, &pyra->settings,sizeof (struct pyra_settings ));if (difference) {
drivers/input/serio/i8042-x86ia64io.h +47 -0
71 lines not on this page · raw message
drivers/input/serio/i8042.c +14 -0
@@ -67,6 +67,10 @@ static bool i8042_notimeout;module_param_named (notimeout, i8042_notimeout, bool,0 );MODULE_PARM_DESC (notimeout,"Ignore timeouts signalled by i8042" ); +static bool i8042_kbdreset; +module_param_named (kbdreset, i8042_kbdreset, bool,0 ); +MODULE_PARM_DESC (kbdreset,"Reset device connected to KBD port" ); +#ifdef CONFIG_X86 static bool i8042_dritek;module_param_named (dritek, i8042_dritek, bool,0 );
@@ -783,6 +787,16 @@ static int __init i8042_check_aux(void)return -1 ;/* +* Reset keyboard (needed on some laptops to successfully detect +* touchpad, e.g., some Gigabyte laptop models with Elantech +* touchpads). +*/ +if (i8042_kbdreset) { +pr_warn ("Attempting to reset device connected to KBD port\n" ); +i8042_kbd_write (NULL , (unsigned char )0xff ); + } + +/* * Test AUX IRQ delivery to make sure BIOS did not grab the IRQ and * used it for a PCI card or somethig else. */
drivers/iommu/intel-iommu.c +3 -5
@@ -1763,7 +1763,7 @@ static int __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn,struct dma_pte *first_pte =NULL , *pte =NULL ;phys_addr_t uninitialized_var (pteval );int addr_width =agaw_to_width (domain->agaw) -VTD_PAGE_SHIFT ; -unsigned long sg_res; +unsigned long sg_res =0 ;unsigned int largepage_lvl =0 ;unsigned long lvl_pages =0 ;
@@ -1774,10 +1774,8 @@ static int __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn, prot &=DMA_PTE_READ |DMA_PTE_WRITE |DMA_PTE_SNP ; -if (sg) - sg_res =0 ; -else { - sg_res = nr_pages +1 ; +if (!sg) { + sg_res = nr_pages; pteval = ((phys_addr_t )phys_pfn <<VTD_PAGE_SHIFT ) | prot; }
drivers/md/persistent-data/dm-space-map-metadata.c +3 -1
@@ -419,7 +419,9 @@ static int sm_bootstrap_get_nr_blocks(struct dm_space_map *sm, dm_block_t *count { struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm); -return smm->ll.nr_blocks; + *count = smm->ll.nr_blocks; + +return 0 ; }static int sm_bootstrap_get_nr_free (struct dm_space_map *sm,dm_block_t *count)
drivers/media/dvb/dvb-usb/af9005.c +3 -0
@@ -1072,9 +1072,12 @@ static int __init af9005_usb_module_init(void)err ("usb_register failed. (%d)" , result);return result; } +#if IS_MODULE (CONFIG_DVB_USB_AF9005 ) || defined(CONFIG_DVB_USB_AF9005_REMOTE ) +/* FIXME: convert to todays kernel IR infrastructure */ rc_decode =symbol_request (af9005_rc_decode); rc_keys =symbol_request (rc_map_af9005_table); rc_keys_size =symbol_request (rc_map_af9005_table_size); +#endif if (rc_decode ==NULL || rc_keys ==NULL || rc_keys_size ==NULL ) {err ("af9005_rc_decode function not found, disabling remote" ); af9005_properties.rc.legacy.rc_query =NULL ;
drivers/media/video/au0828/au0828-cards.c +5 -0
@@ -36,6 +36,11 @@ void hvr950q_cs5340_audio(void *priv, int enable)au0828_clear (dev,REG_000 ,0x10 ); } +/* +* WARNING: There's a quirks table at sound/usb/quirks-table.h +* that should also be updated every time a new device with V4L2 support +* is added here. +*/ struct au0828_board au0828_boards[] = { [AU0828_BOARD_UNKNOWN ] = { .name ="Unknown board" ,
drivers/media/video/uvc/uvc_driver.c +3 -3
@@ -1597,12 +1597,12 @@ static void uvc_delete(struct uvc_device *dev) {struct list_head *p, *n; -usb_put_intf (dev->intf); -usb_put_dev (dev->udev); -uvc_status_cleanup (dev);uvc_ctrl_cleanup_device (dev); +usb_put_intf (dev->intf); +usb_put_dev (dev->udev); +if (dev->vdev.dev)v4l2_device_unregister (&dev->vdev);#ifdef CONFIG_MEDIA_CONTROLLER
drivers/mfd/tc6393xb.c +12 -1
@@ -263,6 +263,17 @@ static int tc6393xb_ohci_disable(struct platform_device *dev)return 0 ; } +static int tc6393xb_ohci_suspend (struct platform_device *dev) +{ +struct tc6393xb_platform_data *tcpd =dev_get_platdata (dev->dev.parent); + +/* We can't properly store/restore OHCI state, so fail here */ +if (tcpd->resume_restore) +return -EBUSY ; + +return tc6393xb_ohci_disable (dev); +} +static int tc6393xb_fb_enable (struct platform_device *dev) {struct tc6393xb *tc6393xb =dev_get_drvdata (dev->dev.parent);
@@ -403,7 +414,7 @@ static struct mfd_cell __devinitdata tc6393xb_cells[] = { .num_resources = ARRAY_SIZE(tc6393xb_ohci_resources), .resources = tc6393xb_ohci_resources, .enable = tc6393xb_ohci_enable, - .suspend = tc6393xb_ohci_disable, + .suspend = tc6393xb_ohci_suspend, .resume = tc6393xb_ohci_enable, .disable = tc6393xb_ohci_disable, },
drivers/mtd/ubi/upd.c +6 -4
@@ -135,6 +135,10 @@ int ubi_start_update(struct ubi_device *ubi, struct ubi_volume *vol,ubi_assert (!vol->updating && !vol->changing_leb); vol->updating =1 ; + vol->upd_buf =vmalloc (ubi->leb_size); +if (!vol->upd_buf) +return -ENOMEM ; + err =set_update_marker (ubi, vol);if (err)return err;
@@ -154,14 +158,12 @@ int ubi_start_update(struct ubi_device *ubi, struct ubi_volume *vol, err =clear_update_marker (ubi, vol,0 );if (err)return err; + +vfree (vol->upd_buf); vol->updating =0 ;return 0 ; } - vol->upd_buf =vmalloc (ubi->leb_size); -if (!vol->upd_buf) -return -ENOMEM ; - vol->upd_ebs =div_u64 (bytes + vol->usable_leb_size -1 , vol->usable_leb_size); vol->upd_bytes = bytes;
drivers/net/can/dev.c +6 -2
@@ -605,10 +605,14 @@ static int can_changelink(struct net_device *dev,if (dev->flags &IFF_UP )return -EBUSY ; cm =nla_data (data[IFLA_CAN_CTRLMODE ]); -if (cm->flags & ~priv->ctrlmode_supported) + +/* check whether changed bits are allowed to be modified */ +if (cm->mask & ~priv->ctrlmode_supported)return -EOPNOTSUPP ; + +/* clear bits to be modified and copy the flag values */ priv->ctrlmode &= ~cm->mask; - priv->ctrlmode |= cm->flags; + priv->ctrlmode |= (cm->flags & cm->mask); }if (data[IFLA_CAN_BITTIMING ]) {
drivers/net/ethernet/broadcom/tg3.c +17 -17
@@ -15647,23 +15647,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, goto err_out_apeunmap; } -/* -* Reset chip in case UNDI or EFI driver did not shutdown -* DMA self test will enable WDMAC and we'll see (spurious) -* pending DMA on the PCI bus at that point. -*/ -if ((tr32 (HOSTCC_MODE ) &HOSTCC_MODE_ENABLE ) || - (tr32 (WDMAC_MODE ) &WDMAC_MODE_ENABLE )) { -tw32 (MEMARB_MODE ,MEMARB_MODE_ENABLE ); -tg3_halt (tp,RESET_KIND_SHUTDOWN ,1 ); - } - - err =tg3_test_dma (tp); -if (err) { -dev_err (&pdev->dev,"DMA engine test failed, aborting\n" ); - goto err_out_apeunmap; - } - intmbx =MAILBOX_INTERRUPT_0 +TG3_64BIT_REG_LOW ; rcvmbx =MAILBOX_RCVRET_CON_IDX_0 +TG3_64BIT_REG_LOW ; sndmbx =MAILBOX_SNDHOST_PROD_IDX_0 +TG3_64BIT_REG_LOW ;
@@ -15708,6 +15691,23 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, sndmbx +=0xc ; } +/* +* Reset chip in case UNDI or EFI driver did not shutdown +* DMA self test will enable WDMAC and we'll see (spurious) +* pending DMA on the PCI bus at that point. +*/ +if ((tr32 (HOSTCC_MODE ) &HOSTCC_MODE_ENABLE ) || + (tr32 (WDMAC_MODE ) &WDMAC_MODE_ENABLE )) { +tw32 (MEMARB_MODE ,MEMARB_MODE_ENABLE ); +tg3_halt (tp,RESET_KIND_SHUTDOWN ,1 ); + } + + err =tg3_test_dma (tp); +if (err) { +dev_err (&pdev->dev,"DMA engine test failed, aborting\n" ); + goto err_out_apeunmap; + } +tg3_init_coal (tp);pci_set_drvdata (pdev, dev);
drivers/net/ethernet/cisco/enic/enic_main.c +8 -4
@@ -1272,10 +1272,14 @@ static void enic_rq_indicate_buf(struct vnic_rq *rq,skb_put (skb, bytes_written); skb->protocol =eth_type_trans (skb, netdev); -if ((netdev->features &NETIF_F_RXCSUM ) && !csum_not_calc) { - skb->csum =htons (checksum); - skb->ip_summed =CHECKSUM_COMPLETE ; - } +/* Hardware does not provide whole packet checksum. It only +* provides pseudo checksum. Since hw validates the packet +* checksum but not provide us the checksum value. use +* CHECSUM_UNNECESSARY. +*/ +if ((netdev->features &NETIF_F_RXCSUM ) && tcp_udp_csum_ok && + ipv4_csum_ok) + skb->ip_summed =CHECKSUM_UNNECESSARY ; skb->dev = netdev;
drivers/net/wireless/ath/ath5k/qcu.c +1 -7
@@ -167,13 +167,7 @@ int ath5k_hw_setup_tx_queue(struct ath5k_hw *ah, enum ath5k_tx_queue queue_type, }else {switch (queue_type) {case AR5K_TX_QUEUE_DATA : -for (queue =AR5K_TX_QUEUE_ID_DATA_MIN ; - ah->ah_txq[queue].tqi_type != -AR5K_TX_QUEUE_INACTIVE ; queue++) { - -if (queue >AR5K_TX_QUEUE_ID_DATA_MAX ) -return -EINVAL ; - } + queue = queue_info->tqi_subtype;break ;case AR5K_TX_QUEUE_UAPSD : queue =AR5K_TX_QUEUE_ID_UAPSD ;
drivers/net/wireless/ath/ath9k/hw.h +2 -2
@@ -174,8 +174,8 @@#define PAPRD_IDEAL_AGC2_PWR_RANGE 0xe0enum ath_hw_txq_subtype { -ATH_TXQ_AC_BE =0 , -ATH_TXQ_AC_BK =1 , +ATH_TXQ_AC_BK =0 , +ATH_TXQ_AC_BE =1 ,ATH_TXQ_AC_VI =2 ,ATH_TXQ_AC_VO =3 , };
drivers/net/wireless/ath/ath9k/mac.c +1 -8
@@ -311,14 +311,7 @@ int ath9k_hw_setuptxqueue(struct ath_hw *ah, enum ath9k_tx_queue type, q =ATH9K_NUM_TX_QUEUES -3 ;break ;case ATH9K_TX_QUEUE_DATA : -for (q =0 ; q <ATH9K_NUM_TX_QUEUES ; q++) -if (ah->txq[q].tqi_type == -ATH9K_TX_QUEUE_INACTIVE ) -break ; -if (q ==ATH9K_NUM_TX_QUEUES ) { -ath_err (common,"No available TX queue\n" ); -return -1 ; - } + q = qinfo->tqi_subtype;break ;default :ath_err (common,"Invalid TX queue type: %u\n" , type);
drivers/pci/probe.c +3 -0
@@ -175,14 +175,17 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, res->flags |=IORESOURCE_SIZEALIGN ;if (res->flags &IORESOURCE_IO ) { l &=PCI_BASE_ADDRESS_IO_MASK ; + sz &=PCI_BASE_ADDRESS_IO_MASK ; mask =PCI_BASE_ADDRESS_IO_MASK & (u32 )IO_SPACE_LIMIT ; }else { l &=PCI_BASE_ADDRESS_MEM_MASK ; + sz &=PCI_BASE_ADDRESS_MEM_MASK ; mask = (u32 )PCI_BASE_ADDRESS_MEM_MASK ; } }else { res->flags |= (l &IORESOURCE_ROM_ENABLE ); l &=PCI_ROM_ADDRESS_MASK ; + sz &=PCI_ROM_ADDRESS_MASK ; mask = (u32 )PCI_ROM_ADDRESS_MASK ; }
drivers/platform/x86/hp_accel.c +1 -0
@@ -237,6 +237,7 @@ static struct dmi_system_id lis3lv02d_dmi_ids[] = {AXIS_DMI_MATCH ("HPB64xx" ,"HP ProBook 64" , xy_swap),AXIS_DMI_MATCH ("HPB64xx" ,"HP EliteBook 84" , xy_swap),AXIS_DMI_MATCH ("HPB65xx" ,"HP ProBook 65" , x_inverted), +AXIS_DMI_MATCH ("HPZBook15" ,"HP ZBook 15" , x_inverted), { NULL, }/* Laptop models without axis info (yet): * "NC6910" "HP Compaq 6910"
drivers/regulator/core.c +2 -0
@@ -1314,12 +1314,14 @@ void regulator_put(struct regulator *regulator)device_remove_file (regulator->dev, ®ulator->dev_attr);kfree (regulator->dev_attr.attr.name); } +mutex_lock (&rdev->mutex);kfree (regulator->supply_name);list_del (®ulator->list);kfree (regulator); rdev->open_count--; rdev->exclusive =0 ; +mutex_unlock (&rdev->mutex);module_put (rdev->owner);mutex_unlock (®ulator_list_mutex);
drivers/s390/char/con3215.c +17 -3
@@ -993,12 +993,26 @@ static int tty3215_write(struct tty_struct * tty, const unsigned char *buf, int count) {struct raw3215_info *raw; +int i, written;if (!tty)return 0 ; raw = (struct raw3215_info *) tty->driver_data; -raw3215_write (raw, buf, count); -return count; + written = count; +while (count >0 ) { +for (i =0 ; i < count; i++) +if (buf[i] =='\t' || buf[i] =='\n' ) +break ; +raw3215_write (raw, buf, i); + count -= i; + buf += i; +if (count >0 ) { +raw3215_putchar (raw, *buf); + count--; + buf++; + } + } +return written; }/*
@@ -1146,7 +1160,7 @@ static int __init tty3215_init(void) driver->subtype =SYSTEM_TYPE_TTY ; driver->init_termios = tty_std_termios; driver->init_termios.c_iflag =IGNBRK |IGNPAR ; - driver->init_termios.c_oflag =ONLCR |XTABS ; + driver->init_termios.c_oflag =ONLCR ; driver->init_termios.c_lflag =ISIG ; driver->flags =TTY_DRIVER_REAL_RAW ;tty_set_operations (driver, &tty3215_ops);
drivers/scsi/NCR5380.c +6 -6
@@ -2662,14 +2662,14 @@ static void NCR5380_dma_complete(NCR5380_instance * instance) {* * Purpose : abort a command * -* Inputs : cmd - the Scsi_Cmnd to abort, code - code to set the -* host byte of the result field to, if zero DID_ABORTED is +* Inputs : cmd - the Scsi_Cmnd to abort, code - code to set the +* host byte of the result field to, if zero DID_ABORTED is * used. * -* Returns : 0 - success, -1 on failure. +* Returns : SUCCESS - success, FAILED on failure. * -* XXX - there is no way to abort the command that is currently -* connected, you have to wait for it to complete. If this is +* XXX - there is no way to abort the command that is currently +* connected, you have to wait for it to complete. If this is * a problem, we could implement longjmp() / setjmp(), setjmp() * called where the loop started in NCR5380_main(). *
@@ -2719,7 +2719,7 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) {* aborted flag and get back into our main loop. */ - return 0; + return SUCCESS; }#endif
drivers/scsi/aha1740.c +1 -1
@@ -551,7 +551,7 @@ static int aha1740_eh_abort_handler (Scsi_Cmnd *dummy)* quiet as possible... */ -return 0 ; +return SUCCESS ; }static struct scsi_host_template aha1740_template = {
drivers/scsi/atari_NCR5380.c +1 -1
@@ -2638,7 +2638,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)* host byte of the result field to, if zero DID_ABORTED is * used. * -* Returns : 0 - success, -1 on failure. +* Returns : SUCCESS - success, FAILED on failure. * * XXX - there is no way to abort the command that is currently * connected, you have to wait for it to complete. If this is
drivers/scsi/megaraid.c +4 -4
@@ -1964,7 +1964,7 @@ megaraid_abort_and_reset(adapter_t *adapter, Scsi_Cmnd *cmd, int aor) cmd->device->id, cmd->device->lun);if (list_empty (&adapter->pending_list)) -return FALSE; +return FAILED ;list_for_each_safe (pos, next, &adapter->pending_list) {
@@ -1987,7 +1987,7 @@ megaraid_abort_and_reset(adapter_t *adapter, Scsi_Cmnd *cmd, int aor) (aor==SCB_ABORT ) ?"ABORTING" :"RESET" , scb->idx); -return FALSE; +return FAILED ; }else {
@@ -2012,12 +2012,12 @@ megaraid_abort_and_reset(adapter_t *adapter, Scsi_Cmnd *cmd, int aor)list_add_tail (SCSI_LIST (cmd), &adapter->completed_list); -return TRUE; +return SUCCESS ; } } } -return FALSE; +return FAILED ; } static inline int
drivers/scsi/sun3_NCR5380.c +5 -5
@@ -2624,15 +2624,15 @@ static void NCR5380_reselect (struct Scsi_Host *instance)* Purpose : abort a command * * Inputs : cmd - the struct scsi_cmnd to abort, code - code to set the -* host byte of the result field to, if zero DID_ABORTED is +* host byte of the result field to, if zero DID_ABORTED is * used. * -* Returns : 0 - success, -1 on failure. +* Returns : SUCCESS - success, FAILED on failure. * -* XXX - there is no way to abort the command that is currently -* connected, you have to wait for it to complete. If this is +* XXX - there is no way to abort the command that is currently +* connected, you have to wait for it to complete. If this is * a problem, we could implement longjmp() / setjmp(), setjmp() -* called where the loop started in NCR5380_main(). +* called where the loop started in NCR5380_main(). */ static int NCR5380_abort (struct scsi_cmnd *cmd)
drivers/spi/spi-dw-mid.c +0 -1
@@ -219,7 +219,6 @@ int dw_spi_mid_init(struct dw_spi *dws)iounmap (clk_reg); dws->num_cs =16 ; - dws->fifo_len =40 ;/* FIFO has 40 words buffer */ #ifdef CONFIG_SPI_DW_MID_DMA dws->dma_priv =kzalloc (sizeof (struct mid_dma ),GFP_KERNEL );
drivers/spi/spi-dw.c +2 -2
@@ -786,13 +786,13 @@ static void spi_hw_init(struct dw_spi *dws)*/ if (!dws->fifo_len) {u32 fifo; -for (fifo =2 ; fifo <=257 ; fifo++) { +for (fifo =2 ; fifo <=256 ; fifo++) {dw_writew (dws,DW_SPI_TXFLTR , fifo);if (fifo !=dw_readw (dws,DW_SPI_TXFLTR ))break ; } - dws->fifo_len = (fifo ==257 ) ?0 : fifo; + dws->fifo_len = (fifo ==2 ) ?0 : fifo -1 ;dw_writew (dws,DW_SPI_TXFLTR ,0 ); } }
drivers/target/iscsi/iscsi_target_util.c +11 -15
@@ -1483,15 +1483,15 @@ static int iscsit_do_tx_data(struct iscsi_conn *conn, struct iscsi_data_count *count) { - int data = count->data_length, total_tx = 0, tx_loop = 0, iov_len; + int ret, iov_len;struct kvec *iov_p;struct msghdr msg;if (!conn || !conn->sock || !conn->conn_ops)return -1 ; -if (data <=0 ) { -pr_err ("Data length is: %d\n" , data); +if (count->data_length <=0 ) { +pr_err ("Data length is: %d\n" , count->data_length);return -1 ; }
@@ -1500,20 +1500,16 @@ static int iscsit_do_tx_data( iov_p = count->iov; iov_len = count->iov_count; -while (total_tx < data) { - tx_loop =kernel_sendmsg (conn->sock, &msg, iov_p, iov_len, - (data - total_tx)); -if (tx_loop <=0 ) { -pr_debug ("tx_loop: %d total_tx %d\n" , - tx_loop, total_tx); -return tx_loop; - } - total_tx += tx_loop; -pr_debug ("tx_loop: %d, total_tx: %d, data: %d\n" , - tx_loop, total_tx, data); + ret =kernel_sendmsg (conn->sock, &msg, iov_p, iov_len, + count->data_length); +if (ret != count->data_length) { +pr_err ("Unexpected ret: %d send data %d\n" , + ret, count->data_length); +return -EPIPE ; } +pr_debug ("ret: %d, sent data: %d\n" , ret, count->data_length); -return total_tx; +return ret; } int rx_data(
drivers/tty/serial/samsung.c +4 -0
@@ -519,11 +519,15 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level, unsigned int old) {struct s3c24xx_uart_port *ourport =to_ourport (port); +int timeout =10000 ; ourport->pm_level = level;switch (level) {case 3 : +while (--timeout && !s3c24xx_serial_txempty_nofifo (port)) +udelay (100 ); +if (!IS_ERR (ourport->baudclk) && ourport->baudclk !=NULL )clk_disable (ourport->baudclk);
drivers/usb/class/cdc-acm.c +5 -4
@@ -1011,10 +1011,11 @@ next_desc: }else { control_interface =usb_ifnum_to_if (usb_dev, union_header->bMasterInterface0); data_interface =usb_ifnum_to_if (usb_dev, (data_interface_num = union_header->bSlaveInterface0)); -if (!control_interface || !data_interface) { -dev_dbg (&intf->dev,"no interfaces\n" ); -return -ENODEV ; - } + } + +if (!control_interface || !data_interface) { +dev_dbg (&intf->dev,"no interfaces\n" ); +return -ENODEV ; }if (data_interface_num != call_interface_num)
drivers/usb/core/config.c +11 -0
@@ -201,6 +201,17 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,if (n ==0 ) n =9 ;/* 32 ms = 2^(9-1) uframes */ j =16 ; + +/* +* Adjust bInterval for quirked devices. +* This quirk fixes bIntervals reported in +* linear microframes. +*/ +if (to_usb_device (ddev)->quirks & +USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL ) { + n =clamp (fls (d->bInterval), i, j); + i = j = n; + }break ;default :/* USB_SPEED_FULL or _LOW */ /* For low-speed, 10 ms is the official minimum.
drivers/usb/core/otg_whitelist.h +5 -0
@@ -59,6 +59,11 @@ static int is_targeted(struct usb_device *dev) le16_to_cpu(dev->descriptor.idProduct) == 0xbadd))return 0 ; +/* OTG PET device is always targeted (see OTG 2.0 ECN 6.4.2) */ +if ((le16_to_cpu (dev->descriptor.idVendor) ==0x1a0a && +le16_to_cpu (dev->descriptor.idProduct) ==0x0200 )) +return 1 ; +/* NOTE: can't use usb_match_id() since interface caches * aren't set up yet. this is cut/paste from that code. */
drivers/usb/core/quirks.c +8 -0
@@ -150,6 +150,10 @@ static const struct usb_device_id usb_quirk_list[] = {/* SKYMEDI USB_DRIVE */ { USB_DEVICE(0x1516, 0x8628), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Razer - Razer Blade Keyboard */ + { USB_DEVICE(0x1532, 0x0116), .driver_info = + USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL }, + /* BUILDWIN Photo Frame */ { USB_DEVICE(0x1908, 0x1315), .driver_info = USB_QUIRK_HONOR_BNUMINTERFACES },
@@ -164,6 +168,10 @@ static const struct usb_device_id usb_quirk_list[] = { { USB_DEVICE(0x0b05, 0x17e0), .driver_info = USB_QUIRK_IGNORE_REMOTE_WAKEUP }, + /* Protocol and OTG Electrical Test Device */ + { USB_DEVICE(0x1a0a, 0x0200), .driver_info = + USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL }, + { } /* terminating entry must be last */ };
drivers/usb/gadget/atmel_usba_udc.c +14 -5
@@ -739,10 +739,10 @@ static int queue_dma(struct usba_udc *udc, struct usba_ep *ep, req->ctrl =USBA_BF (DMA_BUF_LEN , req->req.length) |USBA_DMA_CH_EN |USBA_DMA_END_BUF_IE - |USBA_DMA_END_TR_EN |USBA_DMA_END_TR_IE ; + |USBA_DMA_END_BUF_EN ; -if (ep->is_in) - req->ctrl |=USBA_DMA_END_BUF_EN ; +if (!ep->is_in) + req->ctrl |=USBA_DMA_END_TR_EN |USBA_DMA_END_TR_IE ;/* * Add this request to the queue and submit for DMA if
@@ -850,7 +850,7 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req) {struct usba_ep *ep =to_usba_ep (_ep);struct usba_udc *udc = ep->udc; -struct usba_request *req =to_usba_req (_req); +struct usba_request *req;unsigned long flags;u32 status;
@@ -859,6 +859,16 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)spin_lock_irqsave (&udc->lock, flags); +list_for_each_entry (req, &ep->queue, queue) { +if (&req->req == _req) +break ; + } + +if (&req->req != _req) { +spin_unlock_irqrestore (&udc->lock, flags); +return -EINVAL ; + } +if (req->using_dma) {/* * If this request is currently being transferred,
@@ -1597,7 +1607,6 @@ static void usba_ep_irq(struct usba_udc *udc, struct usba_ep *ep)if ((epstatus & epctrl) &USBA_RX_BK_RDY ) {DBG (DBG_BUS ,"%s: RX data ready\n" , ep->ep.name);receive_data (ep); -usba_ep_writel (ep,CLR_STA ,USBA_RX_BK_RDY ); } }
drivers/usb/host/pci-quirks.c +15 -3
@@ -470,7 +470,8 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) {void __iomem *base;u32 control; -u32 fminterval; +u32 fminterval =0 ; +bool no_fminterval = false;int cnt;if (!mmio_resource_enabled (pdev,0 ))
@@ -480,6 +481,13 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)if (base ==NULL )return ; +/* +* ULi M5237 OHCI controller locks the whole system when accessing +* the OHCI_FMINTERVAL offset. +*/ +if (pdev->vendor ==PCI_VENDOR_ID_AL && pdev->device ==0x5237 ) + no_fminterval = true; + control =readl (base +OHCI_CONTROL );/* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */
@@ -518,7 +526,9 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) }/* software reset of the controller, preserving HcFmInterval */ - fminterval =readl (base +OHCI_FMINTERVAL ); +if (!no_fminterval) + fminterval =readl (base +OHCI_FMINTERVAL ); +writel (OHCI_HCR , base +OHCI_CMDSTATUS );/* reset requires max 10 us delay */
@@ -527,7 +537,9 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)break ;udelay (1 ); } -writel (fminterval, base +OHCI_FMINTERVAL ); + +if (!no_fminterval) +writel (fminterval, base +OHCI_FMINTERVAL );/* Now the controller is safely in SUSPEND and nothing can wake it up */ iounmap (base);
drivers/usb/misc/adutux.c +0 -4
@@ -865,15 +865,11 @@ static void adu_disconnect(struct usb_interface *interface)usb_set_intfdata (interface,NULL );/* if the device is not opened, then we clean up right now */ -dbg (2 ," %s : open count %d" , __func__, dev->open_count);if (!dev->open_count)adu_delete (dev);mutex_unlock (&adutux_mutex); -dev_info (&interface->dev,"ADU device adutux%d now disconnected\n" , - (minor -ADU_MINOR_BASE )); -dbg (2 ," %s : leave" , __func__); }
drivers/usb/renesas_usbhs/mod_gadget.c +4 -0
@@ -514,6 +514,10 @@ static int usbhsg_ep_enable(struct usb_ep *ep,static int usbhsg_ep_disable (struct usb_ep *ep) {struct usbhsg_uep *uep =usbhsg_ep_to_uep (ep); +struct usbhs_pipe *pipe =usbhsg_uep_to_pipe (uep); + +if (!pipe) +return -EINVAL ;return usbhsg_pipe_disable (uep); }
drivers/usb/serial/console.c +10 -5
@@ -47,6 +47,8 @@ static struct console usbcons;* ------------------------------------------------------------ */ +static const struct tty_operations usb_console_fake_tty_ops = { +};/* * The parsing of the command line works exactly like the
@@ -141,14 +143,17 @@ static int usb_console_setup(struct console *co, char *options) goto reset_open_count; }kref_init (&tty->kref); -tty_port_tty_set (&port->port, tty); tty->driver = usb_serial_tty_driver; tty->index = co->index; +INIT_LIST_HEAD (&tty->tty_files); +kref_get (&tty->driver->kref); + tty->ops = &usb_console_fake_tty_ops;if (tty_init_termios (tty)) { retval = -ENOMEM ;err ("no more memory" ); - goto free_tty; + goto put_tty; } +tty_port_tty_set (&port->port, tty); }/* only call the device specific open if this
@@ -170,7 +175,7 @@ static int usb_console_setup(struct console *co, char *options) serial->type->set_termios (tty, port, &dummy);tty_port_tty_set (&port->port,NULL ); -kfree (tty); +tty_kref_put (tty); }set_bit (ASYNCB_INITIALIZED , &port->port.flags); }
@@ -186,8 +191,8 @@ static int usb_console_setup(struct console *co, char *options) fail:tty_port_tty_set (&port->port,NULL ); - free_tty: -kfree (tty); + put_tty: +tty_kref_put (tty); reset_open_count: port->port.count =0 ;usb_autopm_put_interface (serial->interface);
drivers/usb/serial/cp210x.c +3 -1
@@ -126,10 +126,12 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */ { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */ - { USB_DEVICE(0x10C4, 0x8875) }, /* CEL MeshConnect USB Stick */ + { USB_DEVICE(0x10C4, 0x8856) }, /* CEL EM357 ZigBee USB Stick - LR */ + { USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */ { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ + { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */ { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */
drivers/usb/storage/unusual_devs.h +7 -0
@@ -1956,6 +1956,13 @@ UNUSUAL_DEV( 0x152d, 0x2329, 0x0100, 0x0100, USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_IGNORE_RESIDUE | US_FL_SANE_SENSE ), +/* Reported by Dmitry Nezhevenko <[email protected]> */ +UNUSUAL_DEV (0x152d ,0x2566 ,0x0114 ,0x0114 , +"JMicron" , +"USB to ATA/ATAPI Bridge" , +USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , +US_FL_BROKEN_FUA ), +/* Entrega Technologies U1-SC25 (later Xircom PortGear PGSCSI) * and Mac USB Dock USB-SCSI */ UNUSUAL_DEV( 0x1645, 0x0007, 0x0100, 0x0133,
drivers/video/fb_defio.c +3 -2
@@ -83,9 +83,10 @@ int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasycancel_delayed_work_sync (&info->deferred_work);/* Run it immediately */ - err =schedule_delayed_work (&info->deferred_work,0 ); +schedule_delayed_work (&info->deferred_work,0 );mutex_unlock (&inode->i_mutex); -return err; + +return 0 ; }EXPORT_SYMBOL_GPL (fb_deferred_io_fsync);
drivers/video/logo/logo.c +16 -1
@@ -25,6 +25,21 @@ static int nologo;module_param (nologo, bool,0 );MODULE_PARM_DESC (nologo,"Disables startup logo" );
Lines of this file are not shown. View the raw message.
fs/udf/symlink.c +54 -13
67 lines not on this page · raw message
kernel/irq/irqdesc.c +52 -0
52 lines not on this page · raw message
mm/page-writeback.c +12 -31
43 lines not on this page · raw message
mm/rmap.c +41 -1
42 lines not on this page · raw message
net/netfilter/nf_conntrack_proto_generic.c +25 -1
Lines of this file are not shown. View the raw message.
security/keys/encrypted-keys/encrypted.c +4 -1
Lines of this file are not shown. View the raw message.
sound/usb/quirks-table.h +39 -127
166 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Quoted 8 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.67 release. There are 152 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Feb 19 02:00:00 UTC 2015. Anything received after that time might be too late.
Build tests:
total: 98 pass: 95 fail: 3
Failed builds:
mips:allmodconfig
xtensa:defconfig
xtensa:allmodconfig
Qemu tests:
total: 20 pass: 20 fail: 0
Results are as expected.
Detailed build results are available at http://server.roeck-us.net:8010/builders.
Guenter
Quoted 17 lines · Guenter Roeck
Quoted 8 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.67 release. There are 152 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Feb 19 02:00:00 UTC 2015. Anything received after that time might be too late.
Build tests:
total: 98 pass: 95 fail: 3Failed builds:
mips:allmodconfig
xtensa:defconfig
xtensa:allmodconfig
Quoted 5 lines
Qemu tests:
total: 20 pass: 20 fail: 0Results are as expected.
Detailed build results are available at http://server.roeck-us.net:8010/builders.
Thanks for this.
Ben.
Signature · 2 lines
Ben Hutchings Never attribute to conspiracy what can adequately be explained by stupidity.