Linux 4.9.174
Greg KH
maintainerI'm announcing the release of the 4.9.174 kernel.
All users of the 4.9 kernel series must upgrade.
The updated 4.9.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/usb/power-management.txt | 14 +- Makefile | 2 arch/arm/mach-iop13xx/setup.c | 8 - arch/arm/mach-iop13xx/tpmi.c | 10 - arch/arm/plat-iop/adma.c | 6 - arch/arm/plat-orion/common.c | 4 arch/arm64/include/asm/system_misc.h | 2 arch/arm64/mm/fault.c | 35 ++++-- arch/arm64/mm/kasan_init.c | 2 arch/arm64/mm/proc.S | 14 +- arch/sh/boards/of-generic.c | 4 arch/x86/events/amd/core.c | 111 +++++++++++++++++++++- arch/x86/include/asm/stacktrace.h | 5 arch/x86/kernel/acpi/wakeup_64.S | 9 + arch/x86/kernel/cpu/mcheck/mce-severity.c | 5 arch/x86/kernel/unwind_frame.c | 20 +++ drivers/block/xsysace.c | 2 drivers/hid/hid-debug.c | 5 drivers/hid/hid-logitech-hidpp.c | 8 + drivers/infiniband/ulp/srpt/ib_srpt.c | 11 ++ drivers/input/keyboard/snvs_pwrkey.c | 6 - drivers/media/i2c/ov7670.c | 16 +-- drivers/net/bonding/bond_sysfs_slave.c | 4 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 + drivers/net/ethernet/hisilicon/hns/hnae.c | 4 drivers/net/ethernet/hisilicon/hns/hns_enet.c | 12 -- drivers/net/ethernet/intel/igb/e1000_defines.h | 2 drivers/net/ethernet/intel/igb/igb_main.c | 57 +---------- drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 6 - drivers/net/ethernet/stmicro/stmmac/enh_desc.c | 12 +- drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 2 drivers/net/phy/marvell.c | 6 - drivers/nvme/target/core.c | 20 +-- drivers/rtc/rtc-da9063.c | 7 + drivers/rtc/rtc-sh.c | 2 drivers/scsi/scsi_devinfo.c | 1 drivers/scsi/scsi_dh.c | 1 drivers/scsi/storvsc_drv.c | 13 ++ drivers/staging/iio/addac/adt7316.c | 22 +++- drivers/usb/core/driver.c | 13 -- drivers/usb/core/message.c | 4 drivers/usb/misc/yurex.c | 1 drivers/usb/storage/realtek_cr.c | 13 -- drivers/usb/usbip/stub_rx.c | 12 -- drivers/usb/usbip/usbip_common.h | 7 + drivers/vfio/pci/vfio_pci.c | 4 drivers/w1/masters/ds2490.c | 6 - fs/debugfs/inode.c | 13 +- fs/hugetlbfs/inode.c | 20 ++- fs/jffs2/readinode.c | 5 fs/jffs2/super.c | 5 include/linux/kasan.h | 1 include/linux/usb.h | 2 include/net/caif/cfpkt.h | 27 +++++ lib/Makefile | 1 lib/test_kasan.c | 2 mm/kasan/kasan.c | 9 + mm/kasan/kasan_init.c | 15 +- mm/kasan/report.c | 1 net/batman-adv/bridge_loop_avoidance.c | 16 ++- net/batman-adv/translation-table.c | 32 ++++-- net/caif/cfctrl.c | 50 ++++----- net/ipv4/ip_output.c | 1 net/ipv6/ip6_flowlabel.c | 22 ++-- net/packet/af_packet.c | 24 ++-- security/selinux/hooks.c | 40 ++++++- sound/usb/line6/driver.c | 60 ++++++----- sound/usb/line6/podhd.c | 21 ++-- sound/usb/line6/toneport.c | 24 +++- 69 files changed, 612 insertions(+), 318 deletions(-)
Aaro Koskinen (3):
net: stmmac: don't overwrite discard_frame status
net: stmmac: fix dropping of multi-descriptor RX frames
net: stmmac: don't log oversized frames
Al Viro (2):
jffs2: fix use-after-free on symlink traversal
debugfs: fix use-after-free on symlink traversal
Alan Stern (4):
USB: yurex: Fix protection fault after device removal
USB: w1 ds2490: Fix bug caused by improper use of altsetting array
USB: core: Fix unterminated string returned by usb_string()
USB: core: Fix bug caused by duplicate interface PM usage counter
Alexandre Belloni (1):
rtc: da9063: set uie_unsupported when relevant
Andrew Lunn (1):
net: phy: marvell: Fix buffer overrun with stats counters
Andrey Konovalov (1):
kasan: prevent compiler from optimizing away memset in tests
Anson Huang (1):
Input: snvs_pwrkey - initialize necessary driver data before enabling IRQ
Arnd Bergmann (4):
kasan: avoid -Wmaybe-uninitialized warning
caif: reduce stack size with KASAN
ARM: orion: don't use using 64-bit DMA masks
ARM: iop: don't use using 64-bit DMA masks
Arvind Sankar (1):
igb: Fix WARN_ONCE on runtime suspend
Bart Van Assche (1):
scsi: RDMA/srpt: Fix a credit leak for aborted commands
Colin Ian King (1):
kasan: remove redundant initialization of variable 'real_size'
Eric Dumazet (1):
ipv6/flowlabel: wait rcu grace period before put_pid()
Geert Uytterhoeven (1):
rtc: sh: Fix invalid alarm warning for non-enabled alarm
Greg Kroah-Hartman (2):
ALSA: line6: use dynamic buffers
Linux 4.9.174
Guenter Roeck (1):
xsysace: Fix error handling in ace_setup
He, Bo (1):
HID: debug: fix race condition with between rdesc_show() and device removal
Jacopo Mondi (1):
media: v4l2: i2c: ov7670: Fix PLL bypass register values
Jeremy Fertic (3):
staging: iio: adt7316: allow adt751x to use internal vref for all dacs
staging: iio: adt7316: fix the dac read calculation
staging: iio: adt7316: fix the dac write calculation
Josh Poimboeuf (2):
x86/suspend: fix false positive KASAN warning on suspend/resume x86/unwind: Disable KASAN checks for non-current tasks
Kangjie Lu (1):
HID: logitech: check the return value of create_singlethread_workqueue
Kim Phillips (1):
perf/x86/amd: Update generic hardware cache events for Family 17h
Konstantin Khorenko (1):
bonding: show full hw address in sysfs for slave entries
Kristina Martsenko (2):
arm64: mm: print out correct page table entries
arm64: mm: don't print out page table entries on EL0 faults
Laura Abbott (1):
mm/kasan: Switch to using __pa_symbol and lm_alias
Liubin Shu (1):
net: hns: fix KASAN: use-after-free in hns_nic_net_xmit_hw()
Louis Taylor (1):
vfio/pci: use correct format characters
Malte Leip (1):
usb: usbip: fix isoc packet num validation in get_pipe
Mark Rutland (1):
arm64: kasan: avoid bad virt_to_pfn()
Masami Hiramatsu (1):
kasan: add a prototype of task_struct to avoid warning
Michael Chan (1):
bnxt_en: Improve multicast address setup logic.
Michael Kelley (1):
scsi: storvsc: Fix calculation of sub-channel count
Mike Kravetz (1):
hugetlbfs: fix memory leak for resv_map
Omri Kahalon (1):
net/mlx5: E-Switch, Fix esw manager vport indication for more vport commands
Ondrej Mosnacek (1):
selinux: never allow relabeling on context mounts
Randy Dunlap (1):
sh: fix multiple function definition build errors
Shmulik Ladkani (1):
ipv4: ip_do_fragment: Preserve skb_iif during fragmentation
Sven Eckelmann (3):
batman-adv: Reduce claim hash refcnt only for removed entry
batman-adv: Reduce tt_local hash refcnt only for removed entry
batman-adv: Reduce tt_global hash refcnt only for removed entry
Tony Luck (1):
x86/mce: Improve error message when kernel cannot recover, p2
Will Deacon (1):
arm64: proc: Set PTE_NG for table entries to avoid traversing them twice
Willem de Bruijn (2):
ipv6: invert flowlabel sharing check in process and user mode
packet: validate msg_namelen in send directly
Xose Vazquez Perez (1):
scsi: core: add new RDAC LENOVO/DE_Series device
Yonglong Liu (2):
net: hns: Use NAPI_POLL_WEIGHT for hns driver
net: hns: Fix WARNING when remove HNS driver with SMMU enabled
Yufen Yu (1):
nvme-loop: init nvmet_ctrl fatal_err_work when allocate
Greg KH
maintainerDocumentation/usb/power-management.txt +9 -5
@@ -365,11 +365,15 @@ autosuspend the interface's device. When the usage counter is = 0 then the interface is considered to be idle, and the kernel may autosuspend the device. -Drivers need not be concerned about balancing changes to the usage -counter; the USB core will undo any remaining "get"s when a driver -is unbound from its interface. As a corollary, drivers must not call -any of the usb_autopm_* functions after their disconnect() routine has -returned. +Drivers must be careful to balance their overall changes to the usage +counter. Unbalanced "get"s will remain in effect when a driver is +unbound from its interface, preventing the device from going into +runtime suspend should the interface be bound to a driver again. On +the other hand, drivers are allowed to achieve this balance by calling +the ``usb_autopm_*`` functions even after their ``disconnect`` routine +has returned -- say from within a work-queue routine -- provided they +retain an active reference to the interface (via ``usb_get_intf`` and +``usb_put_intf``). Drivers using the async routines are responsible for their own synchronization and mutual exclusion.
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 9 -SUBLEVEL = 173 +SUBLEVEL = 174 EXTRAVERSION = NAME = Roaring Lionus
arch/arm/mach-iop13xx/setup.c +4 -4
@@ -300,7 +300,7 @@ static struct resource iop13xx_adma_2_resources[] = { } }; -static u64 iop13xx_adma_dmamask =DMA_BIT_MASK (64 ); +static u64 iop13xx_adma_dmamask =DMA_BIT_MASK (32 );static struct iop_adma_platform_data iop13xx_adma_0_data = { .hw_id =0 , .pool_size =PAGE_SIZE ,
@@ -324,7 +324,7 @@ static struct platform_device iop13xx_adma_0_channel = { .resource = iop13xx_adma_0_resources, .dev = { .dma_mask = &iop13xx_adma_dmamask, - .coherent_dma_mask = DMA_BIT_MASK(64), + .coherent_dma_mask = DMA_BIT_MASK(32), .platform_data = (void *) &iop13xx_adma_0_data, }, };
@@ -336,7 +336,7 @@ static struct platform_device iop13xx_adma_1_channel = { .resource = iop13xx_adma_1_resources, .dev = { .dma_mask = &iop13xx_adma_dmamask, - .coherent_dma_mask = DMA_BIT_MASK(64), + .coherent_dma_mask = DMA_BIT_MASK(32), .platform_data = (void *) &iop13xx_adma_1_data, }, };
@@ -348,7 +348,7 @@ static struct platform_device iop13xx_adma_2_channel = { .resource = iop13xx_adma_2_resources, .dev = { .dma_mask = &iop13xx_adma_dmamask, - .coherent_dma_mask = DMA_BIT_MASK(64), + .coherent_dma_mask = DMA_BIT_MASK(32), .platform_data = (void *) &iop13xx_adma_2_data, }, };
arch/arm/mach-iop13xx/tpmi.c +5 -5
@@ -152,7 +152,7 @@ static struct resource iop13xx_tpmi_3_resources[] = { } }; -u64 iop13xx_tpmi_mask =DMA_BIT_MASK (64 ); +u64 iop13xx_tpmi_mask =DMA_BIT_MASK (32 );static struct platform_device iop13xx_tpmi_0_device = { .name ="iop-tpmi" , .id =0 ,
@@ -160,7 +160,7 @@ static struct platform_device iop13xx_tpmi_0_device = { .resource = iop13xx_tpmi_0_resources, .dev = { .dma_mask = &iop13xx_tpmi_mask, - .coherent_dma_mask = DMA_BIT_MASK(64), + .coherent_dma_mask = DMA_BIT_MASK(32), }, };
@@ -171,7 +171,7 @@ static struct platform_device iop13xx_tpmi_1_device = { .resource = iop13xx_tpmi_1_resources, .dev = { .dma_mask = &iop13xx_tpmi_mask, - .coherent_dma_mask = DMA_BIT_MASK(64), + .coherent_dma_mask = DMA_BIT_MASK(32), }, };
@@ -182,7 +182,7 @@ static struct platform_device iop13xx_tpmi_2_device = { .resource = iop13xx_tpmi_2_resources, .dev = { .dma_mask = &iop13xx_tpmi_mask, - .coherent_dma_mask = DMA_BIT_MASK(64), + .coherent_dma_mask = DMA_BIT_MASK(32), }, };
@@ -193,7 +193,7 @@ static struct platform_device iop13xx_tpmi_3_device = { .resource = iop13xx_tpmi_3_resources, .dev = { .dma_mask = &iop13xx_tpmi_mask, - .coherent_dma_mask = DMA_BIT_MASK(64), + .coherent_dma_mask = DMA_BIT_MASK(32), }, };
arch/arm/plat-iop/adma.c +3 -3
@@ -143,7 +143,7 @@ struct platform_device iop3xx_dma_0_channel = { .resource = iop3xx_dma_0_resources, .dev = { .dma_mask = &iop3xx_adma_dmamask, - .coherent_dma_mask = DMA_BIT_MASK(64), + .coherent_dma_mask = DMA_BIT_MASK(32), .platform_data = (void *) &iop3xx_dma_0_data, }, };
@@ -155,7 +155,7 @@ struct platform_device iop3xx_dma_1_channel = { .resource = iop3xx_dma_1_resources, .dev = { .dma_mask = &iop3xx_adma_dmamask, - .coherent_dma_mask = DMA_BIT_MASK(64), + .coherent_dma_mask = DMA_BIT_MASK(32), .platform_data = (void *) &iop3xx_dma_1_data, }, };
@@ -167,7 +167,7 @@ struct platform_device iop3xx_aau_channel = { .resource = iop3xx_aau_resources, .dev = { .dma_mask = &iop3xx_adma_dmamask, - .coherent_dma_mask = DMA_BIT_MASK(64), + .coherent_dma_mask = DMA_BIT_MASK(32), .platform_data = (void *) &iop3xx_aau_data, }, };
arch/arm/plat-orion/common.c +2 -2
@@ -605,7 +605,7 @@ static struct platform_device orion_xor0_shared = { .resource = orion_xor0_shared_resources, .dev = { .dma_mask = &orion_xor_dmamask, - .coherent_dma_mask = DMA_BIT_MASK(64), + .coherent_dma_mask = DMA_BIT_MASK(32), .platform_data = &orion_xor0_pdata, }, };
@@ -666,7 +666,7 @@ static struct platform_device orion_xor1_shared = { .resource = orion_xor1_shared_resources, .dev = { .dma_mask = &orion_xor_dmamask, - .coherent_dma_mask = DMA_BIT_MASK(64), + .coherent_dma_mask = DMA_BIT_MASK(32), .platform_data = &orion_xor1_pdata, }, };
arch/arm64/include/asm/system_misc.h +1 -1
@@ -40,7 +40,7 @@ void hook_debug_fault_code(int nr, int (*fn)(unsigned long, unsigned int, int sig, int code, const char *name);struct mm_struct ; -extern void show_pte (struct mm_struct *mm,unsigned long addr); +extern void show_pte (unsigned long addr);extern void __show_regs (struct pt_regs *);extern void (*arm_pm_restart)(enum reboot_mode reboot_mode,const char *cmd);
arch/arm64/mm/fault.c +24 -11
@@ -79,18 +79,33 @@ static inline int notify_page_fault(struct pt_regs *regs, unsigned int esr)#endif /* -* Dump out the page tables associated with 'addr' in mm 'mm'. +* Dump out the page tables associated with 'addr' in the currently active mm. */ -void show_pte (struct mm_struct *mm,unsigned long addr) +void show_pte (unsigned long addr) { +struct mm_struct *mm;pgd_t *pgd; -if (!mm) +if (addr <TASK_SIZE ) { +/* TTBR0 */ + mm = current->active_mm; +if (mm == &init_mm) { +pr_alert ("[%016lx] user address but active_mm is swapper\n" , + addr); +return ; + } + }else if (addr >=VA_START ) { +/* TTBR1 */ mm = &init_mm; + }else { +pr_alert ("[%016lx] address between user and kernel address ranges\n" , + addr); +return ; + }pr_alert ("pgd = %p\n" , mm->pgd); pgd =pgd_offset (mm, addr); -pr_alert ("[%08lx] *pgd=%016llx" , addr,pgd_val (*pgd)); +pr_alert ("[%016lx] *pgd=%016llx" , addr,pgd_val (*pgd)); do { pud_t *pud;
@@ -176,8 +191,8 @@ static bool is_el1_instruction_abort(unsigned int esr)/* * The kernel tried to access some page that wasn't present. */ -static void __do_kernel_fault (struct mm_struct *mm,unsigned long addr, -unsigned int esr,struct pt_regs *regs) +static void __do_kernel_fault (unsigned long addr,unsigned int esr, +struct pt_regs *regs) {/* * Are we prepared to handle this kernel fault?
@@ -194,7 +209,7 @@ static void __do_kernel_fault(struct mm_struct *mm, unsigned long addr, (addr <PAGE_SIZE ) ?"NULL pointer dereference" : "paging request", addr); -show_pte (mm, addr); +show_pte (addr);die ("Oops" , regs, esr);bust_spinlocks (0 );do_exit (SIGKILL );
@@ -216,7 +231,6 @@ static void __do_user_fault(struct task_struct *tsk, unsigned long addr,pr_info ("%s[%d]: unhandled %s (%d) at 0x%08lx, esr 0x%03x\n" , tsk->comm,task_pid_nr (tsk), inf->name, sig, addr, esr); -show_pte (tsk->mm, addr);show_regs (regs); }
@@ -232,7 +246,6 @@ static void __do_user_fault(struct task_struct *tsk, unsigned long addr,static void do_bad_area (unsigned long addr,unsigned int esr,struct pt_regs *regs) {struct task_struct *tsk = current; -struct mm_struct *mm = tsk->active_mm;const struct fault_info *inf;/*
@@ -243,7 +256,7 @@ static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *re inf =esr_to_fault_info (esr);__do_user_fault (tsk, addr, esr, inf->sig, inf->code, regs); }else -__do_kernel_fault (mm, addr, esr, regs); +__do_kernel_fault (addr, esr, regs); }#define VM_FAULT_BADMAP 0x010000
@@ -454,7 +467,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,return 0 ; no_context: -__do_kernel_fault (mm, addr, esr, regs); +__do_kernel_fault (addr, esr, regs);return 0 ; }
arch/arm64/mm/kasan_init.c +1 -1
@@ -153,7 +153,7 @@ void __init kasan_init(void)clear_pgds (KASAN_SHADOW_START ,KASAN_SHADOW_END );vmemmap_populate (kimg_shadow_start, kimg_shadow_end, -pfn_to_nid (virt_to_pfn (_text))); +pfn_to_nid (virt_to_pfn (lm_alias (_text))));/* * vmemmap_populate() has populated the shadow region that covers the
arch/arm64/mm/proc.S +9 -5
@@ -181,7 +181,8 @@ ENDPROC(idmap_cpu_replace_ttbr1) dc cvac, cur_\()\type\()p // Ensure any existing dirty dmb sy // lines are written back before ldr \type, [cur_\()\type\()p] // loading the entry - tbz \type, #0, next_\()\type // Skip invalid entries + tbz \type, #0, skip_\()\type // Skip invalid and + tbnz \type, #11, skip_\()\type // non-global entries .endm .macro __idmap_kpti_put_pgtable_ent_ng, type
@@ -241,8 +242,9 @@ ENTRY(idmap_kpti_install_ng_mappings) add end_pgdp, cur_pgdp, #(PTRS_PER_PGD * 8) do_pgd: __idmap_kpti_get_pgtable_ent pgd tbnz pgd, #1, walk_puds - __idmap_kpti_put_pgtable_ent_ng pgd next_pgd: + __idmap_kpti_put_pgtable_ent_ng pgd +skip_pgd: add cur_pgdp, cur_pgdp, #8 cmp cur_pgdp, end_pgdp b.ne do_pgd
@@ -270,8 +272,9 @@ walk_puds: add end_pudp, cur_pudp, #(PTRS_PER_PUD * 8) do_pud: __idmap_kpti_get_pgtable_ent pud tbnz pud, #1, walk_pmds - __idmap_kpti_put_pgtable_ent_ng pud next_pud: + __idmap_kpti_put_pgtable_ent_ng pud +skip_pud: add cur_pudp, cur_pudp, 8 cmp cur_pudp, end_pudp b.ne do_pud
@@ -290,8 +293,9 @@ walk_pmds: add end_pmdp, cur_pmdp, #(PTRS_PER_PMD * 8) do_pmd: __idmap_kpti_get_pgtable_ent pmd tbnz pmd, #1, walk_ptes - __idmap_kpti_put_pgtable_ent_ng pmd next_pmd: + __idmap_kpti_put_pgtable_ent_ng pmd +skip_pmd: add cur_pmdp, cur_pmdp, #8 cmp cur_pmdp, end_pmdp b.ne do_pmd
@@ -309,7 +313,7 @@ walk_ptes: add end_ptep, cur_ptep, #(PTRS_PER_PTE * 8) do_pte: __idmap_kpti_get_pgtable_ent pte __idmap_kpti_put_pgtable_ent_ng pte -next_pte: +skip_pte: add cur_ptep, cur_ptep, #8 cmp cur_ptep, end_ptep b.ne do_pte
arch/sh/boards/of-generic.c +2 -2
@@ -180,10 +180,10 @@ static struct sh_machine_vector __initmv sh_of_generic_mv = {struct sh_clk_ops ; -void __init arch_init_clk_ops (struct sh_clk_ops **ops,int idx) +void __init __weak arch_init_clk_ops (struct sh_clk_ops **ops,int idx) { } -void __init plat_irq_setup (void ) +void __init __weak plat_irq_setup (void ) { }
arch/x86/events/amd/core.c +108 -3
123 lines not on this page · raw message
arch/x86/include/asm/stacktrace.h +4 -1
@@ -55,13 +55,16 @@ extern int kstack_depth_to_print;static inline unsigned long *get_frame_pointer (struct task_struct *task,struct pt_regs *regs) { +struct inactive_task_frame *frame; +if (regs)return (unsigned long *)regs->bp;if (task == current)return __builtin_frame_address (0 ); -return (unsigned long *)((struct inactive_task_frame *)task->thread.sp)->bp; + frame = (struct inactive_task_frame *)task->thread.sp; +return (unsigned long *)READ_ONCE_NOCHECK (frame->bp); }#else static inline unsigned long *
arch/x86/kernel/acpi/wakeup_64.S +9 -0
@@ -109,6 +109,15 @@ ENTRY(do_suspend_lowlevel) movq pt_regs_r14(%rax), %r14 movq pt_regs_r15(%rax), %r15 +#ifdef CONFIG_KASAN + /* + * The suspend path may have poisoned some areas deeper in the stack, + * which we now need to unpoison. + */ + movq %rsp, %rdi + call kasan_unpoison_task_stack_below +#endif + xorl %eax, %eax addq $8, %rsp FRAME_END
arch/x86/kernel/cpu/mcheck/mce-severity.c +5 -0
@@ -148,6 +148,11 @@ static struct severity { SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR|MCI_ADDR|MCACOD, MCI_UC_SAR|MCI_ADDR|MCACOD_DATA), KERNEL ), + MCESEV( + PANIC, "Instruction fetch error in kernel", + SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR|MCI_ADDR|MCACOD, MCI_UC_SAR|MCI_ADDR|MCACOD_INSTR), + KERNEL + ),#endif MCESEV( PANIC, "Action required: unknown MCACOD",
arch/x86/kernel/unwind_frame.c +18 -2
@@ -6,6 +6,21 @@#define FRAME_HEADER_SIZE (sizeof(long) * 2) +/* +* This disables KASAN checking when reading a value from another task's stack, +* since the other task could be running on another CPU and could have poisoned +* the stack in the meantime. +*/ +#define READ_ONCE_TASK_STACK (task, x) \ +({ \ + unsigned long val; \ + if (task == current) \ + val = READ_ONCE(x); \ + else \ + val = READ_ONCE_NOCHECK(x); \ + val; \ +}) +unsigned long unwind_get_return_address (struct unwind_state *state) {unsigned long addr;
@@ -14,7 +29,8 @@ unsigned long unwind_get_return_address(struct unwind_state *state)if (unwind_done (state))return 0 ; - addr =ftrace_graph_ret_addr (state->task, &state->graph_idx, *addr_p, + addr =READ_ONCE_TASK_STACK (state->task, *addr_p); + addr =ftrace_graph_ret_addr (state->task, &state->graph_idx, addr, addr_p);return __kernel_text_address (addr) ? addr :0 ;
@@ -48,7 +64,7 @@ bool unwind_next_frame(struct unwind_state *state)if (unwind_done (state))return false; - next_bp = (unsigned long *)*state->bp; + next_bp = (unsigned long *)READ_ONCE_TASK_STACK (state->task,*state->bp);/* make sure the next frame's data is accessible */ if (!update_stack_state (state, next_bp,FRAME_HEADER_SIZE ))
drivers/block/xsysace.c +2 -0
@@ -1062,6 +1062,8 @@ static int ace_setup(struct ace_device *ace)return 0 ; err_read: +/* prevent double queue cleanup */ + ace->gd->queue =NULL ;put_disk (ace->gd); err_alloc_disk:blk_cleanup_queue (ace->queue);
drivers/hid/hid-debug.c +5 -0
@@ -1058,10 +1058,15 @@ static int hid_debug_rdesc_show(struct seq_file *f, void *p)seq_printf (f,"\n\n" );/* dump parsed data and input mappings */ +if (down_interruptible (&hdev->driver_input_lock)) +return 0 ; +hid_dump_device (hdev, f);seq_printf (f,"\n" );hid_dump_input_mapping (hdev, f); +up (&hdev->driver_input_lock); +return 0 ; }
drivers/hid/hid-logitech-hidpp.c +7 -1
@@ -1282,6 +1282,13 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)kfree (data);return -ENOMEM ; } + data->wq =create_singlethread_workqueue ("hidpp-ff-sendqueue" ); +if (!data->wq) { +kfree (data->effect_ids); +kfree (data); +return -ENOMEM ; + } + data->hidpp = hidpp; data->feature_index = feature_index; data->version = version;
@@ -1326,7 +1333,6 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)/* ignore boost value at response.fap.params[2] */ /* init the hardware command queue */ - data->wq =create_singlethread_workqueue ("hidpp-ff-sendqueue" );atomic_set (&data->workqueue_size,0 );/* initialize with zero autocenter to get wheel in usable state */
drivers/infiniband/ulp/srpt/ib_srpt.c +11 -0
@@ -2368,8 +2368,19 @@ static void srpt_queue_tm_rsp(struct se_cmd *cmd)srpt_queue_response (cmd); } +/* +* This function is called for aborted commands if no response is sent to the +* initiator. Make sure that the credits freed by aborting a command are +* returned to the initiator the next time a response is sent by incrementing +* ch->req_lim_delta. +*/ static void srpt_aborted_task (struct se_cmd *cmd) { +struct srpt_send_ioctx *ioctx =container_of (cmd, + struct srpt_send_ioctx, cmd); +struct srpt_rdma_ch *ch = ioctx->ch; + +atomic_inc (&ch->req_lim_delta); }static int srpt_queue_status (struct se_cmd *cmd)
drivers/input/keyboard/snvs_pwrkey.c +3 -3
@@ -156,6 +156,9 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)return error; } + pdata->input = input; +platform_set_drvdata (pdev, pdata); + error =devm_request_irq (&pdev->dev, pdata->irq, imx_snvs_pwrkey_interrupt,0 , pdev->name, pdev);
@@ -171,9 +174,6 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)return error; } - pdata->input = input; -platform_set_drvdata (pdev, pdata); -device_init_wakeup (&pdev->dev, pdata->wakeup);return 0 ;
drivers/media/i2c/ov7670.c +6 -10
@@ -155,10 +155,10 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)");#define REG_GFIX 0x69/* Fix gain control */ #define REG_DBLV 0x6b/* PLL control an debugging */ -#define DBLV_BYPASS 0x00/* Bypass PLL */ -#define DBLV_X4 0x01/* clock x4 */ -#define DBLV_X6 0x10/* clock x6 */ -#define DBLV_X8 0x11/* clock x8 */ +#define DBLV_BYPASS 0x0a/* Bypass PLL */ +#define DBLV_X4 0x4a/* clock x4 */ +#define DBLV_X6 0x8a/* clock x6 */ +#define DBLV_X8 0xca/* clock x8 */ #define REG_REG76 0x76/* OV's name */ #define R76_BLKPCOR 0x80/* Black pixel correction enable */
@@ -833,7 +833,7 @@ static int ov7675_set_framerate(struct v4l2_subdev *sd,if (ret <0 )return ret; -return ov7670_write (sd,REG_DBLV ,DBLV_X4 ); +return 0 ; } static void ov7670_get_framerate_legacy(struct v4l2_subdev *sd,
@@ -1578,11 +1578,7 @@ static int ov7670_probe(struct i2c_client *client,if (config->clock_speed) info->clock_speed = config->clock_speed; -/* -* It should be allowed for ov7670 too when it is migrated to -* the new frame rate formula. -*/ -if (config->pll_bypass && id->driver_data !=MODEL_OV7670 ) +if (config->pll_bypass) info->pll_bypass = true;if (config->pclk_hb_disable)
drivers/net/bonding/bond_sysfs_slave.c +3 -1
@@ -55,7 +55,9 @@ static SLAVE_ATTR_RO(link_failure_count);static ssize_t perm_hwaddr_show (struct slave *slave,char *buf) { -return sprintf (buf,"%pM\n" , slave->perm_hwaddr); +return sprintf (buf,"%*phC\n" , + slave->dev->addr_len, + slave->perm_hwaddr); }static SLAVE_ATTR_RO (perm_hwaddr);
drivers/net/ethernet/broadcom/bnxt/bnxt.c +8 -1
@@ -5954,8 +5954,15 @@ static int bnxt_cfg_rx_mode(struct bnxt *bp) skip_uc: rc =bnxt_hwrm_cfa_l2_set_rx_mask (bp,0 ); +if (rc && vnic->mc_list_count) { +netdev_info (bp->dev,"Failed setting MC filters rc: %d, turning on ALL_MCAST mode\n" , + rc); + vnic->rx_mask |=CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST ; + vnic->mc_list_count =0 ; + rc =bnxt_hwrm_cfa_l2_set_rx_mask (bp,0 ); + }if (rc) -netdev_err (bp->dev,"HWRM cfa l2 rx mask failure rc: %x\n" , +netdev_err (bp->dev,"HWRM cfa l2 rx mask failure rc: %d\n" , rc);return rc;
drivers/net/ethernet/hisilicon/hns/hnae.c +3 -1
@@ -146,7 +146,6 @@ static int hnae_alloc_buffers(struct hnae_ring *ring)/* free desc along with its attached buffer */ static void hnae_free_desc (struct hnae_ring *ring) { -hnae_free_buffers (ring);dma_unmap_single (ring_to_dev (ring), ring->desc_dma_addr, ring->desc_num *sizeof (ring->desc[0 ]),ring_to_dma_dir (ring));
@@ -179,6 +178,9 @@ static int hnae_alloc_desc(struct hnae_ring *ring)/* fini ring, also free the buffer for the ring */ static void hnae_fini_ring (struct hnae_ring *ring) { +if (is_rx_ring (ring)) +hnae_free_buffers (ring); +hnae_free_desc (ring);kfree (ring->desc_cb); ring->desc_cb =NULL ;
drivers/net/ethernet/hisilicon/hns/hns_enet.c +5 -7
@@ -28,9 +28,6 @@#define SERVICE_TIMER_HZ (1 * HZ) -#define NIC_TX_CLEAN_MAX_NUM 256 -#define NIC_RX_CLEAN_MAX_NUM 64 -#define RCB_IRQ_NOT_INITED 0#define RCB_IRQ_INITED 1#define HNS_BUFFER_SIZE_2048 2048
@@ -375,8 +372,6 @@ netdev_tx_t hns_nic_net_xmit_hw(struct net_device *ndev,wmb ();/* commit all data before submit */ assert (skb->queue_mapping < priv->ae_handle->q_num);hnae_queue_xmit (priv->ae_handle->qs[skb->queue_mapping], buf_num); - ring->stats.tx_pkts++; - ring->stats.tx_bytes += skb->len;return NETDEV_TX_OK ;
@@ -916,6 +911,9 @@ static int hns_nic_tx_poll_one(struct hns_nic_ring_data *ring_data,/* issue prefetch for next Tx descriptor */ prefetch (&ring->desc_cb[ring->next_to_clean]); } +/* update tx ring statistics. */ + ring->stats.tx_pkts += pkts; + ring->stats.tx_bytes += bytes;NETIF_TX_UNLOCK (ndev);
@@ -1821,7 +1819,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv) hns_nic_tx_fini_pro_v2;netif_napi_add (priv->netdev, &rd->napi, - hns_nic_common_poll,NIC_TX_CLEAN_MAX_NUM ); + hns_nic_common_poll,NAPI_POLL_WEIGHT ); rd->ring->irq_init_flag =RCB_IRQ_NOT_INITED ; }for (i = h->q_num; i < h->q_num *2 ; i++) {
@@ -1834,7 +1832,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv) hns_nic_rx_fini_pro_v2;netif_napi_add (priv->netdev, &rd->napi, - hns_nic_common_poll,NIC_RX_CLEAN_MAX_NUM ); + hns_nic_common_poll,NAPI_POLL_WEIGHT ); rd->ring->irq_init_flag =RCB_IRQ_NOT_INITED ; }
drivers/net/ethernet/intel/igb/e1000_defines.h +2 -0
@@ -193,6 +193,8 @@/* enable link status from external LINK_0 and LINK_1 pins */ #define E1000_CTRL_SWDPIN0 0x00040000/* SWDPIN 0 value */ #define E1000_CTRL_SWDPIN1 0x00080000/* SWDPIN 1 value */ +#define E1000_CTRL_ADVD3WUC 0x00100000/* D3 WUC */ +#define E1000_CTRL_EN_PHY_PWR_MGMT 0x00200000/* PHY PM enable */ #define E1000_CTRL_SDP0_DIR 0x00400000/* SDP0 Data direction */ #define E1000_CTRL_SDP1_DIR 0x00800000/* SDP1 Data direction */ #define E1000_CTRL_RST 0x04000000/* Global reset */
drivers/net/ethernet/intel/igb/igb_main.c +8 -49
97 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +2 -4
@@ -92,8 +92,7 @@ static int arm_vport_context_events_cmd(struct mlx5_core_dev *dev, u16 vport, opcode, MLX5_CMD_OP_MODIFY_NIC_VPORT_CONTEXT);MLX5_SET (modify_nic_vport_context_in, in, field_select.change_event,1 );MLX5_SET (modify_nic_vport_context_in, in, vport_number, vport); -if (vport) -MLX5_SET (modify_nic_vport_context_in, in, other_vport,1 ); +MLX5_SET (modify_nic_vport_context_in, in, other_vport,1 ); nic_vport_ctx =MLX5_ADDR_OF (modify_nic_vport_context_in, in, nic_vport_context);
@@ -121,8 +120,7 @@ static int modify_esw_vport_context_cmd(struct mlx5_core_dev *dev, u16 vport,MLX5_SET (modify_esw_vport_context_in, in, opcode,MLX5_CMD_OP_MODIFY_ESW_VPORT_CONTEXT );MLX5_SET (modify_esw_vport_context_in, in, vport_number, vport); -if (vport) -MLX5_SET (modify_esw_vport_context_in, in, other_vport,1 ); +MLX5_SET (modify_esw_vport_context_in, in, other_vport,1 );return mlx5_cmd_exec (dev, in, inlen, out,sizeof (out)); }
drivers/net/ethernet/stmicro/stmmac/enh_desc.c +9 -3
@@ -205,6 +205,11 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x,if (unlikely (rdes0 &RDES0_OWN ))return dma_own; +if (unlikely (!(rdes0 &RDES0_LAST_DESCRIPTOR ))) { + stats->rx_length_errors++; +return discard_frame; + } +if (unlikely (rdes0 &RDES0_ERROR_SUMMARY )) {if (unlikely (rdes0 &RDES0_DESCRIPTOR_ERROR )) { x->rx_desc++;
@@ -235,9 +240,10 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x,* It doesn't match with the information reported into the databook. * At any rate, we need to understand if the CSUM hw computation is ok * and report this info to the upper layers. */ - ret =enh_desc_coe_rdes0 (!!(rdes0 &RDES0_IPC_CSUM_ERROR ), - !!(rdes0 &RDES0_FRAME_TYPE ), - !!(rdes0 &ERDES0_RX_MAC_ADDR )); +if (likely (ret == good_frame)) + ret =enh_desc_coe_rdes0 (!!(rdes0 &RDES0_IPC_CSUM_ERROR ), + !!(rdes0 &RDES0_FRAME_TYPE ), + !!(rdes0 &ERDES0_RX_MAC_ADDR ));if (unlikely (rdes0 &RDES0_DRIBBLING )) x->dribbling_bit++;
drivers/net/ethernet/stmicro/stmmac/norm_desc.c +0 -2
@@ -95,8 +95,6 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x,return dma_own;if (unlikely (!(rdes0 &RDES0_LAST_DESCRIPTOR ))) { -pr_warn ("%s: Oversized frame spanned multiple buffers\n" , - __func__); stats->rx_length_errors++;return discard_frame; }
drivers/net/phy/marvell.c +4 -2
@@ -1429,9 +1429,10 @@ static int marvell_get_sset_count(struct phy_device *phydev)static void marvell_get_strings (struct phy_device *phydev,u8 *data) { +int count =marvell_get_sset_count (phydev);int i; -for (i =0 ; i <ARRAY_SIZE (marvell_hw_stats); i++) { +for (i =0 ; i < count; i++) {memcpy (data + i *ETH_GSTRING_LEN , marvell_hw_stats[i].string,ETH_GSTRING_LEN ); }
@@ -1470,9 +1471,10 @@ static u64 marvell_get_stat(struct phy_device *phydev, int i)static void marvell_get_stats (struct phy_device *phydev,struct ethtool_stats *stats,u64 *data) { +int count =marvell_get_sset_count (phydev);int i; -for (i =0 ; i <ARRAY_SIZE (marvell_hw_stats); i++) +for (i =0 ; i < count; i++) data[i] =marvell_get_stat (phydev, i); }
drivers/nvme/target/core.c +10 -10
@@ -709,6 +709,15 @@ bool nvmet_host_allowed(struct nvmet_req *req, struct nvmet_subsys *subsys,return __nvmet_host_allowed (subsys, hostnqn); } +static void nvmet_fatal_error_handler (struct work_struct *work) +{ +struct nvmet_ctrl *ctrl = + container_of(work, struct nvmet_ctrl, fatal_err_work); + +pr_err ("ctrl %d fatal error occurred!\n" , ctrl->cntlid); + ctrl->ops->delete_ctrl (ctrl); +} +u16 nvmet_alloc_ctrl (const char *subsysnqn,const char *hostnqn,struct nvmet_req *req,u32 kato,struct nvmet_ctrl **ctrlp) {
@@ -747,6 +756,7 @@ u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn,INIT_WORK (&ctrl->async_event_work, nvmet_async_event_work);INIT_LIST_HEAD (&ctrl->async_events); +INIT_WORK (&ctrl->fatal_err_work, nvmet_fatal_error_handler);memcpy (ctrl->subsysnqn, subsysnqn,NVMF_NQN_SIZE );memcpy (ctrl->hostnqn, hostnqn,NVMF_NQN_SIZE );
@@ -849,21 +859,11 @@ void nvmet_ctrl_put(struct nvmet_ctrl *ctrl)kref_put (&ctrl->ref, nvmet_ctrl_free); } -static void nvmet_fatal_error_handler (struct work_struct *work) -{ -struct nvmet_ctrl *ctrl = - container_of(work, struct nvmet_ctrl, fatal_err_work); - -pr_err ("ctrl %d fatal error occurred!\n" , ctrl->cntlid); - ctrl->ops->delete_ctrl (ctrl); -} -void nvmet_ctrl_fatal_error (struct nvmet_ctrl *ctrl) {mutex_lock (&ctrl->lock);if (!(ctrl->csts &NVME_CSTS_CFS )) { ctrl->csts |=NVME_CSTS_CFS ; -INIT_WORK (&ctrl->fatal_err_work, nvmet_fatal_error_handler);schedule_work (&ctrl->fatal_err_work); }mutex_unlock (&ctrl->lock);
drivers/rtc/rtc-da9063.c +7 -0
@@ -480,6 +480,13 @@ static int da9063_rtc_probe(struct platform_device *pdev)da9063_data_to_tm (data, &rtc->alarm_time, rtc); rtc->rtc_sync = false; +/* +* TODO: some models have alarms on a minute boundary but still support +* real hardware interrupts. Add this once the core supports it. +*/ +if (config->rtc_data_start !=RTC_SEC ) + rtc->rtc_dev->uie_unsupported =1 ; + irq_alarm =platform_get_irq_byname (pdev,"ALARM" ); ret = devm_request_threaded_irq(&pdev->dev, irq_alarm, NULL, da9063_alarm_event,
drivers/rtc/rtc-sh.c +1 -1
@@ -454,7 +454,7 @@ static int sh_rtc_set_time(struct device *dev, struct rtc_time *tm)static inline int sh_rtc_read_alarm_value (struct sh_rtc *rtc,int reg_off) {unsigned int byte; -int value =0xff ;/* return 0xff for ignored values */ +int value =-1 ;/* return -1 for ignored values */ byte =readb (rtc->regbase + reg_off);if (byte &AR_ENB ) {
drivers/scsi/scsi_devinfo.c +1 -0
@@ -249,6 +249,7 @@ static struct { {"NETAPP", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, {"LSI", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, {"ENGENIO", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, + {"LENOVO", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, {"SMSC", "USB 2 HS-CF", NULL, BLIST_SPARSELUN | BLIST_INQUIRY_36}, {"SONY", "CD-ROM CDU-8001", NULL, BLIST_BORKEN}, {"SONY", "TSL", NULL, BLIST_FORCELUN}, /* DDS3 & DDS4 autoloaders */
drivers/scsi/scsi_dh.c +1 -0
@@ -75,6 +75,7 @@ static const struct scsi_dh_blist scsi_dh_blist[] = { {"NETAPP", "INF-01-00", "rdac", }, {"LSI", "INF-01-00", "rdac", }, {"ENGENIO", "INF-01-00", "rdac", }, + {"LENOVO", "DE_Series", "rdac", }, {NULL, NULL, NULL }, };
drivers/scsi/storvsc_drv.c +11 -2
@@ -641,13 +641,22 @@ static void handle_sc_creation(struct vmbus_channel *new_sc)static void handle_multichannel_storage (struct hv_device *device,int max_chns) {struct storvsc_device *stor_device; -int num_cpus =num_online_cpus ();int num_sc;struct storvsc_cmd_request *request;struct vstor_packet *vstor_packet;int ret, t; - num_sc = ((max_chns > num_cpus) ? num_cpus : max_chns); +/* +* If the number of CPUs is artificially restricted, such as +* with maxcpus=1 on the kernel boot line, Hyper-V could offer +* sub-channels >= the number of CPUs. These sub-channels +* should not be created. The primary channel is already created +* and assigned to one CPU, so check against # CPUs - 1. +*/ + num_sc =min ((int )(num_online_cpus () -1 ), max_chns); +if (!num_sc) +return ; + stor_device =get_out_stor_device (device);if (!stor_device)return ;
drivers/staging/iio/addac/adt7316.c +16 -6
@@ -47,6 +47,8 @@#define ADT7516_MSB_AIN3 0xA#define ADT7516_MSB_AIN4 0xB#define ADT7316_DA_DATA_BASE 0x10 +#define ADT7316_DA_10_BIT_LSB_SHIFT 6 +#define ADT7316_DA_12_BIT_LSB_SHIFT 4#define ADT7316_DA_MSB_DATA_REGS 4#define ADT7316_LSB_DAC_A 0x10#define ADT7316_MSB_DAC_A 0x11
@@ -1089,7 +1091,7 @@ static ssize_t adt7316_store_DAC_internal_Vref(struct device *dev, ldac_config = chip->ldac_config & (~ADT7516_DAC_IN_VREF_MASK );if (data &0x1 ) ldac_config |=ADT7516_DAC_AB_IN_VREF ; -else if (data &0x2 ) +if (data &0x2 ) ldac_config |=ADT7516_DAC_CD_IN_VREF ; }else { ret =kstrtou8 (buf,16 , &data);
@@ -1411,7 +1413,7 @@ static IIO_DEVICE_ATTR(ex_analog_temp_offset, S_IRUGO | S_IWUSR,static ssize_t adt7316_show_DAC (struct adt7316_chip_info *chip,int channel,char *buf) { -u16 data; +u16 data =0 ;u8 msb, lsb, offset;int ret;
@@ -1436,7 +1438,11 @@ static ssize_t adt7316_show_DAC(struct adt7316_chip_info *chip,if (ret)return -EIO ; - data = (msb << offset) + (lsb & ((1 << offset) -1 )); +if (chip->dac_bits ==12 ) + data = lsb >>ADT7316_DA_12_BIT_LSB_SHIFT ; +else if (chip->dac_bits ==10 ) + data = lsb >>ADT7316_DA_10_BIT_LSB_SHIFT ; + data |= msb << offset;return sprintf (buf,"%d\n" , data); }
@@ -1444,7 +1450,7 @@ static ssize_t adt7316_show_DAC(struct adt7316_chip_info *chip,static ssize_t adt7316_store_DAC (struct adt7316_chip_info *chip,int channel,const char *buf,size_t len) { -u8 msb, lsb, offset; +u8 msb, lsb, lsb_reg, offset;u16 data;int ret;
@@ -1462,9 +1468,13 @@ static ssize_t adt7316_store_DAC(struct adt7316_chip_info *chip,return -EINVAL ;if (chip->dac_bits >8 ) { - lsb = data & (1 << offset); + lsb = data & ((1 << offset) -1 ); +if (chip->dac_bits ==12 ) + lsb_reg = lsb <<ADT7316_DA_12_BIT_LSB_SHIFT ; +else + lsb_reg = lsb <<ADT7316_DA_10_BIT_LSB_SHIFT ; ret = chip->bus.write (chip->bus.client, -ADT7316_DA_DATA_BASE + channel *2 , lsb); +ADT7316_DA_DATA_BASE + channel *2 , lsb_reg);if (ret)return -EIO ; }
drivers/usb/core/driver.c +0 -13
@@ -470,11 +470,6 @@ static int usb_unbind_interface(struct device *dev)pm_runtime_disable (dev);pm_runtime_set_suspended (dev); -/* Undo any residual pm_autopm_get_interface_* calls */ -for (r =atomic_read (&intf->pm_usage_cnt); r >0 ; --r) -usb_autopm_put_interface_no_suspend (intf); -atomic_set (&intf->pm_usage_cnt,0 ); -if (!error)usb_autosuspend_device (udev);
@@ -1625,7 +1620,6 @@ void usb_autopm_put_interface(struct usb_interface *intf)int status;usb_mark_last_busy (udev); -atomic_dec (&intf->pm_usage_cnt); status =pm_runtime_put_sync (&intf->dev); dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n", __func__, atomic_read(&intf->dev.power.usage_count),
@@ -1654,7 +1648,6 @@ void usb_autopm_put_interface_async(struct usb_interface *intf)int status;usb_mark_last_busy (udev); -atomic_dec (&intf->pm_usage_cnt); status =pm_runtime_put (&intf->dev); dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n", __func__, atomic_read(&intf->dev.power.usage_count),
@@ -1676,7 +1669,6 @@ void usb_autopm_put_interface_no_suspend(struct usb_interface *intf)struct usb_device *udev =interface_to_usbdev (intf);usb_mark_last_busy (udev); -atomic_dec (&intf->pm_usage_cnt);pm_runtime_put_noidle (&intf->dev); }EXPORT_SYMBOL_GPL (usb_autopm_put_interface_no_suspend);
@@ -1707,8 +1699,6 @@ int usb_autopm_get_interface(struct usb_interface *intf) status =pm_runtime_get_sync (&intf->dev);if (status <0 )pm_runtime_put_sync (&intf->dev); -else -atomic_inc (&intf->pm_usage_cnt);dev_vdbg (&intf->dev,"%s: cnt %d -> %d\n" , __func__,atomic_read (&intf->dev.power.usage_count), status);
@@ -1742,8 +1732,6 @@ int usb_autopm_get_interface_async(struct usb_interface *intf) status =pm_runtime_get (&intf->dev);if (status <0 && status != -EINPROGRESS )pm_runtime_put_noidle (&intf->dev); -else -atomic_inc (&intf->pm_usage_cnt);dev_vdbg (&intf->dev,"%s: cnt %d -> %d\n" , __func__,atomic_read (&intf->dev.power.usage_count), status);
@@ -1767,7 +1755,6 @@ void usb_autopm_get_interface_no_resume(struct usb_interface *intf)struct usb_device *udev =interface_to_usbdev (intf);usb_mark_last_busy (udev); -atomic_inc (&intf->pm_usage_cnt);pm_runtime_get_noresume (&intf->dev); }EXPORT_SYMBOL_GPL (usb_autopm_get_interface_no_resume);
drivers/usb/core/message.c +3 -1
@@ -817,9 +817,11 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size)if (dev->state ==USB_STATE_SUSPENDED )return -EHOSTUNREACH ; -if (size <=0 || !buf || !index) +if (size <=0 || !buf)return -EINVAL ; buf[0 ] =0 ; +if (index <=0 || index >=256 ) +return -EINVAL ; tbuf =kmalloc (256 ,GFP_NOIO );if (!tbuf)return -ENOMEM ;
drivers/usb/misc/yurex.c +1 -0
@@ -324,6 +324,7 @@ static void yurex_disconnect(struct usb_interface *interface)usb_deregister_dev (interface, &yurex_class);/* prevent more I/O from starting */ +usb_poison_urb (dev->urb);mutex_lock (&dev->io_mutex); dev->interface =NULL ;mutex_unlock (&dev->io_mutex);
drivers/usb/storage/realtek_cr.c +5 -8
@@ -776,18 +776,16 @@ static void rts51x_suspend_timer_fn(unsigned long data)break ;case RTS51X_STAT_IDLE :case RTS51X_STAT_SS : -usb_stor_dbg (us,"RTS51X_STAT_SS, intf->pm_usage_cnt:%d, power.usage:%d\n" , -atomic_read (&us->pusb_intf->pm_usage_cnt), +usb_stor_dbg (us,"RTS51X_STAT_SS, power.usage:%d\n" ,atomic_read (&us->pusb_intf->dev.power.usage_count)); -if (atomic_read (&us->pusb_intf->pm_usage_cnt) >0 ) { +if (atomic_read (&us->pusb_intf->dev.power.usage_count) >0 ) {usb_stor_dbg (us,"Ready to enter SS state\n" );rts51x_set_stat (chip,RTS51X_STAT_SS );/* ignore mass storage interface's children */ pm_suspend_ignore_children (&us->pusb_intf->dev, true);usb_autopm_put_interface_async (us->pusb_intf); -usb_stor_dbg (us,"RTS51X_STAT_SS 01, intf->pm_usage_cnt:%d, power.usage:%d\n" , -atomic_read (&us->pusb_intf->pm_usage_cnt), +usb_stor_dbg (us,"RTS51X_STAT_SS 01, power.usage:%d\n" ,atomic_read (&us->pusb_intf->dev.power.usage_count)); }break ;
@@ -820,11 +818,10 @@ static void rts51x_invoke_transport(struct scsi_cmnd *srb, struct us_data *us)int ret;if (working_scsi (srb)) { -usb_stor_dbg (us,"working scsi, intf->pm_usage_cnt:%d, power.usage:%d\n" , -atomic_read (&us->pusb_intf->pm_usage_cnt), +usb_stor_dbg (us,"working scsi, power.usage:%d\n" ,atomic_read (&us->pusb_intf->dev.power.usage_count)); -if (atomic_read (&us->pusb_intf->pm_usage_cnt) <=0 ) { +if (atomic_read (&us->pusb_intf->dev.power.usage_count) <=0 ) { ret =usb_autopm_get_interface (us->pusb_intf);usb_stor_dbg (us,"working scsi, ret=%d\n" , ret); }
drivers/usb/usbip/stub_rx.c +3 -9
@@ -383,16 +383,10 @@ static int get_pipe(struct stub_device *sdev, struct usbip_header *pdu) }if (usb_endpoint_xfer_isoc (epd)) { -/* validate packet size and number of packets */ -unsigned int maxp, packets, bytes; - - maxp =usb_endpoint_maxp (epd); - maxp *=usb_endpoint_maxp_mult (epd); - bytes = pdu->u.cmd_submit.transfer_buffer_length; - packets =DIV_ROUND_UP (bytes, maxp); - +/* validate number of packets */ if (pdu->u.cmd_submit.number_of_packets <0 || - pdu->u.cmd_submit.number_of_packets > packets) { + pdu->u.cmd_submit.number_of_packets > +USBIP_MAX_ISO_PACKETS ) {dev_err (&sdev->udev->dev,"CMD_SUBMIT: isoc invalid num packets %d\n" , pdu->u.cmd_submit.number_of_packets);
drivers/usb/usbip/usbip_common.h +7 -0
@@ -136,6 +136,13 @@ extern struct device_attribute dev_attr_usbip_debug;#define USBIP_DIR_OUT 0x00#define USBIP_DIR_IN 0x01 +/* +* Arbitrary limit for the maximum number of isochronous packets in an URB, +* compare for example the uhci_submit_isochronous function in +* drivers/usb/host/uhci-q.c +*/ +#define USBIP_MAX_ISO_PACKETS 1024 +/** * struct usbip_header_basic - data pertinent to every request * @command: the usbip request type
drivers/vfio/pci/vfio_pci.c +2 -2
@@ -1467,11 +1467,11 @@ static void __init vfio_pci_fill_ids(void) rc =pci_add_dynid (&vfio_pci_driver, vendor, device, subvendor, subdevice, class, class_mask,0 );if (rc) -pr_warn ("failed to add dynamic id [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x (%d)\n" , +pr_warn ("failed to add dynamic id [%04x:%04x[%04x:%04x]] class %#08x/%08x (%d)\n" , vendor, device, subvendor, subdevice, class, class_mask, rc);else -pr_info ("add [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x\n" , +pr_info ("add [%04x:%04x[%04x:%04x]] class %#08x/%08x\n" , vendor, device, subvendor, subdevice, class, class_mask); }
drivers/w1/masters/ds2490.c +3 -3
@@ -1039,15 +1039,15 @@ static int ds_probe(struct usb_interface *intf,/* alternative 3, 1ms interrupt (greatly speeds search), 64 byte bulk */ alt =3 ; err =usb_set_interface (dev->udev, - intf->altsetting[alt].desc.bInterfaceNumber, alt); + intf->cur_altsetting->desc.bInterfaceNumber, alt);if (err) {dev_err (&dev->udev->dev,"Failed to set alternative setting %d " "for %d interface: err=%d.\n" , alt, - intf->altsetting[alt].desc.bInterfaceNumber, err); + intf->cur_altsetting->desc.bInterfaceNumber, err); goto err_out_clear; } - iface_desc = &intf->altsetting[alt]; + iface_desc = intf->cur_altsetting;if (iface_desc->desc.bNumEndpoints !=NUM_EP -1 ) {pr_info ("Num endpoints=%d. It is not DS9490R.\n" , iface_desc->desc.bNumEndpoints);
fs/debugfs/inode.c +9 -4
@@ -170,19 +170,24 @@ static int debugfs_show_options(struct seq_file *m, struct dentry *root)return 0 ; } -static void debugfs_evict_inode (struct inode *inode) +static void debugfs_i_callback (struct rcu_head *head) { -truncate_inode_pages_final (&inode->i_data); -clear_inode (inode); + struct inode *inode = container_of(head, struct inode, i_rcu);if (S_ISLNK (inode->i_mode))kfree (inode->i_link); +free_inode_nonrcu (inode); +} + +static void debugfs_destroy_inode (struct inode *inode) +{ +call_rcu (&inode->i_rcu, debugfs_i_callback); }static const struct super_operations debugfs_super_operations = { .statfs = simple_statfs, .remount_fs = debugfs_remount, .show_options = debugfs_show_options, - .evict_inode = debugfs_evict_inode, + .destroy_inode = debugfs_destroy_inode, };static struct vfsmount *debugfs_automount (struct path *path)
fs/hugetlbfs/inode.c +14 -6
@@ -746,11 +746,17 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, umode_t mode, dev_t dev) {struct inode *inode; -struct resv_map *resv_map; +struct resv_map *resv_map =NULL ; - resv_map =resv_map_alloc (); -if (!resv_map) -return NULL ; +/* +* Reserve maps are only needed for inodes that can have associated +* page allocations. +*/ +if (S_ISREG (mode) ||S_ISLNK (mode)) { + resv_map =resv_map_alloc (); +if (!resv_map) +return NULL ; + } inode =new_inode (sb);if (inode) {
@@ -782,8 +788,10 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb,break ; }lockdep_annotate_inode_mutex_key (inode); - }else -kref_put (&resv_map->refs, resv_map_release); + }else { +if (resv_map) +kref_put (&resv_map->refs, resv_map_release); + }return inode; }
fs/jffs2/readinode.c +0 -5
@@ -1414,11 +1414,6 @@ void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f)jffs2_kill_fragtree (&f->fragtree, deleted?c:NULL ); -if (f->target) { -kfree (f->target); - f->target =NULL ; - } - fds = f->dents;while (fds) { fd = fds;
fs/jffs2/super.c +4 -1
@@ -47,7 +47,10 @@ static struct inode *jffs2_alloc_inode(struct super_block *sb)static void jffs2_i_callback (struct rcu_head *head) { struct inode *inode = container_of(head, struct inode, i_rcu); -kmem_cache_free (jffs2_inode_cachep,JFFS2_INODE_INFO (inode)); +struct jffs2_inode_info *f =JFFS2_INODE_INFO (inode); + +kfree (f->target); +kmem_cache_free (jffs2_inode_cachep, f); }static void jffs2_destroy_inode (struct inode *inode)
include/linux/kasan.h +1 -0
@@ -7,6 +7,7 @@struct kmem_cache ;struct page ;struct vm_struct ; +struct task_struct ;#ifdef CONFIG_KASAN
include/linux/usb.h +0 -2
@@ -129,7 +129,6 @@ enum usb_interface_condition {* @dev: driver model's view of this device * @usb_dev: if an interface is bound to the USB major, this will point * to the sysfs representation for that device. -* @pm_usage_cnt: PM usage counter for this interface * @reset_ws: Used for scheduling resets from atomic context. * @resetting_device: USB core reset the device, so use alt setting 0 as * current; needs bandwidth alloc after reset.
@@ -186,7 +185,6 @@ struct usb_interface {struct device dev;/* interface specific device info */ struct device *usb_dev; -atomic_t pm_usage_cnt;/* usage counter for autosuspend */ struct work_struct reset_ws;/* for resets in atomic context */ };#define to_usb_interface (d) container_of(d, struct usb_interface, dev)
include/net/caif/cfpkt.h +27 -0
@@ -32,6 +32,33 @@ void cfpkt_destroy(struct cfpkt *pkt);*/ int cfpkt_extr_head (struct cfpkt *pkt,void *data,u16 len); +static inline u8 cfpkt_extr_head_u8 (struct cfpkt *pkt) +{ +u8 tmp; + +cfpkt_extr_head (pkt, &tmp,1 ); + +return tmp; +} + +static inline u16 cfpkt_extr_head_u16 (struct cfpkt *pkt) +{ +__le16 tmp; + +cfpkt_extr_head (pkt, &tmp,2 ); + +return le16_to_cpu (tmp); +} + +static inline u32 cfpkt_extr_head_u32 (struct cfpkt *pkt) +{ +__le32 tmp; + +cfpkt_extr_head (pkt, &tmp,4 ); + +return le32_to_cpu (tmp); +} +/* * Peek header from packet. * Reads data from packet without changing packet.
lib/Makefile +1 -0
@@ -46,6 +46,7 @@ obj-$(CONFIG_TEST_BPF) += test_bpf.o obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.o obj-$(CONFIG_TEST_HASH) += test_hash.o obj-$(CONFIG_TEST_KASAN) += test_kasan.o +CFLAGS_test_kasan.o += -fno-builtin obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o obj-$(CONFIG_TEST_LKM) += test_module.o obj-$(CONFIG_TEST_RHASHTABLE) += test_rhashtable.o
lib/test_kasan.c +1 -1
@@ -355,7 +355,7 @@ static noinline void __init kasan_stack_oob(void) static noinline void __init ksize_unpoisons_memory(void) {char *ptr; -size_t size =123 , real_size = size; +size_t size =123 , real_size;pr_info ("ksize() unpoisons the whole allocated chunk\n" ); ptr =kmalloc (size,GFP_KERNEL );
mm/kasan/kasan.c +8 -1
@@ -80,7 +80,14 @@ void kasan_unpoison_task_stack(struct task_struct *task)/* Unpoison the stack for the current task beyond a watermark sp value. */ asmlinkage void kasan_unpoison_task_stack_below(const void *watermark) { -__kasan_unpoison_stack (current, watermark); +/* +* Calculate the task stack base address. Avoid using 'current' +* because this function is called by early resume code which hasn't +* yet set up the percpu register (%gs). +*/ +void *base = (void *)((unsigned long )watermark & ~(THREAD_SIZE -1 )); + +kasan_unpoison_shadow (base, watermark - base); }/*
mm/kasan/kasan_init.c +8 -7
@@ -15,6 +15,7 @@#include <linux/kasan.h> #include <linux/kernel.h> #include <linux/memblock.h> +#include <linux/mm.h> #include <linux/pfn.h> #include <asm/page.h>
@@ -49,7 +50,7 @@ static void __init zero_pte_populate(pmd_t *pmd, unsigned long addr,pte_t *pte =pte_offset_kernel (pmd, addr);pte_t zero_pte; - zero_pte =pfn_pte (PFN_DOWN (__pa (kasan_zero_page)),PAGE_KERNEL ); + zero_pte =pfn_pte (PFN_DOWN (__pa_symbol (kasan_zero_page)),PAGE_KERNEL ); zero_pte =pte_wrprotect (zero_pte);while (addr +PAGE_SIZE <= end) {
@@ -69,7 +70,7 @@ static void __init zero_pmd_populate(pud_t *pud, unsigned long addr, next =pmd_addr_end (addr, end);if (IS_ALIGNED (addr,PMD_SIZE ) && end - addr >=PMD_SIZE ) { -pmd_populate_kernel (&init_mm, pmd, kasan_zero_pte); +pmd_populate_kernel (&init_mm, pmd,lm_alias (kasan_zero_pte));continue ; }
@@ -92,9 +93,9 @@ static void __init zero_pud_populate(pgd_t *pgd, unsigned long addr,if (IS_ALIGNED (addr,PUD_SIZE ) && end - addr >=PUD_SIZE ) {pmd_t *pmd; -pud_populate (&init_mm, pud, kasan_zero_pmd); +pud_populate (&init_mm, pud,lm_alias (kasan_zero_pmd)); pmd =pmd_offset (pud, addr); -pmd_populate_kernel (&init_mm, pmd, kasan_zero_pte); +pmd_populate_kernel (&init_mm, pmd,lm_alias (kasan_zero_pte));continue ; }
@@ -135,11 +136,11 @@ void __init kasan_populate_zero_shadow(const void *shadow_start,* puds,pmds, so pgd_populate(), pud_populate() * is noops. */ -pgd_populate (&init_mm, pgd, kasan_zero_pud); +pgd_populate (&init_mm, pgd,lm_alias (kasan_zero_pud)); pud =pud_offset (pgd, addr); -pud_populate (&init_mm, pud, kasan_zero_pmd); +pud_populate (&init_mm, pud,lm_alias (kasan_zero_pmd)); pmd =pmd_offset (pud, addr); -pmd_populate_kernel (&init_mm, pmd, kasan_zero_pte); +pmd_populate_kernel (&init_mm, pmd,lm_alias (kasan_zero_pte));continue ; }
mm/kasan/report.c +1 -0
@@ -302,6 +302,7 @@ void kasan_report(unsigned long addr, size_t size,disable_trace_on_warning (); info.access_addr = (void *)addr; + info.first_bad_addr = (void *)addr; info.access_size = size; info.is_write = is_write; info.ip = ip;
net/batman-adv/bridge_loop_avoidance.c +13 -3
@@ -802,6 +802,8 @@ static void batadv_bla_del_claim(struct batadv_priv *bat_priv, const u8 *mac, const unsigned short vid) {struct batadv_bla_claim search_claim, *claim; +struct batadv_bla_claim *claim_removed_entry; +struct hlist_node *claim_removed_node;ether_addr_copy (search_claim.addr, mac); search_claim.vid = vid;
@@ -812,10 +814,18 @@ static void batadv_bla_del_claim(struct batadv_priv *bat_priv,batadv_dbg (BATADV_DBG_BLA , bat_priv,"bla_del_claim(): %pM, vid %d\n" , mac,BATADV_PRINT_VID (vid)); -batadv_hash_remove (bat_priv->bla.claim_hash, batadv_compare_claim, - batadv_choose_claim, claim); -batadv_claim_put (claim);/* reference from the hash is gone */ + claim_removed_node =batadv_hash_remove (bat_priv->bla.claim_hash, + batadv_compare_claim, + batadv_choose_claim, claim); +if (!claim_removed_node) + goto free_claim; +/* reference from the hash is gone */ + claim_removed_entry =hlist_entry (claim_removed_node, + struct batadv_bla_claim, hash_entry); +batadv_claim_put (claim_removed_entry); + +free_claim:/* don't need the reference from hash_find() anymore */ batadv_claim_put (claim); }
net/batman-adv/translation-table.c +24 -8
@@ -615,14 +615,26 @@ static void batadv_tt_global_free(struct batadv_priv *bat_priv,struct batadv_tt_global_entry *tt_global, const char *message) { + struct batadv_tt_global_entry *tt_removed_entry; +struct hlist_node *tt_removed_node; +batadv_dbg (BATADV_DBG_TT , bat_priv,"Deleting global tt entry %pM (vid: %d): %s\n" , tt_global->common.addr,BATADV_PRINT_VID (tt_global->common.vid), message); -batadv_hash_remove (bat_priv->tt.global_hash, batadv_compare_tt, - batadv_choose_tt, &tt_global->common); -batadv_tt_global_entry_put (tt_global); + tt_removed_node =batadv_hash_remove (bat_priv->tt.global_hash, + batadv_compare_tt, + batadv_choose_tt, + &tt_global->common); +if (!tt_removed_node) +return ; + +/* drop reference of remove hash entry */ + tt_removed_entry =hlist_entry (tt_removed_node, + struct batadv_tt_global_entry, + common.hash_entry); +batadv_tt_global_entry_put (tt_removed_entry); }/**
@@ -1308,9 +1320,10 @@ u16 batadv_tt_local_remove(struct batadv_priv *bat_priv, const u8 *addr, unsigned short vid, const char *message, bool roaming) { + struct batadv_tt_local_entry *tt_removed_entry;struct batadv_tt_local_entry *tt_local_entry;u16 flags, curr_flags =BATADV_NO_FLAGS ; -void *tt_entry_exists; +struct hlist_node *tt_removed_node; tt_local_entry =batadv_tt_local_hash_find (bat_priv, addr, vid);if (!tt_local_entry)
@@ -1339,15 +1352,18 @@ u16 batadv_tt_local_remove(struct batadv_priv *bat_priv, const u8 *addr,*/ batadv_tt_local_event (bat_priv, tt_local_entry,BATADV_TT_CLIENT_DEL ); - tt_entry_exists =batadv_hash_remove (bat_priv->tt.local_hash, + tt_removed_node =batadv_hash_remove (bat_priv->tt.local_hash, batadv_compare_tt, batadv_choose_tt, &tt_local_entry->common); -if (!tt_entry_exists) +if (!tt_removed_node) goto out; -/* extra call to free the local tt entry */ -batadv_tt_local_entry_put (tt_local_entry); +/* drop reference of remove hash entry */ + tt_removed_entry =hlist_entry (tt_removed_node, + struct batadv_tt_local_entry, + common.hash_entry); +batadv_tt_local_entry_put (tt_removed_entry); out:if (tt_local_entry)
net/caif/cfctrl.c +22 -28
152 lines not on this page · raw message
net/ipv4/ip_output.c +1 -0
@@ -492,6 +492,7 @@ static void ip_copy_metadata(struct sk_buff *to, struct sk_buff *from) to->pkt_type = from->pkt_type; to->priority = from->priority; to->protocol = from->protocol; + to->skb_iif = from->skb_iif;skb_dst_drop (to);skb_dst_copy (to, from); to->dev = from->dev;
net/ipv6/ip6_flowlabel.c +14 -8
@@ -94,15 +94,21 @@ static struct ip6_flowlabel *fl_lookup(struct net *net, __be32 label)return fl; } +static void fl_free_rcu (struct rcu_head *head) +{ + struct ip6_flowlabel *fl = container_of(head, struct ip6_flowlabel, rcu); + +if (fl->share ==IPV6_FL_S_PROCESS ) +put_pid (fl->owner.pid); +kfree (fl->opt); +kfree (fl); +} +static void fl_free (struct ip6_flowlabel *fl) { -if (fl) { -if (fl->share ==IPV6_FL_S_PROCESS ) -put_pid (fl->owner.pid); -kfree (fl->opt); -kfree_rcu (fl, rcu); - } +if (fl) +call_rcu (&fl->rcu, fl_free_rcu); }static void fl_release (struct ip6_flowlabel *fl)
@@ -634,9 +640,9 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)if (fl1->share ==IPV6_FL_S_EXCL || fl1->share != fl->share || ((fl1->share ==IPV6_FL_S_PROCESS ) && - (fl1->owner.pid == fl->owner.pid)) || + (fl1->owner.pid != fl->owner.pid)) || ((fl1->share ==IPV6_FL_S_USER ) && -uid_eq (fl1->owner.uid, fl->owner.uid))) + !uid_eq (fl1->owner.uid, fl->owner.uid))) goto release; err = -ENOMEM ;
net/packet/af_packet.c +14 -10
@@ -2638,8 +2638,8 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)void *ph; DECLARE_SOCKADDR(struct sockaddr_ll *, saddr, msg->msg_name);bool need_wait = !(msg->msg_flags &MSG_DONTWAIT ); +unsigned char *addr =NULL ;int tp_len, size_max; -unsigned char *addr;void *data;int len_sum =0 ;int status =TP_STATUS_AVAILABLE ;
@@ -2650,7 +2650,6 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)if (likely (saddr ==NULL )) { dev =packet_cached_dev_get (po); proto = po->num; - addr =NULL ; }else { err = -EINVAL ;if (msg->msg_namelen <sizeof (struct sockaddr_ll ))
@@ -2660,10 +2659,13 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg) sll_addr))) goto out; proto = saddr->sll_protocol; - addr = saddr->sll_halen ? saddr->sll_addr :NULL ; dev =dev_get_by_index (sock_net (&po->sk), saddr->sll_ifindex); -if (addr && dev && saddr->sll_halen < dev->addr_len) - goto out_put; +if (po->sk.sk_socket->type ==SOCK_DGRAM ) { +if (dev && msg->msg_namelen < dev->addr_len + + offsetof(struct sockaddr_ll , sll_addr)) + goto out_put; + addr = saddr->sll_addr; + } } err = -ENXIO ;
@@ -2834,7 +2836,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)struct sk_buff *skb;struct net_device *dev;__be16 proto; -unsigned char *addr; +unsigned char *addr =NULL ;int err, reserve =0 ;struct sockcm_cookie sockc;struct virtio_net_hdr vnet_hdr = {0 };
@@ -2851,7 +2853,6 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)if (likely (saddr ==NULL )) { dev =packet_cached_dev_get (po); proto = po->num; - addr =NULL ; }else { err = -EINVAL ;if (msg->msg_namelen <sizeof (struct sockaddr_ll ))
@@ -2859,10 +2860,13 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)if (msg->msg_namelen < (saddr->sll_halen + offsetof(struct sockaddr_ll , sll_addr))) goto out; proto = saddr->sll_protocol; - addr = saddr->sll_halen ? saddr->sll_addr :NULL ; dev =dev_get_by_index (sock_net (sk), saddr->sll_ifindex); -if (addr && dev && saddr->sll_halen < dev->addr_len) - goto out_unlock; +if (sock->type ==SOCK_DGRAM ) { +if (dev && msg->msg_namelen < dev->addr_len + + offsetof(struct sockaddr_ll , sll_addr)) + goto out_unlock; + addr = saddr->sll_addr; + } } err = -ENXIO ;
security/selinux/hooks.c +31 -9
@@ -467,21 +467,43 @@ static int may_context_mount_inode_relabel(u32 sid,return rc; } -static int selinux_is_sblabel_mnt (struct super_block *sb) +static int selinux_is_genfs_special_handling (struct super_block *sb) { -struct superblock_security_struct *sbsec = sb->s_security; - -return sbsec->behavior ==SECURITY_FS_USE_XATTR || - sbsec->behavior ==SECURITY_FS_USE_TRANS || - sbsec->behavior ==SECURITY_FS_USE_TASK || - sbsec->behavior ==SECURITY_FS_USE_NATIVE || -/* Special handling. Genfs but also in-core setxattr handler */ - !strcmp (sb->s_type->name,"sysfs" ) || +/* Special handling. Genfs but also in-core setxattr handler */ +return !strcmp (sb->s_type->name,"sysfs" ) || !strcmp (sb->s_type->name,"pstore" ) || !strcmp (sb->s_type->name,"debugfs" ) || !strcmp (sb->s_type->name,"rootfs" ); } +static int selinux_is_sblabel_mnt (struct super_block *sb) +{ +struct superblock_security_struct *sbsec = sb->s_security; + +/* +* IMPORTANT: Double-check logic in this function when adding a new +* SECURITY_FS_USE_* definition! +*/ +BUILD_BUG_ON (SECURITY_FS_USE_MAX !=7 ); + +switch (sbsec->behavior) { +case SECURITY_FS_USE_XATTR : +case SECURITY_FS_USE_TRANS : +case SECURITY_FS_USE_TASK : +case SECURITY_FS_USE_NATIVE : +return 1 ; + +case SECURITY_FS_USE_GENFS : +return selinux_is_genfs_special_handling (sb); + +/* Never allow relabeling on context mounts */ +case SECURITY_FS_USE_MNTPOINT : +case SECURITY_FS_USE_NONE : +default : +return 0 ; + } +} +static int sb_finish_set_opts (struct super_block *sb) {struct superblock_security_struct *sbsec = sb->s_security;
sound/usb/line6/driver.c +35 -25
141 lines not on this page · raw message
sound/usb/line6/podhd.c +12 -9
@@ -221,28 +221,32 @@ static void podhd_startup_start_workqueue(unsigned long data)static int podhd_dev_start (struct usb_line6_podhd *pod) {int ret; -u8 init_bytes[8 ]; +u8 *init_bytes;int i;struct usb_device *usbdev = pod->line6.usbdev; + init_bytes =kmalloc (8 ,GFP_KERNEL ); +if (!init_bytes) +return -ENOMEM ; + ret =usb_control_msg (usbdev,usb_sndctrlpipe (usbdev,0 ),0x67 ,USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_OUT ,0x11 ,0 ,NULL ,0 ,LINE6_TIMEOUT *HZ );if (ret <0 ) {dev_err (pod->line6.ifcdev,"read request failed (error %d)\n" , ret); -return ret; + goto exit; }/* NOTE: looks like some kind of ping message */ ret =usb_control_msg (usbdev,usb_rcvctrlpipe (usbdev,0 ),0x67 ,USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_IN ,0x11 ,0x0 , - &init_bytes,3 ,LINE6_TIMEOUT *HZ ); + init_bytes,3 ,LINE6_TIMEOUT *HZ );if (ret <0 ) {dev_err (pod->line6.ifcdev,"receive length failed (error %d)\n" , ret); -return ret; + goto exit; } pod->firmware_version =
@@ -251,7 +255,7 @@ static int podhd_dev_start(struct usb_line6_podhd *pod)for (i =0 ; i <=16 ; i++) { ret =line6_read_data (&pod->line6,0xf000 +0x08 * i, init_bytes,8 );if (ret <0 ) -return ret; + goto exit; } ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0),
@@ -259,10 +263,9 @@ static int podhd_dev_start(struct usb_line6_podhd *pod)USB_TYPE_STANDARD |USB_RECIP_DEVICE |USB_DIR_OUT ,1 ,0 , NULL, 0, LINE6_TIMEOUT * HZ); -if (ret <0 ) -return ret; - -return 0 ; +exit: +kfree (init_bytes); +return ret; }static void podhd_startup_workqueue (struct work_struct *work)
sound/usb/line6/toneport.c +18 -6
@@ -365,15 +365,20 @@ static bool toneport_has_source_select(struct usb_line6_toneport *toneport)/* Setup Toneport device. */ -static void toneport_setup (struct usb_line6_toneport *toneport) +static int toneport_setup (struct usb_line6_toneport *toneport) { -int ticks; +int *ticks;struct usb_line6 *line6 = &toneport->line6;struct usb_device *usbdev = line6->usbdev; + ticks =kmalloc (sizeof (*ticks),GFP_KERNEL ); +if (!ticks) +return -ENOMEM ; +/* sync time on device with host: */ - ticks = (int )get_seconds (); -line6_write_data (line6,0x80c6 , &ticks,4 ); + *ticks = (int )get_seconds (); +line6_write_data (line6,0x80c6 , ticks,4 ); +kfree (ticks);/* enable device: */ toneport_send_cmd (usbdev,0x0301 ,0x0000 );
@@ -388,6 +393,7 @@ static void toneport_setup(struct usb_line6_toneport *toneport)toneport_update_led (toneport);mod_timer (&toneport->timer, jiffies +TONEPORT_PCM_DELAY *HZ ); +return 0 ; }/*
@@ -451,7 +457,9 @@ static int toneport_init(struct usb_line6 *line6,return err; } -toneport_setup (toneport); + err =toneport_setup (toneport); +if (err) +return err;/* register audio system: */ return snd_card_register (line6->card);
@@ -463,7 +471,11 @@ static int toneport_init(struct usb_line6 *line6,*/ static int toneport_reset_resume (struct usb_interface *interface) { -toneport_setup (usb_get_intfdata (interface)); +int err; + + err =toneport_setup (usb_get_intfdata (interface)); +if (err) +return err;return line6_resume (interface); }#endif