Skip to contentSkip to conversation

Linux 3.16.52

PATCH Ben Hutchings 1 participant 1 message Jan 2, 2018 Stable branch

lore
Share & tools
lore
#0 lore raw

I'm announcing the release of the 3.16.52 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.51 is attached to this message.

Ben.

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

 Makefile                                           |   2 +-
 arch/alpha/kernel/ptrace.c                         |   2 +-
 arch/arm/boot/dts/da850-evm.dts                    |   7 ++
 arch/arm/include/asm/Kbuild                        |   1 -
 arch/arm/include/asm/unaligned.h                   |  27 +++++
 arch/arm/kernel/traps.c                            |  28 ++++--
 arch/arm/kvm/emulate.c                             |   5 +-
 arch/arm/kvm/mmio.c                                |   4 +-
 arch/arm64/kernel/head.S                           |   1 +
 arch/arm64/kernel/traps.c                          |  28 +++---
 arch/arm64/kvm/inject_fault.c                      |  16 ++-
 arch/arm64/mm/fault.c                              |   2 +-
 arch/blackfin/kernel/ptrace.c                      |   4 +-
 arch/cris/arch-v32/kernel/ptrace.c                 |   2 +-
 arch/ia64/kernel/ptrace.c                          |   2 +-
 arch/mips/ar7/platform.c                           |   1 +
 arch/mips/include/asm/mips-cm.h                    |   4 +-
 arch/mips/kernel/ptrace32.c                        |   4 +-
 arch/mips/mm/uasm-micromips.c                      |   2 +-
 arch/parisc/kernel/syscall.S                       |   6 +-
 arch/powerpc/kernel/ptrace32.c                     |   4 +-
 arch/powerpc/perf/core-book3s.c                    |   5 +
 arch/powerpc/platforms/pseries/mobility.c          |   4 +-
 arch/s390/mm/gup.c                                 |   7 +-
 arch/sh/include/cpu-sh2a/cpu/sh7264.h              |   4 +-
 arch/sh/include/cpu-sh2a/cpu/sh7269.h              |   4 +-
 arch/sh/include/cpu-sh4/cpu/sh7722.h               |   2 +-
 arch/sh/include/cpu-sh4/cpu/sh7757.h               |   8 +-
 arch/tile/kernel/setup.c                           |   2 +-
 arch/x86/crypto/salsa20_glue.c                     |   7 --
 arch/x86/include/asm/uaccess.h                     |  14 ++-
 arch/x86/kernel/amd_nb.c                           |  48 +++++++++
 arch/x86/kernel/cpu/microcode/intel.c              |  18 ++++
 arch/x86/kvm/vmx.c                                 |   7 +-
 arch/x86/kvm/x86.c                                 |   8 +-
 arch/x86/oprofile/op_model_ppro.c                  |   4 +-
 block/bio.c                                        |  14 ++-
 crypto/hmac.c                                      |   6 +-
 crypto/salsa20_generic.c                           |   7 --
 crypto/shash.c                                     |  13 ++-
 drivers/block/rbd.c                                |   4 +-
 drivers/bus/mvebu-mbus.c                           |   2 +-
 drivers/crypto/talitos.c                           |   7 +-
 drivers/gpio/gpiolib-acpi.c                        |   2 +-
 drivers/gpu/drm/i915/intel_bios.c                  |   7 ++
 drivers/hid/i2c-hid/i2c-hid.c                      |   3 +-
 drivers/iio/adc/ad7793.c                           |   4 +-
 drivers/iio/adc/ad_sigma_delta.c                   |  28 ++++++
 drivers/iio/adc/mcp320x.c                          |   1 +
 drivers/iio/industrialio-core.c                    |   4 +-
 drivers/infiniband/hw/mlx5/mem.c                   |  49 ++++-----
 drivers/infiniband/hw/ocrdma/ocrdma_hw.c           |   3 +
 drivers/infiniband/ulp/ipoib/ipoib_ib.c            |  13 ---
 drivers/input/ff-core.c                            |  13 ++-
 drivers/input/misc/ims-pcu.c                       |  16 ++-
 drivers/input/misc/uinput.c                        |  57 +++++++----
 drivers/input/touchscreen/ti_am335x_tsc.c          |   2 +-
 drivers/iommu/amd_iommu.c                          |   1 +
 drivers/iommu/exynos-iommu.c                       |   2 +-
 drivers/net/can/c_can/c_can_pci.c                  |   1 -
 drivers/net/can/c_can/c_can_platform.c             |   1 -
 drivers/net/can/usb/esd_usb2.c                     |   2 +-
 drivers/net/can/usb/gs_usb.c                       |  10 +-
 drivers/net/can/usb/kvaser_usb.c                   |   3 +-
 drivers/net/macvtap.c                              |   6 +-
 drivers/net/tun.c                                  |   7 ++
 drivers/net/wireless/brcm80211/brcmfmac/fweh.c     |  58 +++--------
 drivers/net/wireless/brcm80211/brcmfmac/fweh.h     |  68 ++++++++++---
 drivers/net/wireless/brcm80211/brcmfmac/p2p.c      |  10 ++
 .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c  |   5 +
 drivers/net/wireless/iwlwifi/mvm/mac80211.c        |  10 +-
 drivers/pci/pci-sysfs.c                            |  11 ++-
 drivers/s390/scsi/zfcp_aux.c                       |   5 +
 drivers/s390/scsi/zfcp_erp.c                       |  18 ++--
 drivers/s390/scsi/zfcp_scsi.c                      |   5 +
 drivers/scsi/libiscsi.c                            |   2 +-
 drivers/scsi/lpfc/lpfc_init.c                      |   1 +
 drivers/scsi/scsi_scan.c                           |   3 +
 drivers/scsi/sd.c                                  |  16 ++-
 drivers/staging/iio/adc/ad7192.c                   |   4 +-
 drivers/staging/iio/meter/ade7759.c                |   2 +-
 drivers/usb/class/cdc-acm.c                        |   3 +
 drivers/usb/core/config.c                          |   6 +-
 drivers/usb/core/hub.c                             |  13 ++-
 drivers/usb/core/quirks.c                          |   4 +
 drivers/usb/gadget/composite.c                     |   5 +
 drivers/usb/gadget/dummy_hcd.c                     |  81 +++++++++++----
 drivers/usb/gadget/f_mass_storage.c                |  31 ++----
 drivers/usb/gadget/f_mass_storage.h                |  14 ---
 drivers/usb/gadget/inode.c                         |  55 +++++++++--
 drivers/usb/gadget/mass_storage.c                  |  20 +---
 drivers/usb/gadget/net2280.c                       |   5 +-
 drivers/usb/host/pci-quirks.c                      |   8 +-
 drivers/usb/host/xhci-hub.c                        |  22 ++++-
 drivers/usb/host/xhci.h                            |   2 +-
 drivers/usb/renesas_usbhs/fifo.c                   |  23 ++++-
 drivers/usb/serial/cp210x.c                        |   1 +
 drivers/usb/serial/ftdi_sio.c                      |   2 +
 drivers/usb/serial/ftdi_sio_ids.h                  |   7 ++
 drivers/usb/serial/metro-usb.c                     |   1 +
 drivers/usb/serial/option.c                        |   2 +
 drivers/usb/serial/qcserial.c                      |   4 +
 drivers/usb/storage/transport.c                    |  14 ++-
 drivers/usb/storage/unusual_devs.h                 |   7 ++
 drivers/uwb/hwa-rc.c                               |   2 +
 drivers/uwb/uwbd.c                                 |  12 ++-
 fs/block_dev.c                                     |   6 +-
 fs/btrfs/ioctl.c                                   |  10 +-
 fs/cifs/cifsfs.c                                   |   2 +-
 fs/cifs/connect.c                                  |   8 ++
 fs/cifs/file.c                                     |   7 ++
 fs/cifs/smb2pdu.c                                  |  34 +++++--
 fs/direct-io.c                                     |   3 +-
 fs/ecryptfs/ecryptfs_kernel.h                      |  25 +++--
 fs/ecryptfs/keystore.c                             |   9 +-
 fs/exec.c                                          |  22 ++++-
 fs/fscache/object-list.c                           |   7 ++
 fs/fuse/dir.c                                      |   3 +-
 fs/mpage.c                                         |  14 ++-
 fs/ocfs2/alloc.c                                   |  24 +++--
 fs/read_write.c                                    |   4 +-
 fs/xattr.c                                         |   2 +-
 include/crypto/internal/hash.h                     |   8 ++
 include/linux/buffer_head.h                        |   1 +
 include/linux/capability.h                         |   2 +
 include/linux/iio/adc/ad_sigma_delta.h             |   3 +
 include/linux/input.h                              |   1 +
 include/linux/key.h                                |   2 +
 include/linux/mbus.h                               |   4 +-
 include/linux/mm.h                                 |   2 +
 include/linux/mm_types.h                           |   1 +
 include/linux/mmzone.h                             |  10 +-
 include/linux/netdevice.h                          |   3 +
 include/linux/of.h                                 |  10 ++
 include/linux/pci_ids.h                            |   2 +
 include/linux/preempt_mask.h                       |  21 ++--
 include/linux/ptrace.h                             |  11 ++-
 include/linux/sched.h                              |   1 +
 include/linux/skbuff.h                             |   7 ++
 include/net/protocol.h                             |   2 +-
 include/net/route.h                                |   4 +-
 include/net/tcp.h                                  |   8 +-
 include/net/udp.h                                  |   2 +-
 include/scsi/scsi_device.h                         |   1 +
 include/scsi/scsi_devinfo.h                        |   1 +
 include/sound/seq_kernel.h                         |   3 +-
 include/sound/seq_virmidi.h                        |   1 +
 include/sound/timer.h                              |   2 +
 include/trace/events/kvm.h                         |   7 +-
 include/uapi/linux/spi/spidev.h                    |   1 +
 kernel/capability.c                                |  36 ++++++-
 kernel/fork.c                                      |   9 +-
 kernel/params.c                                    |   2 +-
 kernel/ptrace.c                                    |  91 +++++++++++------
 kernel/sched/core.c                                |  21 ++--
 kernel/sched/features.h                            |   1 -
 kernel/sysctl.c                                    |   3 +-
 kernel/trace/trace.c                               |  12 ++-
 kernel/workqueue.c                                 |  37 +++----
 kernel/workqueue_internal.h                        |   3 +-
 lib/asn1_decoder.c                                 |   7 +-
 lib/digsig.c                                       |   6 ++
 mm/huge_memory.c                                   |  14 +--
 mm/init-mm.c                                       |   2 +
 mm/memory.c                                        |   2 +-
 mm/memory_hotplug.c                                |   6 +-
 mm/nommu.c                                         |   2 +-
 net/8021q/vlan.c                                   |   6 +-
 net/bluetooth/bnep/core.c                          |   3 +
 net/bluetooth/cmtp/core.c                          |   3 +
 net/core/dev.c                                     |   6 +-
 net/core/rtnetlink.c                               |   5 +-
 net/core/skbuff.c                                  |   1 +
 net/dccp/proto.c                                   |   5 +
 net/ipv4/ip_input.c                                |  22 +++--
 net/ipv4/ip_vti.c                                  |   3 +-
 net/ipv4/route.c                                   |  44 +++++----
 net/ipv4/tcp_ipv4.c                                |   9 +-
 net/ipv4/tcp_output.c                              |  12 ++-
 net/ipv4/udp.c                                     |  30 ++++--
 net/ipv6/ip6_gre.c                                 |  41 ++++----
 net/ipv6/ip6_vti.c                                 |   3 +-
 net/l2tp/l2tp_core.c                               |  10 +-
 net/l2tp/l2tp_core.h                               |   5 +-
 net/l2tp/l2tp_eth.c                                |  51 +---------
 net/l2tp/l2tp_ip.c                                 |  20 ++--
 net/l2tp/l2tp_ip6.c                                |  21 ++--
 net/l2tp/l2tp_ppp.c                                |  10 +-
 net/netfilter/ipset/ip_set_core.c                  |  23 +++--
 net/netfilter/nfnetlink_cthelper.c                 |  10 ++
 net/netfilter/x_tables.c                           |   4 +-
 net/netfilter/xt_osf.c                             |   7 ++
 net/netlink/af_netlink.c                           |   3 +
 net/packet/af_packet.c                             |   4 +-
 net/sched/sch_generic.c                            |   1 +
 net/sctp/input.c                                   |   2 +-
 net/sctp/sm_sideeffect.c                           |   4 +-
 net/unix/diag.c                                    |   2 +
 net/wireless/nl80211.c                             |  12 ++-
 net/xfrm/xfrm_state.c                              |   1 +
 net/xfrm/xfrm_user.c                               |   3 +-
 security/keys/big_key.c                            |   2 +-
 security/keys/encrypted-keys/encrypted.c           |   7 ++
 security/keys/internal.h                           |   2 +-
 security/keys/key.c                                |   2 +
 security/keys/keyctl.c                             |   8 +-
 security/keys/keyring.c                            |  72 +++++++-------
 security/keys/process_keys.c                       |   8 +-
 security/keys/request_key.c                        |  46 +++++++--
 security/keys/request_key_auth.c                   |  69 ++++++-------
 security/keys/trusted.c                            |  69 ++++++-------
 security/smack/smack_lsm.c                         |  65 ++++++------
 security/yama/yama_lsm.c                           |   4 +-
 sound/core/hrtimer.c                               |   1 +
 sound/core/seq/oss/seq_oss_midi.c                  |   4 +-
 sound/core/seq/oss/seq_oss_readq.c                 |  29 ++++++
 sound/core/seq/oss/seq_oss_readq.h                 |   2 +
 sound/core/seq/seq_clientmgr.c                     |   2 +-
 sound/core/seq/seq_virmidi.c                       |  27 +++--
 sound/core/timer.c                                 | 109 ++++++++++++++-------
 sound/core/timer_compat.c                          |  17 +++-
 sound/pci/hda/hda_codec.c                          |   2 +-
 sound/soc/codecs/adau17x1.c                        |  24 ++++-
 sound/soc/codecs/adau17x1.h                        |   2 +
 sound/usb/caiaq/device.c                           |  12 ++-
 sound/usb/usx2y/usb_stream.c                       |   6 +-
 226 files changed, 1732 insertions(+), 944 deletions(-)

Adrian Salido (1):
HID: i2c-hid: allocate hid buffers for real worst case

Al Viro (3):
more bio_map_user_iov() leak fixes
Bluetooth: cmtp: cmtp_add_connection() should verify that it's dealing with l2cap socket
Bluetooth: bnep: bnep_add_connection() should verify that it's dealing with l2cap socket

Alan Stern (11):
usb-storage: fix bogus hardware error messages for ATA pass-thru devices
usb-storage: unusual_devs entry to fix write-access regression for Seagate external drives
USB: gadgetfs: fix copy_to_user while holding spinlock
USB: gadgetfs: Fix crash caused by inadequate synchronization
USB: g_mass_storage: Fix deadlock when driver is unbound
USB: dummy-hcd: fix connection failures (wrong speed)
USB: dummy-hcd: fix infinite-loop resubmission bug
USB: gadgetfs, dummy-hcd, net2280: fix locking for callbacks
USB: dummy-hcd: Fix erroneous synchronization change
USB: dummy-hcd: Fix deadlock caused by disconnect detection
USB: core: prevent malicious bNumInterfaces overflow

Alex Estrin (1):
Revert "IB/ipoib: Update broadcast object if PKey value was changed in index 0"

Alexey Kodanev (1):
vti: fix use after free in vti_tunnel_xmit/vti6_tnl_xmit

Andreas Engel (1):

      USB: serial: cp210x: add support for ELV TFD500

Andreas Gruenbacher (2):
vfs: Return -ENXIO for negative SEEK_HOLE / SEEK_DATA offsets
direct-io: Prevent NULL pointer access in submit_page_section

Andrei Vagin (1):
net/unix: don't show information about sockets from other namespaces

Andrew Gabbasov (1):
usb: gadget: composite: Fix use-after-free in usb_composite_overwrite_options

Andrew Honig (1):

      KVM: VMX: remove I/O port 0x80 bypass on Intel hosts

Andrey Konovalov (2):
uwb: ensure that endpoint is interrupt
uwb: properly check kthread_run return value

Aravind Gopalakrishnan (2):
pci_ids: Add PCI device IDs for F15h M60h x86, amd_nb: Add device IDs to NB tables for F15h M60h

Arnd Bergmann (4):
gpio: acpi: work around false-positive -Wstring-overflow warning
usb: gadget: dummy: fix nonsensical comparisons include/linux/of.h: provide of_n_{addr,size}_cells wrappers for !CONFIG_OF
ARM: 8715/1: add a private asm/unaligned.h

Ashish Samant (1):
ocfs2: fstrim: Fix start offset of first cluster group during fstrim

Baruch Siach (1):
spi: uapi: spidev: add missing ioctl header

Ben Hutchings (2):
ipsec: Fix aborted xfrm policy dump crash
Linux 3.16.52

Bo Yan (1):
tracing: Erase irqsoff trace with empty write

Borislav Petkov (3):
x86/microcode/intel: Disable late loading on model 79 x86/cpu/AMD: Apply the Erratum 688 fix when the BIOS doesn't x86/oprofile/ppro: Do not use __this_cpu*() in preemptible context

Casey Schaufler (1):
lsm: fix smack_inode_removexattr and xattr_getsecurity memleak

Christophe Jaillet (1):
IB/mlx5: Fix the size parameter to find_first_bit

Colin Ian King (2):
IB/ocrdma: fix incorrect fall-through on switch statement
staging: iio: ade7759: fix signed extension bug on shift of a u8

Cong Wang (2):
tun: call dev_get_valid_name() before register_netdevice()
vlan: fix a use-after-free in vlan_device_event()

Craig Gallek (1):
tun/tap: sanitize TUNSETSNDBUF input

Dan Carpenter (1):
tile: array underflow in setup_maxnodemem()

David Disseldorp (2):
SMB: fix leak of validate negotiate info response buffer
SMB: fix validate negotiate info uninitialised memory use

Dmitry Fleytman (1):
usb: Increase quirk delay for USB devices

Dmitry Torokhov (3):
Input: uinput - avoid FF flush when destroying device
Input: uinput - avoid crash when sending FF request to device going away
Input: ims-psu - check if CDC union descriptor is sane

Dongjiu Geng (1):
arm/arm64: KVM: set right LR register value for 32 bit guest when inject abort

Dragos Bogdan (2):
iio: ad_sigma_delta: Implement a dedicated reset function
iio: ad7793: Fix the serial interface reset

