Skip to contentSkip to conversation

Linux 3.16.83

PATCH Ben Hutchings 1 participant 1 message Apr 28, 2020 Stable branch

lore
Share & tools
lore
#0 lore raw

I'm announcing the release of the 3.16.83 kernel.

All users of the 3.16 kernel series should upgrade.

The updated 3.16.y git tree can be found at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.16.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

The diff from 3.16.82 is attached to this message.

Ben.

------------

 Documentation/sysctl/fs.txt                       |  36 ++
 Makefile                                          |   2 +-
 arch/powerpc/kernel/irq.c                         |   4 +-
 arch/x86/boot/compressed/head_64.S                |   5 +
 arch/x86/include/asm/kaiser.h                     |  10 +
 arch/x86/kernel/cpu/microcode/amd.c               |   4 +
 arch/x86/kvm/cpuid.c                              |   3 +-
 arch/x86/kvm/vmx.c                                |   2 +-
 arch/x86/realmode/init.c                          |   4 +-
 arch/x86/realmode/rm/trampoline_64.S              |   3 +-
 block/blk-settings.c                              |   2 +-
 drivers/acpi/device_pm.c                          |  12 +-
 drivers/block/floppy.c                            |   7 +-
 drivers/gpio/gpiolib.c                            |  13 +-
 drivers/hid/hid-core.c                            |   6 +
 drivers/hid/hid-input.c                           |  16 +-
 drivers/hid/hidraw.c                              |   7 +-
 drivers/hid/uhid.c                                |   5 +-
 drivers/hwmon/adt7475.c                           |   5 +-
 drivers/iio/industrialio-buffer.c                 |   6 +-
 drivers/infiniband/hw/mlx4/main.c                 |  16 +-
 drivers/input/input.c                             |  26 +-
 drivers/input/misc/keyspan_remote.c               |   9 +-
 drivers/input/tablet/aiptek.c                     |   6 +-
 drivers/input/tablet/gtco.c                       |  10 +-
 drivers/input/touchscreen/sur40.c                 |   2 +-
 drivers/isdn/gigaset/usb-gigaset.c                |  23 +-
 drivers/md/dm-crypt.c                             |   4 +-
 drivers/md/dm-delay.c                             |  16 +-
 drivers/md/dm-flakey.c                            |  40 +-
 drivers/md/dm-linear.c                            |   7 +-
 drivers/md/dm-raid1.c                             |   8 +-
 drivers/md/dm-snap-persistent.c                   |   2 +-
 drivers/md/dm-stripe.c                            |   8 +-
 drivers/md/dm-thin-metadata.c                     |  29 +
 drivers/md/dm-thin-metadata.h                     |   7 +
 drivers/md/persistent-data/dm-btree-remove.c      |   8 +-
 drivers/md/raid0.c                                |   2 +-
 drivers/media/media-device.c                      |  43 +-
 drivers/media/media-devnode.c                     | 171 +++---
 drivers/media/usb/gspca/ov519.c                   |  10 +
 drivers/media/usb/gspca/stv06xx/stv06xx.c         |  19 +-
 drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c  |   4 +
 drivers/media/usb/gspca/xirlink_cit.c             |  18 +-
 drivers/media/usb/uvc/uvc_driver.c                |   2 +-
 drivers/misc/enclosure.c                          |   3 +-
 drivers/mmc/host/sdhci.c                          |  10 +-
 drivers/net/bonding/bond_main.c                   |  40 +-
 drivers/net/can/mscan/mscan.c                     |  21 +-
 drivers/net/can/slcan.c                           |  16 +-
 drivers/net/can/usb/gs_usb.c                      |   4 +-
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |   5 -
 drivers/net/ethernet/natsemi/sonic.c              | 113 +++-
 drivers/net/ethernet/natsemi/sonic.h              |  25 +-
 drivers/net/ethernet/stmicro/stmmac/common.h      |   5 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c |   2 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |   4 +-
 drivers/net/hamradio/6pack.c                      |   4 +-
 drivers/net/hamradio/mkiss.c                      |   4 +-
 drivers/net/macvlan.c                             |   3 +-
 drivers/net/slip/slip.c                           |  12 +-
 drivers/net/usb/r8152.c                           |   3 +
 drivers/net/vxlan.c                               |   5 +-
 drivers/net/wireless/libertas/cfg.c               |  18 +-
 drivers/net/wireless/mwifiex/sta_ioctl.c          |   1 +
 drivers/net/wireless/mwifiex/tdls.c               |  74 ++-
 drivers/pinctrl/pinctrl-baytrail.c                | 212 ++++---
 drivers/platform/x86/asus-wmi.c                   |   8 +-
 drivers/platform/x86/hp-wmi.c                     |   2 +-
 drivers/ptp/ptp_clock.c                           |  42 +-
 drivers/ptp/ptp_private.h                         |   9 +-
 drivers/ptp/ptp_sysfs.c                           | 162 +++---
 drivers/scsi/fnic/vnic_dev.c                      |  20 +-
 drivers/scsi/qla4xxx/ql4_os.c                     |   1 -
 drivers/scsi/sd.c                                 |   4 +-
 drivers/staging/android/ashmem.c                  |  28 +
 drivers/staging/rtl8188eu/os_dep/usb_intf.c       |   3 +-
 drivers/staging/rtl8712/usb_intf.c                |   2 +-
 drivers/staging/usbip/vhci_rx.c                   |  13 +-
 drivers/tty/serial/msm_serial.c                   |  13 +-
 drivers/tty/serial/serial_core.c                  |   1 +
 drivers/tty/vt/selection.c                        |  34 +-
 drivers/tty/vt/vt.c                               |   2 -
 drivers/usb/atm/ueagle-atm.c                      |  18 +-
 drivers/usb/core/config.c                         |  77 ++-
 drivers/usb/core/hub.c                            |   1 +
 drivers/usb/core/quirks.c                         |  37 ++
 drivers/usb/core/urb.c                            |   1 +
 drivers/usb/core/usb.h                            |   3 +
 drivers/usb/dwc3/dwc3-pci.c                       |  30 +
 drivers/usb/host/ehci-q.c                         |  13 +-
 drivers/usb/host/xhci-hub.c                       |   8 +-
 drivers/usb/host/xhci-ring.c                      |   3 +-
 drivers/usb/misc/adutux.c                         |   2 +-
 drivers/usb/misc/idmouse.c                        |   2 +-
 drivers/usb/mon/mon_bin.c                         |  32 +-
 drivers/usb/musb/musbhsdma.c                      |   2 +-
 drivers/usb/serial/ch341.c                        |   6 +-
 drivers/usb/serial/io_edgeport.c                  |  26 +-
 drivers/usb/serial/keyspan.c                      |   4 +
 drivers/usb/serial/opticon.c                      |   2 +-
 drivers/usb/serial/quatech2.c                     |   6 +
 drivers/usb/serial/usb-serial-simple.c            |   2 +
 drivers/usb/serial/usb-serial.c                   |   3 +
 drivers/vhost/net.c                               |  13 +-
 drivers/video/console/vgacon.c                    |   3 +
 drivers/virtio/virtio_balloon.c                   |  10 +
 firmware/Makefile                                 |   2 +-
 fs/btrfs/Makefile                                 |   2 +-
 fs/btrfs/ctree.c                                  |  19 +-
 fs/btrfs/ctree.h                                  | 157 +++---
 fs/btrfs/dev-replace.c                            |   2 +-
 fs/btrfs/disk-io.c                                |  80 +--
 fs/btrfs/extent-tree.c                            | 110 +++-
 fs/btrfs/extent_io.c                              |  98 ++--
 fs/btrfs/extent_io.h                              |  25 +-
 fs/btrfs/extent_map.c                             |   2 +-
 fs/btrfs/extent_map.h                             |  10 +-
 fs/btrfs/inode.c                                  |   8 +-
 fs/btrfs/ioctl.c                                  |  10 +-
 fs/btrfs/relocation.c                             |   1 +
 fs/btrfs/root-tree.c                              |  10 +-
 fs/btrfs/scrub.c                                  |   2 +-
 fs/btrfs/struct-funcs.c                           |   9 +-
 fs/btrfs/tree-checker.c                           | 649 ++++++++++++++++++++++
 fs/btrfs/tree-checker.h                           |  38 ++
 fs/btrfs/tree-log.c                               |  24 +-
 fs/btrfs/uuid-tree.c                              |   2 +
 fs/btrfs/volumes.c                                | 206 +++++--
 fs/btrfs/volumes.h                                |   2 +
 fs/char_dev.c                                     |  88 ++-
 fs/ext4/dir.c                                     |   5 +
 fs/ext4/ext4.h                                    |  13 +
 fs/ext4/extents.c                                 |  89 +--
 fs/ext4/file.c                                    |   2 +-
 fs/ext4/inode.c                                   | 117 +++-
 fs/ext4/super.c                                   |   1 +
 fs/ext4/truncate.h                                |   2 +
 fs/inode.c                                        |   1 +
 fs/locks.c                                        |   2 +-
 fs/namei.c                                        |  56 +-
 include/linux/blkdev.h                            |  10 +-
 include/linux/blktrace_api.h                      |   6 +-
 include/linux/cdev.h                              |   5 +
 include/linux/fs.h                                |   3 +
 include/linux/futex.h                             |  17 +-
 include/linux/if_ether.h                          |   8 +
 include/linux/kobject.h                           |   2 +
 include/linux/mod_devicetable.h                   |   4 +-
 include/linux/netfilter_arp/arp_tables.h          |   2 +-
 include/linux/posix-clock.h                       |  19 +-
 include/linux/quotaops.h                          |   2 +-
 include/linux/usb/quirks.h                        |   3 +
 include/media/media-device.h                      |   5 +-
 include/media/media-devnode.h                     |  32 +-
 include/net/addrconf.h                            |   5 +-
 include/net/cfg80211.h                            |  11 +
 include/net/neighbour.h                           |   1 -
 kernel/futex.c                                    |  93 ++--
 kernel/sysctl.c                                   |  18 +
 kernel/taskstats.c                                |  30 +-
 kernel/time/posix-clock.c                         |  31 +-
 kernel/trace/blktrace.c                           | 129 +++--
 kernel/trace/ftrace.c                             |   6 +-
 kernel/trace/trace_sched_wakeup.c                 |   4 +-
 kernel/trace/trace_stack.c                        |   5 +
 lib/kobject.c                                     |   5 +-
 mm/mempolicy.c                                    |   6 +-
 net/8021q/vlan_netlink.c                          |  10 +-
 net/batman-adv/distributed-arp-table.c            |   4 +-
 net/bridge/br_netfilter.c                         |   3 +
 net/bridge/netfilter/ebtables.c                   |  58 +-
 net/core/neighbour.c                              |   3 -
 net/ipv4/netfilter/arp_tables.c                   |  42 +-
 net/ipv4/netfilter/arptable_filter.c              |   2 +-
 net/ipv4/tcp_input.c                              |   5 +-
 net/ipv4/tcp_output.c                             |   8 +
 net/ipv6/af_inet6.c                               |   2 +-
 net/mac80211/cfg.c                                |  55 +-
 net/mac80211/sta_info.c                           |   4 +
 net/netfilter/ipset/ip_set_bitmap_gen.h           |   2 +-
 net/netfilter/ipset/ip_set_core.c                 |   3 +-
 net/netfilter/nf_conntrack_netlink.c              |   3 +
 net/netfilter/nft_bitwise.c                       |  19 +-
 net/netfilter/nft_cmp.c                           |  18 +-
 net/packet/af_packet.c                            |   3 +-
 net/sched/ematch.c                                |   2 +-
 net/sched/sch_fq.c                                |  10 +-
 net/sctp/sm_sideeffect.c                          |  28 +-
 net/wireless/util.c                               |  45 ++
 scripts/recordmcount.c                            |  17 +
 sound/core/pcm_native.c                           |   4 +
 sound/core/seq/seq_timer.c                        |  14 +-
 sound/pci/hda/patch_ca0132.c                      |   5 +-
 sound/pci/ice1712/ice1724.c                       |   9 +-
 sound/soc/codecs/wm8962.c                         |   4 +-
 sound/usb/pcm.c                                   |  44 +-
 197 files changed, 3377 insertions(+), 1229 deletions(-)

Al Viro (2):
do_last(): fetch directory ->i_mode and ->i_uid before it's too late
vfs: fix do_last() regression

Alan Cox (1):
usb: dwc3: pci: Add PCI ID for Intel Braswell

Alan Stern (1):
HID: Fix slab-out-of-bounds read in hid_field_extract

Alberto Aguirre (2):
ALSA: usb-audio: add implicit fb quirk for Axe-Fx II
ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk

Alex Sverdlin (1):
ARM: 8950/1: ftrace/recordmcount: filter relocation types

Amir Goldstein (1):
locks: print unsigned ino in /proc/locks

Ard Biesheuvel (1):
x86/efistub: Disable paging at mixed mode entry

Arnd Bergmann (2):
btrfs: tree-checker: use %zu format string for size_t
scsi: fnic: fix invalid stack access

Avinash Patil (1):
mwifiex: fix probable memory corruption while processing TDLS frame

Ben Hutchings (1):

      Linux 3.16.83

Brian Norris (1):
mwifiex: fix unbalanced locking in mwifiex_process_country_ie()

Cengiz Can (1):
blktrace: fix dereference after null check

Chao Yu (1):
quota: fix wrong condition in is_quota_modification()

Chen-Yu Tsai (1):
net: stmmac: dwmac-sunxi: Allow all RGMII modes

Christian Brauner (1):
taskstats: fix data-race

Christophe Leroy (1):
powerpc/irq: fix stack overflow verification

Cong Wang (2):
netfilter: fix a use-after-free in mtype_destroy()
net_sched: fix datalen for ematch

Dan Carpenter (1):
scsi: iscsi: qla4xxx: fix double free in probe

David Hildenbrand (1):
virtio-balloon: fix managed page counts when migrating pages between zones

David Sterba (6):
btrfs: new define for the inline extent data start
btrfs: kill extent_buffer_page helper
btrfs: cleanup, rename a few variables in btrfs_read_sys_array
btrfs: add more checks to btrfs_read_sys_array
btrfs: handle invalid num_stripes in sys_array
btrfs: tree-check: reduce stack consumption in check_dir_item

Davidlohr Bueso (1):

      blktrace: re-write setting q->blk_trace

Dedy Lansky (1):

      cfg80211/mac80211: make ieee80211_send_layer2_update a public function

Dmitry Torokhov (5):
HID: hid-input: clear unmapped usages
Input: add safety guards to input_set_keycode()
ptp: do not explicitly set drvdata in ptp_clock_register()
ptp: use is_visible method to hide unused attributes
ptp: create "pins" together with the rest of attributes

