Linux 4.4.271
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.4.271 kernel.
All users of the 4.4 kernel series must upgrade.
The updated 4.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.4.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
------------
Makefile | 2 arch/mips/alchemy/board-xxs1500.c | 1 arch/mips/ralink/of.c | 2 arch/openrisc/include/asm/barrier.h | 9 + arch/x86/entry/entry_64.S | 2 arch/x86/include/asm/atomic.h | 8 - arch/x86/include/asm/atomic64_64.h | 8 - arch/x86/include/asm/bitops.h | 29 ++-- arch/x86/include/asm/local.h | 8 - arch/x86/include/asm/percpu.h | 2 arch/x86/include/asm/preempt.h | 2 arch/x86/include/asm/rmwcc.h | 4 drivers/char/hpet.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 drivers/i2c/busses/i2c-i801.c | 6 drivers/i2c/busses/i2c-s3c2410.c | 4 drivers/iio/adc/ad7793.c | 1 drivers/isdn/hardware/mISDN/mISDNinfineon.c | 24 ++- drivers/md/dm-snap.c | 2 drivers/media/dvb-frontends/sp8870.c | 4 drivers/media/usb/gspca/m5602/m5602_po1030.c | 10 + drivers/misc/kgdbts.c | 3 drivers/misc/lis3lv02d/lis3lv02d.h | 1 drivers/misc/mei/interrupt.c | 3 drivers/net/caif/caif_serial.c | 1 drivers/net/ethernet/broadcom/bnx2.c | 2 drivers/net/ethernet/fujitsu/fmvj18x_cs.c | 5 drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 4 drivers/net/ethernet/mellanox/mlx4/port.c | 107 ++++++++++++++++- drivers/net/ethernet/ti/netcp_core.c | 2 drivers/net/usb/hso.c | 4 drivers/net/usb/smsc75xx.c | 8 - drivers/net/wireless/libertas/mesh.c | 28 ---- drivers/platform/x86/hp_accel.c | 22 +++ drivers/scsi/BusLogic.c | 6 drivers/scsi/BusLogic.h | 2 drivers/scsi/libsas/sas_port.c | 4 drivers/spi/spi-sh.c | 14 -- drivers/spi/spi.c | 9 - drivers/staging/emxx_udc/emxx_udc.c | 4 drivers/staging/iio/cdc/ad7746.c | 1 drivers/tty/serial/rp2.c | 52 ++------ drivers/usb/core/hub.h | 6 drivers/usb/misc/trancevibrator.c | 4 drivers/usb/misc/uss720.c | 1 drivers/usb/serial/ftdi_sio.c | 3 drivers/usb/serial/ftdi_sio_ids.h | 7 + drivers/usb/serial/option.c | 4 drivers/usb/serial/pl2303.c | 1 drivers/usb/serial/pl2303.h | 1 fs/btrfs/tree-log.c | 2 fs/hugetlbfs/inode.c | 4 fs/nfs/filelayout/filelayout.c | 2 fs/nfs/nfs4file.c | 2 fs/nfs/pagelist.c | 12 - fs/proc/base.c | 4 include/linux/hugetlb.h | 2 include/linux/ieee80211.h | 10 + include/linux/netfilter/x_tables.h | 2 include/linux/spi/spi.h | 3 include/net/nfc/nci_core.h | 1 mm/hugetlb.c | 8 - mm/vmstat.c | 3 net/bluetooth/cmtp/core.c | 5 net/bluetooth/hci_core.c | 13 +- net/ipv6/mcast.c | 3 net/mac80211/ieee80211_i.h | 36 ++--- net/mac80211/iface.c | 9 - net/mac80211/key.c | 7 + net/mac80211/key.h | 2 net/mac80211/rx.c | 148 ++++++++++++++++++------ net/mac80211/sta_info.c | 4 net/mac80211/sta_info.h | 31 +++++ net/mac80211/wpa.c | 12 + net/netfilter/x_tables.c | 3 net/nfc/nci/core.c | 1 net/nfc/nci/hci.c | 5 net/sched/sch_dsmark.c | 3 net/tipc/msg.c | 9 - net/tipc/socket.c | 5 net/wireless/util.c | 15 +- 81 files changed, 550 insertions(+), 258 deletions(-)
Alaa Emad (1):
media: dvb: Add check on sp8870_readreg return
Alexander Usyskin (1):
mei: request autosuspend after sending rx flow control
Anirudh Rayabharam (1):
net: fujitsu: fix potential null-ptr-deref
Christophe JAILLET (1):
net: netcp: Fix an error message
Chunfeng Yun (1):
usb: core: reduce power-on-good delay time of root hub
Dan Carpenter (3):
NFS: fix an incorrect limit in filelayout_decode_layout()
staging: emxx_udc: fix loop in _nbu2ss_nuke()
scsi: libsas: Use _safe() loop in sas_resume_port()
Daniele Palmas (1):
USB: serial: option: add Telit LE910-S1 compositions 0x7010, 0x7011
Dominik Andreas Schorpp (1):
USB: serial: ftdi_sio: add IDs for IDS GmbH Products
Dongliang Mu (2):
NFC: nci: fix memory leak in nci_allocate_device misc/uss720: fix memory leak in uss720_probe
Du Cheng (1):
net: caif: remove BUG_ON(dev == NULL) in caif_xmit
Greg Kroah-Hartman (4):
kgdb: fix gcc-11 warnings harder
libertas: register sysfs groups properly
media: gspca: properly check for errors in po1030_probe() Linux 4.4.271
H. Peter Anvin (1):
x86, asm: change the GEN_*_RMWcc() macros to not quote the condition
Hoang Le (1):
Revert "net:tipc: Fix a double free in tipc_sk_mcast_rcv"
Jan Beulich (2):
x86/asm: Add instruction suffixes to bitops
x86/entry/64: Add instruction suffix
Jean Delvare (1):
i2c: i801: Don't generate an interrupt on bus reset
Johan Hovold (2):
net: hso: fix control-request directions
USB: trancevibrator: fix control-request direction
Johannes Berg (5):
mac80211: drop A-MSDUs on old ciphers
mac80211: add fragment cache to sta_info
mac80211: check defrag PN against current frame
mac80211: prevent attacks on TKIP/WEP as well
mac80211: do not accept/forward invalid EAPOL frames
Josef Bacik (1):
btrfs: do not BUG_ON in link_to_fixup_dir
Kai-Heng Feng (1):
platform/x86: hp_accel: Avoid invoking _INI to speed up resume
Kees Cook (1):
proc: Check /proc/$pid/attr/ writes against file opener
Krzysztof Kozlowski (1):
i2c: s3c2410: fix possible NULL pointer deref on read message after write
Lin Ma (1):
bluetooth: eliminate the potential race condition when removing the HCI controller
Lucas Stankus (1):
staging: iio: cdc: ad7746: avoid overwrite of num_channels
Lukas Wunner (1):
spi: spi-sh: Fix use-after-free on unbind
Mark Tomlinson (1):
netfilter: x_tables: Use correct memory barriers.
Mathy Vanhoef (4):
mac80211: assure all fragments are encrypted
mac80211: prevent mixed key and fragment cache attacks
mac80211: properly handle A-MSDUs that start with an RFC 1042 header
cfg80211: mitigate A-MSDU aggregation attacks
Matt Wang (1):
scsi: BusLogic: Fix 64-bit system enumeration error for Buslogic
Mike Kravetz (1):
hugetlbfs: hugetlb_fault_mutex_hash() cleanup
Mikulas Patocka (1):
dm snapshot: properly fix a crash when an origin has no snapshots
Pavel Skripkin (1):
net: usb: fix memory leak in smsc75xx_bind
Peter Zijlstra (1):
openrisc: Define memory barrier mb
Phillip Potter (1):
isdn: mISDNinfineon: check/cleanup ioremap failure correctly in setup_io
Randy Dunlap (2):
MIPS: alchemy: xxs1500: add gpio-au1000.h header file
MIPS: ralink: export rt_sysc_membase for rt2880_wdt.c
Stephen Brennan (1):
mm, vmstat: drop zone->lock in /proc/pagetypeinfo
Taehee Yoo (2):
mld: fix panic in mld_newpack()
sch_dsmark: fix a NULL deref in qdisc_reset()
Thadeu Lima de Souza Cascardo (1):
Bluetooth: cmtp: fix file refcount when cmtp_attach_device fails
Tom Seewald (1):
char: hpet: add checks after calling ioremap
Trond Myklebust (1):
NFS: Don't corrupt the value of pg_bytes_written in nfs_do_recoalesce()
Vladyslav Tarasiuk (1):
net/mlx4: Fix EEPROM dump support
Wen Gong (1):
mac80211: extend protection against mixed key and fragment cache attacks
William A. Kennington III (1):
spi: Fix use-after-free with devm_spi_alloc_*
Xin Long (1):
tipc: skb_linearize the head skb when reassembling msgs
YueHaibing (1):
iio: adc: ad7793: Add missing error code in ad7793_setup()
Zhang Xiaoxu (1):
NFSv4: Fix v4.0/v4.1 SEEK_DATA return -ENOTSUPP when set NFS_V4_2 config
Zhen Lei (1):
net: bnx2: Fix error return code in bnx2_init_board()
Zheyu Ma (1):
serial: rp2: use 'request_firmware' instead of 'request_firmware_nowait'
Zolton Jheng (1):
USB: serial: pl2303: add device id for ADLINK ND-6530 GC
xinhui pan (1):
drm/amdgpu: Fix a use-after-free
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 4 -SUBLEVEL = 270 +SUBLEVEL = 271 EXTRAVERSION = NAME = Blurry Fish Butt
arch/mips/alchemy/board-xxs1500.c +1 -0
@@ -30,6 +30,7 @@#include <asm/bootinfo.h> #include <asm/reboot.h> #include <asm/mach-au1x00/au1000.h> +#include <asm/mach-au1x00/gpio-au1000.h> #include <prom.h> const char *get_system_type (void )
arch/mips/ralink/of.c +2 -0
@@ -10,6 +10,7 @@#include <linux/io.h> #include <linux/clk.h> +#include <linux/export.h> #include <linux/init.h> #include <linux/sizes.h> #include <linux/of_fdt.h>
@@ -27,6 +28,7 @@__iomem void *rt_sysc_membase;__iomem void *rt_memc_membase; +EXPORT_SYMBOL_GPL (rt_sysc_membase);__iomem void *plat_of_remap_node (const char *node) {
arch/openrisc/include/asm/barrier.h new file +9 -0
@@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_BARRIER_H +#define __ASM_BARRIER_H + +#define mb () asm volatile ("l.msync" ::: "memory") + +#include <asm-generic/barrier.h> + +#endif /* __ASM_BARRIER_H */
arch/x86/entry/entry_64.S +1 -1
@@ -57,7 +57,7 @@ ENDPROC(native_usergs_sysret64) .macro TRACE_IRQS_IRETQ #ifdef CONFIG_TRACE_IRQFLAGS - bt $9, EFLAGS(%rsp) /* interrupts off? */ + btl $9, EFLAGS(%rsp) /* interrupts off? */ jnc 1f TRACE_IRQS_ON 1:
arch/x86/include/asm/atomic.h +4 -4
@@ -77,7 +77,7 @@ static __always_inline void atomic_sub(int i, atomic_t *v)*/ static __always_inline int atomic_sub_and_test(int i, atomic_t *v) { -GEN_BINARY_RMWcc (LOCK_PREFIX "subl" , v->counter,"er" , i,"%0" ,"e" ); +GEN_BINARY_RMWcc (LOCK_PREFIX "subl" , v->counter,"er" , i,"%0" , e); }/**
@@ -114,7 +114,7 @@ static __always_inline void atomic_dec(atomic_t *v)*/ static __always_inline int atomic_dec_and_test(atomic_t *v) { -GEN_UNARY_RMWcc (LOCK_PREFIX "decl" , v->counter,"%0" ,"e" ); +GEN_UNARY_RMWcc (LOCK_PREFIX "decl" , v->counter,"%0" , e); }/**
@@ -127,7 +127,7 @@ static __always_inline int atomic_dec_and_test(atomic_t *v)*/ static __always_inline int atomic_inc_and_test(atomic_t *v) { -GEN_UNARY_RMWcc (LOCK_PREFIX "incl" , v->counter,"%0" ,"e" ); +GEN_UNARY_RMWcc (LOCK_PREFIX "incl" , v->counter,"%0" , e); }/**
@@ -141,7 +141,7 @@ static __always_inline int atomic_inc_and_test(atomic_t *v)*/ static __always_inline int atomic_add_negative(int i, atomic_t *v) { -GEN_BINARY_RMWcc (LOCK_PREFIX "addl" , v->counter,"er" , i,"%0" ,"s" ); +GEN_BINARY_RMWcc (LOCK_PREFIX "addl" , v->counter,"er" , i,"%0" , s); }/**
arch/x86/include/asm/atomic64_64.h +4 -4
@@ -72,7 +72,7 @@ static inline void atomic64_sub(long i, atomic64_t *v)*/ static inline int atomic64_sub_and_test (long i,atomic64_t *v) { -GEN_BINARY_RMWcc (LOCK_PREFIX "subq" , v->counter,"er" , i,"%0" ,"e" ); +GEN_BINARY_RMWcc (LOCK_PREFIX "subq" , v->counter,"er" , i,"%0" , e); }/**
@@ -111,7 +111,7 @@ static __always_inline void atomic64_dec(atomic64_t *v)*/ static inline int atomic64_dec_and_test (atomic64_t *v) { -GEN_UNARY_RMWcc (LOCK_PREFIX "decq" , v->counter,"%0" ,"e" ); +GEN_UNARY_RMWcc (LOCK_PREFIX "decq" , v->counter,"%0" , e); }/**
@@ -124,7 +124,7 @@ static inline int atomic64_dec_and_test(atomic64_t *v)*/ static inline int atomic64_inc_and_test (atomic64_t *v) { -GEN_UNARY_RMWcc (LOCK_PREFIX "incq" , v->counter,"%0" ,"e" ); +GEN_UNARY_RMWcc (LOCK_PREFIX "incq" , v->counter,"%0" , e); }/**
@@ -138,7 +138,7 @@ static inline int atomic64_inc_and_test(atomic64_t *v)*/ static inline int atomic64_add_negative (long i,atomic64_t *v) { -GEN_BINARY_RMWcc (LOCK_PREFIX "addq" , v->counter,"er" , i,"%0" ,"s" ); +GEN_BINARY_RMWcc (LOCK_PREFIX "addq" , v->counter,"er" , i,"%0" , s); }/**
arch/x86/include/asm/bitops.h +16 -13
@@ -77,7 +77,7 @@ set_bit(long nr, volatile unsigned long *addr) : "iq" ((u8)CONST_MASK(nr)) : "memory"); } else { - asm volatile(LOCK_PREFIX "bts %1,%0" + asm volatile(LOCK_PREFIX __ASM_SIZE(bts) " %1,%0" : BITOP_ADDR(addr) : "Ir" (nr) : "memory"); } }
@@ -93,7 +93,7 @@ set_bit(long nr, volatile unsigned long *addr)*/ static inline void __set_bit (long nr,volatile unsigned long *addr) { - asm volatile("bts %1,%0" : ADDR : "Ir" (nr) : "memory"); + asm volatile(__ASM_SIZE(bts) " %1,%0" : ADDR : "Ir" (nr) : "memory"); }/**
@@ -114,7 +114,7 @@ clear_bit(long nr, volatile unsigned long *addr) : CONST_MASK_ADDR(nr, addr) : "iq" ((u8)~CONST_MASK(nr))); }else { - asm volatile(LOCK_PREFIX "btr %1,%0" + asm volatile(LOCK_PREFIX __ASM_SIZE(btr) " %1,%0" : BITOP_ADDR(addr) : "Ir" (nr)); }
@@ -136,7 +136,7 @@ static inline void clear_bit_unlock(long nr, volatile unsigned long *addr)static inline void __clear_bit (long nr,volatile unsigned long *addr) { - asm volatile("btr %1,%0" : ADDR : "Ir" (nr)); + asm volatile(__ASM_SIZE(btr) " %1,%0" : ADDR : "Ir" (nr)); }/*
@@ -168,7 +168,7 @@ static inline void __clear_bit_unlock(long nr, volatile unsigned long *addr)*/ static inline void __change_bit (long nr,volatile unsigned long *addr) { - asm volatile("btc %1,%0" : ADDR : "Ir" (nr)); + asm volatile(__ASM_SIZE(btc) " %1,%0" : ADDR : "Ir" (nr)); }/**
@@ -187,7 +187,7 @@ static inline void change_bit(long nr, volatile unsigned long *addr) : CONST_MASK_ADDR(nr, addr) : "iq" ((u8)CONST_MASK(nr))); }else { - asm volatile(LOCK_PREFIX "btc %1,%0" + asm volatile(LOCK_PREFIX __ASM_SIZE(btc) " %1,%0" : BITOP_ADDR(addr) : "Ir" (nr)); }
@@ -203,7 +203,8 @@ static inline void change_bit(long nr, volatile unsigned long *addr)*/ static inline int test_and_set_bit (long nr,volatile unsigned long *addr) { -GEN_BINARY_RMWcc (LOCK_PREFIX "bts" , *addr,"Ir" , nr,"%0" ,"c" ); + GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(bts), + *addr, "Ir", nr, "%0", c); }/**
@@ -232,7 +233,7 @@ static inline int __test_and_set_bit(long nr, volatile unsigned long *addr) {int oldbit; - asm("bts %2,%1\n\t" + asm(__ASM_SIZE(bts) " %2,%1\n\t""sbb %0,%0" : "=r" (oldbit), ADDR :"Ir" (nr));
@@ -249,7 +250,8 @@ static inline int __test_and_set_bit(long nr, volatile unsigned long *addr)*/ static inline int test_and_clear_bit (long nr,volatile unsigned long *addr) { -GEN_BINARY_RMWcc (LOCK_PREFIX "btr" , *addr,"Ir" , nr,"%0" ,"c" ); + GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(btr), + *addr, "Ir", nr, "%0", c); }/**
@@ -272,7 +274,7 @@ static inline int __test_and_clear_bit(long nr, volatile unsigned long *addr) {int oldbit; - asmvolatile ("btr %2,%1\n\t" + asm volatile(__ASM_SIZE(btr) " %2,%1\n\t""sbb %0,%0" : "=r" (oldbit), ADDR :"Ir" (nr));
@@ -284,7 +286,7 @@ static inline int __test_and_change_bit(long nr, volatile unsigned long *addr) {int oldbit; - asmvolatile ("btc %2,%1\n\t" + asm volatile(__ASM_SIZE(btc) " %2,%1\n\t""sbb %0,%0" : "=r" (oldbit), ADDR :"Ir" (nr) :"memory" );
@@ -302,7 +304,8 @@ static inline int __test_and_change_bit(long nr, volatile unsigned long *addr)*/ static inline int test_and_change_bit (long nr,volatile unsigned long *addr) { -GEN_BINARY_RMWcc (LOCK_PREFIX "btc" , *addr,"Ir" , nr,"%0" ,"c" ); + GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(btc), + *addr, "Ir", nr, "%0", c); } static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr)
@@ -315,7 +318,7 @@ static inline int variable_test_bit(long nr, volatile const unsigned long *addr) {int oldbit; - asmvolatile ("bt %2,%1\n\t" + asm volatile(__ASM_SIZE(bt) " %2,%1\n\t""sbb %0,%0" :"=r" (oldbit) :"m" (*(unsigned long *)addr),"Ir" (nr));
arch/x86/include/asm/local.h +4 -4
@@ -52,7 +52,7 @@ static inline void local_sub(long i, local_t *l)*/ static inline int local_sub_and_test (long i,local_t *l) { -GEN_BINARY_RMWcc (_ASM_SUB, l->a.counter,"er" , i,"%0" ,"e" ); +GEN_BINARY_RMWcc (_ASM_SUB, l->a.counter,"er" , i,"%0" , e); }/**
@@ -65,7 +65,7 @@ static inline int local_sub_and_test(long i, local_t *l)*/ static inline int local_dec_and_test (local_t *l) { -GEN_UNARY_RMWcc (_ASM_DEC, l->a.counter,"%0" ,"e" ); +GEN_UNARY_RMWcc (_ASM_DEC, l->a.counter,"%0" , e); }/**
@@ -78,7 +78,7 @@ static inline int local_dec_and_test(local_t *l)*/ static inline int local_inc_and_test (local_t *l) { -GEN_UNARY_RMWcc (_ASM_INC, l->a.counter,"%0" ,"e" ); +GEN_UNARY_RMWcc (_ASM_INC, l->a.counter,"%0" , e); }/**
@@ -92,7 +92,7 @@ static inline int local_inc_and_test(local_t *l)*/ static inline int local_add_negative (long i,local_t *l) { -GEN_BINARY_RMWcc (_ASM_ADD, l->a.counter,"er" , i,"%0" ,"s" ); +GEN_BINARY_RMWcc (_ASM_ADD, l->a.counter,"er" , i,"%0" , s); }/**
arch/x86/include/asm/percpu.h +1 -1
@@ -534,7 +534,7 @@ static inline int x86_this_cpu_variable_test_bit(int nr, {int oldbit; - asm volatile("bt "__percpu_arg(2)",%1\n\t" + asm volatile("btl "__percpu_arg(2)",%1\n\t" "sbb %0,%0" : "=r" (oldbit) : "m" (*(unsigned long *)addr), "Ir" (nr));
arch/x86/include/asm/preempt.h +1 -1
@@ -81,7 +81,7 @@ static __always_inline void __preempt_count_sub(int val)*/ static __always_inline bool __preempt_count_dec_and_test(void) { -GEN_UNARY_RMWcc ("decl" , __preempt_count,__percpu_arg (0 ),"e" ); +GEN_UNARY_RMWcc ("decl" , __preempt_count,__percpu_arg (0 ), e); }/*
arch/x86/include/asm/rmwcc.h +2 -2
@@ -5,7 +5,7 @@#define __GEN_RMWcc (fullop, var, cc, ...) \ do { \ - asm_volatile_goto (fullop "; j" cc " %l[cc_label]" \ + asm_volatile_goto (fullop "; j" #cc " %l[cc_label]" \ : : "m" (var), ## __VA_ARGS__ \ : "memory" : cc_label); \ return 0; \
@@ -24,7 +24,7 @@ cc_label: \#define __GEN_RMWcc (fullop, var, cc, ...) \ do { \ char c; \ - asm volatile (fullop "; set" cc " %1" \ + asm volatile (fullop "; set" #cc " %1" \ : "+m" (var), "=qm" (c) \ : __VA_ARGS__ : "memory"); \ return c != 0; \
drivers/char/hpet.c +4 -0
@@ -976,6 +976,8 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)if (ACPI_SUCCESS (status)) { hdp->hd_phys_address = addr.address.minimum; hdp->hd_address =ioremap (addr.address.minimum, addr.address.address_length); +if (!hdp->hd_address) +return AE_ERROR ;if (hpet_is_known (hdp)) {iounmap (hdp->hd_address);
@@ -989,6 +991,8 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data) hdp->hd_phys_address = fixmem32->address; hdp->hd_address =ioremap (fixmem32->address,HPET_RANGE_SIZE ); +if (!hdp->hd_address) +return AE_ERROR ;if (hpet_is_known (hdp)) {iounmap (hdp->hd_address);
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -0
@@ -737,6 +737,7 @@ static void amdgpu_ttm_tt_unpopulate(struct ttm_tt *ttm)if (gtt && gtt->userptr) {kfree (ttm->sg); + ttm->sg =NULL ; ttm->page_flags &= ~TTM_PAGE_FLAG_SG ;return ; }
drivers/i2c/busses/i2c-i801.c +2 -4
@@ -327,11 +327,9 @@ static int i801_check_post(struct i801_priv *priv, int status)dev_err (&priv->pci_dev->dev,"Transaction timeout\n" );/* try to stop the current command */ dev_dbg (&priv->pci_dev->dev,"Terminating the current operation\n" ); -outb_p (inb_p (SMBHSTCNT (priv)) |SMBHSTCNT_KILL , -SMBHSTCNT (priv)); +outb_p (SMBHSTCNT_KILL ,SMBHSTCNT (priv));usleep_range (1000 ,2000 ); -outb_p (inb_p (SMBHSTCNT (priv)) & (~SMBHSTCNT_KILL ), -SMBHSTCNT (priv)); +outb_p (0 ,SMBHSTCNT (priv));/* Check if it worked */ status =inb_p (SMBHSTSTS (priv));
drivers/i2c/busses/i2c-s3c2410.c +3 -1
@@ -499,8 +499,10 @@ static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)/* cannot do this, the controller * forces us to send a new START * when we change direction */ - +dev_dbg (i2c->dev, +"missing START before write->read\n" );s3c24xx_i2c_stop (i2c, -EINVAL ); +break ; } goto retry_write;
drivers/iio/adc/ad7793.c +1 -0
@@ -279,6 +279,7 @@ static int ad7793_setup(struct iio_dev *indio_dev, id &=AD7793_ID_MASK ;if (id != st->chip_info->id) { + ret = -ENODEV ;dev_err (&st->sd.spi->dev,"device ID query failed\n" ); goto out; }
drivers/isdn/hardware/mISDN/mISDNinfineon.c +16 -8
@@ -645,17 +645,19 @@ static void release_io(struct inf_hw *hw) {if (hw->cfg.mode) { -if (hw->cfg.p) { +if (hw->cfg.mode ==AM_MEMIO ) {release_mem_region (hw->cfg.start, hw->cfg.size); -iounmap (hw->cfg.p); +if (hw->cfg.p) +iounmap (hw->cfg.p); }else release_region (hw->cfg.start, hw->cfg.size); hw->cfg.mode =AM_NONE ; }if (hw->addr.mode) { -if (hw->addr.p) { +if (hw->addr.mode ==AM_MEMIO ) {release_mem_region (hw->addr.start, hw->addr.size); -iounmap (hw->addr.p); +if (hw->addr.p) +iounmap (hw->addr.p); }else release_region (hw->addr.start, hw->addr.size); hw->addr.mode =AM_NONE ;
@@ -685,9 +687,12 @@ setup_io(struct inf_hw *hw) (ulong)hw->cfg.start, (ulong)hw->cfg.size);return err; } -if (hw->ci->cfg_mode ==AM_MEMIO ) - hw->cfg.p =ioremap (hw->cfg.start, hw->cfg.size); hw->cfg.mode = hw->ci->cfg_mode; +if (hw->ci->cfg_mode ==AM_MEMIO ) { + hw->cfg.p =ioremap (hw->cfg.start, hw->cfg.size); +if (!hw->cfg.p) +return -ENOMEM ; + }if (debug &DEBUG_HW ) pr_notice("%s: IO cfg %lx (%lu bytes) mode%d\n", hw->name, (ulong)hw->cfg.start,
@@ -712,9 +717,12 @@ setup_io(struct inf_hw *hw) (ulong)hw->addr.start, (ulong)hw->addr.size);return err; } -if (hw->ci->addr_mode ==AM_MEMIO ) - hw->addr.p =ioremap (hw->addr.start, hw->addr.size); hw->addr.mode = hw->ci->addr_mode; +if (hw->ci->addr_mode ==AM_MEMIO ) { + hw->addr.p =ioremap (hw->addr.start, hw->addr.size); +if (!hw->addr.p) +return -ENOMEM ; + }if (debug &DEBUG_HW ) pr_notice("%s: IO addr %lx (%lu bytes) mode%d\n", hw->name, (ulong)hw->addr.start,
drivers/md/dm-snap.c +1 -1
@@ -789,7 +789,7 @@ static int dm_add_exception(void *context, chunk_t old, chunk_t new)static uint32_t __minimum_chunk_size (struct origin *o) {struct dm_snapshot *snap; -unsigned chunk_size =0 ; +unsigned chunk_size =rounddown_pow_of_two (UINT_MAX );if (o)list_for_each_entry (snap, &o->snapshots, list)
drivers/media/dvb-frontends/sp8870.c +3 -1
@@ -293,7 +293,9 @@ static int sp8870_set_frontend_parameters(struct dvb_frontend *fe)sp8870_writereg (state,0xc05 , reg0xc05);// read status reg in order to clear pending irqs -sp8870_readreg (state,0x200 ); + err =sp8870_readreg (state,0x200 ); +if (err <0 ) +return err;// system controller start sp8870_microcontroller_start (state);
drivers/media/usb/gspca/m5602/m5602_po1030.c +7 -3
@@ -55,6 +55,7 @@ static const struct v4l2_ctrl_config po1030_greenbal_cfg = {int po1030_probe (struct sd *sd) {u8 dev_id_h =0 , i; +int err;struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;if (force_sensor) {
@@ -73,10 +74,13 @@ int po1030_probe(struct sd *sd)for (i =0 ; i <ARRAY_SIZE (preinit_po1030); i++) {u8 data = preinit_po1030[i][2 ];if (preinit_po1030[i][0 ] ==SENSOR ) -m5602_write_sensor (sd, - preinit_po1030[i][1 ], &data,1 ); + err =m5602_write_sensor (sd, preinit_po1030[i][1 ], + &data,1 );else -m5602_write_bridge (sd, preinit_po1030[i][1 ], data); + err =m5602_write_bridge (sd, preinit_po1030[i][1 ], + data); +if (err <0 ) +return err; }if (m5602_read_sensor (sd,PO1030_DEVID_H , &dev_id_h,1 ))
drivers/misc/kgdbts.c +2 -1
@@ -110,8 +110,9 @@ printk(KERN_INFO a); \ }while (0 ) #define v2printk(a...) do { \ -if (verbose >1 ) \ +if (verbose >1 ) { \ printk(KERN_INFO a); \ + } \touch_nmi_watchdog (); \ } while (0) #define eprintk(a...) do { \
drivers/misc/lis3lv02d/lis3lv02d.h +1 -0
@@ -284,6 +284,7 @@ struct lis3lv02d {int regs_size;u8 *reg_cache;bool regs_stored; +bool init_required;u8 odr_mask;/* ODR bit mask */ u8 whoami;/* indicates measurement precision */ s16 (*read_data) (struct lis3lv02d *lis3,int reg);
drivers/misc/mei/interrupt.c +3 -0
@@ -220,6 +220,9 @@ static int mei_cl_irq_read(struct mei_cl *cl, struct mei_cl_cb *cb,return ret; } +pm_runtime_mark_last_busy (dev->dev); +pm_request_autosuspend (dev->dev); +list_move_tail (&cb->list, &cl->rd_pending);return 0 ;
drivers/net/caif/caif_serial.c +0 -1
@@ -281,7 +281,6 @@ static int caif_xmit(struct sk_buff *skb, struct net_device *dev) {struct ser_device *ser; -BUG_ON (dev ==NULL ); ser =netdev_priv (dev);/* Send flow off once, on high water mark */
drivers/net/ethernet/broadcom/bnx2.c +1 -1
@@ -8234,9 +8234,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)BNX2_WR (bp,PCI_COMMAND , reg); }else if ((BNX2_CHIP_ID (bp) ==BNX2_CHIP_ID_5706_A1 ) && !(bp->flags &BNX2_FLAG_PCIX )) { -dev_err (&pdev->dev,"5706 A1 can only be used in a PCIX bus, aborting\n" ); + rc = -EPERM ; goto err_out_unmap; }
drivers/net/ethernet/fujitsu/fmvj18x_cs.c +5 -0
@@ -548,6 +548,11 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)return -1 ; base =ioremap (link->resource[2 ]->start,resource_size (link->resource[2 ])); +if (!base) { +pcmcia_release_window (link, link->resource[2 ]); +return -1 ; + } +pcmcia_map_mem_page (link, link->resource[2 ],0 );/*
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +1 -3
@@ -1907,8 +1907,6 @@ static int mlx4_en_set_tunable(struct net_device *dev,return ret; } -#define MLX4_EEPROM_PAGE_LEN 256 -static int mlx4_en_get_module_info (struct net_device *dev,struct ethtool_modinfo *modinfo) {
@@ -1943,7 +1941,7 @@ static int mlx4_en_get_module_info(struct net_device *dev,break ;case MLX4_MODULE_ID_SFP : modinfo->type =ETH_MODULE_SFF_8472 ; - modinfo->eeprom_len =MLX4_EEPROM_PAGE_LEN ; + modinfo->eeprom_len =ETH_MODULE_SFF_8472_LEN ;break ;default :return -ENOSYS ;
drivers/net/ethernet/mellanox/mlx4/port.c +103 -4
138 lines not on this page · raw message
drivers/net/ethernet/ti/netcp_core.c +1 -1
@@ -1284,9 +1284,9 @@ int netcp_txpipe_open(struct netcp_tx_pipe *tx_pipe) tx_pipe->dma_queue =knav_queue_open (name, tx_pipe->dma_queue_id,KNAV_QUEUE_SHARED );if (IS_ERR (tx_pipe->dma_queue)) { + ret =PTR_ERR (tx_pipe->dma_queue);dev_err (dev,"Could not open DMA queue for channel \"%s\": %d\n" , name, ret); - ret =PTR_ERR (tx_pipe->dma_queue); goto err; }
drivers/net/usb/hso.c +2 -2
@@ -1710,7 +1710,7 @@ static int hso_serial_tiocmset(struct tty_struct *tty,spin_unlock_irqrestore (&serial->serial_lock, flags);return usb_control_msg (serial->parent->usb, -usb_rcvctrlpipe (serial->parent->usb,0 ),0x22 , +usb_sndctrlpipe (serial->parent->usb,0 ),0x22 ,0x21 , val, if_num,NULL ,0 ,USB_CTRL_SET_TIMEOUT ); }
@@ -2461,7 +2461,7 @@ static int hso_rfkill_set_block(void *data, bool blocked)if (hso_dev->usb_gone) rv =0 ;else - rv =usb_control_msg (hso_dev->usb,usb_rcvctrlpipe (hso_dev->usb,0 ), + rv =usb_control_msg (hso_dev->usb,usb_sndctrlpipe (hso_dev->usb,0 ), enabled ?0x82 :0x81 ,0x40 ,0 ,0 ,NULL ,0 ,USB_CTRL_SET_TIMEOUT );mutex_unlock (&hso_dev->mutex);
drivers/net/usb/smsc75xx.c +6 -2
@@ -1485,7 +1485,7 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) ret =smsc75xx_wait_ready (dev,0 );if (ret <0 ) {netdev_warn (dev->net,"device not ready in smsc75xx_bind\n" ); -return ret; + goto err; }smsc75xx_init_mac_address (dev);
@@ -1494,7 +1494,7 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) ret =smsc75xx_reset (dev);if (ret <0 ) {netdev_warn (dev->net,"smsc75xx_reset error %d\n" , ret); -return ret; + goto err; } dev->net->netdev_ops = &smsc75xx_netdev_ops;
@@ -1503,6 +1503,10 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) dev->net->hard_header_len +=SMSC75XX_TX_OVERHEAD ; dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;return 0 ; + +err: +kfree (pdata); +return ret; }static void smsc75xx_unbind (struct usbnet *dev,struct usb_interface *intf)
drivers/net/wireless/libertas/mesh.c +4 -24
@@ -797,19 +797,6 @@ static const struct attribute_group mesh_ie_group = { .attrs = mesh_ie_attrs, }; -static void lbs_persist_config_init (struct net_device *dev) -{ -int ret; - ret =sysfs_create_group (&(dev->dev.kobj), &boot_opts_group); - ret =sysfs_create_group (&(dev->dev.kobj), &mesh_ie_group); -} - -static void lbs_persist_config_remove (struct net_device *dev) -{ -sysfs_remove_group (&(dev->dev.kobj), &boot_opts_group); -sysfs_remove_group (&(dev->dev.kobj), &mesh_ie_group); -} -/*************************************************************************** * Initializing and starting, stopping mesh
@@ -1021,6 +1008,10 @@ static int lbs_add_mesh(struct lbs_private *priv)SET_NETDEV_DEV (priv->mesh_dev, priv->dev->dev.parent); mesh_dev->flags |=IFF_BROADCAST |IFF_MULTICAST ; + mesh_dev->sysfs_groups[0 ] = &lbs_mesh_attr_group; + mesh_dev->sysfs_groups[1 ] = &boot_opts_group; + mesh_dev->sysfs_groups[2 ] = &mesh_ie_group; +/* Register virtual mesh interface */ ret =register_netdev (mesh_dev);if (ret) {
@@ -1028,19 +1019,10 @@ static int lbs_add_mesh(struct lbs_private *priv) goto err_free_netdev; } - ret =sysfs_create_group (&(mesh_dev->dev.kobj), &lbs_mesh_attr_group); -if (ret) - goto err_unregister; - -lbs_persist_config_init (mesh_dev); -/* Everything successful */ ret =0 ; goto done; -err_unregister: -unregister_netdev (mesh_dev); - err_free_netdev:free_netdev (mesh_dev);
@@ -1063,8 +1045,6 @@ void lbs_remove_mesh(struct lbs_private *priv)lbs_deb_enter (LBS_DEB_MESH );netif_stop_queue (mesh_dev);netif_carrier_off (mesh_dev); -sysfs_remove_group (&(mesh_dev->dev.kobj), &lbs_mesh_attr_group); -lbs_persist_config_remove (mesh_dev);unregister_netdev (mesh_dev); priv->mesh_dev =NULL ;kfree (mesh_dev->ieee80211_ptr);
drivers/platform/x86/hp_accel.c +21 -1
@@ -101,6 +101,9 @@ MODULE_DEVICE_TABLE(acpi, lis3lv02d_device_ids);static int lis3lv02d_acpi_init (struct lis3lv02d *lis3) {struct acpi_device *dev = lis3->bus_priv; +if (!lis3->init_required) +return 0 ; +if (acpi_evaluate_object (dev->handle,METHOD_NAME__INI ,NULL ,NULL ) !=AE_OK )return -EINVAL ;
@@ -361,6 +364,7 @@ static int lis3lv02d_add(struct acpi_device *device) }/* call the core layer do its init */ + lis3_dev.init_required = true; ret =lis3lv02d_init_device (&lis3_dev);if (ret)return ret;
@@ -408,11 +412,27 @@ static int lis3lv02d_suspend(struct device *dev)static int lis3lv02d_resume (struct device *dev) { + lis3_dev.init_required = false; +lis3lv02d_poweron (&lis3_dev); +return 0 ; +} + +static int lis3lv02d_restore (struct device *dev) +{ + lis3_dev.init_required = true;lis3lv02d_poweron (&lis3_dev);return 0 ; } -static SIMPLE_DEV_PM_OPS(hp_accel_pm, lis3lv02d_suspend, lis3lv02d_resume); +static const struct dev_pm_ops hp_accel_pm = { + .suspend = lis3lv02d_suspend, + .resume = lis3lv02d_resume, + .freeze = lis3lv02d_suspend, + .thaw = lis3lv02d_resume, + .poweroff = lis3lv02d_suspend, + .restore = lis3lv02d_restore, +}; +#define HP_ACCEL_PM (&hp_accel_pm)#else #define HP_ACCEL_PM NULL
drivers/scsi/BusLogic.c +3 -3
@@ -3081,11 +3081,11 @@ static int blogic_qcmd_lck(struct scsi_cmnd *command, ccb->opcode =BLOGIC_INITIATOR_CCB_SG ; ccb->datalen = count *sizeof (struct blogic_sg_seg );if (blogic_multimaster_type (adapter)) - ccb->data = (void *)((unsigned int ) ccb->dma_handle + + ccb->data = (unsigned int ) ccb->dma_handle + ((unsigned long ) &ccb->sglist - - (unsigned long ) ccb)); + (unsigned long ) ccb);else - ccb->data = ccb->sglist; + ccb->data =virt_to_32bit_virt (ccb->sglist);scsi_for_each_sg (command, sg, count, i) { ccb->sglist[i].segbytes =sg_dma_len (sg);
drivers/scsi/BusLogic.h +1 -1
@@ -821,7 +821,7 @@ struct blogic_ccb {unsigned char cdblen;/* Byte 2 */ unsigned char sense_datalen;/* Byte 3 */ u32 datalen;/* Bytes 4-7 */ -void *data;/* Bytes 8-11 */ +u32 data;/* Bytes 8-11 */ unsigned char:8; /* Byte 12 */ unsigned char:8; /* Byte 13 */enum blogic_adapter_status adapter_status;/* Byte 14 */
drivers/scsi/libsas/sas_port.c +2 -2
@@ -41,7 +41,7 @@ static bool phy_is_wideport_member(struct asd_sas_port *port, struct asd_sas_phystatic void sas_resume_port (struct asd_sas_phy *phy) { -struct domain_device *dev; +struct domain_device *dev, *n;struct asd_sas_port *port = phy->port;struct sas_ha_struct *sas_ha = phy->ha;struct sas_internal *si =to_sas_internal (sas_ha->core.shost->transportt);
@@ -60,7 +60,7 @@ static void sas_resume_port(struct asd_sas_phy *phy)* 1/ presume every device came back * 2/ force the next revalidation to check all expander phys */ -list_for_each_entry (dev, &port->dev_list, dev_list_node) { +list_for_each_entry_safe (dev, n, &port->dev_list, dev_list_node) {int i, rc; rc =sas_notify_lldd_dev_found (dev);
drivers/spi/spi-sh.c +4 -10
@@ -451,7 +451,7 @@ static int spi_sh_probe(struct platform_device *pdev)return -ENODEV ; } - master =spi_alloc_master (&pdev->dev,sizeof (struct spi_sh_data )); + master =devm_spi_alloc_master (&pdev->dev,sizeof (struct spi_sh_data ));if (master ==NULL ) {dev_err (&pdev->dev,"spi_alloc_master error.\n" );return -ENOMEM ;
@@ -469,16 +469,14 @@ static int spi_sh_probe(struct platform_device *pdev)break ;default :dev_err (&pdev->dev,"No support width\n" ); - ret = -ENODEV ; - goto error1; +return -ENODEV ; } ss->irq = irq; ss->master = master; ss->addr =devm_ioremap (&pdev->dev, res->start,resource_size (res));if (ss->addr ==NULL ) {dev_err (&pdev->dev,"ioremap error.\n" ); - ret = -ENOMEM ; - goto error1; +return -ENOMEM ; }INIT_LIST_HEAD (&ss->queue);spin_lock_init (&ss->lock);
@@ -488,8 +486,7 @@ static int spi_sh_probe(struct platform_device *pdev) dev_name(master->dev.parent));if (ss->workqueue ==NULL ) {dev_err (&pdev->dev,"create workqueue error\n" ); - ret = -EBUSY ; - goto error1; +return -EBUSY ; } ret =request_irq (irq, spi_sh_irq,0 ,"spi_sh" , ss);
@@ -516,9 +513,6 @@ static int spi_sh_probe(struct platform_device *pdev)free_irq (irq, ss); error2:destroy_workqueue (ss->workqueue); - error1: -spi_master_put (master); -return ret; }
drivers/spi/spi.c +2 -7
@@ -1762,6 +1762,7 @@ struct spi_master *devm_spi_alloc_master(struct device *dev, unsigned int size) master =spi_alloc_master (dev, size);if (master) { + master->devm_allocated = true; *ptr = master;devres_add (dev, ptr); }else {
@@ -1951,11 +1952,6 @@ int devm_spi_register_master(struct device *dev, struct spi_master *master) }EXPORT_SYMBOL_GPL (devm_spi_register_master); -static int devm_spi_match_master (struct device *dev,void *res,void *master) -{ -return *(struct spi_master **)res == master; -} -static int __unregister (struct device *dev,void *null) {spi_unregister_device (to_spi_device (dev));
@@ -1994,8 +1990,7 @@ void spi_unregister_master(struct spi_master *master)/* Release the last reference on the master if its driver * has not yet been converted to devm_spi_alloc_master(). */ -if (!devres_find (master->dev.parent, devm_spi_release_master, - devm_spi_match_master, master)) +if (!master->devm_allocated)put_device (&master->dev);if (IS_ENABLED (CONFIG_SPI_DYNAMIC ))
drivers/staging/emxx_udc/emxx_udc.c +2 -2
@@ -2193,7 +2193,7 @@ static int _nbu2ss_nuke(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep, int status) { -struct nbu2ss_req *req; +struct nbu2ss_req *req, *n;/* Endpoint Disable */ _nbu2ss_epn_exit (udc, ep);
@@ -2205,7 +2205,7 @@ static int _nbu2ss_nuke(struct nbu2ss_udc *udc,return 0 ;/* called with irqs blocked */ -list_for_each_entry (req, &ep->queue, queue) { +list_for_each_entry_safe (req, n, &ep->queue, queue) {_nbu2ss_ep_done (ep, req, status); }
drivers/staging/iio/cdc/ad7746.c +0 -1
@@ -714,7 +714,6 @@ static int ad7746_probe(struct i2c_client *client, indio_dev->num_channels =ARRAY_SIZE (ad7746_channels); else indio_dev->num_channels = ARRAY_SIZE(ad7746_channels) - 2; - indio_dev->num_channels =ARRAY_SIZE (ad7746_channels); indio_dev->modes =INDIO_DIRECT_MODE ;if (pdata) {
drivers/tty/serial/rp2.c +17 -35
99 lines not on this page · raw message
drivers/usb/core/hub.h +4 -2
@@ -140,8 +140,10 @@ static inline unsigned hub_power_on_good_delay(struct usb_hub *hub) {unsigned delay = hub->descriptor->bPwrOn2PwrGood *2 ; -/* Wait at least 100 msec for power to become stable */ -return max (delay,100U ); +if (!hub->hdev->parent)/* root hub */ +return delay; +else /* Wait at least 100 msec for power to become stable */ +return max (delay,100U ); } static inline int hub_port_debounce_be_connected(struct usb_hub *hub,
drivers/usb/misc/trancevibrator.c +2 -2
@@ -74,9 +74,9 @@ static ssize_t set_speed(struct device *dev, struct device_attribute *attr,/* Set speed */ retval =usb_control_msg (tv->udev,usb_sndctrlpipe (tv->udev,0 ),0x01 ,/* vendor request: set speed */ -USB_DIR_IN |USB_TYPE_VENDOR |USB_RECIP_OTHER , +USB_DIR_OUT |USB_TYPE_VENDOR |USB_RECIP_OTHER , tv->speed,/* speed value */ -0 ,NULL ,0 ,USB_CTRL_GET_TIMEOUT ); +0 ,NULL ,0 ,USB_CTRL_SET_TIMEOUT );if (retval) { tv->speed = old;dev_dbg (&tv->udev->dev,"retval = %d\n" , retval);
drivers/usb/misc/uss720.c +1 -0
@@ -753,6 +753,7 @@ static int uss720_probe(struct usb_interface *intf,parport_announce_port (pp);usb_set_intfdata (intf, pp); +usb_put_dev (usbdev);return 0 ; probe_abort:
drivers/usb/serial/ftdi_sio.c +3 -0
@@ -1029,6 +1029,9 @@ static const struct usb_device_id id_table_combined[] = {/* Sienna devices */ { USB_DEVICE(FTDI_VID, FTDI_SIENNA_PID) }, { USB_DEVICE(ECHELON_VID, ECHELON_U20_PID) }, +/* IDS GmbH devices */ + { USB_DEVICE(IDS_VID, IDS_SI31A_PID) }, + { USB_DEVICE(IDS_VID, IDS_CM31A_PID) },/* U-Blox devices */ { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) }, { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_PID) },
drivers/usb/serial/ftdi_sio_ids.h +7 -0
@@ -1566,6 +1566,13 @@#define UNJO_VID 0x22B7#define UNJO_ISODEBUG_V1_PID 0x150D +/* +* IDS GmbH +*/ +#define IDS_VID 0x2CAF +#define IDS_SI31A_PID 0x13A2 +#define IDS_CM31A_PID 0x13A3 +/* * U-Blox products (http://www.u-blox.com). */
drivers/usb/serial/option.c +4 -0
@@ -1222,6 +1222,10 @@ static const struct usb_device_id option_ids[] = { .driver_info = NCTRL(0) | RSVD(1) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1901, 0xff), /* Telit LN940 (MBIM) */ .driver_info = NCTRL(0) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x7010, 0xff), /* Telit LE910-S1 (RNDIS) */ + .driver_info = NCTRL(2) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x7011, 0xff), /* Telit LE910-S1 (ECM) */ + .driver_info = NCTRL(2) }, { USB_DEVICE(TELIT_VENDOR_ID, 0x9010), /* Telit SBL FN980 flashing device */ .driver_info = NCTRL(0) | ZLP }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */
drivers/usb/serial/pl2303.c +1 -0
@@ -102,6 +102,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) }, { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) }, { USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) }, + { USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530GC_PRODUCT_ID) }, { USB_DEVICE(SMART_VENDOR_ID, SMART_PRODUCT_ID) }, { USB_DEVICE(AT_VENDOR_ID, AT_VTKIT3_PRODUCT_ID) }, { } /* Terminating entry */
drivers/usb/serial/pl2303.h +1 -0
@@ -156,6 +156,7 @@/* ADLINK ND-6530 RS232,RS485 and RS422 adapter */ #define ADLINK_VENDOR_ID 0x0b63#define ADLINK_ND6530_PRODUCT_ID 0x6530 +#define ADLINK_ND6530GC_PRODUCT_ID 0x653a/* SMART USB Serial Adapter */ #define SMART_VENDOR_ID 0x0b8c
fs/btrfs/tree-log.c +0 -2
@@ -1582,8 +1582,6 @@ static noinline int link_to_fixup_dir(struct btrfs_trans_handle *trans, ret =btrfs_update_inode (trans, root, inode); }else if (ret == -EEXIST ) { ret =0 ; - }else { -BUG ();/* Logic Error */ }iput (inode);
fs/hugetlbfs/inode.c +2 -2
@@ -414,7 +414,7 @@ static void remove_inode_hugepages(struct inode *inode, loff_t lstart,if (next >= end)break ; - hash =hugetlb_fault_mutex_hash (h, mapping, next,0 ); + hash =hugetlb_fault_mutex_hash (h, mapping, next);mutex_lock (&hugetlb_fault_mutex_table[hash]);lock_page (page);
@@ -630,7 +630,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, addr = index * hpage_size;/* mutex taken here, fault path and hole punch */ - hash =hugetlb_fault_mutex_hash (h, mapping, index, addr); + hash =hugetlb_fault_mutex_hash (h, mapping, index);mutex_lock (&hugetlb_fault_mutex_table[hash]);/* See if already present in mapping to avoid alloc/free */
fs/nfs/filelayout/filelayout.c +1 -1
@@ -716,7 +716,7 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo,if (unlikely (!p)) goto out_err; fl->fh_array[i]->size =be32_to_cpup (p++); -if (sizeof (struct nfs_fh ) < fl->fh_array[i]->size) { +if (fl->fh_array[i]->size >NFS_MAXFHSIZE ) {printk (KERN_ERR "NFS: Too big fh %d received %d\n" , i, fl->fh_array[i]->size); goto out_err;
fs/nfs/nfs4file.c +1 -1
@@ -168,7 +168,7 @@ static loff_t nfs4_file_llseek(struct file *filep, loff_t offset, int whence)case SEEK_HOLE :case SEEK_DATA : ret =nfs42_proc_llseek (filep, offset, whence); -if (ret != -ENOTSUPP ) +if (ret != -EOPNOTSUPP )return ret;default :return nfs_file_llseek (filep, offset, whence);
fs/nfs/pagelist.c +5 -7
@@ -993,17 +993,16 @@ static void nfs_pageio_doio(struct nfs_pageio_descriptor *desc) {struct nfs_pgio_mirror *mirror =nfs_pgio_current_mirror (desc); -if (!list_empty (&mirror->pg_list)) {int error = desc->pg_ops->pg_doio (desc);if (error <0 ) desc->pg_error = error; -else +if (list_empty (&mirror->pg_list)) { mirror->pg_bytes_written += mirror->pg_count; - } -if (list_empty (&mirror->pg_list)) { - mirror->pg_count =0 ; - mirror->pg_base =0 ; + mirror->pg_count =0 ; + mirror->pg_base =0 ; + mirror->pg_recoalesce =0 ; + } } }
@@ -1089,7 +1088,6 @@ static int nfs_do_recoalesce(struct nfs_pageio_descriptor *desc) do { list_splice_init(&mirror->pg_list, &head); - mirror->pg_bytes_written -= mirror->pg_count; mirror->pg_count = 0; mirror->pg_base = 0; mirror->pg_recoalesce = 0;
fs/proc/base.c +4 -0
@@ -2413,6 +2413,10 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,ssize_t length;struct task_struct *task =get_proc_task (inode); +/* A task may only write when it was the opener. */ +if (file->f_cred !=current_real_cred ()) +return -EPERM ; + length = -ESRCH ;if (!task) goto out_no_task;
include/linux/hugetlb.h +1 -1
@@ -92,7 +92,7 @@ void free_huge_page(struct page *page);void hugetlb_fix_reserve_counts (struct inode *inode,bool restore_reserve);extern struct mutex *hugetlb_fault_mutex_table;u32 hugetlb_fault_mutex_hash (struct hstate *h,struct address_space *mapping, -pgoff_t idx,unsigned long address); +pgoff_t idx);#ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE pte_t *huge_pmd_share (struct mm_struct *mm,unsigned long addr,pud_t *pud);
include/linux/ieee80211.h +10 -0
@@ -638,6 +638,16 @@ static inline bool ieee80211_is_first_frag(__le16 seq_ctrl)return (seq_ctrl &cpu_to_le16 (IEEE80211_SCTL_FRAG )) ==0 ; } +/** +* ieee80211_is_frag - check if a frame is a fragment +* @hdr: 802.11 header of the frame +*/ +static inline bool ieee80211_is_frag (struct ieee80211_hdr *hdr) +{ +return ieee80211_has_morefrags (hdr->frame_control) || + hdr->seq_ctrl &cpu_to_le16 (IEEE80211_SCTL_FRAG ); +} +struct ieee80211s_hdr {u8 flags;u8 ttl;
include/linux/netfilter/x_tables.h +1 -1
@@ -327,7 +327,7 @@ static inline unsigned int xt_write_recseq_begin(void)* since addend is most likely 1 */ __this_cpu_add (xt_recseq.sequence, addend); -smp_wmb (); +smp_mb ();return addend; }
include/linux/spi/spi.h +3 -0
@@ -425,6 +425,9 @@ struct spi_master {#define SPI_MASTER_MUST_RX BIT(3)/* requires rx */ #define SPI_MASTER_MUST_TX BIT(4)/* requires tx */ +/* flag indicating this is a non-devres managed controller */ +bool devm_allocated; +/* lock and mutex for SPI bus locking */ spinlock_t bus_lock_spinlock;struct mutex bus_lock_mutex;
include/net/nfc/nci_core.h +1 -0
@@ -300,6 +300,7 @@ int nci_core_conn_create(struct nci_dev *ndev, u8 destination_type,int nci_core_conn_close (struct nci_dev *ndev,u8 conn_id);struct nci_hci_dev *nci_hci_allocate (struct nci_dev *ndev); +void nci_hci_deallocate (struct nci_dev *ndev);int nci_hci_send_event (struct nci_dev *ndev,u8 gate,u8 event,const u8 *param,size_t param_len); int nci_hci_send_cmd(struct nci_dev *ndev, u8 gate,
mm/hugetlb.c +4 -4
@@ -3771,7 +3771,7 @@ backout_unlocked:#ifdef CONFIG_SMP u32 hugetlb_fault_mutex_hash (struct hstate *h,struct address_space *mapping, -pgoff_t idx,unsigned long address) +pgoff_t idx) {unsigned long key[2 ];u32 hash;
@@ -3779,7 +3779,7 @@ u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping, key[0 ] = (unsigned long ) mapping; key[1 ] = idx; - hash =jhash2 ((u32 *)&key,sizeof (key)/sizeof (u32),0 ); + hash =jhash2 ((u32 *)&key,sizeof (key)/(sizeof (u32)),0 );return hash & (num_fault_mutexes -1 ); }
@@ -3789,7 +3789,7 @@ u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping,* return 0 and avoid the hashing overhead. */ u32 hugetlb_fault_mutex_hash (struct hstate *h,struct address_space *mapping, -pgoff_t idx,unsigned long address) +pgoff_t idx) {return 0 ; }
@@ -3834,7 +3834,7 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,* get spurious allocation failures if two CPUs race to instantiate * the same page in the page cache. */ - hash =hugetlb_fault_mutex_hash (h, mapping, idx, address); + hash =hugetlb_fault_mutex_hash (h, mapping, idx);mutex_lock (&hugetlb_fault_mutex_table[hash]); entry =huge_ptep_get (ptep);
mm/vmstat.c +3 -0
@@ -973,6 +973,9 @@ static void pagetypeinfo_showfree_print(struct seq_file *m,list_for_each (curr, &area->free_list[mtype]) freecount++;seq_printf (m,"%6lu " , freecount); +spin_unlock_irq (&zone->lock); +cond_resched (); +spin_lock_irq (&zone->lock); }seq_putc (m,'\n' ); }
net/bluetooth/cmtp/core.c +5 -0
@@ -392,6 +392,11 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock)if (!(session->flags &BIT (CMTP_LOOPBACK ))) { err =cmtp_attach_device (session);if (err <0 ) { +/* Caller will call fput in case of failure, and so +* will cmtp_session kthread. +*/ +get_file (session->sock->file); +atomic_inc (&session->terminate);wake_up_interruptible (sk_sleep (session->sock->sk));up_write (&cmtp_session_sem);
net/bluetooth/hci_core.c +9 -4
@@ -371,12 +371,17 @@ static int hci_req_sync(struct hci_dev *hdev, {int ret; -if (!test_bit (HCI_UP , &hdev->flags)) -return -ENETDOWN ; -/* Serialize all requests */ hci_req_lock (hdev); - ret =__hci_req_sync (hdev, req, opt, timeout); +/* check the state after obtaing the lock to protect the HCI_UP +* against any races from hci_dev_do_close when the controller +* gets removed. +*/ +if (test_bit (HCI_UP , &hdev->flags)) + ret =__hci_req_sync (hdev, req, opt, timeout); +else + ret = -ENETDOWN ; +hci_req_unlock (hdev);return ret;
net/ipv6/mcast.c +0 -3
@@ -1573,10 +1573,7 @@ static struct sk_buff *mld_newpack(struct inet6_dev *idev, unsigned int mtu) IPV6_TLV_PADN, 0 };/* we assume size > sizeof(ra) here */ -/* limit our allocations to order-0 page */ - size =min_t (int, size,SKB_MAX_ORDER (0 ,0 )); skb =sock_alloc_send_skb (sk, size,1 , &err); -if (!skb)return NULL ;
net/mac80211/ieee80211_i.h +13 -23
@@ -51,12 +51,6 @@ struct ieee80211_local;#define IEEE80211_ENCRYPT_HEADROOM 8#define IEEE80211_ENCRYPT_TAILROOM 18 -/* IEEE 802.11 (Ch. 9.5 Defragmentation) requires support for concurrent -* reception of at least three fragmented frames. This limit can be increased -* by changing this define, at the cost of slower frame reassembly and -* increased memory use (about 2 kB of RAM per entry). */ -#define IEEE80211_FRAGMENT_MAX 4 -/* power level hasn't been configured (or set to automatic) */ #define IEEE80211_UNSET_POWER_LEVEL INT_MIN
@@ -85,18 +79,6 @@ struct ieee80211_local; #define IEEE80211_DEAUTH_FRAME_LEN (24 /* hdr */ + 2 /* reason */) -struct ieee80211_fragment_entry { -struct sk_buff_head skb_list; -unsigned long first_frag_time; -u16 seq; -u16 extra_len; -u16 last_frag; -u8 rx_queue; -bool check_sequential_pn;/* needed for CCMP/GCMP */ -u8 last_pn[6 ];/* PN of the last fragment if CCMP was used */ -}; - -struct ieee80211_bss {u32 device_ts_beacon, device_ts_presp;
@@ -236,8 +218,15 @@ struct ieee80211_rx_data {*/ int security_idx; -u32 tkip_iv32; -u16 tkip_iv16; +union { +struct { +u32 iv32; +u16 iv16; + } tkip; +struct { +u8 pn[IEEE80211_CCMP_PN_LEN ]; + } ccm_gcm; + }; };struct ieee80211_csa_settings {
@@ -834,9 +823,7 @@ struct ieee80211_sub_if_data {char name[IFNAMSIZ ]; -/* Fragment table for host-based reassembly */ -struct ieee80211_fragment_entry fragments[IEEE80211_FRAGMENT_MAX ]; -unsigned int fragment_next; +struct ieee80211_fragment_cache frags;/* TID bitmap for NoAck policy */ u16 noack_map;
@@ -2076,4 +2063,7 @@ extern const struct ethtool_ops ieee80211_ethtool_ops;#define debug_noinline#endif +void ieee80211_init_frag_cache (struct ieee80211_fragment_cache *cache); +void ieee80211_destroy_frag_cache (struct ieee80211_fragment_cache *cache); +#endif /* IEEE80211_I_H */
net/mac80211/iface.c +2 -7
@@ -1082,16 +1082,12 @@ static void ieee80211_set_multicast_list(struct net_device *dev)*/ static void ieee80211_teardown_sdata (struct ieee80211_sub_if_data *sdata) { -int i; -/* free extra data */ ieee80211_free_keys (sdata, false);ieee80211_debugfs_remove_netdev (sdata); -for (i =0 ; i <IEEE80211_FRAGMENT_MAX ; i++) -__skb_queue_purge (&sdata->fragments[i].skb_list); - sdata->fragment_next =0 ; +ieee80211_destroy_frag_cache (&sdata->frags);if (ieee80211_vif_is_mesh (&sdata->vif))mesh_rmc_free (sdata);
@@ -1787,8 +1783,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, sdata->wdev.wiphy = local->hw.wiphy; sdata->local = local; -for (i =0 ; i <IEEE80211_FRAGMENT_MAX ; i++) -skb_queue_head_init (&sdata->fragments[i].skb_list); +ieee80211_init_frag_cache (&sdata->frags);INIT_LIST_HEAD (&sdata->key_list);
net/mac80211/key.c +7 -0
@@ -646,6 +646,7 @@ int ieee80211_key_link(struct ieee80211_key *key, struct sta_info *sta) {struct ieee80211_local *local = sdata->local; +static atomic_t key_color =ATOMIC_INIT (0 );struct ieee80211_key *old_key;int idx = key->conf.keyidx;bool pairwise = key->conf.flags &IEEE80211_KEY_FLAG_PAIRWISE ;
@@ -680,6 +681,12 @@ int ieee80211_key_link(struct ieee80211_key *key, key->sdata = sdata; key->sta = sta; +/* +* Assign a unique ID to every key so we can easily prevent mixed +* key and fragment cache attacks. +*/ + key->color =atomic_inc_return (&key_color); +increment_tailroom_need_count (sdata);ieee80211_key_replace (sdata, sta, pairwise, old_key, key);
net/mac80211/key.h +2 -0
@@ -123,6 +123,8 @@ struct ieee80211_key { } debugfs;#endif +unsigned int color; +/* * key config, must be last because it contains key * material as variable length member
net/mac80211/rx.c +116 -32
270 lines not on this page · raw message
net/mac80211/sta_info.c +4 -0
@@ -355,6 +355,8 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, sta->sdata = sdata; sta->rx_stats.last_rx = jiffies; +ieee80211_init_frag_cache (&sta->frags); + sta->sta_state =IEEE80211_STA_NONE ;/* Mark TID as unreserved */
@@ -974,6 +976,8 @@ static void __sta_info_destroy_part2(struct sta_info *sta)ieee80211_sta_debugfs_remove (sta);ieee80211_recalc_min_chandef (sdata); +ieee80211_destroy_frag_cache (&sta->frags); +cleanup_single_sta (sta); }
net/mac80211/sta_info.h +31 -0
@@ -324,6 +324,34 @@ struct mesh_sta {DECLARE_EWMA (signal,1024 ,8 ) +/* +* IEEE 802.11-2016 (10.6 "Defragmentation") recommends support for "concurrent +* reception of at least one MSDU per access category per associated STA" +* on APs, or "at least one MSDU per access category" on other interface types. +* +* This limit can be increased by changing this define, at the cost of slower +* frame reassembly and increased memory use while fragments are pending. + */ +#define IEEE80211_FRAGMENT_MAX 4 + +struct ieee80211_fragment_entry { +struct sk_buff_head skb_list; +unsigned long first_frag_time; +u16 seq; +u16 extra_len; +u16 last_frag; +u8 rx_queue; +u8 check_sequential_pn:1 ,/* needed for CCMP/GCMP */ + is_protected:1 ; +u8 last_pn[6 ];/* PN of the last fragment if CCMP was used */ +unsigned int key_color; +}; + +struct ieee80211_fragment_cache { +struct ieee80211_fragment_entry entries[IEEE80211_FRAGMENT_MAX ]; +unsigned int next; +}; +/** * struct sta_info - STA information *
@@ -384,6 +412,7 @@ DECLARE_EWMA(signal, 1024, 8)* @tx_stats: TX statistics * @rx_stats: RX statistics * @status_stats: TX status statistics +* @frags: fragment cache */ struct sta_info {/* General information, mostly static */
@@ -493,6 +522,8 @@ struct sta_info {struct cfg80211_chan_def tdls_chandef; +struct ieee80211_fragment_cache frags; +/* keep last! */ struct ieee80211_sta sta; };
net/mac80211/wpa.c +8 -4
@@ -161,8 +161,8 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx) update_iv:/* update IV in key information to be able to detect replays */ - rx->key->u.tkip.rx[rx->security_idx].iv32 = rx->tkip_iv32; - rx->key->u.tkip.rx[rx->security_idx].iv16 = rx->tkip_iv16; + rx->key->u.tkip.rx[rx->security_idx].iv32 = rx->tkip.iv32; + rx->key->u.tkip.rx[rx->security_idx].iv16 = rx->tkip.iv16;return RX_CONTINUE ;
@@ -292,8 +292,8 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_rx_data *rx) key, skb->data + hdrlen, skb->len - hdrlen, rx->sta->sta.addr, hdr->addr1, hwaccel, rx->security_idx, - &rx->tkip_iv32, - &rx->tkip_iv16); + &rx->tkip.iv32, + &rx->tkip.iv16);if (res !=TKIP_DECRYPT_OK )return RX_DROP_UNUSABLE ;
@@ -553,6 +553,8 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx, }memcpy (key->u.ccmp.rx_pn[queue], pn,IEEE80211_CCMP_PN_LEN ); +if (unlikely (ieee80211_is_frag (hdr))) +memcpy (rx->ccm_gcm.pn, pn,IEEE80211_CCMP_PN_LEN ); }/* Remove CCMP header and MIC */
@@ -784,6 +786,8 @@ ieee80211_crypto_gcmp_decrypt(struct ieee80211_rx_data *rx) }memcpy (key->u.gcmp.rx_pn[queue], pn,IEEE80211_GCMP_PN_LEN ); +if (unlikely (ieee80211_is_frag (hdr))) +memcpy (rx->ccm_gcm.pn, pn,IEEE80211_CCMP_PN_LEN ); }/* Remove GCMP header and MIC */
net/netfilter/x_tables.c +3 -0
@@ -1140,6 +1140,9 @@ xt_replace_table(struct xt_table *table,smp_wmb (); table->private = newinfo; +/* make sure all cpus see new ->private value */ +smp_mb (); +/* * Even though table entries have now been swapped, other CPU's * may still be using the old entries. This is okay, because
net/nfc/nci/core.c +1 -0
@@ -1099,6 +1099,7 @@ EXPORT_SYMBOL(nci_allocate_device);void nci_free_device (struct nci_dev *ndev) {nfc_free_device (ndev->nfc_dev); +nci_hci_deallocate (ndev);kfree (ndev); }EXPORT_SYMBOL (nci_free_device);
net/nfc/nci/hci.c +5 -0
@@ -798,3 +798,8 @@ struct nci_hci_dev *nci_hci_allocate(struct nci_dev *ndev)return hdev; } + +void nci_hci_deallocate (struct nci_dev *ndev) +{ +kfree (ndev->hci_dev); +}
net/sched/sch_dsmark.c +2 -1
@@ -404,7 +404,8 @@ static void dsmark_reset(struct Qdisc *sch)struct dsmark_qdisc_data *p =qdisc_priv (sch);pr_debug ("%s(sch %p,[qdisc %p])\n" , __func__, sch, p); -qdisc_reset (p->q); +if (p->q) +qdisc_reset (p->q); sch->qstats.backlog =0 ; sch->q.qlen =0 ; }
net/tipc/msg.c +2 -7
@@ -139,18 +139,13 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)if (unlikely (head)) goto err; *buf =NULL ; +if (skb_has_frag_list (frag) &&__skb_linearize (frag)) + goto err; frag =skb_unshare (frag,GFP_ATOMIC );if (unlikely (!frag)) goto err; head = *headbuf = frag;TIPC_SKB_CB (head)->tail =NULL ; -if (skb_is_nonlinear (head)) { - skb_walk_frags(head, tail) { -TIPC_SKB_CB (head)->tail = tail; - } - }else { -skb_frag_list_init (head); - }return 0 ; }
net/tipc/socket.c +4 -1
@@ -763,7 +763,10 @@ void tipc_sk_mcast_rcv(struct net *net, struct sk_buff_head *arrvq,spin_lock_bh (&inputq->lock);if (skb_peek (arrvq) == skb) {skb_queue_splice_tail_init (&tmpq, inputq); -__skb_dequeue (arrvq); +/* Decrease the skb's refcnt as increasing in the +* function tipc_skb_peek +*/ +kfree_skb (__skb_dequeue (arrvq)); }spin_unlock_bh (&inputq->lock);__skb_queue_purge (&tmpq);
net/wireless/util.c +12 -3
@@ -409,8 +409,8 @@ unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr) }EXPORT_SYMBOL (ieee80211_get_mesh_hdrlen); -int ieee80211_data_to_8023 (struct sk_buff *skb,const u8 *addr, -enum nl80211_iftype iftype) +static int __ieee80211_data_to_8023 (struct sk_buff *skb,const u8 *addr, +enum nl80211_iftype iftype,bool is_amsdu) {struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;u16 hdrlen, ethertype;
@@ -504,7 +504,7 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, payload = skb->data + hdrlen; ethertype = (payload[6 ] <<8 ) | payload[7 ]; -if (likely ((ether_addr_equal (payload, rfc1042_header) && +if (likely ((!is_amsdu &ðer_addr_equal (payload, rfc1042_header) && ethertype !=ETH_P_AARP && ethertype !=ETH_P_IPX ) ||ether_addr_equal (payload, bridge_tunnel_header))) {/* remove RFC1042 or Bridge-Tunnel encapsulation and
@@ -525,6 +525,12 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, }return 0 ; } + +int ieee80211_data_to_8023 (struct sk_buff *skb,const u8 *addr, +enum nl80211_iftype iftype) +{ +return __ieee80211_data_to_8023 (skb, addr, iftype, false); +}EXPORT_SYMBOL (ieee80211_data_to_8023); int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr,
@@ -683,6 +689,9 @@ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,/* the last MSDU has no padding */ if (subframe_len > remaining) goto purge; +/* mitigate A-MSDU aggregation injection attacks */ +if (ether_addr_equal (eth->h_dest, rfc1042_header)) + goto purge;skb_pull (skb,sizeof (struct ethhdr ));/* reuse skb for the last subframe */