Eric Biggers (18):
KEYS: fix cred refcount leak in request_key_auth_new()
KEYS: don't revoke uninstantiated key in request_key_auth_new()
KEYS: fix key refcount leak in keyctl_assume_authority()
KEYS: fix key refcount leak in keyctl_read_key()
KEYS: fix writing past end of user-supplied buffer in keyring_read()
KEYS: prevent creating a different user's keyrings
KEYS: encrypted: fix dereference of NULL user_key_payload
FS-Cache: fix dereference of NULL user_key_payload lib/digsig: fix dereference of NULL user_key_payload
ecryptfs: fix dereference of NULL user_key_payload
KEYS: return full count in keyring_read() if buffer is too small
KEYS: trusted: sanitize all key material
KEYS: trusted: fix writing past end of buffer in trusted_read()
KEYS: fix out-of-bounds read during ASN.1 parsing
KEYS: fix NULL pointer dereference during ASN.1 parsing [ver #2]
crypto: salsa20 - fix blkcipher_walk API usage
crypto: hmac - require that the underlying hash algorithm is unkeyed
KEYS: add missing permission check for request_key() destination

Eric Dumazet (3):
tcp: fastopen: fix on syn-data transmit failure
netfilter: x_tables: avoid stack-out-of-bounds read in xt_copy_counters_from_user
tcp: fix tcp_mtu_probe() vs highest_sack

Eric W. Biederman (5):
mm: Add a user_ns owner to mm_struct and fix ptrace permission checks
ptrace: Capture the ptracer's creds not PT_PTRACE_CAP
exec: Ensure mm->user_ns contains the execed files
ptrace: Don't allow accessing an undumpable mm
ptrace: Properly initialize ptracer_cred on fork

Ethan Zhao (1):
sched/sysctl: Check user input value of sysctl_sched_time_avg

Felipe Balbi (1):
usb: quirks: add quirk for WORLDE MINI MIDI keyboard

Florian Westphal (1):
netfilter: ipset: pernet ops must be unregistered last

Geert Uytterhoeven (4):
sh: sh7722: remove nonexistent GPIO_PTQ7 to fix pinctrl registration
sh: sh7757: remove nonexistent GPIO_PT[JLNQ]7_RESV to fix pinctrl registration
sh: sh7264: remove nonexistent GPIO_PH[0-7] to fix pinctrl registration
sh: sh7269: remove nonexistent GPIO_PH[0-7] to fix pinctrl registration

Gerald Schaefer (1):
s390/mm: fix write access check in gup_huge_pmd()

Guillaume Nault (6):
l2tp: fix l2tp_eth module loading
l2tp: check ps->sock before running pppol2tp_session_ioctl()
l2tp: hold tunnel in pppol2tp_connect()
l2tp: hold socket before dropping lock in l2tp_ip{, 6}_recv()
l2tp: hold tunnel socket when handling control frames in l2tp_ip and l2tp_ip6
l2tp: don't use l2tp_tunnel_find() in l2tp_ip and l2tp_ip6

Gustavo A. R. Silva (1):
MIPS: microMIPS: Fix incorrect mask in insn_table_MM

Hante Meuleman (1):
brcmfmac: Add length checks on firmware events

Haozhong Zhang (1):
KVM: nVMX: fix guest CR4 loading when emulating L2 to L1 exit

Henryk Heisig (1):
USB: serial: option: add support for TP-Link LTE module

Herbert Xu (1):
crypto: shash - Fix zero-length shash ahash digest crash

Ilya Dryomov (1):
rbd: use GFP_NOIO for parent stat and data requests

Ilya Lesokhin (1):
IB/mlx5: Simplify mlx5_ib_cont_pages

Jan Luebbe (1):
bus: mbus: fix window size calculation for 4GB windows

Jani Nikula (1):
drm/i915/bios: ignore HDMI on port A

Jann Horn (1):
security: let security modules use PTRACE_MODE_* with bitmasks

Jason A. Donenfeld (1):
security/keys: properly zero out sensitive key material in big_key

Jean Delvare (1):
kernel/params.c: align add_sysfs_param documentation with code

Jeff Lance (1):
Input: ti_am335x_tsc - fix incorrect step config for 5 wire touchscreen

Jeffrey Chu (1):
USB: serial: ftdi_sio: add id for Cypress WICED dev board

Jim Dickerson (1):
usb: pci-quirks.c: Corrected timeout values used in handshake

Jimmy Assarsson (1):
can: kvaser_usb: Correct return value in printout

Joerg Roedel (1):
iommu/amd: Finish TLB flush in amd_iommu_unmap()

Johan Hovold (1):
USB: serial: metro-usb: add MS7820 device id

Johannes Thumshirn (1):
scsi: libiscsi: fix shifting of DID_REQUEUE host byte

John David Anglin (1):
parisc: Fix double-word compare and exchange in LWS code on 32-bit kernels

Jonathan Basseri (1):
xfrm: Clear sk_dst_cache when applying per-socket policy.

Kazuya Mizuguchi (1):
usb: renesas_usbhs: Fix DMAC sequence for receiving zero-length packet

Kevin Cernekee (4):
brcmfmac: Add check for short event packets
netfilter: nfnetlink_cthelper: Add missing permission checks
netlink: Add netns check on taps
netfilter: xt_osf: Add missing permission checks

Kirill A. Shutemov (1):
mm, thp: Do not make page table dirty unconditionally in touch_p[mu]d()

Konstantin Khlebnikov (2):
net_sched: always reset qdisc backlog in qdisc_reset()
Smack: remove unneeded NULL-termination from securtity label

LEROY Christophe (2):
crypto: talitos - fix sha224
crypto: talitos - Don't provide setkey for non hmac hashing algs.

Lauro Ramos Venancio (1):
sched/topology: Optimize build_group_mask()

Li Bin (1):
workqueue: Fix NULL pointer dereference

Luca Coelho (1):
iwlwifi: mvm: use IWL_HCMD_NOCOPY for MCAST_FILTER_CMD

Lukas Wunner (1):

      iio: adc: mcp320x: Fix oops on module unload

Maksim Salau (1):
usb: cdc_acm: Add quirk for Elatec TWN3

Marc Zyngier (1):
arm64: Make sure SPsel is always set

Marek Szyprowski (1):
iommu/exynos: Remove initconst attribute to avoid potential kernel oops

Mark Rutland (3):
arm64: fix dump_instr when PAN and UAO are in use
arm64: ensure __dump_instr() checks addr_limit
ARM: 8720/1: ensure dump_instr() checks addr_limit

Martin K. Petersen (1):
scsi: sd: Implement blacklist option for WRITE SAME w/ UNMAP

Mathias Nyman (2):
xhci: fix finding correct bus_state structure for USB 3.1 hosts
usb: hub: Allow reset retry for USB2 devices on connect bounce

Matt Bennett (1):
ip6_gre: Reduce log level in ip6gre_err() to debug

Matt Fornero (1):
iio: core: Return error for failed read_reg

Matthew Wilcox (1):
fs/mpage.c: fix mpage_writepage() for pages with buffers

Mayank Rana (1):
usb: xhci: Handle error condition in xhci_stop_device()

Michael S. Tsirkin (1):
macvtap: fix TUNSETSNDBUF values > 64k

Miklos Szeredi (1):
fuse: fix READDIRPLUS skipping an entry

Mohamed Ghannam (1):

      dccp: CVE-2017-8824: use-after-free in DCCP code

Nicolai Stange (1):
PCI: Fix race condition with driver_override

Nicolas Dichtel (1):
net: enable interface alias removal via rtnl

Oleg Nesterov (1):

      ptrace: change __ptrace_unlink() to clear ->ptrace under ->siglock

Omar Sandoval (1):
Btrfs: fix incorrect {node,sector}size endianness from BTRFS_IOC_FS_INFO

Oswald Buddenhagen (1):
MIPS: AR7: Ensure that serial ports are properly set up

Paolo Abeni (4):
ipv4: fix broadcast packets reception
IPv4: early demux can return an error code
udp: perform source validation for mcast early demux
udp: fix bcast packet reception

Paul Burton (1):
MIPS: Fix CM region target definitions

Peng Xu (1):
nl80211: Define policy for packet pattern attributes

Peter Zijlstra (3):
x86/uaccess, sched/preempt: Verify access_ok() context sched/topology: Remove FORCE_SD_OVERLAP sched/topology: Simplify build_overlap_sched_groups()

Ravi Bangoria (1):
powerpc/sysrq: Fix oops whem ppmu is not registered

Ricard Wanderlof (1):
ASoC: adau17x1: Workaround for noise bug in ADC

Richard Schütz (1):
can: c_can: don't indicate triple sampling support for D_CAN

Ronnie Sahlberg (1):
cifs: check rsp for NULL before dereferencing in SMB2_open

Sabrina Dubroca (1):
l2tp: fix race condition in l2tp_tunnel_delete

Sekhar Nori (1):
ARM: dts: da850-evm: add serial and ethernet aliases

Shrirang Bagul (1):

      USB: serial: qcserial: add Dell DW5818, DW5819

Shu Wang (2):
cifs: release cifs root_cred after exit_cifs
cifs: release auth_key.response for reconnect.

Stefan Mätje (1):
can: esd_usb2: Fix can_dlc value for received RTR, frames

Stefan Popa (1):
staging: iio: ad7192: Fix - use the dedicated reset function avoiding dma from stack.

Stefano Brivio (1):
scsi: lpfc: Don't return internal MBXERR_ERROR code from probe function

Steffen Maier (1):
scsi: zfcp: fix erp_action use-before-initialize in REC action trace

Steve French (3):
SMB: Validate negotiate (to protect against downgrade) even if signing off
SMB3: Don't ignore O_SYNC/O_DSYNC and O_DIRECT flags
SMB3: Validate negotiate request must always be signed

Tahsin Erdogan (1):
tracing: Fix trace_pipe behavior for instance traces

Takashi Iwai (10):
ALSA: usx2y: Suppress kernel warning at page allocation failures
ALSA: seq: Fix copy_from_user() call inside lock
ALSA: caiaq: Fix stray URB at probe error path
ALSA: hda: Remove superfluous '-' added by printk conversion
ALSA: timer: Add missing mutex lock for compat ioctls
ALSA: seq: Fix nested rwsem annotation for lockdep splat
ALSA: timer: Protect the whole snd_timer_close() with open race
ALSA: timer: Limit max instances per timer
ALSA: seq: Avoid invalid lockdep class warning
ALSA: seq: Fix OSS sysex delivery in OSS emulation

Tejun Heo (1):

      workqueue: replace pool->manager_arb mutex with a flag

Tyrel Datwyler (1):
powerpc/pseries: Fix parent_dn reference leak in add_dt_node()

Wanpeng Li (1):
KVM: Fix stack-out-of-bounds read in write_mmio

Will Deacon (1):
arm64: fault: Route pte translation faults via do_translation_fault

Willem de Bruijn (1):

      packet: only test po->has_vnet_hdr once in packet_snd

Wolfgang Grandegger (1):
can: gs_usb: fix busy loop if no more TX context is available

Xin Long (4):
ip6_gre: skb_push ipv6hdr before packing the header in ip6gre_header
sctp: add the missing sock_owned_by_user check in sctp_icmp_redirect
ip6_gre: only increase err_count for some certain type icmpv6 in ip6gre_err
sctp: fix a type cast warnings that causes a_rwnd gets the wrong value

YASUAKI ISHIMATSU (2):
mm/memory_hotplug: change pfn_to_section_nr/section_nr_to_pfn macro to inline function mm/memory_hotplug: define find_{smallest|biggest}_section_pfn as unsigned long

Yazen Ghannam (1):
x86/amd_nb: Add Fam17h Data Fabric as "Northbridge"

Ye Yin (1):
netfilter/ipvs: clear ipvs_property flag when SKB net namespace changed

Yoshihiro Shimoda (2):
usb: renesas_usbhs: fix the BCLR setting condition for non-DCP pipe
usb: renesas_usbhs: fix usbhsf_fifo_clear() for RX direction

satoru takeuchi (1):
btrfs: prevent to set invalid default subvolid

Makefile +1 -1
index fc9df28cecf1..5cf074eb43ed 100644
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 16
-SUBLEVEL = 51
+SUBLEVEL = 52
 EXTRAVERSION =
 NAME = Museum of Fishiegoodies
 
arch/alpha/kernel/ptrace.c +1 -1
index 86d835157b54..292e6cae1d10 100644
@@ -281,7 +281,7 @@ long arch_ptrace(struct task_struct *child, long request,
 	/* When I and D space are separate, these will need to be fixed.  */
 	case PTRACE_PEEKTEXT: /* read word at location addr. */
 	case PTRACE_PEEKDATA:
-		copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
+		copied = ptrace_access_vm(child, addr, &tmp, sizeof(tmp), 0);
 		ret = -EIO;
 		if (copied != sizeof(tmp))
 			break;
arch/arm/boot/dts/da850-evm.dts +7 -0
index 21342ab78ff5..c2f242d122f0 100644
@@ -14,6 +14,13 @@
 	compatible = "ti,da850-evm", "ti,da850";
 	model = "DA850/AM1808/OMAP-L138 EVM";
 
+	aliases {
+		serial0 = &serial0;
+		serial1 = &serial1;
+		serial2 = &serial2;
+		ethernet0 = &eth0;
+	};
+
 	soc {
 		pmx_core: pinmux@1c14120 {
 			status = "okay";
arch/arm/include/asm/Kbuild +0 -1
index f5a357601983..4d9849d22357 100644
@@ -36,4 +36,3 @@ generic-y += termbits.h
 generic-y += termios.h
 generic-y += timex.h
 generic-y += trace_clock.h
-generic-y += unaligned.h
arch/arm/include/asm/unaligned.h new file +27 -0
new file mode 100644
index 000000000000..ab905ffcf193
@@ -0,0 +1,27 @@
+#ifndef __ASM_ARM_UNALIGNED_H
+#define __ASM_ARM_UNALIGNED_H
+
+/*
+ * We generally want to set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS on ARMv6+,
+ * but we don't want to use linux/unaligned/access_ok.h since that can lead
+ * to traps on unaligned stm/ldm or strd/ldrd.
+ */
+#include <asm/byteorder.h>
+
+#if defined(__LITTLE_ENDIAN)
+# include <linux/unaligned/le_struct.h>
+# include <linux/unaligned/be_byteshift.h>
+# include <linux/unaligned/generic.h>
+# define get_unaligned	__get_unaligned_le
+# define put_unaligned	__put_unaligned_le
+#elif defined(__BIG_ENDIAN)
+# include <linux/unaligned/be_struct.h>
+# include <linux/unaligned/le_byteshift.h>
+# include <linux/unaligned/generic.h>
+# define get_unaligned	__get_unaligned_be
+# define put_unaligned	__put_unaligned_be
+#else
+# error need to define endianess
+#endif
+
+#endif /* __ASM_ARM_UNALIGNED_H */
arch/arm/kernel/traps.c +18 -10
index 8dffc57a9f71..cba3cb0b1a47 100644
@@ -129,30 +129,26 @@ static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
 	set_fs(fs);
 }
 
-static void dump_instr(const char *lvl, struct pt_regs *regs)
+static void __dump_instr(const char *lvl, struct pt_regs *regs)
 {
 	unsigned long addr = instruction_pointer(regs);
 	const int thumb = thumb_mode(regs);
 	const int width = thumb ? 4 : 8;
-	mm_segment_t fs;
 	char str[sizeof("00000000 ") * 5 + 2 + 1], *p = str;
 	int i;
 
 	/*
-	 * We need to switch to kernel mode so that we can use __get_user
-	 * to safely read from kernel space.  Note that we now dump the
-	 * code first, just in case the backtrace kills us.
+	 * Note that we now dump the code first, just in case the backtrace
+	 * kills us.
 	 */
-	fs = get_fs();
-	set_fs(KERNEL_DS);
 
 	for (i = -4; i < 1 + !!thumb; i++) {
 		unsigned int val, bad;
 
 		if (thumb)
-			bad = __get_user(val, &((u16 *)addr)[i]);
+			bad = get_user(val, &((u16 *)addr)[i]);
 		else
-			bad = __get_user(val, &((u32 *)addr)[i]);
+			bad = get_user(val, &((u32 *)addr)[i]);
 
 		if (!bad)
 			p += sprintf(p, i == 0 ? "(%0*x) " : "%0*x ",
@@ -163,8 +159,20 @@ static void dump_instr(const char *lvl, struct pt_regs *regs)
 		}
 	}
 	printk("%sCode: %s\n", lvl, str);
+}
 
-	set_fs(fs);
+static void dump_instr(const char *lvl, struct pt_regs *regs)
+{
+	mm_segment_t fs;
+
+	if (!user_mode(regs)) {
+		fs = get_fs();
+		set_fs(KERNEL_DS);
+		__dump_instr(lvl, regs);
+		set_fs(fs);
+	} else {
+		__dump_instr(lvl, regs);
+	}
 }
 
 #ifdef CONFIG_ARM_UNWIND
arch/arm/kvm/emulate.c +2 -3
index d6c005283678..ef0a11f8a9d1 100644
@@ -295,7 +295,7 @@ void kvm_inject_undefined(struct kvm_vcpu *vcpu)
 	u32 return_offset = (is_thumb) ? 2 : 4;
 
 	new_spsr_value = cpsr;
-	new_lr_value = *vcpu_pc(vcpu) - return_offset;
+	new_lr_value = *vcpu_pc(vcpu) + return_offset;
 
 	*vcpu_cpsr(vcpu) = (cpsr & ~MODE_MASK) | UND_MODE;
 	*vcpu_cpsr(vcpu) |= PSR_I_BIT;
@@ -324,9 +324,8 @@ static void inject_abt(struct kvm_vcpu *vcpu, bool is_pabt, unsigned long addr)
 	unsigned long new_spsr_value;
 	unsigned long cpsr = *vcpu_cpsr(vcpu);
 	u32 sctlr = vcpu->arch.cp15[c1_SCTLR];
-	bool is_thumb = (cpsr & PSR_T_BIT);
 	u32 vect_offset;
-	u32 return_offset = (is_thumb) ? 4 : 0;
+	u32 return_offset = (is_pabt) ? 4 : 8;
 	bool is_lpae;
 
 	new_spsr_value = cpsr;
arch/arm/kvm/mmio.c +2 -2
index 4cb5a93182e9..c47f108c2b8a 100644
@@ -113,7 +113,7 @@ int kvm_handle_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run)
 		}
 
 		trace_kvm_mmio(KVM_TRACE_MMIO_READ, len, run->mmio.phys_addr,
-			       data);
+			       &data);
 		data = vcpu_data_host_to_guest(vcpu, data, len);
 		*vcpu_reg(vcpu, vcpu->arch.mmio_decode.rt) = data;
 	}
@@ -192,7 +192,7 @@ int io_mem_abort(struct kvm_vcpu *vcpu, struct kvm_run *run,
 	trace_kvm_mmio((mmio.is_write) ? KVM_TRACE_MMIO_WRITE :
 					 KVM_TRACE_MMIO_READ_UNSATISFIED,
 			mmio.len, fault_ipa,
-			(mmio.is_write) ? data : 0);
+			(mmio.is_write) ? &data : NULL);
 
 	if (mmio.is_write)
 		mmio_write_buf(mmio.data, mmio.len, data);
arch/arm64/kernel/head.S +1 -0
index cb83c1aabae8..d15ed089bb83 100644
@@ -269,6 +269,7 @@ ENDPROC(stext)
  * booted in EL1 or EL2 respectively.
  */
 ENTRY(el2_setup)
+	msr	SPsel, #1			// We want to use SP_EL{1,2}
 	mrs	x0, CurrentEL
 	cmp	x0, #CurrentEL_EL2
 	b.ne	1f
arch/arm64/kernel/traps.c +14 -14
index c1c2ad6a1c94..ec1e323060e0 100644
@@ -59,8 +59,7 @@ static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
 
 	/*
 	 * We need to switch to kernel mode so that we can use __get_user
-	 * to safely read from kernel space.  Note that we now dump the
-	 * code first, just in case the backtrace kills us.
+	 * to safely read from kernel space.
 	 */
 	fs = get_fs();
 	set_fs(KERNEL_DS);