Emiliano Ingrassia (1):
usb: core: urb: fix URB structure initialization function

Eric Dumazet (9):
netfilter: bridge: make sure to pull arp header in br_nf_forward_arp()
neighbour: remove neigh_cleanup() method
bonding: fix bond_neigh_init()
6pack,mkiss: fix possible deadlock
tcp: do not send empty skb from tcp_write_xmit()
vlan: vlan_changelink() should propagate errors
pkt_sched: fq: do not accept silly TCA_FQ_QUANTUM
macvlan: do not assume mac_header is set in macvlan_broadcast()
macvlan: use skb_reset_mac_header() in macvlan_queue_xmit()

Erkka Talvitie (1):
USB: EHCI: Do not return -EPIPE when hub is disconnected

Eryu Guan (1):
ext4: update c/mtime on truncate up

Eugenio Pérez (1):
vhost: Check docket sk_family instead of call getname

Fabian Henneke (1):
hidraw: Return EPOLLOUT from hidraw_poll

Felipe Balbi (3):
usb: dwc3: pci: add support for Comet Lake PCH ID
usb: dwc3: pci: Add Support for Intel Elkhart Lake Devices
usb: dwc3: pci: add support for TigerLake Devices

Filipe Manana (3):
Btrfs: fix emptiness check for dirtied extent buffers at check_leaf()
Btrfs: fix removal logic of the tree mod log that leads to use-after-free issues
Btrfs: fix infinite loop during nocow writeback due to race

Finn Thain (4):
net/sonic: Add mutual exclusion for accessing shared state net/sonic: Use MMIO accessors
net/sonic: Fix receive buffer handling
net/sonic: Quiesce SONIC before re-initializing descriptor memory

Florian Faber (1):
can: mscan: mscan_rx_poll(): fix rx path lockup when returning from polling to irq mode

Florian Westphal (6):
netfilter: ctnetlink: netns exit must wait for callbacks
netfilter: ebtables: convert BUG_ONs to WARN_ONs
netfilter: ebtables: compat: reject all padding in matches/watchers
netfilter: arp_tables: init netns pointer in xt_tgchk_param struct
netfilter: ipset: avoid null deref when IPSET_ATTR_LINENO is present
netfilter: arp_tables: init netns pointer in xt_tgdtor_param struct

Geert Uytterhoeven (1):
gpio: Fix error message on out-of-range GPIO in lookup table

Goldwyn Rodrigues (1):
dm flakey: check for null arg_name in parse_features()

Gu Jinxiang (1):
btrfs: validate type when reading a chunk

Hangbin Liu (1):
vxlan: fix tos value before xmit

Hans de Goede (2):
pinctrl: baytrail: Really serialize all register accesses platform/x86: hp-wmi: Make buffer for HPWMI_FEATURE2_QUERY 128 bytes

Heikki Krogerus (8):
usb: dwc3: pci: add support for Intel Sunrise Point PCH
usb: dwc3: pci: add support for Intel Broxton SOC
usb: dwc3: pci: add ID for one more Intel Broxton platform
usb: dwc3: pci: add Intel Kabylake PCI ID
usb: dwc3: pci: add Intel Gemini Lake PCI ID
usb: dwc3: pci: add Intel Cannonlake PCI IDs
usb: dwc3: pci: add support for Intel IceLake
usb: dwc3: pci: add ID for the Intel Comet Lake -H variant

Hou Tao (1):
dm btree: increase rebalance threshold in __rebalance2()

James Bottomley (1):
scsi: enclosure: Fix stale device oops with hot replug

Jan Kara (7):
ext4: fix races between page faults and hole punching
ext4: move unlocked dio protection from ext4_alloc_file_blocks()
ext4: fix races between buffered IO and collapse / insert range
ext4: fix races of writeback with punch hole and zero range
ext4: check for directory entries too close to block end
kobject: Export kobject_get_unless_zero()
blktrace: Protect q->blk_trace with RCU

Jari Ruusu (1):
Fix built-in early-load Intel microcode alignment

Jeff Mahoney (2):
btrfs: cleanup, stop casting for extent_map->lookup everywhere
btrfs: struct-funcs, constify readers

Jerónimo Borque (1):
USB: serial: simple: Add Motorola Solutions TETRA MTP3xxx and MTP85xx

Jian-Hong Pan (1):
platform/x86: asus-wmi: Fix keyboard brightness cannot be set to 0

Jim Mattson (1):
kvm: x86: Host feature SSBD doesn't imply guest feature SPEC_CTRL_SSBD

Jiri Kosina (1):
HID: hidraw, uhid: Always report EPOLLOUT

Jiri Slaby (4):
vt: selection, handle pending signals in paste_selection
vt: selection, close sel_buffer race
vt: selection, push console lock down
vt: selection, push sel_lock up

Johan Hovold (29):
staging: gigaset: fix general protection fault on probe
staging: gigaset: fix illegal free on probe errors
staging: gigaset: add endpoint-type sanity check
USB: serial: io_edgeport: fix epic endpoint lookup
USB: idmouse: fix interface sanity checks
USB: adutux: fix interface sanity check
USB: atm: ueagle-atm: add missing endpoint check
staging: rtl8188eu: fix interface sanity check
staging: rtl8712: fix interface sanity check
USB: core: fix check for duplicate endpoints
USB: core: add endpoint-blacklist quirk
USB: quirks: blacklist duplicate ep on Sound Devices USBPre2
can: gs_usb: gs_usb_probe(): use descriptors of current altsetting
Input: aiptek - fix endpoint sanity check
Input: gtco - fix endpoint sanity check
Input: sur40 - fix interface sanity checks
ALSA: usb-audio: fix sync-ep altsetting sanity check
USB: serial: opticon: fix control-message timeouts
r8152: add missing endpoint sanity check
Input: keyspan-remote - fix control-message timeouts
USB: serial: suppress driver bind attributes
USB: serial: ch341: handle unbound port at reset_resume
USB: serial: io_edgeport: handle unbound ports on URB completion
USB: serial: io_edgeport: add missing active-port sanity check
USB: serial: keyspan: handle unbound ports
USB: serial: quatech2: handle unbound ports
media: ov519: add missing endpoint sanity checks
media: stv06xx: add missing descriptor sanity checks
media: xirlink_cit: add missing descriptor sanity checks

Johannes Thumshirn (1):
btrfs: ensure that a DUP or RAID1 block group has exactly two stripes

Jose Abreu (2):
net: stmmac: 16KB buffer must be 16 byte aligned
net: stmmac: Enable 16KB buffer size

Josef Bacik (9):
ext4: only call ext4_truncate when size <= isize
Btrfs: fix em leak in find_first_block_group
btrfs: do not call synchronize_srcu() in inode_tree_del
btrfs: abort transaction after failed inode updates in create_subvol
btrfs: handle ENOENT in btrfs_uuid_tree_iterate
btrfs: skip log replay on orphaned roots
btrfs: do not leak reloc root if we fail to read the fs root
btrfs: do not delete mismatched root refs
btrfs: check rw_devices, not num_devices for balance

Jouni Malinen (1):
mac80211: Do not send Layer 2 Update frame before authorization

Kaitao Cheng (1):
kernel/trace: Fix do not unregister tracepoints when register sched_migrate_task fail

Keiya Nobuta (1):
usb: core: hub: Improved device recognition on remote wakeup

Kenneth Klette Jonassen (1):
pkt_sched: fq: avoid hang when quantum 0

Lars Möllendorf (1):
iio: buffer: align the size of scan bytes to size of the largest element

Leo Yan (1):
tty: serial: msm_serial: Fix lockup for sysrq and oops

Linus Torvalds (1):
floppy: check FDC index for errors before assigning it

Liu Bo (9):
Btrfs: add validadtion checks for chunk loading
Btrfs: check inconsistence between chunk and block group
Btrfs: detect corruption when non-root leaf has zero item
Btrfs: check btree node's nritems
Btrfs: fix BUG_ON in btrfs_mark_buffer_dirty
Btrfs: memset to avoid stale content in btree node block
Btrfs: improve check_node to avoid reading corrupted nodes
Btrfs: kill BUG_ON in run_delayed_tree_ref
Btrfs: memset to avoid stale content in btree leaf

Logan Gunthorpe (1):
chardev: add helper function to register char devs with a struct device

Lu Fengqi (1):
btrfs: Remove redundant btrfs_release_path from btrfs_unlink_subvol

Lukas Czerner (1):
ext4: wait for existing dio workers in ext4_alloc_file_blocks()

Luuk Paulussen (1):
hwmon: (adt7475) Make volt2reg return same reg as reg2volt input

Mao Wenan (2):
af_packet: set defaule value for tmo
net: sonic: return NETDEV_TX_OK if failed to map buffer

Marcel Holtmann (2):
HID: uhid: Fix returning EPOLLOUT from uhid_char_poll
HID: hidraw: Fix returning EPOLLOUT from hidraw_poll

Mathias Nyman (2):
xhci: handle some XHCI_TRUST_TX_LENGTH quirks cases as default behaviour.
xhci: make sure interrupts are restored to correct state

Mauro Carvalho Chehab (3):
media-devnode: just return 0 instead of using a var
media-devnode: fix namespace mess
media-device: dynamically allocate struct media_devnode

Max Kellermann (2):
drivers/media/media-devnode: clear private_data before put_device()
media-devnode: add missing mutex lock in error handler

Michael Straube (1):
staging: rtl8188eu: Add device code for TP-Link TL-WN727N v5.21

Michał Mirosław (1):
mmc: sdhci: fix minimum clock rate for v3 controller

Mika Westerberg (4):
pinctrl: baytrail: Relax GPIO request rules
pinctrl: baytrail: Clear interrupt triggering from pins that are in GPIO mode
pinctrl: baytrail: Rework interrupt handling
pinctrl: baytrail: Serialize all register access

Mike Snitzer (1):
dm flakey: fix reads to be issued if drop_writes configured

Mikulas Patocka (1):
block: fix an integer overflow in logical block size

Moni Shoua (1):
IB/mlx4: Avoid executing gid task when device is being removed

Nicolai Stange (2):
libertas: don't exit from lbs_ibss_join_existing() with RCU read lock held
libertas: make lbs_ibss_join_existing() return error code on rates overflow

Nikos Tsironis (1):
dm thin metadata: Add support for a pre-commit callback

Pablo Neira Ayuso (2):
netfilter: nf_tables: missing sanitization in data from userspace
netfilter: nf_tables: validate NFT_DATA_VALUE after nft_data_init()

Paolo Bonzini (1):
KVM: nVMX: Don't emulate instructions in guest mode

Parav Pandit (1):
IB/mlx4: Follow mirror sequence of device add during device removal

Paul Cercueil (1):
usb: musb: dma: Correct parameter passed to IRQ handler

Pavel Tatashin (1):
x86/pti/efi: broken conversion from efi to kernel page table

Pengcheng Yang (1):
tcp: fix "old stuff" D-SACK causing SACK to be treated as D-SACK

Pete Zaitcev (1):
usb: mon: Fix a deadlock in usbmon between mmap and read

Peter Hurley (1):
tty: vt: Fix !TASK_RUNNING diagnostic warning from paste_selection()

Peter Zijlstra (1):
futex: Fix inode life-time issue

Qu Wenruo (14):
btrfs: Enhance chunk validation check
btrfs: Refactor check_leaf function for later expansion
btrfs: Check if item pointer overlaps with the item itself
btrfs: Add sanity check for EXTENT_DATA when reading out leaf
btrfs: Add checker for EXTENT_CSUM
btrfs: Move leaf and node validation checker to tree-checker.c
btrfs: tree-checker: Enhance btrfs_check_node output
btrfs: tree-checker: Fix false panic for sanity test
btrfs: tree-checker: Add checker for dir item
btrfs: tree-checker: Verify block_group_item
btrfs: tree-checker: Detect invalid and empty essential trees
btrfs: Check that each block group has corresponding chunk at mount time
btrfs: Verify that every chunk has corresponding block group at mount time
btrfs: tree-checker: Check level for leaves and nodes

Radoslaw Tyl (1):
ixgbevf: Remove limit of 10 entries for unicast filter list

Rafael J. Wysocki (1):
ACPI: PM: Avoid attaching ACPI PM domain to certain devices

Randy Dunlap (1):
mm: mempolicy: require at least one nodeid for MPOL_PREFERRED

Richard Palethorpe (2):
can, slip: Protect tty->disc_data in write_wakeup and close with RCU
slcan: Don't transmit uninitialized stack data in padding

Russell King (2):
gpiolib: fix up emulated open drain outputs
mod_devicetable: fix PHY module format

Sabrina Dubroca (1):
net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup

Salvatore Mesoraca (1):
namei: allow restricted O_CREAT of FIFOs and regular files

Shaokun Zhang (1):
btrfs: tree-checker: Fix misleading group system information

Shengjiu Wang (1):
ASoC: wm8962: fix lambda value

Shuah Khan (3):
media: Fix media_open() to clear filp->private_data in error leg
media: fix use-after-free in cdev_put() when app exits after driver unbind
media: fix media devnode ioctl/syscall and unregister race

Steven Rostedt (VMware) (1):
tracing: Have stack tracer compile when MCOUNT_INSN_SIZE is not defined

Sudip Mukherjee (2):
tty: link tty and port before configuring it as console
tty: always relink the port

Suren Baghdasaryan (1):
staging: android: ashmem: Disallow ashmem memory from being remapped

Suwan Kim (1):
usbip: Fix error path of vhci_recv_ret_submit()

Sven Eckelmann (1):
batman-adv: Fix DAT candidate selection on little endian systems

Takashi Iwai (4):
ALSA: pcm: Avoid possible info leaks from PCM stream buffers
ALSA: hda/ca0132 - Avoid endless loop
ALSA: ice1724: Fix sleep-in-atomic in Infrasonic Quartet support code
ALSA: seq: Fix racy access for queue timer in proc read

Thomas Gleixner (1):
futex: Unbreak futex hashing

Tom Lendacky (1):
x86/microcode/AMD: Add support for fam17h microcode loading

Vivek Goyal (1):
dm: do not override error code returned from dm_get_device()

Vladis Dronov (2):
ptp: fix the race between the release of ptp_clock and cdev
ptp: free ptp device pin descriptors properly

Wang Shilong (1):
Btrfs: fix wrong max inline data size limit

Wei Yongjun (1):
dm flakey: return -EINVAL on interval bounds error in flakey_ctr()

Wen Huang (1):
libertas: Fix two buffer overflows at parsing bss descriptor

Wen Yang (1):
ftrace: Avoid potential division by zero in function profiler

Will Deacon (1):
chardev: Avoid potential use-after-free in 'chrdev_open()'

Xiang Chen (1):

      scsi: sd: Clear sdkp->protection_type if disk is reformatted without PI

Xin Long (1):

      sctp: free cmd->obj.chunk for the unprocessed SCTP_CMD_REPLY

YueHaibing (1):
ptp: Fix pass zero to ERR_PTR() in ptp_clock_register

Zhang Xiaoxu (1):
vgacon: Fix a UAF in vgacon_invert_region

qize wang (1):
mwifiex: Fix heap overflow in mmwifiex_process_tdls_action_frame()

Documentation/sysctl/fs.txt +36 -0
index 35e17f748ca7..af5859b2d0f9 100644
@@ -34,7 +34,9 @@ before actually making adjustments.
 - overflowgid
 - pipe-user-pages-hard
 - pipe-user-pages-soft
+- protected_fifos
 - protected_hardlinks
+- protected_regular
 - protected_symlinks
 - suid_dumpable
 - super-max
@@ -182,6 +184,24 @@ applied.
 
 ==============================================================
 
+protected_fifos:
+
+The intent of this protection is to avoid unintentional writes to
+an attacker-controlled FIFO, where a program expected to create a regular
+file.
+
+When set to "0", writing to FIFOs is unrestricted.
+
+When set to "1" don't allow O_CREAT open on FIFOs that we don't own
+in world writable sticky directories, unless they are owned by the
+owner of the directory.
+
+When set to "2" it also applies to group writable sticky directories.
+
+This protection is based on the restrictions in Openwall.
+
+==============================================================
+
 protected_hardlinks:
 
 A long-standing class of security issues is the hardlink-based
@@ -202,6 +222,22 @@ This protection is based on the restrictions in Openwall and grsecurity.
 
 ==============================================================
 
+protected_regular:
+
+This protection is similar to protected_fifos, but it
+avoids writes to an attacker-controlled regular file, where a program
+expected to create one.
+
+When set to "0", writing to regular files is unrestricted.
+
+When set to "1" don't allow O_CREAT open on regular files that we
+don't own in world writable sticky directories, unless they are
+owned by the owner of the directory.
+
+When set to "2" it also applies to group writable sticky directories.
+
+==============================================================
+
 protected_symlinks:
 
 A long-standing class of security issues is the symlink-based
Makefile +1 -1
index 64e7647e6a9d..99500d145fab 100644
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 16
-SUBLEVEL = 82
+SUBLEVEL = 83
 EXTRAVERSION =
 NAME = Museum of Fishiegoodies
 
arch/powerpc/kernel/irq.c +2 -2
index 856a6cac5c3e..c755e672d96e 100644
@@ -471,8 +471,6 @@ void __do_irq(struct pt_regs *regs)
 
 	trace_irq_entry(regs);
 