@@ -97,25 +96,16 @@ static void dump_backtrace_entry(unsigned long where, unsigned long stack)
 			 stack + sizeof(struct pt_regs));
 }
 
-static void dump_instr(const char *lvl, struct pt_regs *regs)
+static void __dump_instr(const char *lvl, struct pt_regs *regs)
 {
 	unsigned long addr = instruction_pointer(regs);
-	mm_segment_t fs;
 	char str[sizeof("00000000 ") * 5 + 2 + 1], *p = str;
 	int i;
 
-	/*
-	 * We need to switch to kernel mode so that we can use __get_user
-	 * to safely read from kernel space.  Note that we now dump the
-	 * code first, just in case the backtrace kills us.
-	 */
-	fs = get_fs();
-	set_fs(KERNEL_DS);
-
 	for (i = -4; i < 1; i++) {
 		unsigned int val, bad;
 
-		bad = __get_user(val, &((u32 *)addr)[i]);
+		bad = get_user(val, &((u32 *)addr)[i]);
 
 		if (!bad)
 			p += sprintf(p, i == 0 ? "(%08x) " : "%08x ", val);
@@ -125,8 +115,18 @@ static void dump_instr(const char *lvl, struct pt_regs *regs)
 		}
 	}
 	printk("%sCode: %s\n", lvl, str);
+}
 
-	set_fs(fs);
+static void dump_instr(const char *lvl, struct pt_regs *regs)
+{
+	if (!user_mode(regs)) {
+		mm_segment_t fs = get_fs();
+		set_fs(KERNEL_DS);
+		__dump_instr(lvl, regs);
+		set_fs(fs);
+	} else {
+		__dump_instr(lvl, regs);
+	}
 }
 
 static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
arch/arm64/kvm/inject_fault.c +15 -1
index f527a37ac979..595d311affe8 100644
@@ -29,12 +29,26 @@
 				 PSR_I_BIT | PSR_D_BIT)
 #define EL1_EXCEPT_SYNC_OFFSET	0x200
 