-	check_stack_overflow();
-
 	/*
 	 * Query the platform PIC for the interrupt & ack it.
 	 *
@@ -504,6 +502,8 @@ void do_IRQ(struct pt_regs *regs)
 	irqtp = hardirq_ctx[raw_smp_processor_id()];
 	sirqtp = softirq_ctx[raw_smp_processor_id()];
 
+	check_stack_overflow();
+
 	/* Already there ? */
 	if (unlikely(curtp == irqtp || curtp == sirqtp)) {
 		__do_irq(regs);
arch/x86/boot/compressed/head_64.S +5 -0
index 6b1766c6c082..2fcd71219b92 100644
@@ -216,6 +216,11 @@ ENTRY(efi32_stub_entry)
 	leal	efi32_config(%ebp), %eax
 	movl	%eax, efi_config(%ebp)
 
+	/* Disable paging */
+	movl	%cr0, %eax
+	btrl	$X86_CR0_PG_BIT, %eax
+	movl	%eax, %cr0
+
 	jmp	startup_32
 ENDPROC(efi32_stub_entry)
 #endif
arch/x86/include/asm/kaiser.h +10 -0
index 802bbbdfe143..48c791a411ab 100644
@@ -19,6 +19,16 @@
 
 #define KAISER_SHADOW_PGD_OFFSET 0x1000
 
+#ifdef CONFIG_PAGE_TABLE_ISOLATION
+/*
+ *  A page table address must have this alignment to stay the same when
+ *  KAISER_SHADOW_PGD_OFFSET mask is applied
+ */
+#define KAISER_KERNEL_PGD_ALIGNMENT (KAISER_SHADOW_PGD_OFFSET << 1)
+#else
+#define KAISER_KERNEL_PGD_ALIGNMENT PAGE_SIZE
+#endif
+
 #ifdef __ASSEMBLY__
 #ifdef CONFIG_PAGE_TABLE_ISOLATION
 
arch/x86/kernel/cpu/microcode/amd.c +4 -0
index ff16949e7f3d..6068c25e7c48 100644
@@ -154,6 +154,7 @@ static unsigned int verify_patch_size(u8 family, u32 patch_size,
 #define F14H_MPB_MAX_SIZE 1824
 #define F15H_MPB_MAX_SIZE 4096
 #define F16H_MPB_MAX_SIZE 3458
+#define F17H_MPB_MAX_SIZE 3200
 
 	switch (family) {
 	case 0x14:
@@ -165,6 +166,9 @@ static unsigned int verify_patch_size(u8 family, u32 patch_size,
 	case 0x16:
 		max_size = F16H_MPB_MAX_SIZE;
 		break;
+	case 0x17:
+		max_size = F17H_MPB_MAX_SIZE;
+		break;
 	default:
 		max_size = F1XH_MPB_MAX_SIZE;
 		break;
arch/x86/kvm/cpuid.c +2 -1
index 66062325d4b7..22958dcfccd9 100644
@@ -400,7 +400,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 				entry->edx |= F(SPEC_CTRL);
 			if (boot_cpu_has(X86_FEATURE_STIBP))
 				entry->edx |= F(INTEL_STIBP);
-			if (boot_cpu_has(X86_FEATURE_SSBD))
+			if (boot_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD) ||
+			    boot_cpu_has(X86_FEATURE_AMD_SSBD))
 				entry->edx |= F(SPEC_CTRL_SSBD);
 			/*
 			 * We emulate ARCH_CAPABILITIES in software even
arch/x86/kvm/vmx.c +1 -1
index a1dbb20b768b..1faaa78505f4 100644
@@ -8938,7 +8938,7 @@ static int vmx_check_intercept(struct kvm_vcpu *vcpu,
 			       struct x86_instruction_info *info,
 			       enum x86_intercept_stage stage)
 {
-	return X86EMUL_CONTINUE;
+	return X86EMUL_UNHANDLEABLE;
 }
 
 static struct kvm_x86_ops vmx_x86_ops = {
arch/x86/realmode/init.c +3 -1
index bad628a620c4..66f20e7756cc 100644
@@ -4,6 +4,7 @@
 #include <asm/cacheflush.h>
 #include <asm/pgtable.h>
 #include <asm/realmode.h>
+#include <asm/kaiser.h>
 
 struct real_mode_header *real_mode_header;
 u32 *trampoline_cr4_features;
@@ -15,7 +16,8 @@ void __init reserve_real_mode(void)
 	size_t size = PAGE_ALIGN(real_mode_blob_end - real_mode_blob);
 
 	/* Has to be under 1M so we can execute real-mode AP code. */
-	mem = memblock_find_in_range(0, 1<<20, size, PAGE_SIZE);
+	mem = memblock_find_in_range(0, 1 << 20, size,
+				     KAISER_KERNEL_PGD_ALIGNMENT);
 	if (!mem)
 		panic("Cannot allocate trampoline\n");
 
arch/x86/realmode/rm/trampoline_64.S +2 -1
index dac7b20d2f9d..781cca63f795 100644
@@ -30,6 +30,7 @@
 #include <asm/msr.h>
 #include <asm/segment.h>
 #include <asm/processor-flags.h>
+#include <asm/kaiser.h>
 #include "realmode.h"
 
 	.text
@@ -139,7 +140,7 @@ ENTRY(startup_64)
 tr_gdt_end:
 
 	.bss
-	.balign	PAGE_SIZE
+	.balign	KAISER_KERNEL_PGD_ALIGNMENT
 GLOBAL(trampoline_pgd)		.space	PAGE_SIZE
 
 	.balign	8
block/blk-settings.c +1 -1
index aa02247d227e..f1bd4ca22c6b 100644
@@ -373,7 +373,7 @@ EXPORT_SYMBOL(blk_queue_max_segment_size);
  *   storage device can address.  The default of 512 covers most
  *   hardware.
  **/
-void blk_queue_logical_block_size(struct request_queue *q, unsigned short size)
+void blk_queue_logical_block_size(struct request_queue *q, unsigned int size)
 {
 	q->limits.logical_block_size = size;
 
drivers/acpi/device_pm.c +11 -1
index e9f44a210712..4a41ec7414db 100644
@@ -1041,9 +1041,19 @@ static struct dev_pm_domain acpi_general_pm_domain = {
  */
 int acpi_dev_pm_attach(struct device *dev, bool power_on)
 {
+	/*
+	 * Skip devices whose ACPI companions match the device IDs below,
+	 * because they require special power management handling incompatible
+	 * with the generic ACPI PM domain.
+	 */
+	static const struct acpi_device_id special_pm_ids[] = {
+		{"PNP0C0B", }, /* Generic ACPI fan */
+		{"INT3404", }, /* Fan */
+		{}
+	};
 	struct acpi_device *adev = ACPI_COMPANION(dev);
 
-	if (!adev)
+	if (!adev || !acpi_match_device_ids(adev, special_pm_ids))
 		return -ENODEV;
 
 	if (dev->pm_domain)
drivers/block/floppy.c +5 -2
index 3999b8c6a09d..85c8bcb8157b 100644
@@ -847,14 +847,17 @@ static void reset_fdc_info(int mode)
 /* selects the fdc and drive, and enables the fdc's input/dma. */
 static void set_fdc(int drive)
 {
+	unsigned int new_fdc = fdc;
+
 	if (drive >= 0 && drive < N_DRIVE) {
-		fdc = FDC(drive);
+		new_fdc = FDC(drive);
 		current_drive = drive;
 	}
-	if (fdc != 1 && fdc != 0) {
+	if (new_fdc >= N_FDC) {
 		pr_info("bad fdc value\n");
 		return;
 	}
+	fdc = new_fdc;
 	set_dor(fdc, ~0, 8);
 #if N_FDC > 1
 	set_dor(1 - fdc, ~8, 0);
drivers/gpio/gpiolib.c +11 -2
index c6eaa7a4539c..770eabbc554b 100644
@@ -273,6 +273,14 @@ int gpiod_get_direction(const struct gpio_desc *desc)
 	chip = gpiod_to_chip(desc);
 	offset = gpio_chip_hwgpio(desc);
 
+	/*
+	 * Open drain emulation using input mode may incorrectly report
+	 * input here, fix that up.
+	 */
+	if (test_bit(FLAG_OPEN_DRAIN, &desc->flags) &&
+	    test_bit(FLAG_IS_OUT, &desc->flags))
+		return 0;
+
 	if (!chip->get_direction)
 		return status;
 
@@ -2743,8 +2751,9 @@ static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id,
 
 		if (chip->ngpio <= p->chip_hwnum) {
 			dev_err(dev,
-				"requested GPIO %d is out of range [0..%d] for chip %s\n",
-				idx, chip->ngpio, chip->label);
+				"requested GPIO %u (%u) is out of range [0..%u] for chip %s\n",
+				idx, p->chip_hwnum, chip->ngpio - 1,
+				chip->label);
 			return ERR_PTR(-EINVAL);
 		}
 
drivers/hid/hid-core.c +6 -0
index 38b1cad80322..c8f21de0fc19 100644
@@ -248,6 +248,12 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign
 	offset = report->size;
 	report->size += parser->global.report_size * parser->global.report_count;
 
+	/* Total size check: Allow for possible report index byte */
+	if (report->size > (HID_MAX_BUFFER_SIZE - 1) << 3) {
+		hid_err(parser->device, "report is too long\n");
+		return -1;
+	}
+
 	if (!parser->local.usage_index) /* Ignore padding fields */
 		return 0;
 
drivers/hid/hid-input.c +12 -4
index 39b4193a37f4..b65eb2a723ac 100644
@@ -947,9 +947,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 	}
 
 mapped:
-	if (device->driver->input_mapped && device->driver->input_mapped(device,
-				hidinput, field, usage, &bit, &max) < 0)
-		goto ignore;
+	if (device->driver->input_mapped &&
+	    device->driver->input_mapped(device, hidinput, field, usage,
+					 &bit, &max) < 0) {
+		/*
+		 * The driver indicated that no further generic handling
+		 * of the usage is desired.
+		 */
+		return;
+	}
 
 	set_bit(usage->type, input->evbit);
 
@@ -1008,9 +1014,11 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 		set_bit(MSC_SCAN, input->mscbit);
 	}
 
-ignore:
 	return;
 
+ignore:
+	usage->type = 0;
+	usage->code = 0;
 }
 
 void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
drivers/hid/hidraw.c +4 -3
index 627a24d3ea7c..ef9e196b54a5 100644
@@ -262,13 +262,14 @@ static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t
 static unsigned int hidraw_poll(struct file *file, poll_table *wait)
 {
 	struct hidraw_list *list = file->private_data;
+	unsigned int mask = POLLOUT | POLLWRNORM; /* hidraw is always writable */
 
 	poll_wait(file, &list->hidraw->wait, wait);
 	if (list->head != list->tail)
-		return POLLIN | POLLRDNORM;
+		mask |= POLLIN | POLLRDNORM;
 	if (!list->hidraw->exist)
-		return POLLERR | POLLHUP;
-	return 0;
+		mask |= POLLERR | POLLHUP;
+	return mask;
 }
 
 static int hidraw_open(struct inode *inode, struct file *file)
drivers/hid/uhid.c +3 -2
index 035c7c2863dc..f4063d788469 100644
@@ -720,13 +720,14 @@ static ssize_t uhid_char_write(struct file *file, const char __user *buffer,
 static unsigned int uhid_char_poll(struct file *file, poll_table *wait)
 {
 	struct uhid_device *uhid = file->private_data;
+	unsigned int mask = POLLOUT | POLLWRNORM; /* uhid is always writable */
 
 	poll_wait(file, &uhid->waitq, wait);
 
 	if (uhid->head != uhid->tail)
-		return POLLIN | POLLRDNORM;
+		mask |= POLLIN | POLLRDNORM;
 
-	return 0;
+	return mask;
 }
 
 static const struct file_operations uhid_fops = {
drivers/hwmon/adt7475.c +3 -2
index 3cefd1aeb24f..1b9f6adcbd85 100644
@@ -268,9 +268,10 @@ static inline u16 volt2reg(int channel, long volt, u8 bypass_attn)
 	long reg;
 
 	if (bypass_attn & (1 << channel))
-		reg = (volt * 1024) / 2250;
+		reg = DIV_ROUND_CLOSEST(volt * 1024, 2250);
 	else
-		reg = (volt * r[1] * 1024) / ((r[0] + r[1]) * 2250);
+		reg = DIV_ROUND_CLOSEST(volt * r[1] * 1024,
+					(r[0] + r[1]) * 2250);
 	return clamp_val(reg, 0, 1023) & (0xff << 2);
 }
 
drivers/iio/industrialio-buffer.c +5 -1
index 77b19ca8b763..6479e3ec2110 100644
@@ -478,7 +478,7 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev,
 {
 	const struct iio_chan_spec *ch;
 	unsigned bytes = 0;
-	int length, i;
+	int length, i, largest = 0;
 
 	/* How much space will the demuxed element take? */
 	for_each_set_bit(i, mask,
@@ -491,6 +491,7 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev,
 			length = ch->scan_type.storagebits / 8;
 		bytes = ALIGN(bytes, length);
 		bytes += length;
+		largest = max(largest, length);
 	}
 	if (timestamp) {
 		ch = iio_find_channel_from_si(indio_dev,
@@ -502,7 +503,10 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev,
 			length = ch->scan_type.storagebits / 8;
 		bytes = ALIGN(bytes, length);
 		bytes += length;
+		largest = max(largest, length);
 	}
+
+	bytes = ALIGN(bytes, largest);
 	return bytes;
 }
 
drivers/infiniband/hw/mlx4/main.c +13 -3
index 79a8accc0801..401f556d954c 100644
@@ -1395,6 +1395,9 @@ static void update_gids_task(struct work_struct *work)
 	int err;
 	struct mlx4_dev	*dev = gw->dev->dev;
 
+	if (!gw->dev->ib_active)
+		return;
+
 	mailbox = mlx4_alloc_cmd_mailbox(dev);
 	if (IS_ERR(mailbox)) {
 		pr_warn("update gid table failed %ld\n", PTR_ERR(mailbox));
@@ -1425,6 +1428,9 @@ static void reset_gids_task(struct work_struct *work)
 	int err;
 	struct mlx4_dev	*dev = gw->dev->dev;
 
+	if (!gw->dev->ib_active)
+		return;
+
 	mailbox = mlx4_alloc_cmd_mailbox(dev);
 	if (IS_ERR(mailbox)) {
 		pr_warn("reset gid table failed\n");
@@ -2363,15 +2369,19 @@ static void mlx4_ib_remove(struct mlx4_dev *dev, void *ibdev_ptr)
 	struct mlx4_ib_dev *ibdev = ibdev_ptr;
 	int p;
 
-	mlx4_ib_close_sriov(ibdev);
-	mlx4_ib_mad_cleanup(ibdev);
-	ib_unregister_device(&ibdev->ib_dev);
+	ibdev->ib_active = false;
+	flush_workqueue(wq);
+
 	if (ibdev->iboe.nb.notifier_call) {
 		if (unregister_netdevice_notifier(&ibdev->iboe.nb))
 			pr_warn("failure unregistering notifier\n");
 		ibdev->iboe.nb.notifier_call = NULL;
 	}
 
+	mlx4_ib_close_sriov(ibdev);
+	mlx4_ib_mad_cleanup(ibdev);
+	ib_unregister_device(&ibdev->ib_dev);
+
 	mlx4_qp_release_range(dev, ibdev->steer_qpn_base,
 			      ibdev->steer_qpn_count);
 	kfree(ibdev->ib_uc_qpns_bitmap);
drivers/input/input.c +16 -10
index 29ca0bb4f561..0a9e49e425a1 100644
@@ -841,16 +841,18 @@ static int input_default_setkeycode(struct input_dev *dev,
 		}
 	}
 
-	__clear_bit(*old_keycode, dev->keybit);
-	__set_bit(ke->keycode, dev->keybit);
-
-	for (i = 0; i < dev->keycodemax; i++) {
-		if (input_fetch_keycode(dev, i) == *old_keycode) {
-			__set_bit(*old_keycode, dev->keybit);
-			break; /* Setting the bit twice is useless, so break */
+	if (*old_keycode <= KEY_MAX) {
+		__clear_bit(*old_keycode, dev->keybit);
+		for (i = 0; i < dev->keycodemax; i++) {
+			if (input_fetch_keycode(dev, i) == *old_keycode) {
+				__set_bit(*old_keycode, dev->keybit);
+				/* Setting the bit twice is useless, so break */
+				break;
+			}
 		}
 	}
 
+	__set_bit(ke->keycode, dev->keybit);
 	return 0;
 }
 
@@ -906,9 +908,13 @@ int input_set_keycode(struct input_dev *dev,
 	 * Simulate keyup event if keycode is not present
 	 * in the keymap anymore
 	 */
-	if (test_bit(EV_KEY, dev->evbit) &&
-	    !is_event_supported(old_keycode, dev->keybit, KEY_MAX) &&
-	    __test_and_clear_bit(old_keycode, dev->key)) {
+	if (old_keycode > KEY_MAX) {
+		dev_warn(dev->dev.parent ?: &dev->dev,
+			 "%s: got too big old keycode %#x\n",
+			 __func__, old_keycode);
+	} else if (test_bit(EV_KEY, dev->evbit) &&
+		   !is_event_supported(old_keycode, dev->keybit, KEY_MAX) &&
+		   __test_and_clear_bit(old_keycode, dev->key)) {
 		struct input_value vals[] =  {
 			{ EV_KEY, old_keycode, 0 },
 			input_value_sync
drivers/input/misc/keyspan_remote.c +6 -3
index 01f3b5b300f3..7ed630da6b19 100644
@@ -344,7 +344,8 @@ static int keyspan_setup(struct usb_device* dev)
 	int retval = 0;
 
 	retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
-				 0x11, 0x40, 0x5601, 0x0, NULL, 0, 0);
+				 0x11, 0x40, 0x5601, 0x0, NULL, 0,
+				 USB_CTRL_SET_TIMEOUT);
 	if (retval) {
 		dev_dbg(&dev->dev, "%s - failed to set bit rate due to error: %d\n",
 			__func__, retval);
@@ -352,7 +353,8 @@ static int keyspan_setup(struct usb_device* dev)
 	}
 
 	retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
-				 0x44, 0x40, 0x0, 0x0, NULL, 0, 0);
+				 0x44, 0x40, 0x0, 0x0, NULL, 0,
+				 USB_CTRL_SET_TIMEOUT);
 	if (retval) {
 		dev_dbg(&dev->dev, "%s - failed to set resume sensitivity due to error: %d\n",
 			__func__, retval);
@@ -360,7 +362,8 @@ static int keyspan_setup(struct usb_device* dev)
 	}
 
 	retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
-				 0x22, 0x40, 0x0, 0x0, NULL, 0, 0);
+				 0x22, 0x40, 0x0, 0x0, NULL, 0,
+				 USB_CTRL_SET_TIMEOUT);
 	if (retval) {
 		dev_dbg(&dev->dev, "%s - failed to turn receive on due to error: %d\n",
 			__func__, retval);
drivers/input/tablet/aiptek.c +3 -3
index 78ca44840d60..40a166773c1b 100644
@@ -1820,14 +1820,14 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
 	input_set_abs_params(inputdev, ABS_WHEEL, AIPTEK_WHEEL_MIN, AIPTEK_WHEEL_MAX - 1, 0, 0);
 
 	/* Verify that a device really has an endpoint */
-	if (intf->altsetting[0].desc.bNumEndpoints < 1) {
+	if (intf->cur_altsetting->desc.bNumEndpoints < 1) {
 		dev_err(&intf->dev,
 			"interface has %d endpoints, but must have minimum 1\n",
-			intf->altsetting[0].desc.bNumEndpoints);
+			intf->cur_altsetting->desc.bNumEndpoints);
 		err = -EINVAL;
 		goto fail3;
 	}
-	endpoint = &intf->altsetting[0].endpoint[0].desc;
+	endpoint = &intf->cur_altsetting->endpoint[0].desc;
 
 	/* Go set up our URB, which is called when the tablet receives
 	 * input.
drivers/input/tablet/gtco.c +3 -7
index cf3af3a3297a..a0f69a015e0e 100644
@@ -886,18 +886,14 @@ static int gtco_probe(struct usb_interface *usbinterface,
 	}
 
 	/* Sanity check that a device has an endpoint */
-	if (usbinterface->altsetting[0].desc.bNumEndpoints < 1) {
+	if (usbinterface->cur_altsetting->desc.bNumEndpoints < 1) {
 		dev_err(&usbinterface->dev,
 			"Invalid number of endpoints\n");
 		error = -EINVAL;
 		goto err_free_urb;
 	}
 
-	/*
-	 * The endpoint is always altsetting 0, we know this since we know
-	 * this device only has one interrupt endpoint
-	 */
-	endpoint = &usbinterface->altsetting[0].endpoint[0].desc;
+	endpoint = &usbinterface->cur_altsetting->endpoint[0].desc;
 
 	/* Some debug */
 	dev_dbg(&usbinterface->dev, "gtco # interfaces: %d\n", usbinterface->num_altsetting);
@@ -984,7 +980,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
 	input_dev->dev.parent = &usbinterface->dev;
 
 	/* Setup the URB, it will be posted later on open of input device */
-	endpoint = &usbinterface->altsetting[0].endpoint[0].desc;
+	endpoint = &usbinterface->cur_altsetting->endpoint[0].desc;
 
 	usb_fill_int_urb(gtco->urbinfo,
 			 gtco->usbdev,
drivers/input/touchscreen/sur40.c +1 -1
index af96ffcbcffd..c218ac6c2745 100644
@@ -357,7 +357,7 @@ static int sur40_probe(struct usb_interface *interface,
 	int error;
 
 	/* Check if we really have the right interface. */
-	iface_desc = &interface->altsetting[0];
+	iface_desc = interface->cur_altsetting;
 	if (iface_desc->desc.bInterfaceClass != 0xFF)
 		return -ENODEV;
 
drivers/isdn/gigaset/usb-gigaset.c +18 -5
index d0a41cb0cf62..3a6c6bc4a7ae 100644
@@ -578,8 +578,7 @@ static int gigaset_initcshw(struct cardstate *cs)
 {
 	struct usb_cardstate *ucs;
 
-	cs->hw.usb = ucs =
-		kmalloc(sizeof(struct usb_cardstate), GFP_KERNEL);
+	cs->hw.usb = ucs = kzalloc(sizeof(struct usb_cardstate), GFP_KERNEL);
 	if (!ucs) {
 		pr_err("out of memory\n");
 		return -ENOMEM;
@@ -591,9 +590,6 @@ static int gigaset_initcshw(struct cardstate *cs)
 	ucs->bchars[3] = 0;
 	ucs->bchars[4] = 0x11;
 	ucs->bchars[5] = 0x13;
-	ucs->bulk_out_buffer = NULL;
-	ucs->bulk_out_urb = NULL;
-	ucs->read_urb = NULL;
 	tasklet_init(&cs->write_tasklet,
 		     gigaset_modem_fill, (unsigned long) cs);
 
@@ -693,6 +689,11 @@ static int gigaset_probe(struct usb_interface *interface,
 		return -ENODEV;
 	}
 
+	if (hostif->desc.bNumEndpoints < 2) {
+		dev_err(&interface->dev, "missing endpoints\n");
+		return -ENODEV;
+	}
+
 	dev_info(&udev->dev, "%s: Device matched ... !\n", __func__);
 
 	/* allocate memory for our device state and initialize it */
@@ -712,6 +713,12 @@ static int gigaset_probe(struct usb_interface *interface,
 
 	endpoint = &hostif->endpoint[0].desc;
 
+	if (!usb_endpoint_is_bulk_out(endpoint)) {
+		dev_err(&interface->dev, "missing bulk-out endpoint\n");
+		retval = -ENODEV;
+		goto error;
+	}
+
 	buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
 	ucs->bulk_out_size = buffer_size;
 	ucs->bulk_out_endpointAddr = endpoint->bEndpointAddress;
@@ -731,6 +738,12 @@ static int gigaset_probe(struct usb_interface *interface,
 
 	endpoint = &hostif->endpoint[1].desc;
 
+	if (!usb_endpoint_is_int_in(endpoint)) {
+		dev_err(&interface->dev, "missing int-in endpoint\n");
+		retval = -ENODEV;
+		goto error;
+	}
+
 	ucs->busy = 0;
 
 	ucs->read_urb = usb_alloc_urb(0, GFP_KERNEL);
drivers/md/dm-crypt.c +3 -1
index dfab51ff09ea..284871a103f8 100644
@@ -1762,11 +1762,13 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 	}
 	cc->iv_offset = tmpll;
 
-	if (dm_get_device(ti, argv[3], dm_table_get_mode(ti->table), &cc->dev)) {
+	ret = dm_get_device(ti, argv[3], dm_table_get_mode(ti->table), &cc->dev);
+	if (ret) {
 		ti->error = "Device lookup failed";
 		goto bad;
 	}
 
+	ret = -EINVAL;
 	if (sscanf(argv[4], "%llu%c", &tmpll, &dummy) != 1) {
 		ti->error = "Invalid device sector";
 		goto bad;
drivers/md/dm-delay.c +11 -5
index 42c3a27a14cc..7e194aa14634 100644
@@ -129,6 +129,7 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 	struct delay_c *dc;
 	unsigned long long tmpll;
 	char dummy;
+	int ret;
 
 	if (argc != 3 && argc != 6) {
 		ti->error = "requires exactly 3 or 6 arguments";
@@ -143,6 +144,7 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 
 	dc->reads = dc->writes = 0;
 
+	ret = -EINVAL;
 	if (sscanf(argv[1], "%llu%c", &tmpll, &dummy) != 1) {
 		ti->error = "Invalid device sector";
 		goto bad;
@@ -154,12 +156,14 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 		goto bad;
 	}
 
-	if (dm_get_device(ti, argv[0], dm_table_get_mode(ti->table),
-			  &dc->dev_read)) {
+	ret = dm_get_device(ti, argv[0], dm_table_get_mode(ti->table),
+			    &dc->dev_read);
+	if (ret) {
 		ti->error = "Device lookup failed";
 		goto bad;
 	}
 
+	ret = -EINVAL;
 	dc->dev_write = NULL;
 	if (argc == 3)
 		goto out;
@@ -175,13 +179,15 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 		goto bad_dev_read;
 	}
 
-	if (dm_get_device(ti, argv[3], dm_table_get_mode(ti->table),
-			  &dc->dev_write)) {
+	ret = dm_get_device(ti, argv[3], dm_table_get_mode(ti->table),
+			    &dc->dev_write);
+	if (ret) {
 		ti->error = "Write device lookup failed";
 		goto bad_dev_read;
 	}
 
 out:
+	ret = -EINVAL;
 	dc->kdelayd_wq = alloc_workqueue("kdelayd", WQ_MEM_RECLAIM, 0);
 	if (!dc->kdelayd_wq) {
 		DMERR("Couldn't start kdelayd");
@@ -208,7 +214,7 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 	dm_put_device(ti, dc->dev_read);
 bad:
 	kfree(dc);
-	return -EINVAL;
+	return ret;
 }
 
 static void delay_dtr(struct dm_target *ti)
drivers/md/dm-flakey.c +27 -13
index 0f5e1820c92d..8809c5e6f6ac 100644
@@ -69,6 +69,11 @@ static int parse_features(struct dm_arg_set *as, struct flakey_c *fc,
 		arg_name = dm_shift_arg(as);
 		argc--;
 
+		if (!arg_name) {
+			ti->error = "Insufficient feature arguments";
+			return -EINVAL;
+		}
+
 		/*
 		 * drop_writes
 		 */
@@ -183,6 +188,7 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 
 	devname = dm_shift_arg(&as);
 
+	r = -EINVAL;
 	if (sscanf(dm_shift_arg(&as), "%llu%c", &tmpll, &dummy) != 1) {
 		ti->error = "Invalid device sector";
 		goto bad;
@@ -199,11 +205,13 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 
 	if (!(fc->up_interval + fc->down_interval)) {
 		ti->error = "Total (up + down) interval is zero";
+		r = -EINVAL;
 		goto bad;
 	}
 
 	if (fc->up_interval + fc->down_interval < fc->up_interval) {
 		ti->error = "Interval overflow";
+		r = -EINVAL;
 		goto bad;
 	}
 
@@ -211,7 +219,8 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 	if (r)
 		goto bad;
 
-	if (dm_get_device(ti, devname, dm_table_get_mode(ti->table), &fc->dev)) {
+	r = dm_get_device(ti, devname, dm_table_get_mode(ti->table), &fc->dev);
+	if (r) {
 		ti->error = "Device lookup failed";
 		goto bad;
 	}
@@ -224,7 +233,7 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 
 bad:
 	kfree(fc);
-	return -EINVAL;
+	return r;
 }
 
 static void flakey_dtr(struct dm_target *ti)
@@ -287,15 +296,13 @@ static int flakey_map(struct dm_target *ti, struct bio *bio)
 		pb->bio_submitted = true;
 
 		/*
-		 * Map reads as normal only if corrupt_bio_byte set.
+		 * Error reads if neither corrupt_bio_byte or drop_writes are set.
+		 * Otherwise, flakey_end_io() will decide if the reads should be modified.
 		 */
 		if (bio_data_dir(bio) == READ) {
-			/* If flags were specified, only corrupt those that match. */
-			if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw == READ) &&
-			    all_corrupt_bio_flags_match(bio, fc))
-				goto map_bio;
-			else
+			if (!fc->corrupt_bio_byte && !test_bit(DROP_WRITES, &fc->flags))
 				return -EIO;
+			goto map_bio;
 		}
 
 		/*
@@ -332,14 +339,21 @@ static int flakey_end_io(struct dm_target *ti, struct bio *bio, int error)
 	struct flakey_c *fc = ti->private;
 	struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data));
 
-	/*
-	 * Corrupt successful READs while in down state.
-	 */
 	if (!error && pb->bio_submitted && (bio_data_dir(bio) == READ)) {
-		if (fc->corrupt_bio_byte)
+		if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw == READ) &&
+		    all_corrupt_bio_flags_match(bio, fc)) {
+			/*
+			 * Corrupt successful matching READs while in down state.
+			 */
 			corrupt_bio_data(bio, fc);
-		else
+
+		} else if (!test_bit(DROP_WRITES, &fc->flags)) {
+			/*
+			 * Error read during the down_interval if drop_writes
+			 * wasn't configured.
+			 */
 			return -EIO;
+		}
 	}
 
 	return error;
drivers/md/dm-linear.c +5 -2
index 53e848c10939..62c26e4ad6ac 100644
@@ -30,6 +30,7 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 	struct linear_c *lc;
 	unsigned long long tmp;
 	char dummy;
+	int ret;
 
 	if (argc != 2) {
 		ti->error = "Invalid argument count";
@@ -42,13 +43,15 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 		return -ENOMEM;
 	}
 
+	ret = -EINVAL;
 	if (sscanf(argv[1], "%llu%c", &tmp, &dummy) != 1) {
 		ti->error = "dm-linear: Invalid device sector";
 		goto bad;
 	}
 	lc->start = tmp;
 
-	if (dm_get_device(ti, argv[0], dm_table_get_mode(ti->table), &lc->dev)) {
+	ret = dm_get_device(ti, argv[0], dm_table_get_mode(ti->table), &lc->dev);
+	if (ret) {
 		ti->error = "dm-linear: Device lookup failed";
 		goto bad;
 	}
@@ -61,7 +64,7 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 
       bad:
 	kfree(lc);
-	return -EINVAL;
+	return ret;
 }
 
 static void linear_dtr(struct dm_target *ti)
drivers/md/dm-raid1.c +5 -3
index 089d62751f7f..3a477f97952a 100644
@@ -923,16 +923,18 @@ static int get_mirror(struct mirror_set *ms, struct dm_target *ti,
 {
 	unsigned long long offset;
 	char dummy;
+	int ret;
 
 	if (sscanf(argv[1], "%llu%c", &offset, &dummy) != 1) {
 		ti->error = "Invalid offset";
 		return -EINVAL;
 	}
 
-	if (dm_get_device(ti, argv[0], dm_table_get_mode(ti->table),
-			  &ms->mirror[mirror].dev)) {
+	ret = dm_get_device(ti, argv[0], dm_table_get_mode(ti->table),
+			    &ms->mirror[mirror].dev);
+	if (ret) {
 		ti->error = "Device lookup failure";
-		return -ENXIO;
+		return ret;
 	}
 
 	ms->mirror[mirror].ms = ms;
drivers/md/dm-snap-persistent.c +1 -1
index d3272acc0f0e..2d6a12bd3b28 100644
@@ -16,7 +16,7 @@
 #include "dm-bufio.h"
 
 #define DM_MSG_PREFIX "persistent snapshot"
-#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32	/* 16KB */
+#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32U	/* 16KB */
 
 #define DM_PREFETCH_CHUNKS		12
 
drivers/md/dm-stripe.c +5 -3
index d1600d2aa2e2..e7b07b1282d8 100644
@@ -75,13 +75,15 @@ static int get_stripe(struct dm_target *ti, struct stripe_c *sc,
 {
 	unsigned long long start;
 	char dummy;
+	int ret;
 
 	if (sscanf(argv[1], "%llu%c", &start, &dummy) != 1)
 		return -EINVAL;
 
-	if (dm_get_device(ti, argv[0], dm_table_get_mode(ti->table),
-			  &sc->stripe[stripe].dev))
-		return -ENXIO;
+	ret = dm_get_device(ti, argv[0], dm_table_get_mode(ti->table),
+			    &sc->stripe[stripe].dev);
+	if (ret)
+		return ret;
 
 	sc->stripe[stripe].physical_start = start;
 
drivers/md/dm-thin-metadata.c +29 -0
index e6f64c472d5e..da54c8172df0 100644
@@ -197,6 +197,15 @@ struct dm_pool_metadata {
 	 */
 	bool fail_io:1;
 
+	/*
+	 * Pre-commit callback.
+	 *
+	 * This allows the thin provisioning target to run a callback before
+	 * the metadata are committed.
+	 */
+	dm_pool_pre_commit_fn pre_commit_fn;
+	void *pre_commit_context;
+
 	/*
 	 * Reading the space map roots can fail, so we read it into these
 	 * buffers before the superblock is locked and updated.
@@ -784,6 +793,14 @@ static int __commit_transaction(struct dm_pool_metadata *pmd)
 	 */
 	BUILD_BUG_ON(sizeof(struct thin_disk_superblock) > 512);
 
+	if (pmd->pre_commit_fn) {
+		r = pmd->pre_commit_fn(pmd->pre_commit_context);
+		if (r < 0) {
+			DMERR("pre-commit callback failed");
+			return r;
+		}
+	}
+
 	r = __write_changed_details(pmd);
 	if (r < 0)
 		return r;
@@ -844,6 +861,8 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev,
 	pmd->fail_io = false;
 	pmd->bdev = bdev;
 	pmd->data_block_size = data_block_size;
+	pmd->pre_commit_fn = NULL;
+	pmd->pre_commit_context = NULL;
 
 	r = __create_persistent_data_objects(pmd, format_device);
 	if (r) {
@@ -1789,6 +1808,16 @@ int dm_pool_register_metadata_threshold(struct dm_pool_metadata *pmd,
 	return r;
 }
 
+void dm_pool_register_pre_commit_callback(struct dm_pool_metadata *pmd,
+					  dm_pool_pre_commit_fn fn,
+					  void *context)
+{
+	down_write(&pmd->root_lock);
+	pmd->pre_commit_fn = fn;
+	pmd->pre_commit_context = context;
+	up_write(&pmd->root_lock);
+}
+
 int dm_pool_metadata_set_needs_check(struct dm_pool_metadata *pmd)
 {
 	int r;
drivers/md/dm-thin-metadata.h +7 -0
index e3c857db195a..9859dd9fb921 100644
@@ -213,6 +213,13 @@ int dm_pool_register_metadata_threshold(struct dm_pool_metadata *pmd,
 int dm_pool_metadata_set_needs_check(struct dm_pool_metadata *pmd);
 bool dm_pool_metadata_needs_check(struct dm_pool_metadata *pmd);
 
+/* Pre-commit callback */
+typedef int (*dm_pool_pre_commit_fn)(void *context);
+
+void dm_pool_register_pre_commit_callback(struct dm_pool_metadata *pmd,
+					  dm_pool_pre_commit_fn fn,
+					  void *context);
+
 /*----------------------------------------------------------------*/
 
 #endif
drivers/md/persistent-data/dm-btree-remove.c +7 -1
index 92cd09f3c69b..d9fb3490da5d 100644
@@ -203,7 +203,13 @@ static void __rebalance2(struct dm_btree_info *info, struct btree_node *parent,
 	struct btree_node *right = r->n;
 	uint32_t nr_left = le32_to_cpu(left->header.nr_entries);
 	uint32_t nr_right = le32_to_cpu(right->header.nr_entries);
-	unsigned threshold = 2 * merge_threshold(left) + 1;
+	/*
+	 * Ensure the number of entries in each child will be greater
+	 * than or equal to (max_entries / 3 + 1), so no matter which
+	 * child is used for removal, the number will still be not
+	 * less than (max_entries / 3).
+	 */
+	unsigned int threshold = 2 * (merge_threshold(left) + 1);
 
 	if (nr_left + nr_right < threshold) {
 		/*
drivers/md/raid0.c +1 -1
index 8f7dfc58f965..61165e528a5e 100644
@@ -88,7 +88,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
 	char b[BDEVNAME_SIZE];
 	char b2[BDEVNAME_SIZE];
 	struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
-	unsigned short blksize = 512;
+	unsigned blksize = 512;
 
 	if (!conf)
 		return -ENOMEM;
drivers/media/media-device.c +31 -12

92 lines not on this page · raw message

drivers/media/media-devnode.c +98 -73

321 lines not on this page · raw message

drivers/media/usb/gspca/ov519.c +10 -0
index c95f32a0c02b..6acb2132aedc 100644
@@ -3497,6 +3497,11 @@ static void ov511_mode_init_regs(struct sd *sd)
 		return;
 	}
 
+	if (alt->desc.bNumEndpoints < 1) {
+		sd->gspca_dev.usb_err = -ENODEV;
+		return;
+	}
+
 	packet_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
 	reg_w(sd, R51x_FIFO_PSIZE, packet_size >> 5);
 
@@ -3622,6 +3627,11 @@ static void ov518_mode_init_regs(struct sd *sd)
 		return;
 	}
 
+	if (alt->desc.bNumEndpoints < 1) {
+		sd->gspca_dev.usb_err = -ENODEV;
+		return;
+	}
+
 	packet_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
 	ov518_reg_w32(sd, R51x_FIFO_PSIZE, packet_size & ~7, 2);
 
drivers/media/usb/gspca/stv06xx/stv06xx.c +18 -1
index 49d209bbf9ee..66a007203b78 100644
@@ -293,6 +293,9 @@ static int stv06xx_start(struct gspca_dev *gspca_dev)
 		return -EIO;
 	}
 
+	if (alt->desc.bNumEndpoints < 1)
+		return -ENODEV;
+
 	packet_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
 	err = stv06xx_write_bridge(sd, STV_ISO_SIZE_L, packet_size);
 	if (err < 0)
@@ -317,11 +320,21 @@ static int stv06xx_start(struct gspca_dev *gspca_dev)
 
 static int stv06xx_isoc_init(struct gspca_dev *gspca_dev)
 {
+	struct usb_interface_cache *intfc;
 	struct usb_host_interface *alt;
 	struct sd *sd = (struct sd *) gspca_dev;
 
+	intfc = gspca_dev->dev->actconfig->intf_cache[0];
+
+	if (intfc->num_altsetting < 2)
+		return -ENODEV;
+
+	alt = &intfc->altsetting[1];
+
+	if (alt->desc.bNumEndpoints < 1)
+		return -ENODEV;
+
 	/* Start isoc bandwidth "negotiation" at max isoc bandwidth */
-	alt = &gspca_dev->dev->actconfig->intf_cache[0]->altsetting[1];
 	alt->endpoint[0].desc.wMaxPacketSize =
 		cpu_to_le16(sd->sensor->max_packet_size[gspca_dev->curr_mode]);
 
@@ -334,6 +347,10 @@ static int stv06xx_isoc_nego(struct gspca_dev *gspca_dev)
 	struct usb_host_interface *alt;
 	struct sd *sd = (struct sd *) gspca_dev;
 
+	/*
+	 * Existence of altsetting and endpoint was verified in
+	 * stv06xx_isoc_init()
+	 */
 	alt = &gspca_dev->dev->actconfig->intf_cache[0]->altsetting[1];
 	packet_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
 	min_packet_size = sd->sensor->min_packet_size[gspca_dev->curr_mode];
drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c +4 -0
index 8d785edcccf2..cc88c059b8d7 100644
@@ -198,6 +198,10 @@ static int pb0100_start(struct sd *sd)
 	alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt);
 	if (!alt)
 		return -ENODEV;
+
+	if (alt->desc.bNumEndpoints < 1)
+		return -ENODEV;
+
 	packet_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
 
 	/* If we don't have enough bandwidth use a lower framerate */
drivers/media/usb/gspca/xirlink_cit.c +17 -1
index a41aa7817c54..b05c27e847e4 100644
@@ -1455,6 +1455,9 @@ static int cit_get_packet_size(struct gspca_dev *gspca_dev)
 		return -EIO;
 	}
 
+	if (alt->desc.bNumEndpoints < 1)
+		return -ENODEV;
+
 	return le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
 }
 
@@ -2632,6 +2635,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
 
 static int sd_isoc_init(struct gspca_dev *gspca_dev)
 {
+	struct usb_interface_cache *intfc;
 	struct usb_host_interface *alt;
 	int max_packet_size;
 
@@ -2647,8 +2651,17 @@ static int sd_isoc_init(struct gspca_dev *gspca_dev)
 		break;
 	}
 
+	intfc = gspca_dev->dev->actconfig->intf_cache[0];
+
+	if (intfc->num_altsetting < 2)
+		return -ENODEV;
+
+	alt = &intfc->altsetting[1];
+
+	if (alt->desc.bNumEndpoints < 1)
+		return -ENODEV;
+
 	/* Start isoc bandwidth "negotiation" at max isoc bandwidth */
-	alt = &gspca_dev->dev->actconfig->intf_cache[0]->altsetting[1];
 	alt->endpoint[0].desc.wMaxPacketSize = cpu_to_le16(max_packet_size);
 
 	return 0;
@@ -2671,6 +2684,9 @@ static int sd_isoc_nego(struct gspca_dev *gspca_dev)
 		break;
 	}
 
+	/*
+	 * Existence of altsetting and endpoint was verified in sd_isoc_init()
+	 */
 	alt = &gspca_dev->dev->actconfig->intf_cache[0]->altsetting[1];
 	packet_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
 	if (packet_size <= min_packet_size)
drivers/media/usb/uvc/uvc_driver.c +1 -1
index 3b5f73ffe17a..9da63b6ff167 100644
@@ -1640,7 +1640,7 @@ static void uvc_delete(struct uvc_device *dev)
 	if (dev->vdev.dev)
 		v4l2_device_unregister(&dev->vdev);
 #ifdef CONFIG_MEDIA_CONTROLLER
-	if (media_devnode_is_registered(&dev->mdev.devnode))
+	if (media_devnode_is_registered(dev->mdev.devnode))
 		media_device_unregister(&dev->mdev);
 #endif
 
drivers/misc/enclosure.c +1 -2
index 6cab9411b158..56c52497d56c 100644
@@ -364,10 +364,9 @@ int enclosure_remove_device(struct enclosure_device *edev, struct device *dev)
 		cdev = &edev->component[i];
 		if (cdev->dev == dev) {
 			enclosure_remove_links(cdev);
-			device_del(&cdev->cdev);
 			put_device(dev);
 			cdev->dev = NULL;
-			return device_add(&cdev->cdev);
+			return 0;
 		}
 	}
 	return -ENODEV;
drivers/mmc/host/sdhci.c +6 -4
index 393444edc78e..be03d058528c 100644
@@ -2945,11 +2945,13 @@ int sdhci_add_host(struct sdhci_host *host)
 	if (host->ops->get_min_clock)
 		mmc->f_min = host->ops->get_min_clock(host);
 	else if (host->version >= SDHCI_SPEC_300) {
-		if (host->clk_mul) {
-			mmc->f_min = (host->max_clk * host->clk_mul) / 1024;
+		if (host->clk_mul)
 			mmc->f_max = host->max_clk * host->clk_mul;
-		} else
-			mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_300;
+		/*
+		 * Divided Clock Mode minimum clock rate is always less than
+		 * Programmable Clock Mode minimum clock rate.
+		 */
+		mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_300;
 	} else
 		mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200;
 
drivers/net/bonding/bond_main.c +21 -19
index 98f9fd6e37b6..3fb81bddf05b 100644
@@ -3421,33 +3421,35 @@ static int bond_neigh_init(struct neighbour *n)
 	const struct net_device_ops *slave_ops;
 	struct neigh_parms parms;
 	struct slave *slave;
-	int ret;
+	int ret = 0;
 
-	slave = bond_first_slave(bond);
+	rcu_read_lock();
+	slave = bond_first_slave_rcu(bond);
 	if (!slave)
-		return 0;
+		goto out;
 	slave_ops = slave->dev->netdev_ops;
 	if (!slave_ops->ndo_neigh_setup)
-		return 0;
-
-	parms.neigh_setup = NULL;
-	parms.neigh_cleanup = NULL;
-	ret = slave_ops->ndo_neigh_setup(slave->dev, &parms);
-	if (ret)
-		return ret;
+		goto out;
 
-	/*
-	 * Assign slave's neigh_cleanup to neighbour in case cleanup is called
-	 * after the last slave has been detached.  Assumes that all slaves
-	 * utilize the same neigh_cleanup (true at this writing as only user
-	 * is ipoib).
+	/* TODO: find another way [1] to implement this.
+	 * Passing a zeroed structure is fragile,
+	 * but at least we do not pass garbage.
+	 *
+	 * [1] One way would be that ndo_neigh_setup() never touch
+	 *     struct neigh_parms, but propagate the new neigh_setup()
+	 *     back to ___neigh_create() / neigh_parms_alloc()
 	 */
-	n->parms->neigh_cleanup = parms.neigh_cleanup;
+	memset(&parms, 0, sizeof(parms));
+	ret = slave_ops->ndo_neigh_setup(slave->dev, &parms);
 
-	if (!parms.neigh_setup)
-		return 0;
+	if (ret)
+		goto out;
 
-	return parms.neigh_setup(n);
+	if (parms.neigh_setup)
+		ret = parms.neigh_setup(n);
+out:
+	rcu_read_unlock();
+	return ret;
 }
 
 /*
drivers/net/can/mscan/mscan.c +10 -11
index e0c9be5e2ab7..9aa851f865f4 100644
@@ -412,13 +412,12 @@ static int mscan_rx_poll(struct napi_struct *napi, int quota)
 	struct net_device *dev = napi->dev;
 	struct mscan_regs __iomem *regs = priv->reg_base;
 	struct net_device_stats *stats = &dev->stats;
-	int npackets = 0;
-	int ret = 1;
+	int work_done = 0;
 	struct sk_buff *skb;
 	struct can_frame *frame;
 	u8 canrflg;
 
-	while (npackets < quota) {
+	while (work_done < quota) {
 		canrflg = in_8(&regs->canrflg);
 		if (!(canrflg & (MSCAN_RXF | MSCAN_ERR_IF)))
 			break;
@@ -439,18 +438,18 @@ static int mscan_rx_poll(struct napi_struct *napi, int quota)
 
 		stats->rx_packets++;
 		stats->rx_bytes += frame->can_dlc;
-		npackets++;
+		work_done++;
 		netif_receive_skb(skb);
 	}
 
-	if (!(in_8(&regs->canrflg) & (MSCAN_RXF | MSCAN_ERR_IF))) {
-		napi_complete(&priv->napi);
-		clear_bit(F_RX_PROGRESS, &priv->flags);
-		if (priv->can.state < CAN_STATE_BUS_OFF)
-			out_8(&regs->canrier, priv->shadow_canrier);
-		ret = 0;
+	if (work_done < quota) {
+		if (likely(napi_complete_done(&priv->napi, work_done))) {
+			clear_bit(F_RX_PROGRESS, &priv->flags);
+			if (priv->can.state < CAN_STATE_BUS_OFF)
+				out_8(&regs->canrier, priv->shadow_canrier);
+		}
 	}
-	return ret;
+	return work_done;
 }
 
 static irqreturn_t mscan_isr(int irq, void *dev_id)
drivers/net/can/slcan.c +11 -5
index ea4d4f1a6411..f0769ce11c4b 100644
@@ -150,7 +150,7 @@ static void slc_bump(struct slcan *sl)
 	u32 tmpid;
 	char *cmd = sl->rbuff;
 
-	cf.can_id = 0;
+	memset(&cf, 0, sizeof(cf));
 
 	switch (*cmd) {
 	case 'r':
@@ -189,8 +189,6 @@ static void slc_bump(struct slcan *sl)
 	else
 		return;
 
-	*(u64 *) (&cf.data) = 0; /* clear payload */
-
 	/* RTR frames may have a dlc > 0 but they never have any data bytes */
 	if (!(cf.can_id & CAN_RTR_FLAG)) {
 		for (i = 0; i < cf.can_dlc; i++) {
@@ -346,9 +344,16 @@ static void slcan_transmit(struct work_struct *work)
  */
 static void slcan_write_wakeup(struct tty_struct *tty)
 {
-	struct slcan *sl = tty->disc_data;
+	struct slcan *sl;
+
+	rcu_read_lock();
+	sl = rcu_dereference(tty->disc_data);
+	if (!sl)
+		goto out;
 
 	schedule_work(&sl->tx_work);
+out:
+	rcu_read_unlock();
 }
 
 /* Send a can_frame to a TTY queue. */
@@ -640,10 +645,11 @@ static void slcan_close(struct tty_struct *tty)
 		return;
 
 	spin_lock_bh(&sl->lock);
-	tty->disc_data = NULL;
+	rcu_assign_pointer(tty->disc_data, NULL);
 	sl->tty = NULL;
 	spin_unlock_bh(&sl->lock);
 
+	synchronize_rcu();
 	flush_work(&sl->tx_work);
 
 	/* Flush network side */
drivers/net/can/usb/gs_usb.c +2 -2
index 3da1be6b508b..b58d25aedb72 100644
@@ -846,7 +846,7 @@ static int gs_usb_probe(struct usb_interface *intf, const struct usb_device_id *
 			     GS_USB_BREQ_HOST_FORMAT,
 			     USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
 			     1,
-			     intf->altsetting[0].desc.bInterfaceNumber,
+			     intf->cur_altsetting->desc.bInterfaceNumber,
 			     hconf,
 			     sizeof(*hconf),
 			     1000);
@@ -869,7 +869,7 @@ static int gs_usb_probe(struct usb_interface *intf, const struct usb_device_id *
 			     GS_USB_BREQ_DEVICE_CONFIG,
 			     USB_DIR_IN|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
 			     1,
-			     intf->altsetting[0].desc.bInterfaceNumber,
+			     intf->cur_altsetting->desc.bInterfaceNumber,
 			     dconf,
 			     sizeof(*dconf),
 			     1000);
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +0 -5
index c932436c6a47..35ab6f85a0df 100644
@@ -1465,11 +1465,6 @@ static int ixgbevf_write_uc_addr_list(struct net_device *netdev)
 	struct ixgbe_hw *hw = &adapter->hw;
 	int count = 0;
 
-	if ((netdev_uc_count(netdev)) > 10) {
-		pr_err("Too many unicast filters - No Space\n");
-		return -ENOSPC;
-	}
-
 	if (!netdev_uc_empty(netdev)) {
 		struct netdev_hw_addr *ha;
 		netdev_for_each_uc_addr(ha, netdev) {
drivers/net/ethernet/natsemi/sonic.c +92 -21

220 lines not on this page · raw message

drivers/net/ethernet/natsemi/sonic.h +15 -10
index 07091dd27e5d..7dcf913d7395 100644
@@ -109,6 +109,9 @@
 #define SONIC_CR_TXP            0x0002
 #define SONIC_CR_HTX            0x0001
 
+#define SONIC_CR_ALL (SONIC_CR_LCAM | SONIC_CR_RRRA | \
+		      SONIC_CR_RXEN | SONIC_CR_TXP)
+
 /*
  * SONIC data configuration bits
  */
@@ -273,8 +276,9 @@
 #define SONIC_NUM_RDS   SONIC_NUM_RRS /* number of receive descriptors */
 #define SONIC_NUM_TDS   16            /* number of transmit descriptors */
 
-#define SONIC_RDS_MASK  (SONIC_NUM_RDS-1)
-#define SONIC_TDS_MASK  (SONIC_NUM_TDS-1)
+#define SONIC_RRS_MASK  (SONIC_NUM_RRS - 1)
+#define SONIC_RDS_MASK  (SONIC_NUM_RDS - 1)
+#define SONIC_TDS_MASK  (SONIC_NUM_TDS - 1)
 
 #define SONIC_RBSIZE	1520          /* size of one resource buffer */
 
@@ -320,6 +324,7 @@ struct sonic_local {
 	unsigned int next_tx;          /* next free TD */
 	struct device *device;         /* generic device */
 	struct net_device_stats stats;
+	spinlock_t lock;
 };
 
 #define TX_TIMEOUT (3 * HZ)
@@ -341,30 +346,30 @@ static void sonic_tx_timeout(struct net_device *dev);
    as far as we can tell. */
 /* OpenBSD calls this "SWO".  I'd like to think that sonic_buf_put()
    is a much better name. */
-static inline void sonic_buf_put(void* base, int bitmode,
+static inline void sonic_buf_put(u16 *base, int bitmode,
 				 int offset, __u16 val)
 {
 	if (bitmode)
 #ifdef __BIG_ENDIAN
-		((__u16 *) base + (offset*2))[1] = val;
+		__raw_writew(val, base + (offset * 2) + 1);
 #else
-		((__u16 *) base + (offset*2))[0] = val;
+		__raw_writew(val, base + (offset * 2) + 0);
 #endif
 	else
-	 	((__u16 *) base)[offset] = val;
+		__raw_writew(val, base + (offset * 1) + 0);
 }
 
-static inline __u16 sonic_buf_get(void* base, int bitmode,
+static inline __u16 sonic_buf_get(u16 *base, int bitmode,
 				  int offset)
 {
 	if (bitmode)
 #ifdef __BIG_ENDIAN
-		return ((volatile __u16 *) base + (offset*2))[1];
+		return __raw_readw(base + (offset * 2) + 1);
 #else
-		return ((volatile __u16 *) base + (offset*2))[0];
+		return __raw_readw(base + (offset * 2) + 0);
 #endif
 	else
-		return ((volatile __u16 *) base)[offset];
+		return __raw_readw(base + (offset * 1) + 0);
 }
 
 /* Inlines that you should actually use for reading/writing DMA buffers */
drivers/net/ethernet/stmicro/stmmac/common.h +2 -3
index 4561b16a9ebb..4747facb3edc 100644
@@ -270,9 +270,8 @@ struct dma_features {
 	unsigned int enh_desc;
 };
 
-/* GMAC TX FIFO is 8K, Rx FIFO is 16K */
-#define BUF_SIZE_16KiB 16384
-/* RX Buffer size must be < 8191 and multiple of 4/8/16 bytes */
+/* RX Buffer size must be multiple of 4/8/16 bytes */
+#define BUF_SIZE_16KiB 16368
 #define BUF_SIZE_8KiB 8188
 #define BUF_SIZE_4KiB 4096
 #define BUF_SIZE_2KiB 2048
drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c +1 -1
index 771cd15fca18..0f7a4d70d919 100644
@@ -78,7 +78,7 @@ static int sun7i_gmac_init(struct platform_device *pdev, void *priv)
 	 * rate, which then uses the auto-reparenting feature of the
 	 * clock driver, and enabling/disabling the clock.
 	 */
-	if (gmac->interface == PHY_INTERFACE_MODE_RGMII) {
+	if (phy_interface_mode_is_rgmii(gmac->interface)) {
 		clk_set_rate(gmac->tx_clk, SUN7I_GMAC_GMII_RGMII_RATE);
 		clk_prepare_enable(gmac->tx_clk);
 		gmac->clk_enabled = 1;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +3 -1
index 5fe95ef7954b..ad9f1f022457 100644
@@ -904,7 +904,9 @@ static int stmmac_set_bfsize(int mtu, int bufsize)
 {
 	int ret = bufsize;
 
-	if (mtu >= BUF_SIZE_4KiB)
+	if (mtu >= BUF_SIZE_8KiB)
+		ret = BUF_SIZE_16KiB;
+	else if (mtu >= BUF_SIZE_4KiB)
 		ret = BUF_SIZE_8KiB;
 	else if (mtu >= BUF_SIZE_2KiB)
 		ret = BUF_SIZE_4KiB;
drivers/net/hamradio/6pack.c +2 -2
index 5e8aff812f20..bd109f981d8b 100644
@@ -685,10 +685,10 @@ static void sixpack_close(struct tty_struct *tty)
 {
 	struct sixpack *sp;
 
-	write_lock_bh(&disc_data_lock);
+	write_lock_irq(&disc_data_lock);
 	sp = tty->disc_data;
 	tty->disc_data = NULL;
-	write_unlock_bh(&disc_data_lock);
+	write_unlock_irq(&disc_data_lock);
 	if (!sp)
 		return;
 
drivers/net/hamradio/mkiss.c +2 -2
index 8a6c720a4cc9..dba143836753 100644
@@ -811,10 +811,10 @@ static void mkiss_close(struct tty_struct *tty)
 {
 	struct mkiss *ax;
 
-	write_lock_bh(&disc_data_lock);
+	write_lock_irq(&disc_data_lock);
 	ax = tty->disc_data;
 	tty->disc_data = NULL;
-	write_unlock_bh(&disc_data_lock);
+	write_unlock_irq(&disc_data_lock);
 
 	if (!ax)
 		return;
drivers/net/macvlan.c +2 -1
index 9493690885cf..02efd2775dcf 100644
@@ -345,10 +345,11 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
 	const struct macvlan_dev *dest;
 
 	if (vlan->mode == MACVLAN_MODE_BRIDGE) {
-		const struct ethhdr *eth = (void *)skb->data;
+		const struct ethhdr *eth = skb_eth_hdr(skb);
 
 		/* send to other bridge ports directly */
 		if (is_multicast_ether_addr(eth->h_dest)) {
+			skb_reset_mac_header(skb);
 			macvlan_broadcast(skb, port, dev, MACVLAN_MODE_BRIDGE);
 			goto xmit_world;
 		}
drivers/net/slip/slip.c +10 -2
index 3780c4672bfa..65df455c056e 100644
@@ -452,9 +452,16 @@ static void slip_transmit(struct work_struct *work)
  */
 static void slip_write_wakeup(struct tty_struct *tty)
 {
-	struct slip *sl = tty->disc_data;
+	struct slip *sl;
+
+	rcu_read_lock();
+	sl = rcu_dereference(tty->disc_data);
+	if (!sl)
+		goto out;
 
 	schedule_work(&sl->tx_work);
+out:
+	rcu_read_unlock();
 }
 
 static void sl_tx_timeout(struct net_device *dev)
@@ -885,10 +892,11 @@ static void slip_close(struct tty_struct *tty)
 		return;
 
 	spin_lock_bh(&sl->lock);
-	tty->disc_data = NULL;
+	rcu_assign_pointer(tty->disc_data, NULL);
 	sl->tty = NULL;
 	spin_unlock_bh(&sl->lock);
 
+	synchronize_rcu();
 	flush_work(&sl->tx_work);
 
 	/* VSV = very important to remove timers */
drivers/net/usb/r8152.c +3 -0
index 6fa1d2c9c556..714beecd16ef 100644
@@ -3425,6 +3425,9 @@ static int rtl8152_probe(struct usb_interface *intf,
 		return -ENODEV;
 	}
 
+	if (intf->cur_altsetting->desc.bNumEndpoints < 3)
+		return -ENODEV;
+
 	usb_reset_device(udev);
 	netdev = alloc_etherdev(sizeof(struct r8152));
 	if (!netdev) {
drivers/net/vxlan.c +3 -2
index 73874090cf42..78f3e8612bab 100644
@@ -1904,7 +1904,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
 			return;
 		}
 
-		tos = ip_tunnel_ecn_encap(tos, old_iph, skb);
+		tos = ip_tunnel_ecn_encap(RT_TOS(tos), old_iph, skb);
 		ttl = ttl ? : ip4_dst_hoplimit(&rt->dst);
 
 		err = vxlan_xmit_skb(vxlan->vn_sock, rt, skb,
@@ -1929,7 +1929,8 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
 		fl6.saddr = vxlan->saddr.sin6.sin6_addr;
 		fl6.flowi6_proto = IPPROTO_UDP;
 
-		if (ipv6_stub->ipv6_dst_lookup(sk, &ndst, &fl6)) {
+		ndst = ipv6_stub->ipv6_dst_lookup_flow(sk, &fl6, NULL);
+		if (unlikely(IS_ERR(ndst))) {
 			netdev_dbg(dev, "no route to %pI6\n",
 				   &dst->sin6.sin6_addr);
 			dev->stats.tx_carrier_errors++;
drivers/net/wireless/libertas/cfg.c +15 -3
index 47a998d8f99e..390541173138 100644
@@ -272,6 +272,10 @@ add_ie_rates(u8 *tlv, const u8 *ie, int *nrates)
 	int hw, ap, ap_max = ie[1];
 	u8 hw_rate;
 
+	if (ap_max > MAX_RATES) {
+		lbs_deb_assoc("invalid rates\n");
+		return tlv;
+	}
 	/* Advance past IE header */
 	ie += 2;
 
@@ -1785,6 +1789,9 @@ static int lbs_ibss_join_existing(struct lbs_private *priv,
 	struct cmd_ds_802_11_ad_hoc_join cmd;
 	u8 preamble = RADIO_PREAMBLE_SHORT;
 	int ret = 0;
+	int hw, i;
+	u8 rates_max;
+	u8 *rates;
 
 	lbs_deb_enter(LBS_DEB_CFG80211);
 
@@ -1845,9 +1852,14 @@ static int lbs_ibss_join_existing(struct lbs_private *priv,
 	if (!rates_eid) {
 		lbs_add_rates(cmd.bss.rates);
 	} else {
-		int hw, i;
-		u8 rates_max = rates_eid[1];
-		u8 *rates = cmd.bss.rates;
+		rates_max = rates_eid[1];
+		if (rates_max > MAX_RATES) {
+			lbs_deb_join("invalid rates");
+			rcu_read_unlock();
+			ret = -EINVAL;
+			goto out;
+		}
+		rates = cmd.bss.rates;
 		for (hw = 0; hw < ARRAY_SIZE(lbs_rates); hw++) {
 			u8 hw_rate = lbs_rates[hw].bitrate / 5;
 			for (i = 0; i < rates_max; i++) {
drivers/net/wireless/mwifiex/sta_ioctl.c +1 -0
index 5326a0095601..501505f2e3c7 100644
@@ -226,6 +226,7 @@ static int mwifiex_process_country_ie(struct mwifiex_private *priv,
 
 	if (country_ie_len >
 	    (IEEE80211_COUNTRY_STRING_LEN + MWIFIEX_MAX_TRIPLET_802_11D)) {
+		rcu_read_unlock();
 		wiphy_dbg(priv->wdev->wiphy,
 			  "11D: country_ie_len overflow!, deauth AP\n");
 		return -EINVAL;
drivers/net/wireless/mwifiex/tdls.c +67 -7

124 lines not on this page · raw message

drivers/pinctrl/pinctrl-baytrail.c +131 -81

384 lines not on this page · raw message

drivers/platform/x86/asus-wmi.c +1 -7
index 3c6ccedc82b6..53329896837f 100644
@@ -386,13 +386,7 @@ static void kbd_led_update(struct work_struct *work)
 
 	asus = container_of(work, struct asus_wmi, kbd_led_work);
 
-	/*
-	 * bits 0-2: level
-	 * bit 7: light on/off
-	 */
-	if (asus->kbd_led_wk > 0)
-		ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F);
-
+	ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F);
 	asus_wmi_set_devstate(ASUS_WMI_DEVID_KBD_BACKLIGHT, ctrl_param, NULL);
 }
 
drivers/platform/x86/hp-wmi.c +1 -1
index d5f86dbf6dd6..7129e40e2788 100644
@@ -309,7 +309,7 @@ static int __init hp_wmi_bios_2008_later(void)
 
 static int __init hp_wmi_bios_2009_later(void)
 {
-	int state = 0;
+	u8 state[128];
 	int ret = hp_wmi_perform_query(HPWMI_FEATURE2_QUERY, 0, &state,
 				       sizeof(state), sizeof(state));
 	if (!ret)
drivers/ptp/ptp_clock.c +21 -21

88 lines not on this page · raw message

drivers/ptp/ptp_private.h +5 -4
index 9c5d41421b65..15346e840caa 100644
@@ -40,7 +40,7 @@ struct timestamp_event_queue {
 
 struct ptp_clock {
 	struct posix_clock clock;
-	struct device *dev;
+	struct device dev;
 	struct ptp_clock_info *info;
 	dev_t devid;
 	int index; /* index into clocks.map */
@@ -54,6 +54,8 @@ struct ptp_clock {
 	struct device_attribute *pin_dev_attr;
 	struct attribute **pin_attr;
 	struct attribute_group pin_attr_group;
+	/* 1st entry is a pointer to the real group, 2nd is NULL terminator */
+	const struct attribute_group *pin_attr_groups[2];
 };
 
 /*
@@ -94,8 +96,7 @@ uint ptp_poll(struct posix_clock *pc,
 
 extern const struct attribute_group *ptp_groups[];
 
-int ptp_cleanup_sysfs(struct ptp_clock *ptp);
-
-int ptp_populate_sysfs(struct ptp_clock *ptp);
+int ptp_populate_pin_groups(struct ptp_clock *ptp);
+void ptp_cleanup_pin_groups(struct ptp_clock *ptp);
 
 #endif
drivers/ptp/ptp_sysfs.c +63 -99

215 lines not on this page · raw message

drivers/scsi/fnic/vnic_dev.c +10 -10
index 9795d6f3e197..4532ef9b46de 100644
@@ -445,26 +445,26 @@ int vnic_dev_soft_reset_done(struct vnic_dev *vdev, int *done)
 
 int vnic_dev_hang_notify(struct vnic_dev *vdev)
 {
-	u64 a0, a1;
+	u64 a0 = 0, a1 = 0;
 	int wait = 1000;
 	return vnic_dev_cmd(vdev, CMD_HANG_NOTIFY, &a0, &a1, wait);
 }
 
 int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr)
 {
-	u64 a0, a1;
+	u64 a[2] = {};
 	int wait = 1000;
 	int err, i;
 
 	for (i = 0; i < ETH_ALEN; i++)
 		mac_addr[i] = 0;
 
-	err = vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a0, &a1, wait);
+	err = vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a[0], &a[1], wait);
 	if (err)
 		return err;
 
 	for (i = 0; i < ETH_ALEN; i++)
-		mac_addr[i] = ((u8 *)&a0)[i];
+		mac_addr[i] = ((u8 *)&a)[i];
 
 	return 0;
 }
@@ -489,15 +489,15 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast,
 
 void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
 {
-	u64 a0 = 0, a1 = 0;
+	u64 a[2] = {};
 	int wait = 1000;
 	int err;
 	int i;
 
 	for (i = 0; i < ETH_ALEN; i++)
-		((u8 *)&a0)[i] = addr[i];
+		((u8 *)&a)[i] = addr[i];
 
-	err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait);
+	err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a[0], &a[1], wait);
 	if (err)
 		printk(KERN_ERR
 			"Can't add addr [%02x:%02x:%02x:%02x:%02x:%02x], %d\n",
@@ -507,15 +507,15 @@ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
 
 void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
 {
-	u64 a0 = 0, a1 = 0;
+	u64 a[2] = {};
 	int wait = 1000;
 	int err;
 	int i;
 
 	for (i = 0; i < ETH_ALEN; i++)
-		((u8 *)&a0)[i] = addr[i];
+		((u8 *)&a)[i] = addr[i];
 
-	err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a0, &a1, wait);
+	err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a[0], &a[1], wait);
 	if (err)
 		printk(KERN_ERR
 			"Can't del addr [%02x:%02x:%02x:%02x:%02x:%02x], %d\n",
drivers/scsi/qla4xxx/ql4_os.c +0 -1
index 91bceca76aa9..dc7c7c17b272 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/sd.c +3 -1
index 2fcda75ef688..34bfd7ebc664 100644

Lines of this file are not shown. View the raw message.

drivers/staging/android/ashmem.c +28 -0
index 5dbc68da8727..610981e49b51 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rtl8188eu/os_dep/usb_intf.c +2 -1
index 1000e87faa73..df88448d1eaa 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rtl8712/usb_intf.c +1 -1
index 22a28becf275..af79582dbc28 100644

Lines of this file are not shown. View the raw message.

drivers/staging/usbip/vhci_rx.c +9 -4
index d573917f998c..d9e0c76ead6e 100644

Lines of this file are not shown. View the raw message.

drivers/tty/serial/msm_serial.c +11 -2
index 1c438396c630..15bf626abd8b 100644

Lines of this file are not shown. View the raw message.

drivers/tty/serial/serial_core.c +1 -0
index 6b71032b8123..1726bab49e40 100644

Lines of this file are not shown. View the raw message.

drivers/tty/vt/selection.c +30 -4
index ea27804d87af..4e0c3d95884b 100644

Lines of this file are not shown. View the raw message.

drivers/tty/vt/vt.c +0 -2
index 6f5d249d454d..b9d4075ddc17 100644

Lines of this file are not shown. View the raw message.

drivers/usb/atm/ueagle-atm.c +12 -6
index 5a459377574b..6038314056cd 100644

Lines of this file are not shown. View the raw message.

drivers/usb/core/config.c +67 -10

77 lines not on this page · raw message

drivers/usb/core/hub.c +1 -0
index 2e9e0012286b..464e4ac307a8 100644

Lines of this file are not shown. View the raw message.

drivers/usb/core/quirks.c +37 -0
index 33772a954df6..312eee48cda1 100644

Lines of this file are not shown. View the raw message.

drivers/usb/core/urb.c +1 -0
index ce5f13d62b64..65ffab5e9a8d 100644

Lines of this file are not shown. View the raw message.

drivers/usb/core/usb.h +3 -0
index d7ac1603826b..283de7f3840e 100644

Lines of this file are not shown. View the raw message.

drivers/usb/dwc3/dwc3-pci.c +30 -0
index 69f27169081b..1b1ef79f02fa 100644

Lines of this file are not shown. View the raw message.

drivers/usb/host/ehci-q.c +12 -1
index 54f5332f814d..230c56d40557 100644

Lines of this file are not shown. View the raw message.

drivers/usb/host/xhci-hub.c +4 -4
index 79dabb14c2bf..d527dcebed81 100644

Lines of this file are not shown. View the raw message.

drivers/usb/host/xhci-ring.c +2 -1
index ae3b2b5fa9f6..0d18385f85bb 100644

Lines of this file are not shown. View the raw message.

drivers/usb/misc/adutux.c +1 -1
index 684ce2ad1a39..ab5be88930d7 100644

Lines of this file are not shown. View the raw message.

drivers/usb/misc/idmouse.c +1 -1
index 6d4e75785710..066dce850cc6 100644

Lines of this file are not shown. View the raw message.

drivers/usb/mon/mon_bin.c +21 -11
index bbec84dd34fb..4c5aa817162f 100644

Lines of this file are not shown. View the raw message.

drivers/usb/musb/musbhsdma.c +1 -1
index d006f54d5e15..5edca85a491a 100644

Lines of this file are not shown. View the raw message.

drivers/usb/serial/ch341.c +5 -1
index 83b2602c6ae1..9b0282cc927a 100644

Lines of this file are not shown. View the raw message.

drivers/usb/serial/io_edgeport.c +15 -11
index 6947985ccfb0..aea82f20deaa 100644

Lines of this file are not shown. View the raw message.

drivers/usb/serial/keyspan.c +4 -0
index 38112be0dbae..f211d0792d63 100644

Lines of this file are not shown. View the raw message.

drivers/usb/serial/opticon.c +1 -1
index 64bf258e7e00..9606dde3194c 100644

Lines of this file are not shown. View the raw message.

drivers/usb/serial/quatech2.c +6 -0
index af0c87276299..82f28192694f 100644

Lines of this file are not shown. View the raw message.

drivers/usb/serial/usb-serial-simple.c +2 -0
index 235733c69272..11d925bfdf1e 100644

Lines of this file are not shown. View the raw message.

drivers/usb/serial/usb-serial.c +3 -0
index 97b9af49c1d2..f3ed3c65e855 100644

Lines of this file are not shown. View the raw message.

drivers/vhost/net.c +2 -11
index 3f16c299263f..c99c71afcd5c 100644

Lines of this file are not shown. View the raw message.

drivers/video/console/vgacon.c +3 -0
index 6e6aa704fe84..ba0ef937e517 100644

Lines of this file are not shown. View the raw message.

drivers/virtio/virtio_balloon.c +10 -0
index 5ca1928979f6..341c025a230b 100644

Lines of this file are not shown. View the raw message.

firmware/Makefile +1 -1
index 0862d34cf7d1..3a678382b8cc 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/Makefile +1 -1
index 6d1d0b93b1aa..c792df826e12 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/ctree.c +2 -17
index 8c65bac0c8a2..4d1766e5438a 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/ctree.h +89 -68

157 lines not on this page · raw message

fs/btrfs/dev-replace.c +1 -1
index 7ee449d0da8a..7542ba457f09 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/disk-io.c +12 -68

80 lines not on this page · raw message

fs/btrfs/extent-tree.c +107 -3

110 lines not on this page · raw message

fs/btrfs/extent_io.c +56 -42

98 lines not on this page · raw message

fs/btrfs/extent_io.h +9 -16
index ccc264e7bde1..5095cb199128 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/extent_map.c +1 -1
index 6a98bddd8f33..84fb56d5c018 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/extent_map.h +9 -1
index b2991fd8583e..eb8b8fae036b 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/inode.c +5 -3
index e597cc1c5d5b..8ac270f3fa92 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/ioctl.c +8 -2
index 379c88b17c07..c4c26586318d 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/relocation.c +1 -0
index 9cba36820c72..54d79d8af015 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/root-tree.c +6 -4
index 360a728a639f..9bdcae8336ff 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/scrub.c +1 -1
index 70edd60db654..e3a687c472ec 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/struct-funcs.c +5 -4
index b976597b0721..63ffd213b0b7 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/tree-checker.c new file +649 -0

649 lines not on this page · raw message

fs/btrfs/tree-checker.h new file +38 -0
new file mode 100644
index 000000000000..3d53e8d6fda0

Lines of this file are not shown. View the raw message.

fs/btrfs/tree-log.c +22 -2
index f4e90842eb08..323a8f924896 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/uuid-tree.c +2 -0
index f6a4c03ee7d8..dc29f56cc1b3 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/volumes.c +175 -31

206 lines not on this page · raw message

fs/btrfs/volumes.h +2 -0
index 4292c68196ff..9c6a1cfa122d 100644

Lines of this file are not shown. View the raw message.

fs/char_dev.c +87 -1

88 lines not on this page · raw message

fs/ext4/dir.c +5 -0
index 20e6a870d114..4d17006a1b8e 100644

Lines of this file are not shown. View the raw message.

fs/ext4/ext4.h +13 -0
index 550a1bfe98d1..09e978818474 100644

Lines of this file are not shown. View the raw message.

fs/ext4/extents.c +53 -36

89 lines not on this page · raw message

fs/ext4/file.c +1 -1
index 773b653bae51..20c76e3250d9 100644

Lines of this file are not shown. View the raw message.

fs/ext4/inode.c +87 -30

117 lines not on this page · raw message

fs/ext4/super.c +1 -0
index 7410cca5bf39..a0864cc67b03 100644

Lines of this file are not shown. View the raw message.

fs/ext4/truncate.h +2 -0
index 011ba6670d99..c70d06a383e2 100644

Lines of this file are not shown. View the raw message.

fs/inode.c +1 -0
index 49df50c900ca..dd757025ecbe 100644

Lines of this file are not shown. View the raw message.

fs/locks.c +1 -1
index 10bd454eaf98..c5303e2ac167 100644

Lines of this file are not shown. View the raw message.

fs/namei.c +53 -3

56 lines not on this page · raw message

include/linux/blkdev.h +5 -5
index b992a89abde2..5ed3e773c2e0 100644

Lines of this file are not shown. View the raw message.

include/linux/blktrace_api.h +5 -1
index afc1343df3c7..e644bfe50019 100644

Lines of this file are not shown. View the raw message.

include/linux/cdev.h +5 -0
index fb4591977b03..71d087f7eb39 100644

Lines of this file are not shown. View the raw message.

include/linux/fs.h +3 -0
index 49ca7649e5b5..b4335a6e9c6b 100644

Lines of this file are not shown. View the raw message.

include/linux/futex.h +10 -7
index 83fe0d85f8db..41563bfa54a1 100644

Lines of this file are not shown. View the raw message.

include/linux/if_ether.h +8 -0
index d5569734f672..676cf8d0acca 100644

Lines of this file are not shown. View the raw message.

include/linux/kobject.h +2 -0
index 2d61b909f414..d947e541cac8 100644

Lines of this file are not shown. View the raw message.

include/linux/mod_devicetable.h +2 -2
index 44eeef0da186..4c546028b035 100644

Lines of this file are not shown. View the raw message.

include/linux/netfilter_arp/arp_tables.h +1 -1
index cfb7191e6efa..f817d1866428 100644

Lines of this file are not shown. View the raw message.

include/linux/posix-clock.h +11 -8
index 34c4498b800f..6b192187c7ba 100644

Lines of this file are not shown. View the raw message.

include/linux/quotaops.h +1 -1
index c2c41f6a65e2..660f59f3dcd1 100644

Lines of this file are not shown. View the raw message.

include/linux/usb/quirks.h +3 -0
index efc4e51c425a..b0a25fdfb1be 100644

Lines of this file are not shown. View the raw message.

include/media/media-device.h +1 -4
index 6e6db78f1ee2..00bbd679864a 100644

Lines of this file are not shown. View the raw message.

include/media/media-devnode.h +27 -5
index 0dc7060f9625..6b370e97efae 100644

Lines of this file are not shown. View the raw message.

include/net/addrconf.h +3 -2
index c9766ab9c87c..19d0e56375f7 100644

Lines of this file are not shown. View the raw message.

include/net/cfg80211.h +11 -0
index 5d636bbd81a9..e1e51d674c2a 100644

Lines of this file are not shown. View the raw message.

include/net/neighbour.h +0 -1
index 47f425464f84..c24981a8d1a8 100644

Lines of this file are not shown. View the raw message.

kernel/futex.c +55 -38

93 lines not on this page · raw message

kernel/sysctl.c +18 -0
index 6f4e876162f5..c5da3c8a67e8 100644

Lines of this file are not shown. View the raw message.

kernel/taskstats.c +19 -11
index 13d2f7cd65db..158c877e5327 100644

Lines of this file are not shown. View the raw message.

kernel/time/posix-clock.c +13 -18
index 9cff0ab82b63..dfb386931512 100644

Lines of this file are not shown. View the raw message.

kernel/trace/blktrace.c +88 -41

129 lines not on this page · raw message

kernel/trace/ftrace.c +3 -3
index c59d43d54d32..ff5281a9c5d7 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_sched_wakeup.c +3 -1
index 19bd8928ce94..0928ea8c5567 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_stack.c +5 -0
index 8a4e5cb66a4c..27eb7e96dabe 100644

Lines of this file are not shown. View the raw message.

lib/kobject.c +4 -1
index 58751bb80a7c..370f169ab88f 100644

Lines of this file are not shown. View the raw message.

mm/mempolicy.c +5 -1
index aaf4c2e002e2..ad5f8f16270c 100644

Lines of this file are not shown. View the raw message.

net/8021q/vlan_netlink.c +7 -3
index 8ac8a5cc2143..cfcc4cd12944 100644

Lines of this file are not shown. View the raw message.

net/batman-adv/distributed-arp-table.c +3 -1
index ab83d8b16c45..a326c4fe1087 100644

Lines of this file are not shown. View the raw message.

net/bridge/br_netfilter.c +3 -0
index 7ddb8b322556..3829136c245a 100644

Lines of this file are not shown. View the raw message.

net/bridge/netfilter/ebtables.c +33 -25

58 lines not on this page · raw message

net/core/neighbour.c +0 -3
index 9137f30c78b8..e48e552be9fe 100644

Lines of this file are not shown. View the raw message.

net/ipv4/netfilter/arp_tables.c +24 -18

42 lines not on this page · raw message

net/ipv4/netfilter/arptable_filter.c +1 -1
index 802ddecb30b8..5375fb03d26b 100644

Lines of this file are not shown. View the raw message.

net/ipv4/tcp_input.c +4 -1
index a42b6671d542..fc0425cff370 100644

Lines of this file are not shown. View the raw message.

net/ipv4/tcp_output.c +8 -0
index e292792e9964..51f560d5bc03 100644

Lines of this file are not shown. View the raw message.

net/ipv6/af_inet6.c +1 -1
index d5db3ce7b463..afe276635163 100644

Lines of this file are not shown. View the raw message.

net/mac80211/cfg.c +3 -52

55 lines not on this page · raw message

net/mac80211/sta_info.c +4 -0
index c006801f3d83..f89e76effb42 100644

Lines of this file are not shown. View the raw message.

net/netfilter/ipset/ip_set_bitmap_gen.h +1 -1
index f2c7d83dc23f..6338b96d8f17 100644

Lines of this file are not shown. View the raw message.

net/netfilter/ipset/ip_set_core.c +2 -1
index efed6315c695..87c469098350 100644

Lines of this file are not shown. View the raw message.

net/netfilter/nf_conntrack_netlink.c +3 -0
index b9bf8b0f4ec1..63c984e01ff8 100644

Lines of this file are not shown. View the raw message.

net/netfilter/nft_bitwise.c +14 -5
index c9e847ff6451..4ee55017cd58 100644

Lines of this file are not shown. View the raw message.

net/netfilter/nft_cmp.c +16 -2
index 109b91deb69a..109793a93ec9 100644

Lines of this file are not shown. View the raw message.

net/packet/af_packet.c +2 -1
index 2ba9b1a03229..fe436431bd2d 100644

Lines of this file are not shown. View the raw message.

net/sched/ematch.c +1 -1
index a2abc449ce8f..eaf8e3e727dc 100644

Lines of this file are not shown. View the raw message.

net/sched/sch_fq.c +8 -2
index da3621feae74..1a0f943a3423 100644

Lines of this file are not shown. View the raw message.

net/sctp/sm_sideeffect.c +18 -10
index 5e30bdce1d21..ec0eeb35b334 100644

Lines of this file are not shown. View the raw message.

net/wireless/util.c +45 -0

45 lines not on this page · raw message

scripts/recordmcount.c +17 -0
index a97ae04f5d2a..1d03915bf822 100644

Lines of this file are not shown. View the raw message.

sound/core/pcm_native.c +4 -0
index a0ee065a9f8c..4195e3c8b641 100644

Lines of this file are not shown. View the raw message.

sound/core/seq/seq_timer.c +9 -5
index 0e6210000fa9..f6fa4b55d33d 100644

Lines of this file are not shown. View the raw message.

sound/pci/hda/patch_ca0132.c +3 -2
index 554a138efdbf..9e2387efa4ec 100644

Lines of this file are not shown. View the raw message.

sound/pci/ice1712/ice1724.c +6 -3
index 5e7948f3efe9..45f5793465b8 100644

Lines of this file are not shown. View the raw message.

sound/soc/codecs/wm8962.c +2 -2
index 0caaa8fa4231..af54f736c01d 100644

Lines of this file are not shown. View the raw message.

sound/usb/pcm.c +21 -23

44 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.