+/*
+ * Table taken from ARMv8 ARM DDI0487B-B, table G1-10.
+ */
+static const u8 return_offsets[8][2] = {
+	[0] = { 0, 0 },		/* Reset, unused */
+	[1] = { 4, 2 },		/* Undefined */
+	[2] = { 0, 0 },		/* SVC, unused */
+	[3] = { 4, 4 },		/* Prefetch abort */
+	[4] = { 8, 8 },		/* Data abort */
+	[5] = { 0, 0 },		/* HVC, unused */
+	[6] = { 4, 4 },		/* IRQ, unused */
+	[7] = { 4, 4 },		/* FIQ, unused */
+};
+
 static void prepare_fault32(struct kvm_vcpu *vcpu, u32 mode, u32 vect_offset)
 {
 	unsigned long cpsr;
 	unsigned long new_spsr_value = *vcpu_cpsr(vcpu);
 	bool is_thumb = (new_spsr_value & COMPAT_PSR_T_BIT);
-	u32 return_offset = (is_thumb) ? 4 : 0;
+	u32 return_offset = return_offsets[vect_offset >> 2][is_thumb];
 	u32 sctlr = vcpu_cp15(vcpu, c1_SCTLR);
 
 	cpsr = mode | COMPAT_PSR_I_BIT;
arch/arm64/mm/fault.c +1 -1
index 8fd2315bdf4d..ca1b882bc9e1 100644
@@ -386,7 +386,7 @@ static struct fault_info {
 	{ do_translation_fault,	SIGSEGV, SEGV_MAPERR,	"input address range fault"	},
 	{ do_translation_fault,	SIGSEGV, SEGV_MAPERR,	"level 1 translation fault"	},
 	{ do_translation_fault,	SIGSEGV, SEGV_MAPERR,	"level 2 translation fault"	},
-	{ do_page_fault,	SIGSEGV, SEGV_MAPERR,	"level 3 translation fault"	},
+	{ do_translation_fault,	SIGSEGV, SEGV_MAPERR,	"level 3 translation fault"	},
 	{ do_bad,		SIGBUS,  0,		"reserved access flag fault"	},
 	{ do_page_fault,	SIGSEGV, SEGV_ACCERR,	"level 1 access flag fault"	},
 	{ do_page_fault,	SIGSEGV, SEGV_ACCERR,	"level 2 access flag fault"	},
arch/blackfin/kernel/ptrace.c +2 -2
index 8b8fe671b1a6..7d8ece6a93fb 100644
@@ -270,7 +270,7 @@ long arch_ptrace(struct task_struct *child, long request,
 			switch (bfin_mem_access_type(addr, to_copy)) {
 			case BFIN_MEM_ACCESS_CORE:
 			case BFIN_MEM_ACCESS_CORE_ONLY:
-				copied = access_process_vm(child, addr, &tmp,
+				copied = ptrace_access_vm(child, addr, &tmp,
 				                           to_copy, 0);
 				if (copied)
 					break;
@@ -323,7 +323,7 @@ long arch_ptrace(struct task_struct *child, long request,
 			switch (bfin_mem_access_type(addr, to_copy)) {
 			case BFIN_MEM_ACCESS_CORE:
 			case BFIN_MEM_ACCESS_CORE_ONLY:
-				copied = access_process_vm(child, addr, &data,
+				copied = ptrace_access_vm(child, addr, &data,
 				                           to_copy, 1);
 				break;
 			case BFIN_MEM_ACCESS_DMA:
arch/cris/arch-v32/kernel/ptrace.c +1 -1
index f085229cf870..04251c6cb5f9 100644
@@ -147,7 +147,7 @@ long arch_ptrace(struct task_struct *child, long request,
 				/* The trampoline page is globally mapped, no page table to traverse.*/
 				tmp = *(unsigned long*)addr;
 			} else {
-				copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
+				copied = ptrace_access_vm(child, addr, &tmp, sizeof(tmp), 0);
 
 				if (copied != sizeof(tmp))
 					break;
arch/ia64/kernel/ptrace.c +1 -1
index b7a5fffe0924..c218249c4792 100644
@@ -1156,7 +1156,7 @@ arch_ptrace (struct task_struct *child, long request,
 	case PTRACE_PEEKTEXT:
 	case PTRACE_PEEKDATA:
 		/* read word at location addr */
-		if (access_process_vm(child, addr, &data, sizeof(data), 0)
+		if (ptrace_access_vm(child, addr, &data, sizeof(data), 0)
 		    != sizeof(data))
 			return -EIO;
 		/* ensure return value is not mistaken for error code */
arch/mips/ar7/platform.c +1 -0
index 7e2356fd5fd6..e4f47d3e55bb 100644
@@ -581,6 +581,7 @@ static int __init ar7_register_uarts(void)
 	uart_port.type		= PORT_AR7;
 	uart_port.uartclk	= clk_get_rate(bus_clk) / 2;
 	uart_port.iotype	= UPIO_MEM32;
+	uart_port.flags		= UPF_FIXED_TYPE;
 	uart_port.regshift	= 2;
 
 	uart_port.line		= 0;
arch/mips/include/asm/mips-cm.h +2 -2
index 6a9d2dd005ca..79c882be9d17 100644
@@ -173,8 +173,8 @@ BUILD_CM_Cx_R_(tcid_8_priority,	0x80)
 #define CM_GCR_BASE_GCRBASE_MSK			(_ULCAST_(0x1ffff) << 15)
 #define CM_GCR_BASE_CMDEFTGT_SHF		0
 #define CM_GCR_BASE_CMDEFTGT_MSK		(_ULCAST_(0x3) << 0)
-#define  CM_GCR_BASE_CMDEFTGT_DISABLED		0
-#define  CM_GCR_BASE_CMDEFTGT_MEM		1
+#define  CM_GCR_BASE_CMDEFTGT_MEM		0
+#define  CM_GCR_BASE_CMDEFTGT_RESERVED		1
 #define  CM_GCR_BASE_CMDEFTGT_IOCU0		2
 #define  CM_GCR_BASE_CMDEFTGT_IOCU1		3
 
arch/mips/kernel/ptrace32.c +2 -2
index a83fb730b387..fdd26c104c6c 100644
@@ -69,7 +69,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
 		if (get_user(addrOthers, (u32 __user * __user *) (unsigned long) addr) != 0)
 			break;
 
-		copied = access_process_vm(child, (u64)addrOthers, &tmp,
+		copied = ptrace_access_vm(child, (u64)addrOthers, &tmp,
 				sizeof(tmp), 0);
 		if (copied != sizeof(tmp))
 			break;
@@ -178,7 +178,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
 		if (get_user(addrOthers, (u32 __user * __user *) (unsigned long) addr) != 0)
 			break;
 		ret = 0;
-		if (access_process_vm(child, (u64)addrOthers, &data,
+		if (ptrace_access_vm(child, (u64)addrOthers, &data,
 					sizeof(data), 1) == sizeof(data))
 			break;
 		ret = -EIO;
arch/mips/mm/uasm-micromips.c +1 -1
index 8399ddf03a02..cab124e0572d 100644
@@ -83,7 +83,7 @@ static struct insn insn_table_MM[] = {
 	{ insn_jr, M(mm_pool32a_op, 0, 0, 0, mm_jalr_op, mm_pool32axf_op), RS },
 	{ insn_lb, M(mm_lb32_op, 0, 0, 0, 0, 0), RT | RS | SIMM },
 	{ insn_ld, 0, 0 },
-	{ insn_lh, M(mm_lh32_op, 0, 0, 0, 0, 0), RS | RS | SIMM },
+	{ insn_lh, M(mm_lh32_op, 0, 0, 0, 0, 0), RT | RS | SIMM },
 	{ insn_ll, M(mm_pool32c_op, 0, 0, (mm_ll_func << 1), 0, 0), RS | RT | SIMM },
 	{ insn_lld, 0, 0 },
 	{ insn_lui, M(mm_pool32i_op, mm_lui_op, 0, 0, 0, 0), RS | SIMM },
arch/parisc/kernel/syscall.S +3 -3
index f716e9e65a49..df6ff75c03ce 100644
@@ -742,7 +742,7 @@ ENTRY(linux_gateway_page)
 10:	ldd	0(%sr3,%r25), %r25
 11:	ldd	0(%sr3,%r24), %r24
 #else
-	/* Load new value into r22/r23 - high/low */
+	/* Load old value into r22/r23 - high/low */
 10:	ldw	0(%sr3,%r25), %r22
 11:	ldw	4(%sr3,%r25), %r23
 	/* Load new value into fr4 for atomic store later */
@@ -834,11 +834,11 @@ ENTRY(linux_gateway_page)
 	copy	%r0, %r28
 #else
 	/* Compare first word */
-19:	ldw,ma	0(%sr3,%r26), %r29
+19:	ldw	0(%sr3,%r26), %r29
 	sub,=	%r29, %r22, %r0
 	b,n	cas2_end
 	/* Compare second word */
-20:	ldw,ma	4(%sr3,%r26), %r29
+20:	ldw	4(%sr3,%r26), %r29
 	sub,=	%r29, %r23, %r0
 	b,n	cas2_end
 	/* Perform the store */
arch/powerpc/kernel/ptrace32.c +2 -2
index f52b7db327c8..2e4f01dc9d64 100644
@@ -73,7 +73,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
 		if (get_user(addrOthers, (u32 __user * __user *)addr) != 0)
 			break;
 
-		copied = access_process_vm(child, (u64)addrOthers, &tmp,
+		copied = ptrace_access_vm(child, (u64)addrOthers, &tmp,
 				sizeof(tmp), 0);
 		if (copied != sizeof(tmp))
 			break;
@@ -178,7 +178,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
 		if (get_user(addrOthers, (u32 __user * __user *)addr) != 0)
 			break;
 		ret = 0;
-		if (access_process_vm(child, (u64)addrOthers, &tmp,
+		if (ptrace_access_vm(child, (u64)addrOthers, &tmp,
 					sizeof(tmp), 1) == sizeof(tmp))
 			break;
 		ret = -EIO;
arch/powerpc/perf/core-book3s.c +5 -0
index 97579de6853b..6b989c2d6e31 100644
@@ -755,6 +755,11 @@ void perf_event_print_debug(void)
 	u32 pmcs[MAX_HWEVENTS];
 	int i;
 
+	if (!ppmu) {
+		pr_info("Performance monitor hardware not registered.\n");
+		return;
+	}
+
 	if (!ppmu->n_counter)
 		return;
 
arch/powerpc/platforms/pseries/mobility.c +3 -1
index c70762e0daf1..eb4b07f3a505 100644
@@ -224,8 +224,10 @@ static int add_dt_node(__be32 parent_phandle, __be32 drc_index)
 		return -ENOENT;
 
 	dn = dlpar_configure_connector(drc_index, parent_dn);
-	if (!dn)
+	if (!dn) {
+		of_node_put(parent_dn);
 		return -ENOENT;
+	}
 
 	rc = dlpar_attach_node(dn);
 	if (rc)
arch/s390/mm/gup.c +3 -4
index 639fce464008..21e925e9845a 100644
@@ -51,13 +51,12 @@ static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr,
 static inline int gup_huge_pmd(pmd_t *pmdp, pmd_t pmd, unsigned long addr,
 		unsigned long end, int write, struct page **pages, int *nr)
 {
-	unsigned long mask, result;
 	struct page *head, *page, *tail;
+	unsigned long mask;
 	int refs;
 
-	result = write ? 0 : _SEGMENT_ENTRY_PROTECT;
-	mask = result | _SEGMENT_ENTRY_INVALID;
-	if ((pmd_val(pmd) & mask) != result)
+	mask = (write ? _SEGMENT_ENTRY_PROTECT : 0) | _SEGMENT_ENTRY_INVALID;
+	if ((pmd_val(pmd) & mask) != 0)
 		return 0;
 	VM_BUG_ON(!pfn_valid(pmd_val(pmd) >> PAGE_SHIFT));
 
arch/sh/include/cpu-sh2a/cpu/sh7264.h +1 -3
index 4d1ef6d74bd6..2ae0e938b657 100644
@@ -43,9 +43,7 @@ enum {
 	GPIO_PG7, GPIO_PG6, GPIO_PG5, GPIO_PG4,
 	GPIO_PG3, GPIO_PG2, GPIO_PG1, GPIO_PG0,
 
-	/* Port H */
-	GPIO_PH7, GPIO_PH6, GPIO_PH5, GPIO_PH4,
-	GPIO_PH3, GPIO_PH2, GPIO_PH1, GPIO_PH0,
+	/* Port H - Port H does not have a Data Register */
 
 	/* Port I - not on device */
 
arch/sh/include/cpu-sh2a/cpu/sh7269.h +1 -3
index 2a0ca8780f0d..13c495a9fc00 100644
@@ -45,9 +45,7 @@ enum {
 	GPIO_PG7, GPIO_PG6, GPIO_PG5, GPIO_PG4,
 	GPIO_PG3, GPIO_PG2, GPIO_PG1, GPIO_PG0,
 
-	/* Port H */
-	GPIO_PH7, GPIO_PH6, GPIO_PH5, GPIO_PH4,
-	GPIO_PH3, GPIO_PH2, GPIO_PH1, GPIO_PH0,
+	/* Port H - Port H does not have a Data Register */
 
 	/* Port I - not on device */
 
arch/sh/include/cpu-sh4/cpu/sh7722.h +1 -1
index 3bb74e534d0f..78961ab78a5a 100644
@@ -67,7 +67,7 @@ enum {
 	GPIO_PTN3, GPIO_PTN2, GPIO_PTN1, GPIO_PTN0,
 
 	/* PTQ */
-	GPIO_PTQ7, GPIO_PTQ6, GPIO_PTQ5, GPIO_PTQ4,
+	GPIO_PTQ6, GPIO_PTQ5, GPIO_PTQ4,
 	GPIO_PTQ3, GPIO_PTQ2, GPIO_PTQ1, GPIO_PTQ0,
 
 	/* PTR */
arch/sh/include/cpu-sh4/cpu/sh7757.h +4 -4
index 5340f3bc1863..b40fb541e72a 100644
@@ -40,7 +40,7 @@ enum {
 
 	/* PTJ */
 	GPIO_PTJ0, GPIO_PTJ1, GPIO_PTJ2, GPIO_PTJ3,
-	GPIO_PTJ4, GPIO_PTJ5, GPIO_PTJ6, GPIO_PTJ7_RESV,
+	GPIO_PTJ4, GPIO_PTJ5, GPIO_PTJ6,
 
 	/* PTK */
 	GPIO_PTK0, GPIO_PTK1, GPIO_PTK2, GPIO_PTK3,
@@ -48,7 +48,7 @@ enum {
 
 	/* PTL */
 	GPIO_PTL0, GPIO_PTL1, GPIO_PTL2, GPIO_PTL3,
-	GPIO_PTL4, GPIO_PTL5, GPIO_PTL6, GPIO_PTL7_RESV,
+	GPIO_PTL4, GPIO_PTL5, GPIO_PTL6,
 
 	/* PTM */
 	GPIO_PTM0, GPIO_PTM1, GPIO_PTM2, GPIO_PTM3,
@@ -56,7 +56,7 @@ enum {
 
 	/* PTN */
 	GPIO_PTN0, GPIO_PTN1, GPIO_PTN2, GPIO_PTN3,
-	GPIO_PTN4, GPIO_PTN5, GPIO_PTN6, GPIO_PTN7_RESV,
+	GPIO_PTN4, GPIO_PTN5, GPIO_PTN6,
 
 	/* PTO */
 	GPIO_PTO0, GPIO_PTO1, GPIO_PTO2, GPIO_PTO3,
@@ -68,7 +68,7 @@ enum {
 
 	/* PTQ */
 	GPIO_PTQ0, GPIO_PTQ1, GPIO_PTQ2, GPIO_PTQ3,
-	GPIO_PTQ4, GPIO_PTQ5, GPIO_PTQ6, GPIO_PTQ7_RESV,
+	GPIO_PTQ4, GPIO_PTQ5, GPIO_PTQ6,
 
 	/* PTR */
 	GPIO_PTR0, GPIO_PTR1, GPIO_PTR2, GPIO_PTR3,
arch/tile/kernel/setup.c +1 -1
index d8a9df999da3..0ac4de510b42 100644
@@ -139,7 +139,7 @@ static int __init setup_maxnodemem(char *str)
 {
 	char *endp;
 	unsigned long long maxnodemem;
-	long node;
+	unsigned long node;
 
 	node = str ? simple_strtoul(str, &endp, 0) : INT_MAX;
 	if (node >= MAX_NUMNODES || *endp != ':')
arch/x86/crypto/salsa20_glue.c +0 -7
index 399a29d067d6..cb91a64a99e7 100644
@@ -59,13 +59,6 @@ static int encrypt(struct blkcipher_desc *desc,
 
 	salsa20_ivsetup(ctx, walk.iv);
 
-	if (likely(walk.nbytes == nbytes))
-	{
-		salsa20_encrypt_bytes(ctx, walk.src.virt.addr,
-				      walk.dst.virt.addr, nbytes);
-		return blkcipher_walk_done(desc, &walk, 0);
-	}
-
 	while (walk.nbytes >= 64) {
 		salsa20_encrypt_bytes(ctx, walk.src.virt.addr,
 				      walk.dst.virt.addr,
arch/x86/include/asm/uaccess.h +12 -2
index 465504609869..887c0ea365a7 100644
@@ -7,6 +7,7 @@
 #include <linux/compiler.h>
 #include <linux/thread_info.h>
 #include <linux/string.h>
+#include <linux/preempt_mask.h>
 #include <asm/asm.h>
 #include <asm/page.h>
 #include <asm/smap.h>
@@ -66,6 +67,12 @@ static inline bool __chk_range_not_ok(unsigned long addr, unsigned long size, un
 	__chk_range_not_ok((unsigned long __force)(addr), size, limit); \
 })
 
+#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
+# define WARN_ON_IN_IRQ()	WARN_ON_ONCE(!in_task())
+#else
+# define WARN_ON_IN_IRQ()
+#endif
+
 /**
  * access_ok: - Checks if a user space pointer is valid
  * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE.  Note that
@@ -85,8 +92,11 @@ static inline bool __chk_range_not_ok(unsigned long addr, unsigned long size, un
  * checks that the pointer is in the user space range - after calling
  * this function, memory access functions may still return -EFAULT.
  */
-#define access_ok(type, addr, size) \
-	likely(!__range_not_ok(addr, size, user_addr_max()))
+#define access_ok(type, addr, size)					\
+({									\
+	WARN_ON_IN_IRQ();						\
+	likely(!__range_not_ok(addr, size, user_addr_max()));		\
+})
 
 /*
  * The exception table consists of pairs of addresses relative to the
arch/x86/kernel/amd_nb.c +48 -0

84 lines not on this page · raw message

arch/x86/kernel/cpu/microcode/intel.c +18 -0
index a276fa75d9b5..8eaa571cb5f6 100644
@@ -267,6 +267,18 @@ static int get_ucode_fw(void *to, const void *from, size_t n)
 	return 0;
 }
 
+static bool is_blacklisted(unsigned int cpu)
+{
+	struct cpuinfo_x86 *c = &cpu_data(cpu);
+
+	if (c->x86 == 6 && c->x86_model == 0x4F) {
+		pr_err_once("late loading on model 79 is disabled.\n");
+		return true;
+	}
+
+	return false;
+}
+
 static enum ucode_state request_microcode_fw(int cpu, struct device *device,
 					     bool refresh_fw)
 {
@@ -275,6 +287,9 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device,
 	const struct firmware *firmware;
 	enum ucode_state ret;
 
+	if (is_blacklisted(cpu))
+		return UCODE_NFOUND;
+
 	sprintf(name, "intel-ucode/%02x-%02x-%02x",
 		c->x86, c->x86_model, c->x86_mask);
 
@@ -299,6 +314,9 @@ static int get_ucode_user(void *to, const void *from, size_t n)
 static enum ucode_state
 request_microcode_user(int cpu, const void __user *buf, size_t size)
 {
+	if (is_blacklisted(cpu))
+		return UCODE_NFOUND;
+
 	return generic_load_microcode(cpu, (void *)buf, size, &get_ucode_user);
 }
 
arch/x86/kvm/vmx.c +1 -6
index 50a1d48b1419..f9a6d8d68720 100644
@@ -8670,7 +8670,7 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,
 	 * (KVM doesn't change it)- no reason to call set_cr4_guest_host_mask();
 	 */
 	vcpu->arch.cr4_guest_owned_bits = ~vmcs_readl(CR4_GUEST_HOST_MASK);
-	kvm_set_cr4(vcpu, vmcs12->host_cr4);
+	vmx_set_cr4(vcpu, vmcs12->host_cr4);
 
 	nested_ept_uninit_mmu_context(vcpu);
 
@@ -9029,12 +9029,7 @@ static int __init vmx_init(void)
 	memset(vmx_vmread_bitmap, 0xff, PAGE_SIZE);
 	memset(vmx_vmwrite_bitmap, 0xff, PAGE_SIZE);
 
-	/*
-	 * Allow direct access to the PC debug port (it is often used for I/O
-	 * delays, but the vmexits simply slow things down).
-	 */
 	memset(vmx_io_bitmap_a, 0xff, PAGE_SIZE);
-	clear_bit(0x80, vmx_io_bitmap_a);
 
 	memset(vmx_io_bitmap_b, 0xff, PAGE_SIZE);
 
arch/x86/kvm/x86.c +4 -4
index 77edfa6d0b54..2d7ccb5a2bdd 100644
@@ -4052,7 +4052,7 @@ static int vcpu_mmio_read(struct kvm_vcpu *vcpu, gpa_t addr, int len, void *v)
 		      !kvm_iodevice_read(&vcpu->arch.apic->dev, addr, n, v))
 		    && kvm_io_bus_read(vcpu->kvm, KVM_MMIO_BUS, addr, n, v))
 			break;
-		trace_kvm_mmio(KVM_TRACE_MMIO_READ, n, addr, *(u64 *)v);
+		trace_kvm_mmio(KVM_TRACE_MMIO_READ, n, addr, v);
 		handled += n;
 		addr += n;
 		len -= n;
@@ -4276,7 +4276,7 @@ static int read_prepare(struct kvm_vcpu *vcpu, void *val, int bytes)
 {
 	if (vcpu->mmio_read_completed) {
 		trace_kvm_mmio(KVM_TRACE_MMIO_READ, bytes,
-			       vcpu->mmio_fragments[0].gpa, *(u64 *)val);
+			       vcpu->mmio_fragments[0].gpa, val);
 		vcpu->mmio_read_completed = 0;
 		return 1;
 	}
@@ -4298,14 +4298,14 @@ static int write_emulate(struct kvm_vcpu *vcpu, gpa_t gpa,
 
 static int write_mmio(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes, void *val)
 {
-	trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, bytes, gpa, *(u64 *)val);
+	trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, bytes, gpa, val);
 	return vcpu_mmio_write(vcpu, gpa, bytes, val);
 }
 
 static int read_exit_mmio(struct kvm_vcpu *vcpu, gpa_t gpa,
 			  void *val, int bytes)
 {
-	trace_kvm_mmio(KVM_TRACE_MMIO_READ_UNSATISFIED, bytes, gpa, 0);
+	trace_kvm_mmio(KVM_TRACE_MMIO_READ_UNSATISFIED, bytes, gpa, NULL);
 	return X86EMUL_IO_NEEDED;
 }
 
arch/x86/oprofile/op_model_ppro.c +2 -2
index d90528ea5412..12c051d19e4b 100644
@@ -212,8 +212,8 @@ static void arch_perfmon_setup_counters(void)
 	eax.full = cpuid_eax(0xa);
 
 	/* Workaround for BIOS bugs in 6/15. Taken from perfmon2 */
-	if (eax.split.version_id == 0 && __this_cpu_read(cpu_info.x86) == 6 &&
-		__this_cpu_read(cpu_info.x86_model) == 15) {
+	if (eax.split.version_id == 0 && boot_cpu_data.x86 == 6 &&
+	    boot_cpu_data.x86_model == 15) {
 		eax.split.version_id = 2;
 		eax.split.num_counters = 2;
 		eax.split.bit_width = 40;
block/bio.c +9 -5
index dcc6365bcc11..4218dab2bb47 100644
@@ -1286,6 +1286,7 @@ static struct bio *__bio_map_user_iov(struct request_queue *q,
 	struct bio *bio;
 	int cur_page = 0;
 	int ret, offset;
+	struct bio_vec *bvec;
 
 	for (i = 0; i < iov_count; i++) {
 		unsigned long uaddr = (unsigned long)iov[i].iov_base;
@@ -1329,7 +1330,12 @@ static struct bio *__bio_map_user_iov(struct request_queue *q,
 
 		ret = get_user_pages_fast(uaddr, local_nr_pages,
 				write_to_vm, &pages[cur_page]);
-		if (ret < local_nr_pages) {
+		if (unlikely(ret < local_nr_pages)) {
+			for (j = cur_page; j < page_limit; j++) {
+				if (!pages[j])
+					break;
+				put_page(pages[j]);
+			}
 			ret = -EFAULT;
 			goto out_unmap;
 		}
@@ -1384,10 +1390,8 @@ static struct bio *__bio_map_user_iov(struct request_queue *q,
 	return bio;
 
  out_unmap:
-	for (i = 0; i < nr_pages; i++) {
-		if(!pages[i])
-			break;
-		page_cache_release(pages[i]);
+	bio_for_each_segment_all(bvec, bio, j) {
+		put_page(bvec->bv_page);
 	}
  out:
 	kfree(pages);
crypto/hmac.c +5 -1
index ade790b454e9..758688b4bc6b 100644
@@ -197,11 +197,15 @@ static int hmac_create(struct crypto_template *tmpl, struct rtattr **tb)
 	salg = shash_attr_alg(tb[1], 0, 0);
 	if (IS_ERR(salg))
 		return PTR_ERR(salg);
+	alg = &salg->base;
 
+	/* The underlying hash algorithm must be unkeyed */
 	err = -EINVAL;
+	if (crypto_shash_alg_has_setkey(salg))
+		goto out_put_alg;
+
 	ds = salg->digestsize;
 	ss = salg->statesize;
-	alg = &salg->base;
 	if (ds > alg->cra_blocksize ||
 	    ss < alg->cra_blocksize)
 		goto out_put_alg;
crypto/salsa20_generic.c +0 -7
index f550b5d94630..d7da0eea5622 100644
@@ -188,13 +188,6 @@ static int encrypt(struct blkcipher_desc *desc,
 
 	salsa20_ivsetup(ctx, walk.iv);
 
-	if (likely(walk.nbytes == nbytes))
-	{
-		salsa20_encrypt_bytes(ctx, walk.dst.virt.addr,
-				      walk.src.virt.addr, nbytes);
-		return blkcipher_walk_done(desc, &walk, 0);
-	}
-
 	while (walk.nbytes >= 64) {
 		salsa20_encrypt_bytes(ctx, walk.dst.virt.addr,
 				      walk.src.virt.addr,
crypto/shash.c +8 -5
index 03fbcd4a82c4..73c065321867 100644
@@ -24,11 +24,12 @@
 
 static const struct crypto_type crypto_shash_type;
 
-static int shash_no_setkey(struct crypto_shash *tfm, const u8 *key,
-			   unsigned int keylen)
+int shash_no_setkey(struct crypto_shash *tfm, const u8 *key,
+		    unsigned int keylen)
 {
 	return -ENOSYS;
 }
+EXPORT_SYMBOL_GPL(shash_no_setkey);
 
 static int shash_setkey_unaligned(struct crypto_shash *tfm, const u8 *key,
 				  unsigned int keylen)
@@ -274,12 +275,14 @@ static int shash_async_finup(struct ahash_request *req)
 
 int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc)
 {
-	struct scatterlist *sg = req->src;
-	unsigned int offset = sg->offset;
 	unsigned int nbytes = req->nbytes;
+	struct scatterlist *sg;
+	unsigned int offset;
 	int err;
 
-	if (nbytes < min(sg->length, ((unsigned int)(PAGE_SIZE)) - offset)) {
+	if (nbytes &&
+	    (sg = req->src, offset = sg->offset,
+	     nbytes < min(sg->length, ((unsigned int)(PAGE_SIZE)) - offset))) {
 		void *data;
 
 		data = kmap_atomic(sg_page(sg));
drivers/block/rbd.c +2 -2
index 6eea35b05f6a..d1c04f0f79b6 100644
@@ -2584,7 +2584,7 @@ static int rbd_img_obj_parent_read_full(struct rbd_obj_request *obj_request)
 	 * from the parent.
 	 */
 	page_count = (u32)calc_pages_for(0, length);
-	pages = ceph_alloc_page_vector(page_count, GFP_KERNEL);
+	pages = ceph_alloc_page_vector(page_count, GFP_NOIO);
 	if (IS_ERR(pages)) {
 		result = PTR_ERR(pages);
 		pages = NULL;
@@ -2711,7 +2711,7 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
 	 */
 	size = sizeof (__le64) + sizeof (__le32) + sizeof (__le32);
 	page_count = (u32)calc_pages_for(0, size);
-	pages = ceph_alloc_page_vector(page_count, GFP_KERNEL);
+	pages = ceph_alloc_page_vector(page_count, GFP_NOIO);
 	if (IS_ERR(pages))
 		return PTR_ERR(pages);
 
drivers/bus/mvebu-mbus.c +1 -1
index d29f5ffdb0f4..d729c1cc7542 100644
@@ -523,7 +523,7 @@ mvebu_mbus_default_setup_cpu_target(struct mvebu_mbus_state *mbus)
 			if (mbus->hw_io_coherency)
 				w->mbus_attr |= ATTR_HW_COHERENCY;
 			w->base = base & DDR_BASE_CS_LOW_MASK;
-			w->size = (size | ~DDR_SIZE_MASK) + 1;
+			w->size = (u64)(size | ~DDR_SIZE_MASK) + 1;
 		}
 	}
 	mvebu_mbus_dram_info.num_cs = cs;
drivers/crypto/talitos.c +4 -3
index c6bd28c59d65..0d3f3af79bde 100644
@@ -1581,9 +1581,9 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc,
 		req_ctx->swinit = 0;
 	} else {
 		desc->ptr[1] = zero_entry;
-		/* Indicate next op is not the first. */
-		req_ctx->first = 0;
 	}
+	/* Indicate next op is not the first. */
+	req_ctx->first = 0;
 
 	/* HMAC key */
 	if (ctx->keylen)
@@ -2550,7 +2550,8 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev,
 		t_alg->algt.alg.hash.final = ahash_final;
 		t_alg->algt.alg.hash.finup = ahash_finup;
 		t_alg->algt.alg.hash.digest = ahash_digest;
-		t_alg->algt.alg.hash.setkey = ahash_setkey;
+		if (!strncmp(alg->cra_name, "hmac", 4))
+			t_alg->algt.alg.hash.setkey = ahash_setkey;
 
 		if (!(priv->features & TALITOS_FTR_HMAC_OK) &&
 		    !strncmp(alg->cra_name, "hmac", 4)) {
drivers/gpio/gpiolib-acpi.c +1 -1
index 86608585ec00..5b38f5aede59 100644
@@ -130,7 +130,7 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
 
 	if (pin <= 255) {
 		char ev_name[5];
-		sprintf(ev_name, "_%c%02X",
+		sprintf(ev_name, "_%c%02hhX",
 			agpio->triggering == ACPI_EDGE_SENSITIVE ? 'E' : 'L',
 			pin);
 		if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))
drivers/gpu/drm/i915/intel_bios.c +7 -0
index 07d72573fc60..e03526a10340 100644
@@ -939,6 +939,13 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
 	is_hdmi = is_dvi && (child->common.device_type & DEVICE_TYPE_NOT_HDMI_OUTPUT) == 0;
 	is_edp = is_dp && (child->common.device_type & DEVICE_TYPE_INTERNAL_CONNECTOR);
 
+	if (port == PORT_A && is_dvi) {
+		DRM_DEBUG_KMS("VBT claims port A supports DVI%s, ignoring\n",
+			      is_hdmi ? "/HDMI" : "");
+		is_dvi = false;
+		is_hdmi = false;
+	}
+
 	info->supports_dvi = is_dvi;
 	info->supports_hdmi = is_hdmi;
 	info->supports_dp = is_dp;
drivers/hid/i2c-hid/i2c-hid.c +2 -1
index 23eebb7f31aa..149d1da033c0 100644
@@ -526,7 +526,8 @@ static int i2c_hid_alloc_buffers(struct i2c_hid *ihid, size_t report_size)
 {
 	/* the worst case is computed from the set_report command with a
 	 * reportID > 15 and the maximum report length */
-	int args_len = sizeof(__u8) + /* optional ReportID byte */
+	int args_len = sizeof(__u8) + /* ReportID */
+		       sizeof(__u8) + /* optional ReportID byte */
 		       sizeof(__u16) + /* data register */
 		       sizeof(__u16) + /* size of the report */
 		       report_size; /* report */
drivers/iio/adc/ad7793.c +2 -2
index 5da07546e182..05ab5ad07df1 100644
@@ -257,7 +257,7 @@ static int ad7793_setup(struct iio_dev *indio_dev,
 	unsigned int vref_mv)
 {
 	struct ad7793_state *st = iio_priv(indio_dev);
-	int i, ret = -1;
+	int i, ret;
 	unsigned long long scale_uv;
 	u32 id;
 
@@ -266,7 +266,7 @@ static int ad7793_setup(struct iio_dev *indio_dev,
 		return ret;
 
 	/* reset the serial interface */
-	ret = spi_write(st->sd.spi, (u8 *)&ret, sizeof(ret));
+	ret = ad_sd_reset(&st->sd, 32);
 	if (ret < 0)
 		goto out;
 	usleep_range(500, 2000); /* Wait for at least 500us */
drivers/iio/adc/ad_sigma_delta.c +28 -0
index eb799a43aef0..dbcea7941059 100644
@@ -177,6 +177,34 @@ int ad_sd_read_reg(struct ad_sigma_delta *sigma_delta,
 }
 EXPORT_SYMBOL_GPL(ad_sd_read_reg);
 
+/**
+ * ad_sd_reset() - Reset the serial interface
+ *
+ * @sigma_delta: The sigma delta device
+ * @reset_length: Number of SCLKs with DIN = 1
+ *
+ * Returns 0 on success, an error code otherwise.
+ **/
+int ad_sd_reset(struct ad_sigma_delta *sigma_delta,
+	unsigned int reset_length)
+{
+	uint8_t *buf;
+	unsigned int size;
+	int ret;
+
+	size = DIV_ROUND_UP(reset_length, 8);
+	buf = kcalloc(size, sizeof(*buf), GFP_KERNEL);
+	if (!buf)
+		return -ENOMEM;
+
+	memset(buf, 0xff, size);
+	ret = spi_write(sigma_delta->spi, buf, size);
+	kfree(buf);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(ad_sd_reset);
+
 static int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta,
 	unsigned int mode, unsigned int channel)
 {
drivers/iio/adc/mcp320x.c +1 -0
index 28a086e48776..662c930fb1c3 100644
@@ -180,6 +180,7 @@ static int mcp320x_probe(struct spi_device *spi)
 	indio_dev->name = spi_get_device_id(spi)->name;
 	indio_dev->modes = INDIO_DIRECT_MODE;
 	indio_dev->info = &mcp320x_info;
+	spi_set_drvdata(spi, indio_dev);
 
 	chip_info = &mcp3208_chip_infos[spi_get_device_id(spi)->driver_data];
 	indio_dev->channels = chip_info->channels;
drivers/iio/industrialio-core.c +3 -1
index c6b0f1503366..4d1b400ed260 100644
@@ -184,8 +184,10 @@ static ssize_t iio_debugfs_read_reg(struct file *file, char __user *userbuf,
 	ret = indio_dev->info->debugfs_reg_access(indio_dev,
 						  indio_dev->cached_reg_addr,
 						  0, &val);
-	if (ret)
+	if (ret) {
 		dev_err(indio_dev->dev.parent, "%s: read failed\n", __func__);
+		return ret;
+	}
 
 	len = snprintf(buf, sizeof(buf), "0x%X\n", val);
 
drivers/infiniband/hw/mlx5/mem.c +18 -31

64 lines not on this page · raw message

drivers/infiniband/hw/ocrdma/ocrdma_hw.c +3 -0
index 3bbf2010a821..e682c79c41c1 100644
@@ -235,7 +235,10 @@ static int ocrdma_get_mbx_errno(u32 status)
 		case OCRDMA_MBX_ADDI_STATUS_INSUFFICIENT_RESOURCES:
 			err_num = -EAGAIN;
 			break;
+		default:
+			err_num = -EFAULT;
 		}
+		break;
 	default:
 		err_num = -EFAULT;
 	}
drivers/infiniband/ulp/ipoib/ipoib_ib.c +0 -13
index 27fe62e2fd95..fcbfdda0e585 100644
@@ -961,19 +961,6 @@ static inline int update_parent_pkey(struct ipoib_dev_priv *priv)
 		 */
 		priv->dev->broadcast[8] = priv->pkey >> 8;
 		priv->dev->broadcast[9] = priv->pkey & 0xff;
-
-		/*
-		 * Update the broadcast address in the priv->broadcast object,
-		 * in case it already exists, otherwise no one will do that.
-		 */
-		if (priv->broadcast) {
-			spin_lock_irq(&priv->lock);
-			memcpy(priv->broadcast->mcmember.mgid.raw,
-			       priv->dev->broadcast + 4,
-			sizeof(union ib_gid));
-			spin_unlock_irq(&priv->lock);
-		}
-
 		return 0;
 	}
 
drivers/input/ff-core.c +10 -3
index f50f6dd92274..b0e2de131b76 100644
@@ -239,9 +239,15 @@ int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file)
 EXPORT_SYMBOL_GPL(input_ff_erase);
 
 /*
- * flush_effects - erase all effects owned by a file handle
+ * input_ff_flush - erase all effects owned by a file handle
+ * @dev: input device to erase effect from
+ * @file: purported owner of the effects
+ *
+ * This function erases all force-feedback effects associated with
+ * the given owner from specified device. Note that @file may be %NULL,
+ * in which case all effects will be erased.
  */
-static int flush_effects(struct input_dev *dev, struct file *file)
+int input_ff_flush(struct input_dev *dev, struct file *file)
 {
 	struct ff_device *ff = dev->ff;
 	int i;
@@ -257,6 +263,7 @@ static int flush_effects(struct input_dev *dev, struct file *file)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(input_ff_flush);
 
 /**
  * input_ff_event() - generic handler for force-feedback events
@@ -340,7 +347,7 @@ int input_ff_create(struct input_dev *dev, unsigned int max_effects)
 	mutex_init(&ff->mutex);
 
 	dev->ff = ff;
-	dev->flush = flush_effects;
+	dev->flush = input_ff_flush;
 	dev->event = input_ff_event;
 	__set_bit(EV_FF, dev->evbit);
 
drivers/input/misc/ims-pcu.c +14 -2
index f19375acfeec..ea8c48a9e09d 100644
@@ -1635,13 +1635,25 @@ ims_pcu_get_cdc_union_desc(struct usb_interface *intf)
 		return NULL;
 	}
 
-	while (buflen > 0) {
+	while (buflen >= sizeof(*union_desc)) {
 		union_desc = (struct usb_cdc_union_desc *)buf;
 
+		if (union_desc->bLength > buflen) {
+			dev_err(&intf->dev, "Too large descriptor\n");
+			return NULL;
+		}
+
 		if (union_desc->bDescriptorType == USB_DT_CS_INTERFACE &&
 		    union_desc->bDescriptorSubType == USB_CDC_UNION_TYPE) {
 			dev_dbg(&intf->dev, "Found union header\n");
-			return union_desc;
+
+			if (union_desc->bLength >= sizeof(*union_desc))
+				return union_desc;
+
+			dev_err(&intf->dev,
+				"Union descriptor to short (%d vs %zd\n)",
+				union_desc->bLength, sizeof(*union_desc));
+			return NULL;
 		}
 
 		buflen -= union_desc->bLength;
drivers/input/misc/uinput.c +39 -18

106 lines not on this page · raw message

drivers/input/touchscreen/ti_am335x_tsc.c +1 -1
index 2ce649520fe0..092fa8b31c67 100644
@@ -157,7 +157,7 @@ static void titsc_step_config(struct titsc *ts_dev)
 		break;
 	case 5:
 		config |= ts_dev->bit_xp | STEPCONFIG_INP_AN4 |
-				ts_dev->bit_xn | ts_dev->bit_yp;
+				STEPCONFIG_XNP | STEPCONFIG_YPN;
 		break;
 	case 8:
 		config |= ts_dev->bit_yp | STEPCONFIG_INP(ts_dev->inp_xp);
drivers/iommu/amd_iommu.c +1 -0
index 07af55cc2dcc..353417c95502 100644
@@ -3440,6 +3440,7 @@ static size_t amd_iommu_unmap(struct iommu_domain *dom, unsigned long iova,
 	mutex_unlock(&domain->api_lock);
 
 	domain_flush_tlb_pde(domain);
+	domain_flush_complete(domain);
 
 	return unmap_size;
 }
drivers/iommu/exynos-iommu.c +1 -1
index 99054d2c040d..e7434b1b1d62 100644
@@ -676,7 +676,7 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id sysmmu_of_match[] __initconst = {
+static const struct of_device_id sysmmu_of_match[] = {
 	{ .compatible	= "samsung,exynos-sysmmu", },
 	{ },
 };
drivers/net/can/c_can/c_can_pci.c +0 -1
index b997508ea7c6..913a1c5ad1b4 100644
@@ -178,7 +178,6 @@ static int c_can_pci_probe(struct pci_dev *pdev,
 		break;
 	case BOSCH_D_CAN:
 		priv->regs = reg_map_d_can;
-		priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
 		break;
 	default:
 		ret = -EINVAL;
drivers/net/can/c_can/c_can_platform.c +0 -1
index 12430be6448a..660404f5ebac 100644
@@ -266,7 +266,6 @@ static int c_can_plat_probe(struct platform_device *pdev)
 		break;
 	case BOSCH_D_CAN:
 		priv->regs = reg_map_d_can;
-		priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
 		priv->read_reg = c_can_plat_read_reg_aligned_to_16bit;
 		priv->write_reg = c_can_plat_write_reg_aligned_to_16bit;
 		priv->read_reg32 = d_can_plat_read_reg32;
drivers/net/can/usb/esd_usb2.c +1 -1
index 7a90075529c3..0cbf2d7eeb7c 100644
@@ -334,7 +334,7 @@ static void esd_usb2_rx_can_msg(struct esd_usb2_net_priv *priv,
 		}
 
 		cf->can_id = id & ESD_IDMASK;
-		cf->can_dlc = get_can_dlc(msg->msg.rx.dlc);
+		cf->can_dlc = get_can_dlc(msg->msg.rx.dlc & ~ESD_RTR);
 
 		if (id & ESD_EXTID)
 			cf->can_id |= CAN_EFF_FLAG;
drivers/net/can/usb/gs_usb.c +2 -8
index b16c5a2d92fb..a864951dfc43 100644
@@ -356,6 +356,8 @@ static void gs_usb_recieve_bulk_callback(struct urb *urb)
 
 		gs_free_tx_context(txc);
 
+		atomic_dec(&dev->active_tx_urbs);
+
 		netif_wake_queue(netdev);
 	}
 
@@ -444,14 +446,6 @@ static void gs_usb_xmit_callback(struct urb *urb)
 			  urb->transfer_buffer_length,
 			  urb->transfer_buffer,
 			  urb->transfer_dma);
-
-	atomic_dec(&dev->active_tx_urbs);
-
-	if (!netif_device_present(netdev))
-		return;
-
-	if (netif_queue_stopped(netdev))
-		netif_wake_queue(netdev);
 }
 
 static netdev_tx_t gs_can_start_xmit(struct sk_buff *skb, struct net_device *netdev)
drivers/net/can/usb/kvaser_usb.c +2 -1
index 4d47f224d705..0c2c23c7dfe0 100644
@@ -1263,7 +1263,8 @@ static int kvaser_usb_close(struct net_device *netdev)
 	if (err)
 		netdev_warn(netdev, "Cannot flush queue, error %d\n", err);
 
-	if (kvaser_usb_send_simple_msg(dev, CMD_RESET_CHIP, priv->channel))
+	err = kvaser_usb_send_simple_msg(dev, CMD_RESET_CHIP, priv->channel);
+	if (err)
 		netdev_warn(netdev, "Cannot reset card, error %d\n", err);
 
 	err = kvaser_usb_stop_chip(priv);
drivers/net/macvtap.c +4 -2
index b787d1ceeba6..47eba38ae526 100644
@@ -1051,10 +1051,12 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
 		return 0;
 
 	case TUNSETSNDBUF:
-		if (get_user(u, up))
+		if (get_user(s, sp))
 			return -EFAULT;
+		if (s <= 0)
+			return -EINVAL;
 
-		q->sk.sk_sndbuf = u;
+		q->sk.sk_sndbuf = s;
 		return 0;
 
 	case TUNGETVNETHDRSZ:
drivers/net/tun.c +7 -0
index 1c843a4ac7a4..a87b76341502 100644
@@ -1647,6 +1647,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
 
 		if (!dev)
 			return -ENOMEM;
+		err = dev_get_valid_name(net, dev, name);
+		if (err)
+			goto err_free_dev;
 
 		dev_net_set(dev, net);
 		dev->rtnl_link_ops = &tun_link_ops;
@@ -2051,6 +2054,10 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
 			ret = -EFAULT;
 			break;
 		}
+		if (sndbuf <= 0) {
+			ret = -EINVAL;
+			break;
+		}
 
 		tun->sndbuf = sndbuf;
 		tun_set_sndbuf(tun);
drivers/net/wireless/brcm80211/brcmfmac/fweh.c +13 -45

94 lines not on this page · raw message

drivers/net/wireless/brcm80211/brcmfmac/fweh.h +55 -13

107 lines not on this page · raw message

drivers/net/wireless/brcm80211/brcmfmac/p2p.c +10 -0
index f3445ac627e4..b489476532df 100644
@@ -1363,6 +1363,11 @@ int brcmf_p2p_notify_action_frame_rx(struct brcmf_if *ifp,
 	u16 mgmt_type;
 	u8 action;
 
+	if (e->datalen < sizeof(*rxframe)) {
+		brcmf_dbg(SCAN, "Event data to small. Ignore\n");
+		return 0;
+	}
+
 	ch.chspec = be16_to_cpu(rxframe->chanspec);
 	cfg->d11inf.decchspec(&ch);
 	/* Check if wpa_supplicant has registered for this frame */
@@ -1861,6 +1866,11 @@ s32 brcmf_p2p_notify_rx_mgmt_p2p_probereq(struct brcmf_if *ifp,
 	brcmf_dbg(INFO, "Enter: event %d reason %d\n", e->event_code,
 		  e->reason);
 
+	if (e->datalen < sizeof(*rxframe)) {
+		brcmf_dbg(SCAN, "Event data to small. Ignore\n");
+		return 0;
+	}
+
 	ch.chspec = be16_to_cpu(rxframe->chanspec);
 	cfg->d11inf.decchspec(&ch);
 
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +5 -0
index 26c5f3bdf2c5..c3e0a9aecd42 100644
@@ -3036,6 +3036,11 @@ brcmf_notify_sched_scan_results(struct brcmf_if *ifp,
 
 	brcmf_dbg(SCAN, "Enter\n");
 
+	if (e->datalen < (sizeof(*pfn_result) + sizeof(*netinfo))) {
+		brcmf_dbg(SCAN, "Event data to small. Ignore\n");
+		return 0;
+	}
+
 	if (e->event_code == BRCMF_E_PFN_NET_LOST) {
 		brcmf_dbg(SCAN, "PFN NET LOST event. Do Nothing\n");
 		return 0;
drivers/net/wireless/iwlwifi/mvm/mac80211.c +9 -1
index e83644dfaa6c..15175dd0cf86 100644
@@ -1004,6 +1004,11 @@ static void iwl_mvm_mc_iface_iterator(void *_data, u8 *mac,
 	struct iwl_mvm_mc_iter_data *data = _data;
 	struct iwl_mvm *mvm = data->mvm;
 	struct iwl_mcast_filter_cmd *cmd = mvm->mcast_filter_cmd;
+	struct iwl_host_cmd hcmd = {
+		.id = MCAST_FILTER_CMD,
+		.flags = CMD_ASYNC,
+		.dataflags[0] = IWL_HCMD_DFL_NOCOPY,
+	};
 	int ret, len;
 
 	/* if we don't have free ports, mcast frames will be dropped */
@@ -1018,7 +1023,10 @@ static void iwl_mvm_mc_iface_iterator(void *_data, u8 *mac,
 	memcpy(cmd->bssid, vif->bss_conf.bssid, ETH_ALEN);
 	len = roundup(sizeof(*cmd) + cmd->count * ETH_ALEN, 4);
 
-	ret = iwl_mvm_send_cmd_pdu(mvm, MCAST_FILTER_CMD, CMD_ASYNC, len, cmd);
+	hcmd.len[0] = len;
+	hcmd.data[0] = cmd;
+
+	ret = iwl_mvm_send_cmd(mvm, &hcmd);
 	if (ret)
 		IWL_ERR(mvm, "mcast filter cmd error. ret=%d\n", ret);
 }
drivers/pci/pci-sysfs.c +9 -2
index 0ca2961a56a2..a8c9a4a361fb 100644
@@ -514,7 +514,7 @@ static ssize_t driver_override_store(struct device *dev,
 				     const char *buf, size_t count)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
-	char *driver_override, *old = pdev->driver_override, *cp;
+	char *driver_override, *old, *cp;
 
 	/* We need to keep extra room for a newline */
 	if (count >= (PAGE_SIZE - 1))
@@ -528,12 +528,15 @@ static ssize_t driver_override_store(struct device *dev,
 	if (cp)
 		*cp = '\0';
 
+	device_lock(dev);
+	old = pdev->driver_override;
 	if (strlen(driver_override)) {
 		pdev->driver_override = driver_override;
 	} else {
 		kfree(driver_override);
 		pdev->driver_override = NULL;
 	}
+	device_unlock(dev);
 
 	kfree(old);
 
@@ -544,8 +547,12 @@ static ssize_t driver_override_show(struct device *dev,
 				    struct device_attribute *attr, char *buf)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
+	ssize_t len;
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", pdev->driver_override);
+	device_lock(dev);
+	len = snprintf(buf, PAGE_SIZE, "%s\n", pdev->driver_override);
+	device_unlock(dev);
+	return len;
 }
 static DEVICE_ATTR_RW(driver_override);
 
drivers/s390/scsi/zfcp_aux.c +5 -0
index 8004b071a9f2..a7a0b3e4f5ea 100644
@@ -356,6 +356,8 @@ struct zfcp_adapter *zfcp_adapter_enqueue(struct ccw_device *ccw_device)
 	INIT_WORK(&adapter->scan_work, zfcp_fc_scan_ports);
 	INIT_WORK(&adapter->ns_up_work, zfcp_fc_sym_name_update);
 
+	adapter->erp_action.adapter = adapter;
+
 	if (zfcp_qdio_setup(adapter))
 		goto failed;
 
@@ -512,6 +514,9 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn,
 	port->dev.groups = zfcp_port_attr_groups;
 	port->dev.release = zfcp_port_release;
 
+	port->erp_action.adapter = adapter;
+	port->erp_action.port = port;
+
 	if (dev_set_name(&port->dev, "0x%016llx", (unsigned long long)wwpn)) {
 		kfree(port);
 		goto err_out;
drivers/s390/scsi/zfcp_erp.c +11 -7
index acb0b8c3989d..d9b2949de543 100644
@@ -193,9 +193,8 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
 		atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE,
 				&zfcp_sdev->status);
 		erp_action = &zfcp_sdev->erp_action;
-		memset(erp_action, 0, sizeof(struct zfcp_erp_action));
-		erp_action->port = port;
-		erp_action->sdev = sdev;
+		WARN_ON_ONCE(erp_action->port != port);
+		WARN_ON_ONCE(erp_action->sdev != sdev);
 		if (!(atomic_read(&zfcp_sdev->status) &
 		      ZFCP_STATUS_COMMON_RUNNING))
 			act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY;
@@ -208,8 +207,8 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
 		zfcp_erp_action_dismiss_port(port);
 		atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &port->status);
 		erp_action = &port->erp_action;
-		memset(erp_action, 0, sizeof(struct zfcp_erp_action));
-		erp_action->port = port;
+		WARN_ON_ONCE(erp_action->port != port);
+		WARN_ON_ONCE(erp_action->sdev != NULL);
 		if (!(atomic_read(&port->status) & ZFCP_STATUS_COMMON_RUNNING))
 			act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY;
 		break;
@@ -219,7 +218,8 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
 		zfcp_erp_action_dismiss_adapter(adapter);
 		atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status);
 		erp_action = &adapter->erp_action;
-		memset(erp_action, 0, sizeof(struct zfcp_erp_action));
+		WARN_ON_ONCE(erp_action->port != NULL);
+		WARN_ON_ONCE(erp_action->sdev != NULL);
 		if (!(atomic_read(&adapter->status) &
 		      ZFCP_STATUS_COMMON_RUNNING))
 			act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY;
@@ -229,7 +229,11 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
 		return NULL;
 	}
 
-	erp_action->adapter = adapter;
+	WARN_ON_ONCE(erp_action->adapter != adapter);
+	memset(&erp_action->list, 0, sizeof(erp_action->list));
+	memset(&erp_action->timer, 0, sizeof(erp_action->timer));
+	erp_action->step = ZFCP_ERP_STEP_UNINITIALIZED;
+	erp_action->fsf_req_id = 0;
 	erp_action->action = need;
 	erp_action->status = act_status;
 
drivers/s390/scsi/zfcp_scsi.c +5 -0
index b495c085a0b5..0c03ae19b689 100644
@@ -136,10 +136,15 @@ static int zfcp_scsi_slave_alloc(struct scsi_device *sdev)
 	struct zfcp_unit *unit;
 	int npiv = adapter->connection_features & FSF_FEATURE_NPIV_MODE;
 
+	zfcp_sdev->erp_action.adapter = adapter;
+	zfcp_sdev->erp_action.sdev = sdev;
+
 	port = zfcp_get_port_by_wwpn(adapter, rport->port_name);
 	if (!port)
 		return -ENXIO;
 
+	zfcp_sdev->erp_action.port = port;
+
 	unit = zfcp_unit_find(port, zfcp_scsi_dev_lun(sdev));
 	if (unit)
 		put_device(&unit->dev);
drivers/scsi/libiscsi.c +1 -1
index 877fd93766ce..fc6801fe134e 100644
@@ -1727,7 +1727,7 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc)
 
 	if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx)) {
 		reason = FAILURE_SESSION_IN_RECOVERY;
-		sc->result = DID_REQUEUE;
+		sc->result = DID_REQUEUE << 16;
 		goto fault;
 	}
 
drivers/scsi/lpfc/lpfc_init.c +1 -0
index 0813a2dcd3d1..83ff6cba873e 100644
@@ -5242,6 +5242,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
 			lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
 				"2999 Unsupported SLI4 Parameters "
 				"Extents and RPI headers enabled.\n");
+			rc = -EIO;
 			goto out_free_bsmbx;
 		}
 	}
drivers/scsi/scsi_scan.c +3 -0
index c31e1cb009af..cf13b561af83 100644
@@ -962,6 +962,9 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
 	if (*bflags & BLIST_NO_DIF)
 		sdev->no_dif = 1;
 
+	if (*bflags & BLIST_UNMAP_LIMIT_WS)
+		sdev->unmap_limit_for_ws = 1;
+
 	sdev->eh_timeout = SCSI_DEFAULT_EH_TIMEOUT;
 
 	if (*bflags & BLIST_TRY_VPD_PAGES)
drivers/scsi/sd.c +12 -4
index 3dcb3c080c1e..c50cfd16a976 100644
@@ -651,13 +651,21 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode)
 		break;
 
 	case SD_LBP_WS16:
-		max_blocks = min_not_zero(sdkp->max_ws_blocks,
-					  (u32)SD_MAX_WS16_BLOCKS);
+		if (sdkp->device->unmap_limit_for_ws)
+			max_blocks = sdkp->max_unmap_blocks;
+		else
+			max_blocks = sdkp->max_ws_blocks;
+
+		max_blocks = min_not_zero(max_blocks, (u32)SD_MAX_WS16_BLOCKS);
 		break;
 
 	case SD_LBP_WS10:
-		max_blocks = min_not_zero(sdkp->max_ws_blocks,
-					  (u32)SD_MAX_WS10_BLOCKS);
+		if (sdkp->device->unmap_limit_for_ws)
+			max_blocks = sdkp->max_unmap_blocks;
+		else
+			max_blocks = sdkp->max_ws_blocks;
+
+		max_blocks = min_not_zero(max_blocks, (u32)SD_MAX_WS10_BLOCKS);
 		break;
 
 	case SD_LBP_ZERO:
drivers/staging/iio/adc/ad7192.c +1 -3
index 26b2cdca29ad..c7aaf2bb1018 100644
@@ -206,11 +206,9 @@ static int ad7192_setup(struct ad7192_state *st,
 	struct iio_dev *indio_dev = spi_get_drvdata(st->sd.spi);
 	unsigned long long scale_uv;
 	int i, ret, id;
-	u8 ones[6];
 
 	/* reset the serial interface */
-	memset(&ones, 0xFF, 6);
-	ret = spi_write(st->sd.spi, &ones, 6);
+	ret = ad_sd_reset(&st->sd, 48);
 	if (ret < 0)
 		goto out;
 	msleep(1); /* Wait for at least 500us */
drivers/staging/iio/meter/ade7759.c +1 -1
index ea0c9debf8bf..14e3eca3ff35 100644
@@ -124,7 +124,7 @@ static int ade7759_spi_read_reg_40(struct device *dev,
 				reg_address);
 		goto error_ret;
 	}
-	*val = ((u64)st->rx[1] << 32) | (st->rx[2] << 24) |
+	*val = ((u64)st->rx[1] << 32) | ((u64)st->rx[2] << 24) |
 		(st->rx[3] << 16) | (st->rx[4] << 8) | st->rx[5];
 
 error_ret:
drivers/usb/class/cdc-acm.c +3 -0
index ef71827f92a3..58034df6351b 100644
@@ -1775,6 +1775,9 @@ static const struct usb_device_id acm_ids[] = {
 	{ USB_DEVICE(0xfff0, 0x0100), /* DATECS FP-2000 */
 	.driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
 	},
+	{ USB_DEVICE(0x09d8, 0x0320), /* Elatec GmbH TWN3 */
+	.driver_info = NO_UNION_NORMAL, /* has misplaced union descriptor */
+	},
 
 	{ USB_DEVICE(0x2912, 0x0001), /* ATOL FPrint */
 	.driver_info = CLEAR_HALT_CONDITIONS,
drivers/usb/core/config.c +4 -2
index 063d9767d6fe..13d31422d6b7 100644
@@ -519,6 +519,9 @@ static int usb_parse_configuration(struct usb_device *dev, int cfgidx,
 	unsigned iad_num = 0;
 
 	memcpy(&config->desc, buffer, USB_DT_CONFIG_SIZE);
+	nintf = nintf_orig = config->desc.bNumInterfaces;
+	config->desc.bNumInterfaces = 0;	// Adjusted later
+
 	if (config->desc.bDescriptorType != USB_DT_CONFIG ||
 	    config->desc.bLength < USB_DT_CONFIG_SIZE ||
 	    config->desc.bLength > size) {
@@ -532,7 +535,6 @@ static int usb_parse_configuration(struct usb_device *dev, int cfgidx,
 	buffer += config->desc.bLength;
 	size -= config->desc.bLength;
 
-	nintf = nintf_orig = config->desc.bNumInterfaces;
 	if (nintf > USB_MAXINTERFACES) {
 		dev_warn(ddev, "config %d has too many interfaces: %d, "
 		    "using maximum allowed: %d\n",
@@ -824,7 +826,7 @@ int usb_get_configuration(struct usb_device *dev)
 		}
 
 		if (dev->quirks & USB_QUIRK_DELAY_INIT)
-			msleep(100);
+			msleep(200);
 
 		result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno,
 		    bigbuffer, length);
drivers/usb/core/hub.c +8 -5
index 598e9adf8858..b4dd4821d1fd 100644
@@ -2625,13 +2625,16 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
 	if (!(portstatus & USB_PORT_STAT_CONNECTION))
 		return -ENOTCONN;
 
-	/* bomb out completely if the connection bounced.  A USB 3.0
-	 * connection may bounce if multiple warm resets were issued,
+	/* Retry if connect change is set but status is still connected.
+	 * A USB 3.0 connection may bounce if multiple warm resets were issued,
 	 * but the device may have successfully re-connected. Ignore it.
 	 */
 	if (!hub_is_superspeed(hub->hdev) &&
-			(portchange & USB_PORT_STAT_C_CONNECTION))
-		return -ENOTCONN;
+	    (portchange & USB_PORT_STAT_C_CONNECTION)) {
+		usb_clear_port_feature(hub->hdev, port1,
+				       USB_PORT_FEAT_C_CONNECTION);
+		return -EAGAIN;
+	}
 
 	if (!(portstatus & USB_PORT_STAT_ENABLE))
 		return -EBUSY;
@@ -4699,7 +4702,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
 			goto loop;
 
 		if (udev->quirks & USB_QUIRK_DELAY_INIT)
-			msleep(1000);
+			msleep(2000);
 
 		/* consecutive bus-powered hubs aren't reliable; they can
 		 * violate the voltage drop budget.  if the new child has
drivers/usb/core/quirks.c +4 -0
index c9b564e362c8..25d0eed708a3 100644
@@ -218,6 +218,10 @@ static const struct usb_device_id usb_quirk_list[] = {
 	/* Corsair Strafe RGB */
 	{ USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT },
 
+	/* MIDI keyboard WORLDE MINI */
+	{ USB_DEVICE(0x1c75, 0x0204), .driver_info =
+			USB_QUIRK_CONFIG_INTF_STRINGS },
+
 	/* Acer C120 LED Projector */
 	{ USB_DEVICE(0x1de1, 0xc102), .driver_info = USB_QUIRK_NO_LPM },
 
drivers/usb/gadget/composite.c +5 -0
index b8a961ba1d2b..38042f6d9c04 100644
@@ -1815,6 +1815,8 @@ static DEVICE_ATTR_RO(suspended);
 static void __composite_unbind(struct usb_gadget *gadget, bool unbind_driver)
 {
 	struct usb_composite_dev	*cdev = get_gadget_data(gadget);
+	struct usb_gadget_strings	*gstr = cdev->driver->strings[0];
+	struct usb_string		*dev_str = gstr->strings;
 
 	/* composite_disconnect() must already have been called
 	 * by the underlying peripheral controller driver!
@@ -1834,6 +1836,9 @@ static void __composite_unbind(struct usb_gadget *gadget, bool unbind_driver)
 
 	composite_dev_cleanup(cdev);
 
+	if (dev_str[USB_GADGET_MANUFACTURER_IDX].s == cdev->def_manufacturer)
+		dev_str[USB_GADGET_MANUFACTURER_IDX].s = "";
+
 	kfree(cdev->def_manufacturer);
 	kfree(cdev);
 	set_gadget_data(gadget, NULL);
drivers/usb/gadget/dummy_hcd.c +61 -20

204 lines not on this page · raw message

drivers/usb/gadget/f_mass_storage.c +10 -21
index 2234c3a5ed8e..f0db2ca816c0 100644
@@ -307,8 +307,6 @@ struct fsg_common {
 	struct completion	thread_notifier;
 	struct task_struct	*thread_task;
 
-	/* Callback functions. */
-	const struct fsg_operations	*ops;
 	/* Gadget's private data. */
 	void			*private_data;
 
@@ -2498,6 +2496,8 @@ static void handle_exception(struct fsg_common *common)
 static int fsg_main_thread(void *common_)
 {
 	struct fsg_common	*common = common_;
+	struct fsg_lun		**curlun_it;
+	unsigned		i;
 
 	/*
 	 * Allow the thread to be killed by a signal, but set the signal mask
@@ -2559,22 +2559,18 @@ static int fsg_main_thread(void *common_)
 	common->thread_task = NULL;
 	spin_unlock_irq(&common->lock);
 
-	if (!common->ops || !common->ops->thread_exits
-	 || common->ops->thread_exits(common) < 0) {
-		struct fsg_lun **curlun_it = common->luns;
-		unsigned i = common->nluns;
+	/* Eject media from all LUNs */
+	curlun_it = common->luns;
+	i = common->nluns;
 
-		down_write(&common->filesem);
-		for (; i--; ++curlun_it) {
-			struct fsg_lun *curlun = *curlun_it;
-			if (!curlun || !fsg_lun_is_open(curlun))
-				continue;
+	down_write(&common->filesem);
+	for (; i--; ++curlun_it) {
+		struct fsg_lun *curlun = *curlun_it;
 
+		if (curlun && fsg_lun_is_open(curlun))
 			fsg_lun_close(curlun);
-			curlun->unit_attention_data = SS_MEDIUM_NOT_PRESENT;
-		}
-		up_write(&common->filesem);
 	}
+	up_write(&common->filesem);
 
 	/* Let fsg_unbind() know the thread has exited */
 	complete_and_exit(&common->thread_notifier, 0);
@@ -2842,13 +2838,6 @@ int fsg_common_set_nluns(struct fsg_common *common, int nluns)
 }
 EXPORT_SYMBOL_GPL(fsg_common_set_nluns);
 
-void fsg_common_set_ops(struct fsg_common *common,
-			const struct fsg_operations *ops)
-{
-	common->ops = ops;
-}
-EXPORT_SYMBOL_GPL(fsg_common_set_ops);
-
 void fsg_common_free_buffers(struct fsg_common *common)
 {
 	_fsg_common_free_buffers(common->buffhds, common->fsg_num_buffers);
drivers/usb/gadget/f_mass_storage.h +0 -14
index b4866fcef30b..bf0fe5cda863 100644
@@ -60,17 +60,6 @@ struct fsg_module_parameters {
 struct fsg_common;
 
 /* FSF callback functions */
-struct fsg_operations {
-	/*
-	 * Callback function to call when thread exits.  If no
-	 * callback is set or it returns value lower then zero MSF
-	 * will force eject all LUNs it operates on (including those
-	 * marked as non-removable or with prevent_medium_removal flag
-	 * set).
-	 */
-	int (*thread_exits)(struct fsg_common *common);
-};
-
 struct fsg_lun_opts {
 	struct config_group group;
 	struct fsg_lun *lun;
@@ -145,9 +134,6 @@ void fsg_common_free_luns(struct fsg_common *common);
 
 int fsg_common_set_nluns(struct fsg_common *common, int nluns);
 
-void fsg_common_set_ops(struct fsg_common *common,
-			const struct fsg_operations *ops);
-
 int fsg_common_create_lun(struct fsg_common *common, struct fsg_lun_config *cfg,
 			  unsigned int id, const char *name,
 			  const char **name_pfx);
drivers/usb/gadget/inode.c +45 -10

175 lines not on this page · raw message

drivers/usb/gadget/mass_storage.c +2 -18
index 8e27a8c96444..c7ca12a109e1 100644
@@ -121,15 +121,6 @@ static unsigned int fsg_num_buffers = CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS;
 
 FSG_MODULE_PARAMETERS(/* no prefix */, mod_data);
 
-static unsigned long msg_registered;
-static void msg_cleanup(void);
-
-static int msg_thread_exits(struct fsg_common *common)
-{
-	msg_cleanup();
-	return 0;
-}
-
 static int __init msg_do_config(struct usb_configuration *c)
 {
 	struct fsg_opts *opts;
@@ -172,9 +163,6 @@ static struct usb_configuration msg_config_driver = {
 
 static int __init msg_bind(struct usb_composite_dev *cdev)
 {
-	static const struct fsg_operations ops = {
-		.thread_exits = msg_thread_exits,
-	};
 	struct fsg_opts *opts;
 	struct fsg_config config;
 	int status;
@@ -195,8 +183,6 @@ static int __init msg_bind(struct usb_composite_dev *cdev)
 	if (status)
 		goto fail_set_nluns;
 
-	fsg_common_set_ops(opts->common, &ops);
-
 	status = fsg_common_set_cdev(opts->common, cdev, config.can_stall);
 	if (status)
 		goto fail_set_cdev;
@@ -221,7 +207,6 @@ static int __init msg_bind(struct usb_composite_dev *cdev)
 	usb_composite_overwrite_options(cdev, &coverwrite);
 	dev_info(&cdev->gadget->dev,
 		 DRIVER_DESC ", version: " DRIVER_VERSION "\n");
-	set_bit(0, &msg_registered);
 	return 0;
 
 fail_string_ids:
@@ -268,9 +253,8 @@ static int __init msg_init(void)
 }
 module_init(msg_init);
 
-static void msg_cleanup(void)
+static void __exit msg_cleanup(void)
 {
-	if (test_and_clear_bit(0, &msg_registered))
-		usb_composite_unregister(&msg_driver);
+	usb_composite_unregister(&msg_driver);
 }
 module_exit(msg_cleanup);
drivers/usb/gadget/net2280.c +1 -4
index 300b3a71383b..b464ed5e129e 100644
@@ -1941,11 +1941,8 @@ stop_activity (struct net2280 *dev, struct usb_gadget_driver *driver)
 		nuke (&dev->ep [i]);
 
 	/* report disconnect; the driver is already quiesced */
-	if (driver) {
-		spin_unlock(&dev->lock);
+	if (driver)
 		driver->disconnect(&dev->gadget);
-		spin_lock(&dev->lock);
-	}
 
 	usb_reinit (dev);
 }
drivers/usb/host/pci-quirks.c +4 -4
index 677b3714557e..67733f044c22 100644
@@ -1024,7 +1024,7 @@ EXPORT_SYMBOL_GPL(usb_disable_xhci_ports);
  *
  * Takes care of the handoff between the Pre-OS (i.e. BIOS) and the OS.
  * It signals to the BIOS that the OS wants control of the host controller,
- * and then waits 5 seconds for the BIOS to hand over control.
+ * and then waits 1 second for the BIOS to hand over control.
  * If we timeout, assume the BIOS is broken and take control anyway.
  */
 static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
@@ -1070,9 +1070,9 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
 	if (val & XHCI_HC_BIOS_OWNED) {
 		writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset);
 
-		/* Wait for 5 seconds with 10 microsecond polling interval */
+		/* Wait for 1 second with 10 microsecond polling interval */
 		timeout = handshake(base + ext_cap_offset, XHCI_HC_BIOS_OWNED,
-				0, 5000, 10);
+				0, 1000000, 10);
 
 		/* Assume a buggy BIOS and take HC ownership anyway */
 		if (timeout) {
@@ -1100,7 +1100,7 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
 	 * operational or runtime registers.  Wait 5 seconds and no more.
 	 */
 	timeout = handshake(op_reg_base + XHCI_STS_OFFSET, XHCI_STS_CNR, 0,
-			5000, 10);
+			5000000, 10);
 	/* Assume a buggy HC and start HC initialization anyway */
 	if (timeout) {
 		val = readl(op_reg_base + XHCI_STS_OFFSET);
drivers/usb/host/xhci-hub.c +17 -5
index 76628f9e39ba..f16bf70b54ba 100644
@@ -293,15 +293,25 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend)
 						     GFP_NOWAIT);
 			if (!command) {
 				spin_unlock_irqrestore(&xhci->lock, flags);
-				xhci_free_command(xhci, cmd);
-				return -ENOMEM;
+				ret = -ENOMEM;
+				goto cmd_cleanup;
+			}
 
+			ret = xhci_queue_stop_endpoint(xhci, command, slot_id,
+						       i, suspend);
+			if (ret) {
+				spin_unlock_irqrestore(&xhci->lock, flags);
+				xhci_free_command(xhci, command);
+				goto cmd_cleanup;
 			}
-			xhci_queue_stop_endpoint(xhci, command, slot_id, i,
-						 suspend);
 		}
 	}
-	xhci_queue_stop_endpoint(xhci, cmd, slot_id, 0, suspend);
+	ret = xhci_queue_stop_endpoint(xhci, cmd, slot_id, 0, suspend);
+	if (ret) {
+		spin_unlock_irqrestore(&xhci->lock, flags);
+		goto cmd_cleanup;
+	}
+
 	xhci_ring_cmd_db(xhci);
 	spin_unlock_irqrestore(&xhci->lock, flags);
 
@@ -312,6 +322,8 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend)
 		xhci_warn(xhci, "Timeout while waiting for stop endpoint command\n");
 		ret = -ETIME;
 	}
+
+cmd_cleanup:
 	xhci_free_command(xhci, cmd);
 	return ret;
 }
drivers/usb/host/xhci.h +1 -1
index 746ffa720ae4..08057459c8e6 100644
@@ -1437,7 +1437,7 @@ struct xhci_bus_state {
 
 static inline unsigned int hcd_index(struct usb_hcd *hcd)
 {
-	if (hcd->speed == HCD_USB3)
+	if (hcd->speed >= HCD_USB3)
 		return 0;
 	else
 		return 1;
drivers/usb/renesas_usbhs/fifo.c +19 -4
index 2a540e4b5c61..70d4b6ed21a3 100644
@@ -261,11 +261,26 @@ static void usbhsf_fifo_clear(struct usbhs_pipe *pipe,
 			      struct usbhs_fifo *fifo)
 {
 	struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
+	int ret = 0;
 
-	if (!usbhs_pipe_is_dcp(pipe))
-		usbhsf_fifo_barrier(priv, fifo);
+	if (!usbhs_pipe_is_dcp(pipe)) {
+		/*
+		 * This driver checks the pipe condition first to avoid -EBUSY
+		 * from usbhsf_fifo_barrier() with about 10 msec delay in
+		 * the interrupt handler if the pipe is RX direction and empty.
+		 */
+		if (usbhs_pipe_is_dir_in(pipe))
+			ret = usbhs_pipe_is_accessible(pipe);
+		if (!ret)
+			ret = usbhsf_fifo_barrier(priv, fifo);
+	}
 
-	usbhs_write(priv, fifo->ctr, BCLR);
+	/*
+	 * if non-DCP pipe, this driver should set BCLR when
+	 * usbhsf_fifo_barrier() returns 0.
+	 */
+	if (!ret)
+		usbhs_write(priv, fifo->ctr, BCLR);
 }
 
 static int usbhsf_fifo_rcv_len(struct usbhs_priv *priv,
@@ -813,9 +828,9 @@ static void xfer_work(struct work_struct *work)
 	dev_dbg(dev, "  %s %d (%d/ %d)\n",
 		fifo->name, usbhs_pipe_number(pipe), pkt->length, pkt->zero);
 
-	usbhsf_dma_start(pipe, fifo);
 	usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->trans);
 	dma_async_issue_pending(chan);
+	usbhsf_dma_start(pipe, fifo);
 	usbhs_pipe_enable(pipe);
 
 xfer_work_end:
drivers/usb/serial/cp210x.c +1 -0
index 8f8f4aed5fbb..13395320f9bc 100644
@@ -170,6 +170,7 @@ static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
 	{ USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
 	{ USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */
+	{ USB_DEVICE(0x18EF, 0xE032) }, /* ELV TFD500 Data Logger */
 	{ USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */
 	{ USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */
 	{ USB_DEVICE(0x1901, 0x0194) },	/* GE Healthcare Remote Alarm Box */
drivers/usb/serial/ftdi_sio.c +2 -0
index 9c0cfba2c803..bf2fbb0798fb 100644
@@ -1028,6 +1028,8 @@ static const struct usb_device_id id_table_combined[] = {
 	{ USB_DEVICE(WICED_VID, WICED_USB20706V2_PID) },
 	{ USB_DEVICE(TI_VID, TI_CC3200_LAUNCHPAD_PID),
 		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+	{ USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_BT_USB_PID) },
+	{ USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_WL_USB_PID) },
 	{ }					/* Terminating entry */
 };
 
drivers/usb/serial/ftdi_sio_ids.h +7 -0
index f34bc435d90a..c03449e3665a 100644
@@ -609,6 +609,13 @@
 #define ADI_GNICE_PID		0xF000
 #define ADI_GNICEPLUS_PID	0xF001
 
+/*
+ * Cypress WICED USB UART
+ */
+#define CYPRESS_VID			0x04B4
+#define CYPRESS_WICED_BT_USB_PID	0x009B
+#define CYPRESS_WICED_WL_USB_PID	0xF900
+
 /*
  * Microchip Technology, Inc.
  *
drivers/usb/serial/metro-usb.c +1 -0
index 39e683096e94..45182c65fa1f 100644
@@ -45,6 +45,7 @@ struct metrousb_private {
 static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE(FOCUS_VENDOR_ID, FOCUS_PRODUCT_ID_BI) },
 	{ USB_DEVICE(FOCUS_VENDOR_ID, FOCUS_PRODUCT_ID_UNI) },
+	{ USB_DEVICE_INTERFACE_CLASS(0x0c2e, 0x0730, 0xff) },	/* MS7820 */
 	{ }, /* Terminating entry. */
 };
 MODULE_DEVICE_TABLE(usb, id_table);
drivers/usb/serial/option.c +2 -0
index 17d28273e03c..ed203e1a4d96 100644
@@ -524,6 +524,7 @@ static void option_instat_callback(struct urb *urb);
 
 /* TP-LINK Incorporated products */
 #define TPLINK_VENDOR_ID			0x2357
+#define TPLINK_PRODUCT_LTE			0x000D
 #define TPLINK_PRODUCT_MA180			0x0201
 
 /* Changhong products */
@@ -2022,6 +2023,7 @@ static const struct usb_device_id option_ids[] = {
 	{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
 	{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) },
 	{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, TPLINK_PRODUCT_LTE, 0xff, 0x00, 0x00) },	/* TP-Link LTE Module */
 	{ USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180),
 	  .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
 	{ USB_DEVICE(TPLINK_VENDOR_ID, 0x9000),					/* TP-Link MA260 */
drivers/usb/serial/qcserial.c +4 -0
index 23c303b2a3a2..996dc09b00b8 100644
@@ -172,6 +172,10 @@ static const struct usb_device_id id_table[] = {
 	{DEVICE_SWI(0x413c, 0x81b3)},	/* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
 	{DEVICE_SWI(0x413c, 0x81b5)},	/* Dell Wireless 5811e QDL */
 	{DEVICE_SWI(0x413c, 0x81b6)},	/* Dell Wireless 5811e QDL */
+	{DEVICE_SWI(0x413c, 0x81cf)},   /* Dell Wireless 5819 */
+	{DEVICE_SWI(0x413c, 0x81d0)},   /* Dell Wireless 5819 */
+	{DEVICE_SWI(0x413c, 0x81d1)},   /* Dell Wireless 5818 */
+	{DEVICE_SWI(0x413c, 0x81d2)},   /* Dell Wireless 5818 */
 
 	/* Huawei devices */
 	{DEVICE_HWI(0x03f0, 0x581d)},	/* HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) */
drivers/usb/storage/transport.c +13 -1
index 8988b268a69a..f848f52a756e 100644
@@ -808,12 +808,24 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us)
 			if (result == USB_STOR_TRANSPORT_GOOD) {
 				srb->result = SAM_STAT_GOOD;
 				srb->sense_buffer[0] = 0x0;
+			}
+
+			/*
+			 * ATA-passthru commands use sense data to report
+			 * the command completion status, and often devices
+			 * return Check Condition status when nothing is
+			 * wrong.
+			 */
+			else if (srb->cmnd[0] == ATA_16 ||
+					srb->cmnd[0] == ATA_12) {
+				/* leave the data alone */
+			}
 
 			/* If there was a problem, report an unspecified
 			 * hardware error to prevent the higher layers from
 			 * entering an infinite retry loop.
 			 */
-			} else {
+			else {
 				srb->result = DID_ERROR << 16;
 				if ((sshdr.response_code & 0x72) == 0x72)
 					srb->sense_buffer[1] = HARDWARE_ERROR;
drivers/usb/storage/unusual_devs.h +7 -0
index 96379e715d4b..825625d62982 100644
@@ -1360,6 +1360,13 @@ UNUSUAL_DEV( 0x0bc2, 0x3010, 0x0000, 0x0000,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_SANE_SENSE ),
 
+/* Reported by Kris Lindgren <[email protected]> */
+UNUSUAL_DEV( 0x0bc2, 0x3332, 0x0000, 0x9999,
+		"Seagate",
+		"External",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_NO_WP_DETECT ),
+
 UNUSUAL_DEV(  0x0d49, 0x7310, 0x0000, 0x9999,
 		"Maxtor",
 		"USB to SATA",
drivers/uwb/hwa-rc.c +2 -0
index e75bbe5a10cd..1212b4b3c5a9 100644
@@ -827,6 +827,8 @@ static int hwarc_probe(struct usb_interface *iface,
 
 	if (iface->cur_altsetting->desc.bNumEndpoints < 1)
 		return -ENODEV;
+	if (!usb_endpoint_xfer_int(&iface->cur_altsetting->endpoint[0].desc))
+		return -ENODEV;
 
 	result = -ENOMEM;
 	uwb_rc = uwb_rc_alloc();
drivers/uwb/uwbd.c +8 -4
index bdcb13cc1d54..5c9828370217 100644
@@ -303,18 +303,22 @@ static int uwbd(void *param)
 /** Start the UWB daemon */
 void uwbd_start(struct uwb_rc *rc)
 {
-	rc->uwbd.task = kthread_run(uwbd, rc, "uwbd");
-	if (rc->uwbd.task == NULL)
+	struct task_struct *task = kthread_run(uwbd, rc, "uwbd");
+	if (IS_ERR(task)) {
+		rc->uwbd.task = NULL;
 		printk(KERN_ERR "UWB: Cannot start management daemon; "
 		       "UWB won't work\n");
-	else
+	} else {
+		rc->uwbd.task = task;
 		rc->uwbd.pid = rc->uwbd.task->pid;
+	}
 }
 
 /* Stop the UWB daemon and free any unprocessed events */
 void uwbd_stop(struct uwb_rc *rc)
 {
-	kthread_stop(rc->uwbd.task);
+	if (rc->uwbd.task)
+		kthread_stop(rc->uwbd.task);
 	uwbd_flush(rc);
 }
 
fs/block_dev.c +4 -2
index ab8652b89577..6b9811823b72 100644
@@ -419,10 +419,12 @@ int bdev_write_page(struct block_device *bdev, sector_t sector,
 		return -EOPNOTSUPP;
 	set_page_writeback(page);
 	result = ops->rw_page(bdev, sector + get_start_sect(bdev), page, rw);
-	if (result)
+	if (result) {
 		end_page_writeback(page);
-	else
+	} else {
+		clean_page_buffers(page);
 		unlock_page(page);
+	}
 	return result;
 }
 EXPORT_SYMBOL_GPL(bdev_write_page);
fs/btrfs/ioctl.c +7 -3
index 04972508c98b..10d36d0dae33 100644
@@ -2745,9 +2745,9 @@ static long btrfs_ioctl_fs_info(struct btrfs_root *root, void __user *arg)
 	}
 	mutex_unlock(&fs_devices->device_list_mutex);
 
-	fi_args->nodesize = root->fs_info->super_copy->nodesize;
-	fi_args->sectorsize = root->fs_info->super_copy->sectorsize;
-	fi_args->clone_alignment = root->fs_info->super_copy->sectorsize;
+	fi_args->nodesize = root->nodesize;
+	fi_args->sectorsize = root->sectorsize;
+	fi_args->clone_alignment = root->sectorsize;
 
 	if (copy_to_user(arg, fi_args, sizeof(*fi_args)))
 		ret = -EFAULT;
@@ -3980,6 +3980,10 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
 		ret = PTR_ERR(new_root);
 		goto out;
 	}
+	if (!is_fstree(new_root->objectid)) {
+		ret = -ENOENT;
+		goto out;
+	}
 
 	path = btrfs_alloc_path();
 	if (!path) {
fs/cifs/cifsfs.c +1 -1
index 281358942b64..a0bf3f135a92 100644
@@ -1294,7 +1294,7 @@ exit_cifs(void)
 	exit_cifs_idmap();
 #endif
 #ifdef CONFIG_CIFS_UPCALL
-	unregister_key_type(&cifs_spnego_key_type);
+	exit_cifs_spnego();
 #endif
 	cifs_destroy_request_bufs();
 	cifs_destroy_mids();
fs/cifs/connect.c +8 -0
index 2959522238c5..d7be06289ff8 100644
@@ -3956,6 +3956,14 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
 	cifs_dbg(FYI, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d\n",
 		 server->sec_mode, server->capabilities, server->timeAdj);
 
+	if (ses->auth_key.response) {
+		cifs_dbg(VFS, "Free previous auth_key.response = %p\n",
+			 ses->auth_key.response);
+		kfree(ses->auth_key.response);
+		ses->auth_key.response = NULL;
+		ses->auth_key.len = 0;
+	}
+
 	if (server->ops->sess_setup)
 		rc = server->ops->sess_setup(xid, ses, nls_info);
 
fs/cifs/file.c +7 -0
index 0ae3f55290e9..a1feb13c7590 100644
@@ -225,6 +225,13 @@ cifs_nt_open(char *full_path, struct inode *inode, struct cifs_sb_info *cifs_sb,
 	if (backup_cred(cifs_sb))
 		create_options |= CREATE_OPEN_BACKUP_INTENT;
 
+	/* O_SYNC also has bit for O_DSYNC so following check picks up either */
+	if (f_flags & O_SYNC)
+		create_options |= CREATE_WRITE_THROUGH;
+
+	if (f_flags & O_DIRECT)
+		create_options |= CREATE_NO_BUFFER;
+
 	oparms.tcon = tcon;
 	oparms.cifs_sb = cifs_sb;
 	oparms.desired_access = desired_access;
fs/cifs/smb2pdu.c +24 -10
index 8add863a81fd..038e428b5173 100644
@@ -479,22 +479,29 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon)
 {
 	int rc = 0;
 	struct validate_negotiate_info_req vneg_inbuf;
-	struct validate_negotiate_info_rsp *pneg_rsp;
+	struct validate_negotiate_info_rsp *pneg_rsp = NULL;
 	u32 rsplen;
 
 	cifs_dbg(FYI, "validate negotiate\n");
 
 	/*
 	 * validation ioctl must be signed, so no point sending this if we
-	 * can not sign it.  We could eventually change this to selectively
+	 * can not sign it (ie are not known user).  Even if signing is not
+	 * required (enabled but not negotiated), in those cases we selectively
 	 * sign just this, the first and only signed request on a connection.
-	 * This is good enough for now since a user who wants better security
-	 * would also enable signing on the mount. Having validation of
-	 * negotiate info for signed connections helps reduce attack vectors
+	 * Having validation of negotiate info  helps reduce attack vectors.
 	 */
-	if (tcon->ses->server->sign == false)
+	if (tcon->ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST)
 		return 0; /* validation requires signing */
 
+	if (tcon->ses->user_name == NULL) {
+		cifs_dbg(FYI, "Can't validate negotiate: null user mount\n");
+		return 0; /* validation requires signing */
+	}
+
+	if (tcon->ses->session_flags & SMB2_SESSION_FLAG_IS_NULL)
+		cifs_dbg(VFS, "Unexpected null user (anonymous) auth flag sent by server\n");
+
 	vneg_inbuf.Capabilities =
 			cpu_to_le32(tcon->ses->server->vals->req_capabilities);
 	memcpy(vneg_inbuf.Guid, tcon->ses->server->client_guid,
@@ -528,8 +535,9 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon)
 			 rsplen);
 
 		/* relax check since Mac returns max bufsize allowed on ioctl */
-		if (rsplen > CIFSMaxBufSize)
-			return -EIO;
+		if ((rsplen > CIFSMaxBufSize)
+		     || (rsplen < sizeof(struct validate_negotiate_info_rsp)))
+			goto err_rsp_free;
 	}
 
 	/* check validate negotiate info response matches what we got earlier */
@@ -548,10 +556,13 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon)
 
 	/* validate negotiate successful */
 	cifs_dbg(FYI, "validate negotiate info successful\n");
+	kfree(pneg_rsp);
 	return 0;
 
 vneg_out:
 	cifs_dbg(VFS, "protocol revalidation - security settings mismatch\n");
+err_rsp_free:
+	kfree(pneg_rsp);
 	return -EIO;
 }
 
@@ -1114,7 +1125,7 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
 	struct TCP_Server_Info *server;
 	struct cifs_tcon *tcon = oparms->tcon;
 	struct cifs_ses *ses = tcon->ses;
-	struct kvec iov[4];
+	struct kvec iov[4] = {{NULL, 0}};
 	int resp_buftype;
 	int uni_path_len;
 	__le16 *copy_path = NULL;
@@ -1215,7 +1226,7 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
 
 	if (rc != 0) {
 		cifs_stats_fail_inc(tcon, SMB2_CREATE_HE);
-		if (err_buf)
+		if (err_buf && rsp)
 			*err_buf = kmemdup(rsp, get_rfc1002_length(rsp) + 4,
 					   GFP_KERNEL);
 		goto creat_exit;
@@ -1331,6 +1342,9 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
 	} else
 		iov[0].iov_len = get_rfc1002_length(req) + 4;
 
+	/* validate negotiate request must be signed - see MS-SMB2 3.2.5.5 */
+	if (opcode == FSCTL_VALIDATE_NEGOTIATE_INFO)
+		req->hdr.Flags |= SMB2_FLAGS_SIGNED;
 
 	rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buftype, 0);
 	rsp = (struct smb2_ioctl_rsp *)iov[0].iov_base;
fs/direct-io.c +2 -1
index e181b6b2e297..a325d8c5ec2d 100644
@@ -812,7 +812,8 @@ submit_page_section(struct dio *dio, struct dio_submit *sdio, struct page *page,
 	 */
 	if (sdio->boundary) {
 		ret = dio_send_cur_page(dio, sdio, map_bh);
-		dio_bio_submit(dio, sdio);
+		if (sdio->bio)
+			dio_bio_submit(dio, sdio);
 		page_cache_release(sdio->cur_page);
 		sdio->cur_page = NULL;
 	}
fs/ecryptfs/ecryptfs_kernel.h +17 -8
index 90d1882b306f..4682bef34bb6 100644
@@ -84,11 +84,16 @@ struct ecryptfs_page_crypt_context {
 static inline struct ecryptfs_auth_tok *
 ecryptfs_get_encrypted_key_payload_data(struct key *key)
 {
-	if (key->type == &key_type_encrypted)
-		return (struct ecryptfs_auth_tok *)
-			(&((struct encrypted_key_payload *)key->payload.data)->payload_data);
-	else
+	struct encrypted_key_payload *payload;
+
+	if (key->type != &key_type_encrypted)
 		return NULL;
+
+	payload = key->payload.data;
+	if (!payload)
+		return ERR_PTR(-EKEYREVOKED);
+
+	return (struct ecryptfs_auth_tok *)payload->payload_data;
 }
 
 static inline struct key *ecryptfs_get_encrypted_key(char *sig)
@@ -114,13 +119,17 @@ static inline struct ecryptfs_auth_tok *
 ecryptfs_get_key_payload_data(struct key *key)
 {
 	struct ecryptfs_auth_tok *auth_tok;
+	struct user_key_payload *ukp;
 
 	auth_tok = ecryptfs_get_encrypted_key_payload_data(key);
-	if (!auth_tok)
-		return (struct ecryptfs_auth_tok *)
-			(((struct user_key_payload *)key->payload.data)->data);
-	else
+	if (auth_tok)
 		return auth_tok;
+
+	ukp = key->payload.data;
+	if (!ukp)
+		return ERR_PTR(-EKEYREVOKED);
+
+	return (struct ecryptfs_auth_tok *)ukp->data;
 }
 
 #define ECRYPTFS_MAX_KEYSET_SIZE 1024
fs/ecryptfs/keystore.c +8 -1
index 4725a07f003c..bb10b3158b49 100644
@@ -459,7 +459,8 @@ static int ecryptfs_verify_version(u16 version)
  * @auth_tok_key: key containing the authentication token
  * @auth_tok: authentication token
  *
- * Returns zero on valid auth tok; -EINVAL otherwise
+ * Returns zero on valid auth tok; -EINVAL if the payload is invalid; or
+ * -EKEYREVOKED if the key was revoked before we acquired its semaphore.
  */
 static int
 ecryptfs_verify_auth_tok_from_key(struct key *auth_tok_key,
@@ -468,6 +469,12 @@ ecryptfs_verify_auth_tok_from_key(struct key *auth_tok_key,
 	int rc = 0;
 
 	(*auth_tok) = ecryptfs_get_key_payload_data(auth_tok_key);
+	if (IS_ERR(*auth_tok)) {
+		rc = PTR_ERR(*auth_tok);
+		*auth_tok = NULL;
+		goto out;
+	}
+
 	if (ecryptfs_verify_version((*auth_tok)->version)) {
 		printk(KERN_ERR "Data structure version mismatch. Userspace "
 		       "tools must match eCryptfs kernel module with major "
fs/exec.c +19 -3
index fa3604731bae..70c31796a314 100644
@@ -56,6 +56,7 @@
 #include <linux/pipe_fs_i.h>
 #include <linux/oom.h>
 #include <linux/compat.h>
+#include <linux/user_namespace.h>
 
 #include <asm/uaccess.h>
 #include <asm/mmu_context.h>
@@ -1129,8 +1130,22 @@ EXPORT_SYMBOL(flush_old_exec);
 
 void would_dump(struct linux_binprm *bprm, struct file *file)
 {
-	if (inode_permission(file_inode(file), MAY_READ) < 0)
+	struct inode *inode = file_inode(file);
+	if (inode_permission(inode, MAY_READ) < 0) {
+		struct user_namespace *old, *user_ns;
 		bprm->interp_flags |= BINPRM_FLAGS_ENFORCE_NONDUMP;
+
+		/* Ensure mm->user_ns contains the executable */
+		user_ns = old = bprm->mm->user_ns;
+		while ((user_ns != &init_user_ns) &&
+		       !privileged_wrt_inode_uidgid(user_ns, inode))
+			user_ns = user_ns->parent;
+
+		if (old != user_ns) {
+			bprm->mm->user_ns = get_user_ns(user_ns);
+			put_user_ns(old);
+		}
+	}
 }
 EXPORT_SYMBOL(would_dump);
 
@@ -1160,7 +1175,6 @@ void setup_new_exec(struct linux_binprm * bprm)
 	    !gid_eq(bprm->cred->gid, current_egid())) {
 		current->pdeath_signal = 0;
 	} else {
-		would_dump(bprm, bprm->file);
 		if (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP)
 			set_dumpable(current->mm, suid_dumpable);
 	}
@@ -1259,7 +1273,7 @@ static void check_unsafe_exec(struct linux_binprm *bprm)
 	unsigned n_fs;
 
 	if (p->ptrace) {
-		if (p->ptrace & PT_PTRACE_CAP)
+		if (ptracer_capable(p, current_user_ns()))
 			bprm->unsafe |= LSM_UNSAFE_PTRACE_CAP;
 		else
 			bprm->unsafe |= LSM_UNSAFE_PTRACE;
@@ -1564,6 +1578,8 @@ static int do_execve_common(struct filename *filename,
 	if (retval < 0)
 		goto out;
 
+	would_dump(bprm, bprm->file);
+
 	retval = exec_binprm(bprm);
 	if (retval < 0)
 		goto out;
fs/fscache/object-list.c +7 -0
index b8179ca6bf9d..8a96aeb2391f 100644
@@ -330,6 +330,13 @@ static void fscache_objlist_config(struct fscache_objlist_data *data)
 	rcu_read_lock();
 
 	confkey = key->payload.data;
+	if (!confkey) {
+		/* key was revoked */
+		rcu_read_unlock();
+		key_put(key);
+		goto no_config;
+	}
+
 	buf = confkey->data;
 
 	for (len = confkey->datalen - 1; len >= 0; len--) {
fs/fuse/dir.c +2 -1
index a5c32420bfc8..373494f247b1 100644
@@ -1382,7 +1382,8 @@ static int parse_dirplusfile(char *buf, size_t nbytes, struct file *file,
 			*/
 			over = !dir_emit(ctx, dirent->name, dirent->namelen,
 				       dirent->ino, dirent->type);
-			ctx->pos = dirent->off;
+			if (!over)
+				ctx->pos = dirent->off;
 		}
 
 		buf += reclen;
fs/mpage.c +11 -3
index 5f9ed622274f..895ee9af5be3 100644
@@ -457,6 +457,16 @@ static void clean_buffers(struct page *page, unsigned first_unmapped)
 		try_to_free_buffers(page);
 }
 
+/*
+ * For situations where we want to clean all buffers attached to a page.
+ * We don't need to calculate how many buffers are attached to the page,
+ * we just need to specify a number larger than the maximum number of buffers.
+ */
+void clean_page_buffers(struct page *page)
+{
+	clean_buffers(page, ~0U);
+}
+
 static int __mpage_writepage(struct page *page, struct writeback_control *wbc,
 		      void *data)
 {
@@ -594,10 +604,8 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc,
 	if (bio == NULL) {
 		if (first_unmapped == blocks_per_page) {
 			if (!bdev_write_page(bdev, blocks[0] << (blkbits - 9),
-								page, wbc)) {
-				clean_buffers(page, first_unmapped);
+								page, wbc))
 				goto out;
-			}
 		}
 		bio = mpage_alloc(bdev, blocks[0] << (blkbits - 9),
 				bio_get_nr_vecs(bdev), GFP_NOFS|__GFP_HIGH);
fs/ocfs2/alloc.c +18 -6
index 9d8fcf2f3b94..296f48c6f43d 100644
@@ -7226,13 +7226,24 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh,
 
 static int ocfs2_trim_extent(struct super_block *sb,
 			     struct ocfs2_group_desc *gd,
-			     u32 start, u32 count)
+			     u64 group, u32 start, u32 count)
 {
 	u64 discard, bcount;
+	struct ocfs2_super *osb = OCFS2_SB(sb);
 
 	bcount = ocfs2_clusters_to_blocks(sb, count);
-	discard = le64_to_cpu(gd->bg_blkno) +
-			ocfs2_clusters_to_blocks(sb, start);
+	discard = ocfs2_clusters_to_blocks(sb, start);
+
+	/*
+	 * For the first cluster group, the gd->bg_blkno is not at the start
+	 * of the group, but at an offset from the start. If we add it while
+	 * calculating discard for first group, we will wrongly start fstrim a
+	 * few blocks after the desried start block and the range can cross
+	 * over into the next cluster group. So, add it only if this is not
+	 * the first cluster group.
+	 */
+	if (group != osb->first_cluster_group_blkno)
+		discard += le64_to_cpu(gd->bg_blkno);
 
 	trace_ocfs2_trim_extent(sb, (unsigned long long)discard, bcount);
 
@@ -7240,7 +7251,7 @@ static int ocfs2_trim_extent(struct super_block *sb,
 }
 
 static int ocfs2_trim_group(struct super_block *sb,
-			    struct ocfs2_group_desc *gd,
+			    struct ocfs2_group_desc *gd, u64 group,
 			    u32 start, u32 max, u32 minbits)
 {
 	int ret = 0, count = 0, next;
@@ -7259,7 +7270,7 @@ static int ocfs2_trim_group(struct super_block *sb,
 		next = ocfs2_find_next_bit(bitmap, max, start);
 
 		if ((next - start) >= minbits) {
-			ret = ocfs2_trim_extent(sb, gd,
+			ret = ocfs2_trim_extent(sb, gd, group,
 						start, next - start);
 			if (ret < 0) {
 				mlog_errno(ret);
@@ -7357,7 +7368,8 @@ int ocfs2_trim_fs(struct super_block *sb, struct fstrim_range *range)
 		}
 
 		gd = (struct ocfs2_group_desc *)gd_bh->b_data;
-		cnt = ocfs2_trim_group(sb, gd, first_bit, last_bit, minlen);
+		cnt = ocfs2_trim_group(sb, gd, group,
+				       first_bit, last_bit, minlen);
 		brelse(gd_bh);
 		gd_bh = NULL;
 		if (cnt < 0) {
fs/read_write.c +2 -2
index 009d8542a889..07053752c148 100644
@@ -116,7 +116,7 @@ generic_file_llseek_size(struct file *file, loff_t offset, int whence,
 		 * In the generic case the entire file is data, so as long as
 		 * offset isn't at the end of the file then the offset is data.
 		 */
-		if (offset >= eof)
+		if ((unsigned long long)offset >= eof)
 			return -ENXIO;
 		break;
 	case SEEK_HOLE:
@@ -124,7 +124,7 @@ generic_file_llseek_size(struct file *file, loff_t offset, int whence,
 		 * There is a virtual hole at the end of the file, so as long as
 		 * offset isn't i_size or larger, return i_size.
 		 */
-		if (offset >= eof)
+		if ((unsigned long long)offset >= eof)
 			return -ENXIO;
 		offset = eof;
 		break;
fs/xattr.c +1 -1
index 7325e2ecbae9..6b57cbd8c962 100644
@@ -163,7 +163,7 @@ xattr_getsecurity(struct inode *inode, const char *name, void *value,
 	}
 	memcpy(value, buffer, len);
 out:
-	security_release_secctx(buffer, len);
+	kfree(buffer);
 out_noalloc:
 	return len;
 }
include/crypto/internal/hash.h +8 -0
index 66fc42c57aff..27f5fa488ad0 100644
@@ -83,6 +83,14 @@ int ahash_register_instance(struct crypto_template *tmpl,
 			    struct ahash_instance *inst);
 void ahash_free_instance(struct crypto_instance *inst);
 
+int shash_no_setkey(struct crypto_shash *tfm, const u8 *key,
+		    unsigned int keylen);
+
+static inline bool crypto_shash_alg_has_setkey(struct shash_alg *alg)
+{
+	return alg->setkey != shash_no_setkey;
+}
+
 int crypto_init_ahash_spawn(struct crypto_ahash_spawn *spawn,
 			    struct hash_alg_common *alg,
 			    struct crypto_instance *inst);
include/linux/buffer_head.h +1 -0
index e6797ded700e..f8d39f7a56f2 100644

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

include/linux/capability.h +2 -0
index aa93e5ef594c..4a12b8d51f1b 100644

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

include/linux/iio/adc/ad_sigma_delta.h +3 -0
index e7fdec4db9da..6cc48ac55fd2 100644

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

include/linux/input.h +1 -0
index 82ce323b9986..25476b19ea54 100644

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

include/linux/key.h +2 -0
index 017b0826642f..f04f6dd6c6f7 100644

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

include/linux/mbus.h +2 -2
index 550c88fb0267..0ae20395bf5a 100644

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

include/linux/mm.h +2 -0
index 35f8b59b37a7..65a4dc2da9de 100644

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

include/linux/mm_types.h +1 -0
index 761fc630f150..489c1307f81e 100644

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

include/linux/mmzone.h +8 -2
index 6cbd1b6c3d20..c7eb42235fbe 100644

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

include/linux/netdevice.h +3 -0
index e5145f8e4004..1d2c25984890 100644

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

include/linux/of.h +10 -0
index 55452d38ae06..0c220cf91e92 100644

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

include/linux/pci_ids.h +2 -0
index 32709bcecfdd..0117cdf84e95 100644

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

include/linux/preempt_mask.h +13 -8
index 5cb25f17331a..7ee3562f70f4 100644

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

include/linux/ptrace.h +8 -3
index 608d90444b6f..5af4994cac23 100644

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

include/linux/sched.h +1 -0
index 25ad8f0bbdcb..ca9589027893 100644

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

include/linux/skbuff.h +7 -0
index 63c9d381e0d9..93431a42f2f9 100644

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

include/net/protocol.h +1 -1
index d6fcc1fcdb5b..035971919ced 100644

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

include/net/route.h +3 -1
index b17cf28f996e..671d5b1c813b 100644

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

include/net/tcp.h +4 -4
index ceaa03fdccf2..6f404e98876a 100644

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

include/net/udp.h +1 -1
index 68a1fefe3dfe..12f4f5b02986 100644

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

include/scsi/scsi_device.h +1 -0
index 6868a5ca183c..ab5bfaa8f9de 100644

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

include/scsi/scsi_devinfo.h +1 -0
index 96e3f56519e7..b29faa3471ed 100644

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

include/sound/seq_kernel.h +2 -1
index 2398521f0998..d06bb8109cdc 100644

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

include/sound/seq_virmidi.h +1 -0
index a03acd0d398a..695257ae64ac 100644

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

include/sound/timer.h +2 -0
index 7990469a44ce..b0489b850c93 100644

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

include/trace/events/kvm.h +5 -2
index 131a0bda7aec..bb71db2d884d 100644

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

include/uapi/linux/spi/spidev.h +1 -0
index dd5f21e75805..856de39d0b89 100644

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

kernel/capability.c +34 -2
index 989f5bfc57dc..4a840b038303 100644

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

kernel/fork.c +6 -3
index f6422f07d133..0a2f907b1302 100644

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

kernel/params.c +1 -1
index 1e52ca233fd9..20b5f8fe7eef 100644

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

kernel/ptrace.c +62 -29

91 lines not on this page · raw message

kernel/sched/core.c +6 -15
index 0940ee9603ae..e6c9458f4b49 100644

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

kernel/sched/features.h +0 -1
index 90284d117fe6..79bad00ea840 100644

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

kernel/sysctl.c +2 -1
index 3a3172559b22..e918a641b1a0 100644

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

kernel/trace/trace.c +9 -3
index 591bbffc2384..99b46db656e0 100644

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

kernel/workqueue.c +15 -22
index 146fb7784900..9bf0b4bd3cc7 100644

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

kernel/workqueue_internal.h +2 -1
index 45215870ac6c..3fa9c146fccb 100644

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

lib/asn1_decoder.c +5 -2
index 806c5b6b4b3a..162b6d290622 100644

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

lib/digsig.c +6 -0
index ae05ea393fc8..4b8ef0bd315b 100644

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

mm/huge_memory.c +4 -10
index e1a6dce055a0..47c8bb45e781 100644

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

mm/init-mm.c +2 -0
index a56a851908d2..975e49f00f34 100644

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

mm/memory.c +1 -1
index e1bde862d6d3..4ab5b0c55f4a 100644

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

mm/memory_hotplug.c +3 -3
index 4174487a1261..1e0ec777523e 100644

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

mm/nommu.c +1 -1
index 53a59f41e2e5..7f2c901c555e 100644

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

net/8021q/vlan.c +3 -3
index 44ebd5c2cd4a..dcd897f9f95c 100644

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

net/bluetooth/bnep/core.c +3 -0
index a841d3e776c5..c7a19a15d760 100644

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

net/bluetooth/cmtp/core.c +3 -0
index 67fe5e84e68f..278a194e6af4 100644

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

net/core/dev.c +3 -3
index ee2177c0b186..37e2e5423af0 100644

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

net/core/rtnetlink.c +4 -1
index 66498c948405..a3ce3f2d7e98 100644

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

net/core/skbuff.c +1 -0
index 8c5409067930..235c639d370b 100644

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

net/dccp/proto.c +5 -0
index f8fa2d15115e..82068e0d9891 100644

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

net/ipv4/ip_input.c +13 -9
index 3d4da2c16b6a..1a04ea201f3b 100644

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

net/ipv4/ip_vti.c +2 -1
index ea7525b1f996..ca0b7408614c 100644

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

net/ipv4/route.c +25 -19

44 lines not on this page · raw message

net/ipv4/tcp_ipv4.c +5 -4
index 4984da1a31b3..964064325681 100644

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

net/ipv4/tcp_output.c +11 -1
index 6ad29aa904bf..52d89fc2b297 100644

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

net/ipv4/udp.c +21 -9
index 0a9aaab17e00..5877d782bdc1 100644

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

net/ipv6/ip6_gre.c +23 -18

41 lines not on this page · raw message

net/ipv6/ip6_vti.c +2 -1
index 4e083dab7445..de67f5bd9bf9 100644

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

net/l2tp/l2tp_core.c +4 -6
index 35f97d9abc4b..1f3677610ad7 100644

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

net/l2tp/l2tp_core.h +4 -1
index 36c25b14bc6f..b56ca9346038 100644

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

net/l2tp/l2tp_eth.c +2 -49

51 lines not on this page · raw message

net/l2tp/l2tp_ip.c +8 -12
index d30f5c03d72f..67c59119d01d 100644

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

net/l2tp/l2tp_ip6.c +8 -13
index c052d2991f84..1615cb38828d 100644

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

net/l2tp/l2tp_ppp.c +9 -1
index 80d4cfa9fe38..22d74e6b6461 100644

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

net/netfilter/ipset/ip_set_core.c +14 -9
index 6850c3c4d6d3..59aaa4159a36 100644

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

net/netfilter/nfnetlink_cthelper.c +10 -0
index 54330fb5efaf..17d9c9df3129 100644

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

net/netfilter/x_tables.c +2 -2
index 3ca6db13af92..7a4e43a8acfa 100644

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

net/netfilter/xt_osf.c +7 -0
index c529161cdbf8..99f3146b7337 100644

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

net/netlink/af_netlink.c +3 -0
index 3bf0c16023ec..2eafcffb5f8e 100644

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

net/packet/af_packet.c +3 -1
index f5bf29c033bd..c7d91a0b51da 100644

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

net/sched/sch_generic.c +1 -0
index c0bdd3bce189..c15c37370f5a 100644

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

net/sctp/input.c +1 -1
index f2e2cbd2d750..adedd61e2bc4 100644

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

net/sctp/sm_sideeffect.c +2 -2
index 198ceb721794..4bfa6070ae68 100644

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

net/unix/diag.c +2 -0
index 27dd3dcb7739..83b90b62b736 100644

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

net/wireless/nl80211.c +10 -2
index 6fd21cab5ada..eb71b29eb647 100644

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

net/xfrm/xfrm_state.c +1 -0
index 725cf243860c..1f9558155e1e 100644

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

net/xfrm/xfrm_user.c +2 -1
index c28716452211..316c27f70560 100644

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

security/keys/big_key.c +1 -1
index 8137b27d641d..aa8f46f0918a 100644

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

security/keys/encrypted-keys/encrypted.c +7 -0
index 9c321a25348f..cad4c1f415e3 100644

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

security/keys/internal.h +1 -1
index 5f20da01fd8d..31c70323cda9 100644

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

security/keys/key.c +2 -0
index 58ebea254519..c55a01471ea2 100644

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

security/keys/keyctl.c +3 -5
index 4598617c66de..8cacd856d1ca 100644

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

security/keys/keyring.c +36 -36

72 lines not on this page · raw message

security/keys/process_keys.c +6 -2
index 18bad7caf602..e56b57f04cf9 100644

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

security/keys/request_key.c +37 -9

46 lines not on this page · raw message

security/keys/request_key_auth.c +31 -38

69 lines not on this page · raw message

security/keys/trusted.c +32 -37

69 lines not on this page · raw message

security/smack/smack_lsm.c +29 -36

65 lines not on this page · raw message

security/yama/yama_lsm.c +2 -2
index 13c88fbcf037..0038834b558e 100644

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

sound/core/hrtimer.c +1 -0
index 38514ed6e55c..9b3445922645 100644

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

sound/core/seq/oss/seq_oss_midi.c +1 -3
index 3a4569669efa..86353dc0439c 100644

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

sound/core/seq/oss/seq_oss_readq.c +29 -0
index 654d17a5023c..dffc27374bdf 100644

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

sound/core/seq/oss/seq_oss_readq.h +2 -0
index f1463f1f449e..8d033ca2d23f 100644

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

sound/core/seq/seq_clientmgr.c +1 -1
index a3988a4bcfd6..0a52e377a617 100644

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

sound/core/seq/seq_virmidi.c +19 -8
index 81134e067184..3b126af4a026 100644

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

sound/core/timer.c +72 -37

109 lines not on this page · raw message

sound/core/timer_compat.c +15 -2
index 2e908225d754..0b4b028e8e98 100644

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

sound/pci/hda/hda_codec.c +1 -1
index 22b7038cff0d..fc1f09a8e5d3 100644

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

sound/soc/codecs/adau17x1.c +23 -1
index 2961fae9670a..eb8e4065c4c5 100644

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

sound/soc/codecs/adau17x1.h +2 -0
index 3ffabaf4c7a8..664db5dd8c20 100644

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

sound/usb/caiaq/device.c +9 -3
index b871ba407e4e..4458190149d1 100644

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

sound/usb/usx2y/usb_stream.c +4 -2
index bf618e1500ac..e7b934f4d837 100644

Lines of this file are not shown. View the 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.