Linux 3.16.83
I'm announcing the release of the 3.16.83 kernel.
All users of the 3.16 kernel series should upgrade.
The updated 3.16.y git tree can be found at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.16.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git
The diff from 3.16.82 is attached to this message.
Ben.
------------
Documentation/sysctl/fs.txt | 36 ++ Makefile | 2 +- arch/powerpc/kernel/irq.c | 4 +- arch/x86/boot/compressed/head_64.S | 5 + arch/x86/include/asm/kaiser.h | 10 + arch/x86/kernel/cpu/microcode/amd.c | 4 + arch/x86/kvm/cpuid.c | 3 +- arch/x86/kvm/vmx.c | 2 +- arch/x86/realmode/init.c | 4 +- arch/x86/realmode/rm/trampoline_64.S | 3 +- block/blk-settings.c | 2 +- drivers/acpi/device_pm.c | 12 +- drivers/block/floppy.c | 7 +- drivers/gpio/gpiolib.c | 13 +- drivers/hid/hid-core.c | 6 + drivers/hid/hid-input.c | 16 +- drivers/hid/hidraw.c | 7 +- drivers/hid/uhid.c | 5 +- drivers/hwmon/adt7475.c | 5 +- drivers/iio/industrialio-buffer.c | 6 +- drivers/infiniband/hw/mlx4/main.c | 16 +- drivers/input/input.c | 26 +- drivers/input/misc/keyspan_remote.c | 9 +- drivers/input/tablet/aiptek.c | 6 +- drivers/input/tablet/gtco.c | 10 +- drivers/input/touchscreen/sur40.c | 2 +- drivers/isdn/gigaset/usb-gigaset.c | 23 +- drivers/md/dm-crypt.c | 4 +- drivers/md/dm-delay.c | 16 +- drivers/md/dm-flakey.c | 40 +- drivers/md/dm-linear.c | 7 +- drivers/md/dm-raid1.c | 8 +- drivers/md/dm-snap-persistent.c | 2 +- drivers/md/dm-stripe.c | 8 +- drivers/md/dm-thin-metadata.c | 29 + drivers/md/dm-thin-metadata.h | 7 + drivers/md/persistent-data/dm-btree-remove.c | 8 +- drivers/md/raid0.c | 2 +- drivers/media/media-device.c | 43 +- drivers/media/media-devnode.c | 171 +++--- drivers/media/usb/gspca/ov519.c | 10 + drivers/media/usb/gspca/stv06xx/stv06xx.c | 19 +- drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c | 4 + drivers/media/usb/gspca/xirlink_cit.c | 18 +- drivers/media/usb/uvc/uvc_driver.c | 2 +- drivers/misc/enclosure.c | 3 +- drivers/mmc/host/sdhci.c | 10 +- drivers/net/bonding/bond_main.c | 40 +- drivers/net/can/mscan/mscan.c | 21 +- drivers/net/can/slcan.c | 16 +- drivers/net/can/usb/gs_usb.c | 4 +- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 5 - drivers/net/ethernet/natsemi/sonic.c | 113 +++- drivers/net/ethernet/natsemi/sonic.h | 25 +- drivers/net/ethernet/stmicro/stmmac/common.h | 5 +- drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +- drivers/net/hamradio/6pack.c | 4 +- drivers/net/hamradio/mkiss.c | 4 +- drivers/net/macvlan.c | 3 +- drivers/net/slip/slip.c | 12 +- drivers/net/usb/r8152.c | 3 + drivers/net/vxlan.c | 5 +- drivers/net/wireless/libertas/cfg.c | 18 +- drivers/net/wireless/mwifiex/sta_ioctl.c | 1 + drivers/net/wireless/mwifiex/tdls.c | 74 ++- drivers/pinctrl/pinctrl-baytrail.c | 212 ++++--- drivers/platform/x86/asus-wmi.c | 8 +- drivers/platform/x86/hp-wmi.c | 2 +- drivers/ptp/ptp_clock.c | 42 +- drivers/ptp/ptp_private.h | 9 +- drivers/ptp/ptp_sysfs.c | 162 +++--- drivers/scsi/fnic/vnic_dev.c | 20 +- drivers/scsi/qla4xxx/ql4_os.c | 1 - drivers/scsi/sd.c | 4 +- drivers/staging/android/ashmem.c | 28 + drivers/staging/rtl8188eu/os_dep/usb_intf.c | 3 +- drivers/staging/rtl8712/usb_intf.c | 2 +- drivers/staging/usbip/vhci_rx.c | 13 +- drivers/tty/serial/msm_serial.c | 13 +- drivers/tty/serial/serial_core.c | 1 + drivers/tty/vt/selection.c | 34 +- drivers/tty/vt/vt.c | 2 - drivers/usb/atm/ueagle-atm.c | 18 +- drivers/usb/core/config.c | 77 ++- drivers/usb/core/hub.c | 1 + drivers/usb/core/quirks.c | 37 ++ drivers/usb/core/urb.c | 1 + drivers/usb/core/usb.h | 3 + drivers/usb/dwc3/dwc3-pci.c | 30 + drivers/usb/host/ehci-q.c | 13 +- drivers/usb/host/xhci-hub.c | 8 +- drivers/usb/host/xhci-ring.c | 3 +- drivers/usb/misc/adutux.c | 2 +- drivers/usb/misc/idmouse.c | 2 +- drivers/usb/mon/mon_bin.c | 32 +- drivers/usb/musb/musbhsdma.c | 2 +- drivers/usb/serial/ch341.c | 6 +- drivers/usb/serial/io_edgeport.c | 26 +- drivers/usb/serial/keyspan.c | 4 + drivers/usb/serial/opticon.c | 2 +- drivers/usb/serial/quatech2.c | 6 + drivers/usb/serial/usb-serial-simple.c | 2 + drivers/usb/serial/usb-serial.c | 3 + drivers/vhost/net.c | 13 +- drivers/video/console/vgacon.c | 3 + drivers/virtio/virtio_balloon.c | 10 + firmware/Makefile | 2 +- fs/btrfs/Makefile | 2 +- fs/btrfs/ctree.c | 19 +- fs/btrfs/ctree.h | 157 +++--- fs/btrfs/dev-replace.c | 2 +- fs/btrfs/disk-io.c | 80 +-- fs/btrfs/extent-tree.c | 110 +++- fs/btrfs/extent_io.c | 98 ++-- fs/btrfs/extent_io.h | 25 +- fs/btrfs/extent_map.c | 2 +- fs/btrfs/extent_map.h | 10 +- fs/btrfs/inode.c | 8 +- fs/btrfs/ioctl.c | 10 +- fs/btrfs/relocation.c | 1 + fs/btrfs/root-tree.c | 10 +- fs/btrfs/scrub.c | 2 +- fs/btrfs/struct-funcs.c | 9 +- fs/btrfs/tree-checker.c | 649 ++++++++++++++++++++++ fs/btrfs/tree-checker.h | 38 ++ fs/btrfs/tree-log.c | 24 +- fs/btrfs/uuid-tree.c | 2 + fs/btrfs/volumes.c | 206 +++++-- fs/btrfs/volumes.h | 2 + fs/char_dev.c | 88 ++- fs/ext4/dir.c | 5 + fs/ext4/ext4.h | 13 + fs/ext4/extents.c | 89 +-- fs/ext4/file.c | 2 +- fs/ext4/inode.c | 117 +++- fs/ext4/super.c | 1 + fs/ext4/truncate.h | 2 + fs/inode.c | 1 + fs/locks.c | 2 +- fs/namei.c | 56 +- include/linux/blkdev.h | 10 +- include/linux/blktrace_api.h | 6 +- include/linux/cdev.h | 5 + include/linux/fs.h | 3 + include/linux/futex.h | 17 +- include/linux/if_ether.h | 8 + include/linux/kobject.h | 2 + include/linux/mod_devicetable.h | 4 +- include/linux/netfilter_arp/arp_tables.h | 2 +- include/linux/posix-clock.h | 19 +- include/linux/quotaops.h | 2 +- include/linux/usb/quirks.h | 3 + include/media/media-device.h | 5 +- include/media/media-devnode.h | 32 +- include/net/addrconf.h | 5 +- include/net/cfg80211.h | 11 + include/net/neighbour.h | 1 - kernel/futex.c | 93 ++-- kernel/sysctl.c | 18 + kernel/taskstats.c | 30 +- kernel/time/posix-clock.c | 31 +- kernel/trace/blktrace.c | 129 +++-- kernel/trace/ftrace.c | 6 +- kernel/trace/trace_sched_wakeup.c | 4 +- kernel/trace/trace_stack.c | 5 + lib/kobject.c | 5 +- mm/mempolicy.c | 6 +- net/8021q/vlan_netlink.c | 10 +- net/batman-adv/distributed-arp-table.c | 4 +- net/bridge/br_netfilter.c | 3 + net/bridge/netfilter/ebtables.c | 58 +- net/core/neighbour.c | 3 - net/ipv4/netfilter/arp_tables.c | 42 +- net/ipv4/netfilter/arptable_filter.c | 2 +- net/ipv4/tcp_input.c | 5 +- net/ipv4/tcp_output.c | 8 + net/ipv6/af_inet6.c | 2 +- net/mac80211/cfg.c | 55 +- net/mac80211/sta_info.c | 4 + net/netfilter/ipset/ip_set_bitmap_gen.h | 2 +- net/netfilter/ipset/ip_set_core.c | 3 +- net/netfilter/nf_conntrack_netlink.c | 3 + net/netfilter/nft_bitwise.c | 19 +- net/netfilter/nft_cmp.c | 18 +- net/packet/af_packet.c | 3 +- net/sched/ematch.c | 2 +- net/sched/sch_fq.c | 10 +- net/sctp/sm_sideeffect.c | 28 +- net/wireless/util.c | 45 ++ scripts/recordmcount.c | 17 + sound/core/pcm_native.c | 4 + sound/core/seq/seq_timer.c | 14 +- sound/pci/hda/patch_ca0132.c | 5 +- sound/pci/ice1712/ice1724.c | 9 +- sound/soc/codecs/wm8962.c | 4 +- sound/usb/pcm.c | 44 +- 197 files changed, 3377 insertions(+), 1229 deletions(-)
Al Viro (2):
do_last(): fetch directory ->i_mode and ->i_uid before it's too late
vfs: fix do_last() regression
Alan Cox (1):
usb: dwc3: pci: Add PCI ID for Intel Braswell
Alan Stern (1):
HID: Fix slab-out-of-bounds read in hid_field_extract
Alberto Aguirre (2):
ALSA: usb-audio: add implicit fb quirk for Axe-Fx II
ALSA: usb-audio: simplify set_sync_ep_implicit_fb_quirk
Alex Sverdlin (1):
ARM: 8950/1: ftrace/recordmcount: filter relocation types
Amir Goldstein (1):
locks: print unsigned ino in /proc/locks
Ard Biesheuvel (1):
x86/efistub: Disable paging at mixed mode entry
Arnd Bergmann (2):
btrfs: tree-checker: use %zu format string for size_t
scsi: fnic: fix invalid stack access
Avinash Patil (1):
mwifiex: fix probable memory corruption while processing TDLS frame
Ben Hutchings (1):
Linux 3.16.83
Brian Norris (1):
mwifiex: fix unbalanced locking in mwifiex_process_country_ie()
Cengiz Can (1):
blktrace: fix dereference after null check
Chao Yu (1):
quota: fix wrong condition in is_quota_modification()
Chen-Yu Tsai (1):
net: stmmac: dwmac-sunxi: Allow all RGMII modes
Christian Brauner (1):
taskstats: fix data-race
Christophe Leroy (1):
powerpc/irq: fix stack overflow verification
Cong Wang (2):
netfilter: fix a use-after-free in mtype_destroy()
net_sched: fix datalen for ematch
Dan Carpenter (1):
scsi: iscsi: qla4xxx: fix double free in probe
David Hildenbrand (1):
virtio-balloon: fix managed page counts when migrating pages between zones
David Sterba (6):
btrfs: new define for the inline extent data start
btrfs: kill extent_buffer_page helper
btrfs: cleanup, rename a few variables in btrfs_read_sys_array
btrfs: add more checks to btrfs_read_sys_array
btrfs: handle invalid num_stripes in sys_array
btrfs: tree-check: reduce stack consumption in check_dir_item
Davidlohr Bueso (1):
blktrace: re-write setting q->blk_trace
Dedy Lansky (1):
cfg80211/mac80211: make ieee80211_send_layer2_update a public function
Dmitry Torokhov (5):
HID: hid-input: clear unmapped usages
Input: add safety guards to input_set_keycode()
ptp: do not explicitly set drvdata in ptp_clock_register()
ptp: use is_visible method to hide unused attributes
ptp: create "pins" together with the rest of attributes
Emiliano Ingrassia (1):
usb: core: urb: fix URB structure initialization function
Eric Dumazet (9):
netfilter: bridge: make sure to pull arp header in br_nf_forward_arp()
neighbour: remove neigh_cleanup() method
bonding: fix bond_neigh_init()
6pack,mkiss: fix possible deadlock
tcp: do not send empty skb from tcp_write_xmit()
vlan: vlan_changelink() should propagate errors
pkt_sched: fq: do not accept silly TCA_FQ_QUANTUM
macvlan: do not assume mac_header is set in macvlan_broadcast()
macvlan: use skb_reset_mac_header() in macvlan_queue_xmit()
Erkka Talvitie (1):
USB: EHCI: Do not return -EPIPE when hub is disconnected
Eryu Guan (1):
ext4: update c/mtime on truncate up
Eugenio Pérez (1):
vhost: Check docket sk_family instead of call getname
Fabian Henneke (1):
hidraw: Return EPOLLOUT from hidraw_poll
Felipe Balbi (3):
usb: dwc3: pci: add support for Comet Lake PCH ID
usb: dwc3: pci: Add Support for Intel Elkhart Lake Devices
usb: dwc3: pci: add support for TigerLake Devices
Filipe Manana (3):
Btrfs: fix emptiness check for dirtied extent buffers at check_leaf()
Btrfs: fix removal logic of the tree mod log that leads to use-after-free issues
Btrfs: fix infinite loop during nocow writeback due to race
Finn Thain (4):
net/sonic: Add mutual exclusion for accessing shared state net/sonic: Use MMIO accessors
net/sonic: Fix receive buffer handling
net/sonic: Quiesce SONIC before re-initializing descriptor memory
Florian Faber (1):
can: mscan: mscan_rx_poll(): fix rx path lockup when returning from polling to irq mode
Florian Westphal (6):
netfilter: ctnetlink: netns exit must wait for callbacks
netfilter: ebtables: convert BUG_ONs to WARN_ONs
netfilter: ebtables: compat: reject all padding in matches/watchers
netfilter: arp_tables: init netns pointer in xt_tgchk_param struct
netfilter: ipset: avoid null deref when IPSET_ATTR_LINENO is present
netfilter: arp_tables: init netns pointer in xt_tgdtor_param struct
Geert Uytterhoeven (1):
gpio: Fix error message on out-of-range GPIO in lookup table
Goldwyn Rodrigues (1):
dm flakey: check for null arg_name in parse_features()
Gu Jinxiang (1):
btrfs: validate type when reading a chunk
Hangbin Liu (1):
vxlan: fix tos value before xmit
Hans de Goede (2):
pinctrl: baytrail: Really serialize all register accesses platform/x86: hp-wmi: Make buffer for HPWMI_FEATURE2_QUERY 128 bytes
Heikki Krogerus (8):
usb: dwc3: pci: add support for Intel Sunrise Point PCH
usb: dwc3: pci: add support for Intel Broxton SOC
usb: dwc3: pci: add ID for one more Intel Broxton platform
usb: dwc3: pci: add Intel Kabylake PCI ID
usb: dwc3: pci: add Intel Gemini Lake PCI ID
usb: dwc3: pci: add Intel Cannonlake PCI IDs
usb: dwc3: pci: add support for Intel IceLake
usb: dwc3: pci: add ID for the Intel Comet Lake -H variant
Hou Tao (1):
dm btree: increase rebalance threshold in __rebalance2()
James Bottomley (1):
scsi: enclosure: Fix stale device oops with hot replug
Jan Kara (7):
ext4: fix races between page faults and hole punching
ext4: move unlocked dio protection from ext4_alloc_file_blocks()
ext4: fix races between buffered IO and collapse / insert range
ext4: fix races of writeback with punch hole and zero range
ext4: check for directory entries too close to block end
kobject: Export kobject_get_unless_zero()
blktrace: Protect q->blk_trace with RCU
Jari Ruusu (1):
Fix built-in early-load Intel microcode alignment
Jeff Mahoney (2):
btrfs: cleanup, stop casting for extent_map->lookup everywhere
btrfs: struct-funcs, constify readers
Jerónimo Borque (1):
USB: serial: simple: Add Motorola Solutions TETRA MTP3xxx and MTP85xx
Jian-Hong Pan (1):
platform/x86: asus-wmi: Fix keyboard brightness cannot be set to 0
Jim Mattson (1):
kvm: x86: Host feature SSBD doesn't imply guest feature SPEC_CTRL_SSBD
Jiri Kosina (1):
HID: hidraw, uhid: Always report EPOLLOUT
Jiri Slaby (4):
vt: selection, handle pending signals in paste_selection
vt: selection, close sel_buffer race
vt: selection, push console lock down
vt: selection, push sel_lock up
Johan Hovold (29):
staging: gigaset: fix general protection fault on probe
staging: gigaset: fix illegal free on probe errors
staging: gigaset: add endpoint-type sanity check
USB: serial: io_edgeport: fix epic endpoint lookup
USB: idmouse: fix interface sanity checks
USB: adutux: fix interface sanity check
USB: atm: ueagle-atm: add missing endpoint check
staging: rtl8188eu: fix interface sanity check
staging: rtl8712: fix interface sanity check
USB: core: fix check for duplicate endpoints
USB: core: add endpoint-blacklist quirk
USB: quirks: blacklist duplicate ep on Sound Devices USBPre2
can: gs_usb: gs_usb_probe(): use descriptors of current altsetting
Input: aiptek - fix endpoint sanity check
Input: gtco - fix endpoint sanity check
Input: sur40 - fix interface sanity checks
ALSA: usb-audio: fix sync-ep altsetting sanity check
USB: serial: opticon: fix control-message timeouts
r8152: add missing endpoint sanity check
Input: keyspan-remote - fix control-message timeouts
USB: serial: suppress driver bind attributes
USB: serial: ch341: handle unbound port at reset_resume
USB: serial: io_edgeport: handle unbound ports on URB completion
USB: serial: io_edgeport: add missing active-port sanity check
USB: serial: keyspan: handle unbound ports
USB: serial: quatech2: handle unbound ports
media: ov519: add missing endpoint sanity checks
media: stv06xx: add missing descriptor sanity checks
media: xirlink_cit: add missing descriptor sanity checks
Johannes Thumshirn (1):
btrfs: ensure that a DUP or RAID1 block group has exactly two stripes
Jose Abreu (2):
net: stmmac: 16KB buffer must be 16 byte aligned
net: stmmac: Enable 16KB buffer size
Josef Bacik (9):
ext4: only call ext4_truncate when size <= isize
Btrfs: fix em leak in find_first_block_group
btrfs: do not call synchronize_srcu() in inode_tree_del
btrfs: abort transaction after failed inode updates in create_subvol
btrfs: handle ENOENT in btrfs_uuid_tree_iterate
btrfs: skip log replay on orphaned roots
btrfs: do not leak reloc root if we fail to read the fs root
btrfs: do not delete mismatched root refs
btrfs: check rw_devices, not num_devices for balance
Jouni Malinen (1):
mac80211: Do not send Layer 2 Update frame before authorization
Kaitao Cheng (1):
kernel/trace: Fix do not unregister tracepoints when register sched_migrate_task fail
Keiya Nobuta (1):
usb: core: hub: Improved device recognition on remote wakeup
Kenneth Klette Jonassen (1):
pkt_sched: fq: avoid hang when quantum 0
Lars Möllendorf (1):
iio: buffer: align the size of scan bytes to size of the largest element
Leo Yan (1):
tty: serial: msm_serial: Fix lockup for sysrq and oops
Linus Torvalds (1):
floppy: check FDC index for errors before assigning it
Liu Bo (9):
Btrfs: add validadtion checks for chunk loading
Btrfs: check inconsistence between chunk and block group
Btrfs: detect corruption when non-root leaf has zero item
Btrfs: check btree node's nritems
Btrfs: fix BUG_ON in btrfs_mark_buffer_dirty
Btrfs: memset to avoid stale content in btree node block
Btrfs: improve check_node to avoid reading corrupted nodes
Btrfs: kill BUG_ON in run_delayed_tree_ref
Btrfs: memset to avoid stale content in btree leaf
Logan Gunthorpe (1):
chardev: add helper function to register char devs with a struct device
Lu Fengqi (1):
btrfs: Remove redundant btrfs_release_path from btrfs_unlink_subvol
Lukas Czerner (1):
ext4: wait for existing dio workers in ext4_alloc_file_blocks()
Luuk Paulussen (1):
hwmon: (adt7475) Make volt2reg return same reg as reg2volt input
Mao Wenan (2):
af_packet: set defaule value for tmo
net: sonic: return NETDEV_TX_OK if failed to map buffer
Marcel Holtmann (2):
HID: uhid: Fix returning EPOLLOUT from uhid_char_poll
HID: hidraw: Fix returning EPOLLOUT from hidraw_poll
Mathias Nyman (2):
xhci: handle some XHCI_TRUST_TX_LENGTH quirks cases as default behaviour.
xhci: make sure interrupts are restored to correct state
Mauro Carvalho Chehab (3):
media-devnode: just return 0 instead of using a var
media-devnode: fix namespace mess
media-device: dynamically allocate struct media_devnode
Max Kellermann (2):
drivers/media/media-devnode: clear private_data before put_device()
media-devnode: add missing mutex lock in error handler
Michael Straube (1):
staging: rtl8188eu: Add device code for TP-Link TL-WN727N v5.21
Michał Mirosław (1):
mmc: sdhci: fix minimum clock rate for v3 controller
Mika Westerberg (4):
pinctrl: baytrail: Relax GPIO request rules
pinctrl: baytrail: Clear interrupt triggering from pins that are in GPIO mode
pinctrl: baytrail: Rework interrupt handling
pinctrl: baytrail: Serialize all register access
Mike Snitzer (1):
dm flakey: fix reads to be issued if drop_writes configured
Mikulas Patocka (1):
block: fix an integer overflow in logical block size
Moni Shoua (1):
IB/mlx4: Avoid executing gid task when device is being removed
Nicolai Stange (2):
libertas: don't exit from lbs_ibss_join_existing() with RCU read lock held
libertas: make lbs_ibss_join_existing() return error code on rates overflow
Nikos Tsironis (1):
dm thin metadata: Add support for a pre-commit callback
Pablo Neira Ayuso (2):
netfilter: nf_tables: missing sanitization in data from userspace
netfilter: nf_tables: validate NFT_DATA_VALUE after nft_data_init()
Paolo Bonzini (1):
KVM: nVMX: Don't emulate instructions in guest mode
Parav Pandit (1):
IB/mlx4: Follow mirror sequence of device add during device removal
Paul Cercueil (1):
usb: musb: dma: Correct parameter passed to IRQ handler
Pavel Tatashin (1):
x86/pti/efi: broken conversion from efi to kernel page table
Pengcheng Yang (1):
tcp: fix "old stuff" D-SACK causing SACK to be treated as D-SACK
Pete Zaitcev (1):
usb: mon: Fix a deadlock in usbmon between mmap and read
Peter Hurley (1):
tty: vt: Fix !TASK_RUNNING diagnostic warning from paste_selection()
Peter Zijlstra (1):
futex: Fix inode life-time issue
Qu Wenruo (14):
btrfs: Enhance chunk validation check
btrfs: Refactor check_leaf function for later expansion
btrfs: Check if item pointer overlaps with the item itself
btrfs: Add sanity check for EXTENT_DATA when reading out leaf
btrfs: Add checker for EXTENT_CSUM
btrfs: Move leaf and node validation checker to tree-checker.c
btrfs: tree-checker: Enhance btrfs_check_node output
btrfs: tree-checker: Fix false panic for sanity test
btrfs: tree-checker: Add checker for dir item
btrfs: tree-checker: Verify block_group_item
btrfs: tree-checker: Detect invalid and empty essential trees
btrfs: Check that each block group has corresponding chunk at mount time
btrfs: Verify that every chunk has corresponding block group at mount time
btrfs: tree-checker: Check level for leaves and nodes
Radoslaw Tyl (1):
ixgbevf: Remove limit of 10 entries for unicast filter list
Rafael J. Wysocki (1):
ACPI: PM: Avoid attaching ACPI PM domain to certain devices
Randy Dunlap (1):
mm: mempolicy: require at least one nodeid for MPOL_PREFERRED
Richard Palethorpe (2):
can, slip: Protect tty->disc_data in write_wakeup and close with RCU
slcan: Don't transmit uninitialized stack data in padding
Russell King (2):
gpiolib: fix up emulated open drain outputs
mod_devicetable: fix PHY module format
Sabrina Dubroca (1):
net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
Salvatore Mesoraca (1):
namei: allow restricted O_CREAT of FIFOs and regular files
Shaokun Zhang (1):
btrfs: tree-checker: Fix misleading group system information
Shengjiu Wang (1):
ASoC: wm8962: fix lambda value
Shuah Khan (3):
media: Fix media_open() to clear filp->private_data in error leg
media: fix use-after-free in cdev_put() when app exits after driver unbind
media: fix media devnode ioctl/syscall and unregister race
Steven Rostedt (VMware) (1):
tracing: Have stack tracer compile when MCOUNT_INSN_SIZE is not defined
Sudip Mukherjee (2):
tty: link tty and port before configuring it as console
tty: always relink the port
Suren Baghdasaryan (1):
staging: android: ashmem: Disallow ashmem memory from being remapped
Suwan Kim (1):
usbip: Fix error path of vhci_recv_ret_submit()
Sven Eckelmann (1):
batman-adv: Fix DAT candidate selection on little endian systems
Takashi Iwai (4):
ALSA: pcm: Avoid possible info leaks from PCM stream buffers
ALSA: hda/ca0132 - Avoid endless loop
ALSA: ice1724: Fix sleep-in-atomic in Infrasonic Quartet support code
ALSA: seq: Fix racy access for queue timer in proc read
Thomas Gleixner (1):
futex: Unbreak futex hashing
Tom Lendacky (1):
x86/microcode/AMD: Add support for fam17h microcode loading
Vivek Goyal (1):
dm: do not override error code returned from dm_get_device()
Vladis Dronov (2):
ptp: fix the race between the release of ptp_clock and cdev
ptp: free ptp device pin descriptors properly
Wang Shilong (1):
Btrfs: fix wrong max inline data size limit
Wei Yongjun (1):
dm flakey: return -EINVAL on interval bounds error in flakey_ctr()
Wen Huang (1):
libertas: Fix two buffer overflows at parsing bss descriptor
Wen Yang (1):
ftrace: Avoid potential division by zero in function profiler
Will Deacon (1):
chardev: Avoid potential use-after-free in 'chrdev_open()'
Xiang Chen (1):
scsi: sd: Clear sdkp->protection_type if disk is reformatted without PI
Xin Long (1):
sctp: free cmd->obj.chunk for the unprocessed SCTP_CMD_REPLY
YueHaibing (1):
ptp: Fix pass zero to ERR_PTR() in ptp_clock_register
Zhang Xiaoxu (1):
vgacon: Fix a UAF in vgacon_invert_region
qize wang (1):
mwifiex: Fix heap overflow in mmwifiex_process_tdls_action_frame()
Documentation/sysctl/fs.txt +36 -0
@@ -34,7 +34,9 @@ before actually making adjustments. - overflowgid - pipe-user-pages-hard - pipe-user-pages-soft +- protected_fifos - protected_hardlinks +- protected_regular - protected_symlinks - suid_dumpable - super-max
@@ -182,6 +184,24 @@ applied. ============================================================== +protected_fifos: + +The intent of this protection is to avoid unintentional writes to +an attacker-controlled FIFO, where a program expected to create a regular +file. + +When set to "0", writing to FIFOs is unrestricted. + +When set to "1" don't allow O_CREAT open on FIFOs that we don't own +in world writable sticky directories, unless they are owned by the +owner of the directory. + +When set to "2" it also applies to group writable sticky directories. + +This protection is based on the restrictions in Openwall. + +============================================================== + protected_hardlinks: A long-standing class of security issues is the hardlink-based
@@ -202,6 +222,22 @@ This protection is based on the restrictions in Openwall and grsecurity. ============================================================== +protected_regular: + +This protection is similar to protected_fifos, but it +avoids writes to an attacker-controlled regular file, where a program +expected to create one. + +When set to "0", writing to regular files is unrestricted. + +When set to "1" don't allow O_CREAT open on regular files that we +don't own in world writable sticky directories, unless they are +owned by the owner of the directory. + +When set to "2" it also applies to group writable sticky directories. + +============================================================== + protected_symlinks: A long-standing class of security issues is the symlink-based
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 16 -SUBLEVEL = 82 +SUBLEVEL = 83 EXTRAVERSION = NAME = Museum of Fishiegoodies
arch/powerpc/kernel/irq.c +2 -2
@@ -471,8 +471,6 @@ void __do_irq(struct pt_regs *regs)trace_irq_entry (regs); -check_stack_overflow (); -/* * Query the platform PIC for the interrupt & ack it. *
@@ -504,6 +502,8 @@ void do_IRQ(struct pt_regs *regs) irqtp = hardirq_ctx[raw_smp_processor_id ()]; sirqtp = softirq_ctx[raw_smp_processor_id ()]; +check_stack_overflow (); +/* Already there ? */ if (unlikely (curtp == irqtp || curtp == sirqtp)) {__do_irq (regs);
arch/x86/boot/compressed/head_64.S +5 -0
@@ -216,6 +216,11 @@ ENTRY(efi32_stub_entry) leal efi32_config(%ebp), %eax movl %eax, efi_config(%ebp) + /* Disable paging */ + movl %cr0, %eax + btrl $X86_CR0_PG_BIT, %eax + movl %eax, %cr0 + jmp startup_32 ENDPROC(efi32_stub_entry) #endif
arch/x86/include/asm/kaiser.h +10 -0
@@ -19,6 +19,16 @@#define KAISER_SHADOW_PGD_OFFSET 0x1000 +#ifdef CONFIG_PAGE_TABLE_ISOLATION +/* +* A page table address must have this alignment to stay the same when +* KAISER_SHADOW_PGD_OFFSET mask is applied +*/ +#define KAISER_KERNEL_PGD_ALIGNMENT (KAISER_SHADOW_PGD_OFFSET << 1) +#else +#define KAISER_KERNEL_PGD_ALIGNMENT PAGE_SIZE +#endif +#ifdef __ASSEMBLY__#ifdef CONFIG_PAGE_TABLE_ISOLATION
arch/x86/kernel/cpu/microcode/amd.c +4 -0
@@ -154,6 +154,7 @@ static unsigned int verify_patch_size(u8 family, u32 patch_size,#define F14H_MPB_MAX_SIZE 1824#define F15H_MPB_MAX_SIZE 4096#define F16H_MPB_MAX_SIZE 3458 +#define F17H_MPB_MAX_SIZE 3200switch (family) {case 0x14 :
@@ -165,6 +166,9 @@ static unsigned int verify_patch_size(u8 family, u32 patch_size,case 0x16 : max_size =F16H_MPB_MAX_SIZE ;break ; +case 0x17 : + max_size =F17H_MPB_MAX_SIZE ; +break ;default : max_size =F1XH_MPB_MAX_SIZE ;break ;
arch/x86/kvm/cpuid.c +2 -1
@@ -400,7 +400,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, entry->edx |=F (SPEC_CTRL );if (boot_cpu_has (X86_FEATURE_STIBP )) entry->edx |=F (INTEL_STIBP ); -if (boot_cpu_has (X86_FEATURE_SSBD )) +if (boot_cpu_has (X86_FEATURE_SPEC_CTRL_SSBD ) || +boot_cpu_has (X86_FEATURE_AMD_SSBD )) entry->edx |=F (SPEC_CTRL_SSBD );/* * We emulate ARCH_CAPABILITIES in software even
arch/x86/kvm/vmx.c +1 -1
@@ -8938,7 +8938,7 @@ static int vmx_check_intercept(struct kvm_vcpu *vcpu,struct x86_instruction_info *info, enum x86_intercept_stage stage) { - return X86EMUL_CONTINUE; + return X86EMUL_UNHANDLEABLE; } static struct kvm_x86_ops vmx_x86_ops = {
arch/x86/realmode/init.c +3 -1
@@ -4,6 +4,7 @@#include <asm/cacheflush.h> #include <asm/pgtable.h> #include <asm/realmode.h> +#include <asm/kaiser.h> struct real_mode_header *real_mode_header;u32 *trampoline_cr4_features;
@@ -15,7 +16,8 @@ void __init reserve_real_mode(void)size_t size =PAGE_ALIGN (real_mode_blob_end - real_mode_blob);/* Has to be under 1M so we can execute real-mode AP code. */ - mem =memblock_find_in_range (0 ,1 <<20 , size,PAGE_SIZE ); + mem =memblock_find_in_range (0 ,1 <<20 , size, +KAISER_KERNEL_PGD_ALIGNMENT );if (!mem)panic ("Cannot allocate trampoline\n" );
arch/x86/realmode/rm/trampoline_64.S +2 -1
@@ -30,6 +30,7 @@ #include <asm/msr.h> #include <asm/segment.h> #include <asm/processor-flags.h> +#include <asm/kaiser.h> #include "realmode.h" .text
@@ -139,7 +140,7 @@ ENTRY(startup_64) tr_gdt_end: .bss - .balign PAGE_SIZE + .balign KAISER_KERNEL_PGD_ALIGNMENT GLOBAL(trampoline_pgd) .space PAGE_SIZE .balign 8
block/blk-settings.c +1 -1
@@ -373,7 +373,7 @@ EXPORT_SYMBOL(blk_queue_max_segment_size);* storage device can address. The default of 512 covers most * hardware. **/ -void blk_queue_logical_block_size (struct request_queue *q,unsigned short size) +void blk_queue_logical_block_size (struct request_queue *q,unsigned int size) { q->limits.logical_block_size = size;
drivers/acpi/device_pm.c +11 -1
@@ -1041,9 +1041,19 @@ static struct dev_pm_domain acpi_general_pm_domain = {*/ int acpi_dev_pm_attach (struct device *dev,bool power_on) { +/* +* Skip devices whose ACPI companions match the device IDs below, +* because they require special power management handling incompatible +* with the generic ACPI PM domain. +*/ +static const struct acpi_device_id special_pm_ids[] = { + {"PNP0C0B" , },/* Generic ACPI fan */ + {"INT3404" , },/* Fan */ + {} + };struct acpi_device *adev =ACPI_COMPANION (dev); -if (!adev) +if (!adev || !acpi_match_device_ids (adev, special_pm_ids))return -ENODEV ;if (dev->pm_domain)
drivers/block/floppy.c +5 -2
@@ -847,14 +847,17 @@ static void reset_fdc_info(int mode)/* selects the fdc and drive, and enables the fdc's input/dma. */ static void set_fdc (int drive) { +unsigned int new_fdc = fdc; +if (drive >=0 && drive <N_DRIVE ) { - fdc =FDC (drive); + new_fdc =FDC (drive); current_drive = drive; } -if (fdc !=1 && fdc !=0 ) { +if (new_fdc >=N_FDC ) {pr_info ("bad fdc value\n" );return ; } + fdc = new_fdc;set_dor (fdc, ~0 ,8 );#if N_FDC >1 set_dor (1 - fdc, ~8 ,0 );
drivers/gpio/gpiolib.c +11 -2
@@ -273,6 +273,14 @@ int gpiod_get_direction(const struct gpio_desc *desc) chip =gpiod_to_chip (desc); offset =gpio_chip_hwgpio (desc); +/* +* Open drain emulation using input mode may incorrectly report +* input here, fix that up. +*/ +if (test_bit (FLAG_OPEN_DRAIN , &desc->flags) && +test_bit (FLAG_IS_OUT , &desc->flags)) +return 0 ; +if (!chip->get_direction)return status;
@@ -2743,8 +2751,9 @@ static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id,if (chip->ngpio <= p->chip_hwnum) {dev_err (dev, -"requested GPIO %d is out of range [0..%d] for chip %s\n" , - idx, chip->ngpio, chip->label); +"requested GPIO %u (%u) is out of range [0..%u] for chip %s\n" , + idx, p->chip_hwnum, chip->ngpio -1 , + chip->label);return ERR_PTR (-EINVAL ); }
drivers/hid/hid-core.c +6 -0
@@ -248,6 +248,12 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign offset = report->size; report->size += parser->global.report_size * parser->global.report_count; +/* Total size check: Allow for possible report index byte */ +if (report->size > (HID_MAX_BUFFER_SIZE -1 ) <<3 ) { +hid_err (parser->device,"report is too long\n" ); +return -1 ; + } +if (!parser->local.usage_index)/* Ignore padding fields */ return 0 ;
drivers/hid/hid-input.c +12 -4
@@ -947,9 +947,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel } mapped: -if (device->driver->input_mapped && device->driver->input_mapped (device, - hidinput, field, usage, &bit, &max) <0 ) - goto ignore; +if (device->driver->input_mapped && + device->driver->input_mapped (device, hidinput, field, usage, + &bit, &max) <0 ) { +/* +* The driver indicated that no further generic handling +* of the usage is desired. +*/ +return ; + }set_bit (usage->type, input->evbit);
@@ -1008,9 +1014,11 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielset_bit (MSC_SCAN , input->mscbit); } -ignore:return ; +ignore: + usage->type =0 ; + usage->code =0 ; }void hidinput_hid_event (struct hid_device *hid,struct hid_field *field,struct hid_usage *usage,__s32 value)
drivers/hid/hidraw.c +4 -3
@@ -262,13 +262,14 @@ static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_tstatic unsigned int hidraw_poll (struct file *file,poll_table *wait) {struct hidraw_list *list = file->private_data; +unsigned int mask =POLLOUT |POLLWRNORM ;/* hidraw is always writable */ poll_wait (file, &list->hidraw->wait, wait);if (list->head != list->tail) -return POLLIN |POLLRDNORM ; + mask |=POLLIN |POLLRDNORM ;if (!list->hidraw->exist) -return POLLERR |POLLHUP ; -return 0 ; + mask |=POLLERR |POLLHUP ; +return mask; }static int hidraw_open (struct inode *inode,struct file *file)
drivers/hid/uhid.c +3 -2
@@ -720,13 +720,14 @@ static ssize_t uhid_char_write(struct file *file, const char __user *buffer,static unsigned int uhid_char_poll (struct file *file,poll_table *wait) {struct uhid_device *uhid = file->private_data; +unsigned int mask =POLLOUT |POLLWRNORM ;/* uhid is always writable */ poll_wait (file, &uhid->waitq, wait);if (uhid->head != uhid->tail) -return POLLIN |POLLRDNORM ; + mask |=POLLIN |POLLRDNORM ; -return 0 ; +return mask; }static const struct file_operations uhid_fops = {
drivers/hwmon/adt7475.c +3 -2
@@ -268,9 +268,10 @@ static inline u16 volt2reg(int channel, long volt, u8 bypass_attn)long reg;if (bypass_attn & (1 << channel)) - reg = (volt *1024 ) /2250 ; + reg =DIV_ROUND_CLOSEST (volt *1024 ,2250 );else - reg = (volt * r[1 ] *1024 ) / ((r[0 ] + r[1 ]) *2250 ); + reg =DIV_ROUND_CLOSEST (volt * r[1 ] *1024 , + (r[0 ] + r[1 ]) *2250 );return clamp_val (reg,0 ,1023 ) & (0xff <<2 ); }
drivers/iio/industrialio-buffer.c +5 -1
@@ -478,7 +478,7 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, {const struct iio_chan_spec *ch;unsigned bytes =0 ; -int length, i; +int length, i, largest =0 ;/* How much space will the demuxed element take? */ for_each_set_bit(i, mask,
@@ -491,6 +491,7 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, length = ch->scan_type.storagebits /8 ; bytes =ALIGN (bytes, length); bytes += length; + largest =max (largest, length); }if (timestamp) { ch = iio_find_channel_from_si(indio_dev,
@@ -502,7 +503,10 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, length = ch->scan_type.storagebits /8 ; bytes =ALIGN (bytes, length); bytes += length; + largest =max (largest, length); } + + bytes =ALIGN (bytes, largest);return bytes; }
drivers/infiniband/hw/mlx4/main.c +13 -3
@@ -1395,6 +1395,9 @@ static void update_gids_task(struct work_struct *work)int err;struct mlx4_dev *dev = gw->dev->dev; +if (!gw->dev->ib_active) +return ; + mailbox =mlx4_alloc_cmd_mailbox (dev);if (IS_ERR (mailbox)) {pr_warn ("update gid table failed %ld\n" ,PTR_ERR (mailbox));
@@ -1425,6 +1428,9 @@ static void reset_gids_task(struct work_struct *work)int err;struct mlx4_dev *dev = gw->dev->dev; +if (!gw->dev->ib_active) +return ; + mailbox =mlx4_alloc_cmd_mailbox (dev);if (IS_ERR (mailbox)) {pr_warn ("reset gid table failed\n" );
@@ -2363,15 +2369,19 @@ static void mlx4_ib_remove(struct mlx4_dev *dev, void *ibdev_ptr)struct mlx4_ib_dev *ibdev = ibdev_ptr;int p; -mlx4_ib_close_sriov (ibdev); -mlx4_ib_mad_cleanup (ibdev); -ib_unregister_device (&ibdev->ib_dev); + ibdev->ib_active = false; +flush_workqueue (wq); +if (ibdev->iboe.nb.notifier_call) {if (unregister_netdevice_notifier (&ibdev->iboe.nb))pr_warn ("failure unregistering notifier\n" ); ibdev->iboe.nb.notifier_call =NULL ; } +mlx4_ib_close_sriov (ibdev); +mlx4_ib_mad_cleanup (ibdev); +ib_unregister_device (&ibdev->ib_dev); +mlx4_qp_release_range (dev, ibdev->steer_qpn_base, ibdev->steer_qpn_count);kfree (ibdev->ib_uc_qpns_bitmap);
drivers/input/input.c +16 -10
@@ -841,16 +841,18 @@ static int input_default_setkeycode(struct input_dev *dev, } } -__clear_bit (*old_keycode, dev->keybit); -__set_bit (ke->keycode, dev->keybit); - -for (i =0 ; i < dev->keycodemax; i++) { -if (input_fetch_keycode (dev, i) == *old_keycode) { -__set_bit (*old_keycode, dev->keybit); -break ;/* Setting the bit twice is useless, so break */ +if (*old_keycode <=KEY_MAX ) { +__clear_bit (*old_keycode, dev->keybit); +for (i =0 ; i < dev->keycodemax; i++) { +if (input_fetch_keycode (dev, i) == *old_keycode) { +__set_bit (*old_keycode, dev->keybit); +/* Setting the bit twice is useless, so break */ +break ; + } } } +__set_bit (ke->keycode, dev->keybit);return 0 ; }
@@ -906,9 +908,13 @@ int input_set_keycode(struct input_dev *dev,* Simulate keyup event if keycode is not present * in the keymap anymore */ -if (test_bit (EV_KEY , dev->evbit) && - !is_event_supported (old_keycode, dev->keybit,KEY_MAX ) && -__test_and_clear_bit (old_keycode, dev->key)) { +if (old_keycode >KEY_MAX ) { +dev_warn (dev->dev.parent ?: &dev->dev, +"%s: got too big old keycode %#x\n" , + __func__, old_keycode); + }else if (test_bit (EV_KEY , dev->evbit) && + !is_event_supported (old_keycode, dev->keybit,KEY_MAX ) && +__test_and_clear_bit (old_keycode, dev->key)) {struct input_value vals[] = { {EV_KEY , old_keycode,0 }, input_value_sync
drivers/input/misc/keyspan_remote.c +6 -3
@@ -344,7 +344,8 @@ static int keyspan_setup(struct usb_device* dev)int retval =0 ; retval =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), -0x11 ,0x40 ,0x5601 ,0x0 ,NULL ,0 ,0 ); +0x11 ,0x40 ,0x5601 ,0x0 ,NULL ,0 , +USB_CTRL_SET_TIMEOUT );if (retval) {dev_dbg (&dev->dev,"%s - failed to set bit rate due to error: %d\n" , __func__, retval);
@@ -352,7 +353,8 @@ static int keyspan_setup(struct usb_device* dev) } retval =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), -0x44 ,0x40 ,0x0 ,0x0 ,NULL ,0 ,0 ); +0x44 ,0x40 ,0x0 ,0x0 ,NULL ,0 , +USB_CTRL_SET_TIMEOUT );if (retval) {dev_dbg (&dev->dev,"%s - failed to set resume sensitivity due to error: %d\n" , __func__, retval);
@@ -360,7 +362,8 @@ static int keyspan_setup(struct usb_device* dev) } retval =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), -0x22 ,0x40 ,0x0 ,0x0 ,NULL ,0 ,0 ); +0x22 ,0x40 ,0x0 ,0x0 ,NULL ,0 , +USB_CTRL_SET_TIMEOUT );if (retval) {dev_dbg (&dev->dev,"%s - failed to turn receive on due to error: %d\n" , __func__, retval);
drivers/input/tablet/aiptek.c +3 -3
@@ -1820,14 +1820,14 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)input_set_abs_params (inputdev,ABS_WHEEL ,AIPTEK_WHEEL_MIN ,AIPTEK_WHEEL_MAX -1 ,0 ,0 );/* Verify that a device really has an endpoint */ -if (intf->altsetting[0 ].desc.bNumEndpoints <1 ) { +if (intf->cur_altsetting->desc.bNumEndpoints <1 ) {dev_err (&intf->dev,"interface has %d endpoints, but must have minimum 1\n" , - intf->altsetting[0 ].desc.bNumEndpoints); + intf->cur_altsetting->desc.bNumEndpoints); err = -EINVAL ; goto fail3; } - endpoint = &intf->altsetting[0 ].endpoint[0 ].desc; + endpoint = &intf->cur_altsetting->endpoint[0 ].desc;/* Go set up our URB, which is called when the tablet receives * input.
drivers/input/tablet/gtco.c +3 -7
@@ -886,18 +886,14 @@ static int gtco_probe(struct usb_interface *usbinterface, }/* Sanity check that a device has an endpoint */ -if (usbinterface->altsetting[0 ].desc.bNumEndpoints <1 ) { +if (usbinterface->cur_altsetting->desc.bNumEndpoints <1 ) {dev_err (&usbinterface->dev,"Invalid number of endpoints\n" ); error = -EINVAL ; goto err_free_urb; } -/* -* The endpoint is always altsetting 0, we know this since we know -* this device only has one interrupt endpoint -*/ - endpoint = &usbinterface->altsetting[0 ].endpoint[0 ].desc; + endpoint = &usbinterface->cur_altsetting->endpoint[0 ].desc;/* Some debug */ dev_dbg (&usbinterface->dev,"gtco # interfaces: %d\n" , usbinterface->num_altsetting);
@@ -984,7 +980,7 @@ static int gtco_probe(struct usb_interface *usbinterface, input_dev->dev.parent = &usbinterface->dev;/* Setup the URB, it will be posted later on open of input device */ - endpoint = &usbinterface->altsetting[0 ].endpoint[0 ].desc; + endpoint = &usbinterface->cur_altsetting->endpoint[0 ].desc; usb_fill_int_urb(gtco->urbinfo, gtco->usbdev,
drivers/input/touchscreen/sur40.c +1 -1
@@ -357,7 +357,7 @@ static int sur40_probe(struct usb_interface *interface,int error;/* Check if we really have the right interface. */ - iface_desc = &interface->altsetting[0 ]; + iface_desc = interface->cur_altsetting;if (iface_desc->desc.bInterfaceClass !=0xFF )return -ENODEV ;
drivers/isdn/gigaset/usb-gigaset.c +18 -5
@@ -578,8 +578,7 @@ static int gigaset_initcshw(struct cardstate *cs) {struct usb_cardstate *ucs; - cs->hw.usb = ucs = -kmalloc (sizeof (struct usb_cardstate ),GFP_KERNEL ); + cs->hw.usb = ucs =kzalloc (sizeof (struct usb_cardstate ),GFP_KERNEL );if (!ucs) {pr_err ("out of memory\n" );return -ENOMEM ;
@@ -591,9 +590,6 @@ static int gigaset_initcshw(struct cardstate *cs) ucs->bchars[3 ] =0 ; ucs->bchars[4 ] =0x11 ; ucs->bchars[5 ] =0x13 ; - ucs->bulk_out_buffer =NULL ; - ucs->bulk_out_urb =NULL ; - ucs->read_urb =NULL ;tasklet_init (&cs->write_tasklet, gigaset_modem_fill, (unsigned long ) cs);
@@ -693,6 +689,11 @@ static int gigaset_probe(struct usb_interface *interface,return -ENODEV ; } +if (hostif->desc.bNumEndpoints <2 ) { +dev_err (&interface->dev,"missing endpoints\n" ); +return -ENODEV ; + } +dev_info (&udev->dev,"%s: Device matched ... !\n" , __func__);/* allocate memory for our device state and initialize it */
@@ -712,6 +713,12 @@ static int gigaset_probe(struct usb_interface *interface, endpoint = &hostif->endpoint[0 ].desc; +if (!usb_endpoint_is_bulk_out (endpoint)) { +dev_err (&interface->dev,"missing bulk-out endpoint\n" ); + retval = -ENODEV ; + goto error; + } + buffer_size =le16_to_cpu (endpoint->wMaxPacketSize); ucs->bulk_out_size = buffer_size; ucs->bulk_out_endpointAddr = endpoint->bEndpointAddress;
@@ -731,6 +738,12 @@ static int gigaset_probe(struct usb_interface *interface, endpoint = &hostif->endpoint[1 ].desc; +if (!usb_endpoint_is_int_in (endpoint)) { +dev_err (&interface->dev,"missing int-in endpoint\n" ); + retval = -ENODEV ; + goto error; + } + ucs->busy =0 ; ucs->read_urb =usb_alloc_urb (0 ,GFP_KERNEL );
drivers/md/dm-crypt.c +3 -1
@@ -1762,11 +1762,13 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) } cc->iv_offset = tmpll; -if (dm_get_device (ti, argv[3 ],dm_table_get_mode (ti->table), &cc->dev)) { + ret =dm_get_device (ti, argv[3 ],dm_table_get_mode (ti->table), &cc->dev); +if (ret) { ti->error ="Device lookup failed" ; goto bad; } + ret = -EINVAL ;if (sscanf (argv[4 ],"%llu%c" , &tmpll, &dummy) !=1 ) { ti->error ="Invalid device sector" ; goto bad;
drivers/md/dm-delay.c +11 -5
@@ -129,6 +129,7 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)struct delay_c *dc;unsigned long long tmpll;char dummy; +int ret;if (argc !=3 && argc !=6 ) { ti->error ="requires exactly 3 or 6 arguments" ;
@@ -143,6 +144,7 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv) dc->reads = dc->writes =0 ; + ret = -EINVAL ;if (sscanf (argv[1 ],"%llu%c" , &tmpll, &dummy) !=1 ) { ti->error ="Invalid device sector" ; goto bad;
@@ -154,12 +156,14 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv) goto bad; } -if (dm_get_device (ti, argv[0 ],dm_table_get_mode (ti->table), - &dc->dev_read)) { + ret =dm_get_device (ti, argv[0 ],dm_table_get_mode (ti->table), + &dc->dev_read); +if (ret) { ti->error ="Device lookup failed" ; goto bad; } + ret = -EINVAL ; dc->dev_write =NULL ;if (argc ==3 ) goto out;
@@ -175,13 +179,15 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv) goto bad_dev_read; } -if (dm_get_device (ti, argv[3 ],dm_table_get_mode (ti->table), - &dc->dev_write)) { + ret =dm_get_device (ti, argv[3 ],dm_table_get_mode (ti->table), + &dc->dev_write); +if (ret) { ti->error ="Write device lookup failed" ; goto bad_dev_read; } out: + ret = -EINVAL ; dc->kdelayd_wq =alloc_workqueue ("kdelayd" ,WQ_MEM_RECLAIM ,0 );if (!dc->kdelayd_wq) {DMERR ("Couldn't start kdelayd" );
@@ -208,7 +214,7 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)dm_put_device (ti, dc->dev_read); bad:kfree (dc); -return -EINVAL ; +return ret; }static void delay_dtr (struct dm_target *ti)
drivers/md/dm-flakey.c +27 -13
@@ -69,6 +69,11 @@ static int parse_features(struct dm_arg_set *as, struct flakey_c *fc, arg_name =dm_shift_arg (as); argc--; +if (!arg_name) { + ti->error ="Insufficient feature arguments" ; +return -EINVAL ; + } +/* * drop_writes */
@@ -183,6 +188,7 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv) devname =dm_shift_arg (&as); + r = -EINVAL ;if (sscanf (dm_shift_arg (&as),"%llu%c" , &tmpll, &dummy) !=1 ) { ti->error ="Invalid device sector" ; goto bad;
@@ -199,11 +205,13 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)if (!(fc->up_interval + fc->down_interval)) { ti->error ="Total (up + down) interval is zero" ; + r = -EINVAL ; goto bad; }if (fc->up_interval + fc->down_interval < fc->up_interval) { ti->error ="Interval overflow" ; + r = -EINVAL ; goto bad; }
@@ -211,7 +219,8 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)if (r) goto bad; -if (dm_get_device (ti, devname,dm_table_get_mode (ti->table), &fc->dev)) { + r =dm_get_device (ti, devname,dm_table_get_mode (ti->table), &fc->dev); +if (r) { ti->error ="Device lookup failed" ; goto bad; }
@@ -224,7 +233,7 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv) bad:kfree (fc); -return -EINVAL ; +return r; }static void flakey_dtr (struct dm_target *ti)
@@ -287,15 +296,13 @@ static int flakey_map(struct dm_target *ti, struct bio *bio) pb->bio_submitted = true;/* -* Map reads as normal only if corrupt_bio_byte set. +* Error reads if neither corrupt_bio_byte or drop_writes are set. +* Otherwise, flakey_end_io() will decide if the reads should be modified. */ if (bio_data_dir (bio) ==READ ) { -/* If flags were specified, only corrupt those that match. */ -if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw ==READ ) && -all_corrupt_bio_flags_match (bio, fc)) - goto map_bio; -else +if (!fc->corrupt_bio_byte && !test_bit (DROP_WRITES , &fc->flags))return -EIO ; + goto map_bio; }/*
@@ -332,14 +339,21 @@ static int flakey_end_io(struct dm_target *ti, struct bio *bio, int error)struct flakey_c *fc = ti->private;struct per_bio_data *pb =dm_per_bio_data (bio,sizeof (struct per_bio_data )); -/* -* Corrupt successful READs while in down state. -*/ if (!error && pb->bio_submitted && (bio_data_dir (bio) ==READ )) { -if (fc->corrupt_bio_byte) +if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw ==READ ) && +all_corrupt_bio_flags_match (bio, fc)) { +/* +* Corrupt successful matching READs while in down state. +*/ corrupt_bio_data (bio, fc); -else + + }else if (!test_bit (DROP_WRITES , &fc->flags)) { +/* +* Error read during the down_interval if drop_writes +* wasn't configured. +*/ return -EIO ; + } }return error;
drivers/md/dm-linear.c +5 -2
@@ -30,6 +30,7 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv)struct linear_c *lc;unsigned long long tmp;char dummy; +int ret;if (argc !=2 ) { ti->error ="Invalid argument count" ;
@@ -42,13 +43,15 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv)return -ENOMEM ; } + ret = -EINVAL ;if (sscanf (argv[1 ],"%llu%c" , &tmp, &dummy) !=1 ) { ti->error ="dm-linear: Invalid device sector" ; goto bad; } lc->start = tmp; -if (dm_get_device (ti, argv[0 ],dm_table_get_mode (ti->table), &lc->dev)) { + ret =dm_get_device (ti, argv[0 ],dm_table_get_mode (ti->table), &lc->dev); +if (ret) { ti->error ="dm-linear: Device lookup failed" ; goto bad; }
@@ -61,7 +64,7 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv) bad:kfree (lc); -return -EINVAL ; +return ret; }static void linear_dtr (struct dm_target *ti)
drivers/md/dm-raid1.c +5 -3
@@ -923,16 +923,18 @@ static int get_mirror(struct mirror_set *ms, struct dm_target *ti, {unsigned long long offset;char dummy; +int ret;if (sscanf (argv[1 ],"%llu%c" , &offset, &dummy) !=1 ) { ti->error ="Invalid offset" ;return -EINVAL ; } -if (dm_get_device (ti, argv[0 ],dm_table_get_mode (ti->table), - &ms->mirror[mirror].dev)) { + ret =dm_get_device (ti, argv[0 ],dm_table_get_mode (ti->table), + &ms->mirror[mirror].dev); +if (ret) { ti->error ="Device lookup failure" ; -return -ENXIO ; +return ret; } ms->mirror[mirror].ms = ms;
drivers/md/dm-snap-persistent.c +1 -1
@@ -16,7 +16,7 @@#include "dm-bufio.h" #define DM_MSG_PREFIX "persistent snapshot" -#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32/* 16KB */ +#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32U/* 16KB */ #define DM_PREFETCH_CHUNKS 12
drivers/md/dm-stripe.c +5 -3
@@ -75,13 +75,15 @@ static int get_stripe(struct dm_target *ti, struct stripe_c *sc, {unsigned long long start;char dummy; +int ret;if (sscanf (argv[1 ],"%llu%c" , &start, &dummy) !=1 )return -EINVAL ; -if (dm_get_device (ti, argv[0 ],dm_table_get_mode (ti->table), - &sc->stripe[stripe].dev)) -return -ENXIO ; + ret =dm_get_device (ti, argv[0 ],dm_table_get_mode (ti->table), + &sc->stripe[stripe].dev); +if (ret) +return ret; sc->stripe[stripe].physical_start = start;
drivers/md/dm-thin-metadata.c +29 -0
@@ -197,6 +197,15 @@ struct dm_pool_metadata {*/ bool fail_io:1; +/* +* Pre-commit callback. +* +* This allows the thin provisioning target to run a callback before +* the metadata are committed. +*/ +dm_pool_pre_commit_fn pre_commit_fn; +void *pre_commit_context; +/* * Reading the space map roots can fail, so we read it into these * buffers before the superblock is locked and updated.
@@ -784,6 +793,14 @@ static int __commit_transaction(struct dm_pool_metadata *pmd)*/ BUILD_BUG_ON (sizeof (struct thin_disk_superblock ) >512 ); +if (pmd->pre_commit_fn) { + r = pmd->pre_commit_fn (pmd->pre_commit_context); +if (r <0 ) { +DMERR ("pre-commit callback failed" ); +return r; + } + } + r =__write_changed_details (pmd);if (r <0 )return r;
@@ -844,6 +861,8 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev, pmd->fail_io = false; pmd->bdev = bdev; pmd->data_block_size = data_block_size; + pmd->pre_commit_fn =NULL ; + pmd->pre_commit_context =NULL ; r =__create_persistent_data_objects (pmd, format_device);if (r) {
@@ -1789,6 +1808,16 @@ int dm_pool_register_metadata_threshold(struct dm_pool_metadata *pmd,return r; } +void dm_pool_register_pre_commit_callback (struct dm_pool_metadata *pmd, +dm_pool_pre_commit_fn fn, +void *context) +{ +down_write (&pmd->root_lock); + pmd->pre_commit_fn = fn; + pmd->pre_commit_context = context; +up_write (&pmd->root_lock); +} +int dm_pool_metadata_set_needs_check (struct dm_pool_metadata *pmd) {int r;
drivers/md/dm-thin-metadata.h +7 -0
@@ -213,6 +213,13 @@ int dm_pool_register_metadata_threshold(struct dm_pool_metadata *pmd,int dm_pool_metadata_set_needs_check (struct dm_pool_metadata *pmd);bool dm_pool_metadata_needs_check (struct dm_pool_metadata *pmd); +/* Pre-commit callback */ +typedef int (*dm_pool_pre_commit_fn )(void *context); + +void dm_pool_register_pre_commit_callback (struct dm_pool_metadata *pmd, +dm_pool_pre_commit_fn fn, +void *context); +/*----------------------------------------------------------------*/ #endif
drivers/md/persistent-data/dm-btree-remove.c +7 -1
@@ -203,7 +203,13 @@ static void __rebalance2(struct dm_btree_info *info, struct btree_node *parent,struct btree_node *right = r->n;uint32_t nr_left =le32_to_cpu (left->header.nr_entries);uint32_t nr_right =le32_to_cpu (right->header.nr_entries); -unsigned threshold =2 *merge_threshold (left) +1 ; +/* +* Ensure the number of entries in each child will be greater +* than or equal to (max_entries / 3 + 1), so no matter which +* child is used for removal, the number will still be not +* less than (max_entries / 3). +*/ +unsigned int threshold =2 * (merge_threshold (left) +1 );if (nr_left + nr_right < threshold) {/*
drivers/md/raid0.c +1 -1
@@ -88,7 +88,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)char b[BDEVNAME_SIZE ];char b2[BDEVNAME_SIZE ];struct r0conf *conf =kzalloc (sizeof (*conf),GFP_KERNEL ); -unsigned short blksize =512 ; +unsigned blksize =512 ;if (!conf)return -ENOMEM ;
drivers/media/media-device.c +31 -12
92 lines not on this page · raw message
drivers/media/media-devnode.c +98 -73
321 lines not on this page · raw message
drivers/media/usb/gspca/ov519.c +10 -0
@@ -3497,6 +3497,11 @@ static void ov511_mode_init_regs(struct sd *sd)return ; } +if (alt->desc.bNumEndpoints <1 ) { + sd->gspca_dev.usb_err = -ENODEV ; +return ; + } + packet_size =le16_to_cpu (alt->endpoint[0 ].desc.wMaxPacketSize);reg_w (sd, R51x_FIFO_PSIZE, packet_size >>5 );
@@ -3622,6 +3627,11 @@ static void ov518_mode_init_regs(struct sd *sd)return ; } +if (alt->desc.bNumEndpoints <1 ) { + sd->gspca_dev.usb_err = -ENODEV ; +return ; + } + packet_size =le16_to_cpu (alt->endpoint[0 ].desc.wMaxPacketSize);ov518_reg_w32 (sd, R51x_FIFO_PSIZE, packet_size & ~7 ,2 );
drivers/media/usb/gspca/stv06xx/stv06xx.c +18 -1
@@ -293,6 +293,9 @@ static int stv06xx_start(struct gspca_dev *gspca_dev)return -EIO ; } +if (alt->desc.bNumEndpoints <1 ) +return -ENODEV ; + packet_size =le16_to_cpu (alt->endpoint[0 ].desc.wMaxPacketSize); err =stv06xx_write_bridge (sd,STV_ISO_SIZE_L , packet_size);if (err <0 )
@@ -317,11 +320,21 @@ static int stv06xx_start(struct gspca_dev *gspca_dev)static int stv06xx_isoc_init (struct gspca_dev *gspca_dev) { +struct usb_interface_cache *intfc;struct usb_host_interface *alt;struct sd *sd = (struct sd *) gspca_dev; + intfc = gspca_dev->dev->actconfig->intf_cache[0 ]; + +if (intfc->num_altsetting <2 ) +return -ENODEV ; + + alt = &intfc->altsetting[1 ]; + +if (alt->desc.bNumEndpoints <1 ) +return -ENODEV ; +/* Start isoc bandwidth "negotiation" at max isoc bandwidth */ - alt = &gspca_dev->dev->actconfig->intf_cache[0 ]->altsetting[1 ]; alt->endpoint[0 ].desc.wMaxPacketSize =cpu_to_le16 (sd->sensor->max_packet_size[gspca_dev->curr_mode]);
@@ -334,6 +347,10 @@ static int stv06xx_isoc_nego(struct gspca_dev *gspca_dev)struct usb_host_interface *alt;struct sd *sd = (struct sd *) gspca_dev; +/* +* Existence of altsetting and endpoint was verified in +* stv06xx_isoc_init() +*/ alt = &gspca_dev->dev->actconfig->intf_cache[0 ]->altsetting[1 ]; packet_size =le16_to_cpu (alt->endpoint[0 ].desc.wMaxPacketSize); min_packet_size = sd->sensor->min_packet_size[gspca_dev->curr_mode];
drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c +4 -0
@@ -198,6 +198,10 @@ static int pb0100_start(struct sd *sd) alt =usb_altnum_to_altsetting (intf, sd->gspca_dev.alt);if (!alt)return -ENODEV ; + +if (alt->desc.bNumEndpoints <1 ) +return -ENODEV ; + packet_size =le16_to_cpu (alt->endpoint[0 ].desc.wMaxPacketSize);/* If we don't have enough bandwidth use a lower framerate */
drivers/media/usb/gspca/xirlink_cit.c +17 -1
@@ -1455,6 +1455,9 @@ static int cit_get_packet_size(struct gspca_dev *gspca_dev)return -EIO ; } +if (alt->desc.bNumEndpoints <1 ) +return -ENODEV ; +return le16_to_cpu (alt->endpoint[0 ].desc.wMaxPacketSize); }
@@ -2632,6 +2635,7 @@ static int sd_start(struct gspca_dev *gspca_dev)static int sd_isoc_init (struct gspca_dev *gspca_dev) { +struct usb_interface_cache *intfc;struct usb_host_interface *alt;int max_packet_size;
@@ -2647,8 +2651,17 @@ static int sd_isoc_init(struct gspca_dev *gspca_dev)break ; } + intfc = gspca_dev->dev->actconfig->intf_cache[0 ]; + +if (intfc->num_altsetting <2 ) +return -ENODEV ; + + alt = &intfc->altsetting[1 ]; + +if (alt->desc.bNumEndpoints <1 ) +return -ENODEV ; +/* Start isoc bandwidth "negotiation" at max isoc bandwidth */ - alt = &gspca_dev->dev->actconfig->intf_cache[0 ]->altsetting[1 ]; alt->endpoint[0 ].desc.wMaxPacketSize =cpu_to_le16 (max_packet_size);return 0 ;
@@ -2671,6 +2684,9 @@ static int sd_isoc_nego(struct gspca_dev *gspca_dev)break ; } +/* +* Existence of altsetting and endpoint was verified in sd_isoc_init() +*/ alt = &gspca_dev->dev->actconfig->intf_cache[0 ]->altsetting[1 ]; packet_size =le16_to_cpu (alt->endpoint[0 ].desc.wMaxPacketSize);if (packet_size <= min_packet_size)
drivers/media/usb/uvc/uvc_driver.c +1 -1
@@ -1640,7 +1640,7 @@ static void uvc_delete(struct uvc_device *dev)if (dev->vdev.dev)v4l2_device_unregister (&dev->vdev);#ifdef CONFIG_MEDIA_CONTROLLER -if (media_devnode_is_registered (&dev->mdev.devnode)) +if (media_devnode_is_registered (dev->mdev.devnode))media_device_unregister (&dev->mdev);#endif
drivers/misc/enclosure.c +1 -2
@@ -364,10 +364,9 @@ int enclosure_remove_device(struct enclosure_device *edev, struct device *dev) cdev = &edev->component[i];if (cdev->dev == dev) {enclosure_remove_links (cdev); -device_del (&cdev->cdev);put_device (dev); cdev->dev =NULL ; -return device_add (&cdev->cdev); +return 0 ; } }return -ENODEV ;
drivers/mmc/host/sdhci.c +6 -4
@@ -2945,11 +2945,13 @@ int sdhci_add_host(struct sdhci_host *host)if (host->ops->get_min_clock) mmc->f_min = host->ops->get_min_clock (host);else if (host->version >=SDHCI_SPEC_300 ) { -if (host->clk_mul) { - mmc->f_min = (host->max_clk * host->clk_mul) /1024 ; +if (host->clk_mul) mmc->f_max = host->max_clk * host->clk_mul; - }else - mmc->f_min = host->max_clk /SDHCI_MAX_DIV_SPEC_300 ; +/* +* Divided Clock Mode minimum clock rate is always less than +* Programmable Clock Mode minimum clock rate. +*/ + mmc->f_min = host->max_clk /SDHCI_MAX_DIV_SPEC_300 ; }else mmc->f_min = host->max_clk /SDHCI_MAX_DIV_SPEC_200 ;
drivers/net/bonding/bond_main.c +21 -19
@@ -3421,33 +3421,35 @@ static int bond_neigh_init(struct neighbour *n)const struct net_device_ops *slave_ops;struct neigh_parms parms;struct slave *slave; -int ret; +int ret =0 ; - slave =bond_first_slave (bond); +rcu_read_lock (); + slave =bond_first_slave_rcu (bond);if (!slave) -return 0 ; + goto out; slave_ops = slave->dev->netdev_ops;if (!slave_ops->ndo_neigh_setup) -return 0 ; - - parms.neigh_setup =NULL ; - parms.neigh_cleanup =NULL ; - ret = slave_ops->ndo_neigh_setup (slave->dev, &parms); -if (ret) -return ret; + goto out; -/* -* Assign slave's neigh_cleanup to neighbour in case cleanup is called -* after the last slave has been detached. Assumes that all slaves -* utilize the same neigh_cleanup (true at this writing as only user -* is ipoib). +/* TODO: find another way [1] to implement this. +* Passing a zeroed structure is fragile, +* but at least we do not pass garbage. +* +* [1] One way would be that ndo_neigh_setup() never touch +* struct neigh_parms, but propagate the new neigh_setup() +* back to ___neigh_create() / neigh_parms_alloc() */ - n->parms->neigh_cleanup = parms.neigh_cleanup; +memset (&parms,0 ,sizeof (parms)); + ret = slave_ops->ndo_neigh_setup (slave->dev, &parms); -if (!parms.neigh_setup) -return 0 ; +if (ret) + goto out; -return parms.neigh_setup (n); +if (parms.neigh_setup) + ret = parms.neigh_setup (n); +out: +rcu_read_unlock (); +return ret; }/*
drivers/net/can/mscan/mscan.c +10 -11
@@ -412,13 +412,12 @@ static int mscan_rx_poll(struct napi_struct *napi, int quota)struct net_device *dev = napi->dev;struct mscan_regs __iomem *regs = priv->reg_base;struct net_device_stats *stats = &dev->stats; -int npackets =0 ; -int ret =1 ; +int work_done =0 ;struct sk_buff *skb;struct can_frame *frame;u8 canrflg; -while (npackets < quota) { +while (work_done < quota) { canrflg =in_8 (®s->canrflg);if (!(canrflg & (MSCAN_RXF |MSCAN_ERR_IF )))break ;
@@ -439,18 +438,18 @@ static int mscan_rx_poll(struct napi_struct *napi, int quota) stats->rx_packets++; stats->rx_bytes += frame->can_dlc; - npackets++; + work_done++;netif_receive_skb (skb); } -if (!(in_8 (®s->canrflg) & (MSCAN_RXF |MSCAN_ERR_IF ))) { -napi_complete (&priv->napi); -clear_bit (F_RX_PROGRESS , &priv->flags); -if (priv->can.state <CAN_STATE_BUS_OFF ) -out_8 (®s->canrier, priv->shadow_canrier); - ret =0 ; +if (work_done < quota) { +if (likely (napi_complete_done (&priv->napi, work_done))) { +clear_bit (F_RX_PROGRESS , &priv->flags); +if (priv->can.state <CAN_STATE_BUS_OFF ) +out_8 (®s->canrier, priv->shadow_canrier); + } } -return ret; +return work_done; }static irqreturn_t mscan_isr (int irq,void *dev_id)
drivers/net/can/slcan.c +11 -5
@@ -150,7 +150,7 @@ static void slc_bump(struct slcan *sl)u32 tmpid;char *cmd = sl->rbuff; - cf.can_id =0 ; +memset (&cf,0 ,sizeof (cf));switch (*cmd) {case 'r' :
@@ -189,8 +189,6 @@ static void slc_bump(struct slcan *sl)else return ; - *(u64 *) (&cf.data) =0 ;/* clear payload */ -/* RTR frames may have a dlc > 0 but they never have any data bytes */ if (!(cf.can_id &CAN_RTR_FLAG )) {for (i =0 ; i < cf.can_dlc; i++) {
@@ -346,9 +344,16 @@ static void slcan_transmit(struct work_struct *work)*/ static void slcan_write_wakeup (struct tty_struct *tty) { -struct slcan *sl = tty->disc_data; +struct slcan *sl; + +rcu_read_lock (); + sl =rcu_dereference (tty->disc_data); +if (!sl) + goto out;schedule_work (&sl->tx_work); +out: +rcu_read_unlock (); }/* Send a can_frame to a TTY queue. */
@@ -640,10 +645,11 @@ static void slcan_close(struct tty_struct *tty)return ;spin_lock_bh (&sl->lock); - tty->disc_data =NULL ; +rcu_assign_pointer (tty->disc_data,NULL ); sl->tty =NULL ;spin_unlock_bh (&sl->lock); +synchronize_rcu ();flush_work (&sl->tx_work);/* Flush network side */
drivers/net/can/usb/gs_usb.c +2 -2
@@ -846,7 +846,7 @@ static int gs_usb_probe(struct usb_interface *intf, const struct usb_device_id *GS_USB_BREQ_HOST_FORMAT ,USB_DIR_OUT |USB_TYPE_VENDOR |USB_RECIP_INTERFACE ,1 , - intf->altsetting[0 ].desc.bInterfaceNumber, + intf->cur_altsetting->desc.bInterfaceNumber, hconf,sizeof (*hconf), 1000);
@@ -869,7 +869,7 @@ static int gs_usb_probe(struct usb_interface *intf, const struct usb_device_id *GS_USB_BREQ_DEVICE_CONFIG ,USB_DIR_IN |USB_TYPE_VENDOR |USB_RECIP_INTERFACE ,1 , - intf->altsetting[0 ].desc.bInterfaceNumber, + intf->cur_altsetting->desc.bInterfaceNumber, dconf,sizeof (*dconf), 1000);
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +0 -5
@@ -1465,11 +1465,6 @@ static int ixgbevf_write_uc_addr_list(struct net_device *netdev)struct ixgbe_hw *hw = &adapter->hw;int count =0 ; -if ((netdev_uc_count (netdev)) >10 ) { -pr_err ("Too many unicast filters - No Space\n" ); -return -ENOSPC ; - } -if (!netdev_uc_empty (netdev)) {struct netdev_hw_addr *ha;netdev_for_each_uc_addr (ha, netdev) {
drivers/net/ethernet/natsemi/sonic.c +92 -21
220 lines not on this page · raw message
drivers/net/ethernet/natsemi/sonic.h +15 -10
@@ -109,6 +109,9 @@#define SONIC_CR_TXP 0x0002#define SONIC_CR_HTX 0x0001 +#define SONIC_CR_ALL (SONIC_CR_LCAM | SONIC_CR_RRRA | \ + SONIC_CR_RXEN | SONIC_CR_TXP) +/* * SONIC data configuration bits */
@@ -273,8 +276,9 @@#define SONIC_NUM_RDS SONIC_NUM_RRS/* number of receive descriptors */ #define SONIC_NUM_TDS 16/* number of transmit descriptors */ -#define SONIC_RDS_MASK (SONIC_NUM_RDS-1) -#define SONIC_TDS_MASK (SONIC_NUM_TDS-1) +#define SONIC_RRS_MASK (SONIC_NUM_RRS - 1) +#define SONIC_RDS_MASK (SONIC_NUM_RDS - 1) +#define SONIC_TDS_MASK (SONIC_NUM_TDS - 1)#define SONIC_RBSIZE 1520/* size of one resource buffer */
@@ -320,6 +324,7 @@ struct sonic_local {unsigned int next_tx;/* next free TD */ struct device *device;/* generic device */ struct net_device_stats stats; +spinlock_t lock; };#define TX_TIMEOUT (3 * HZ)
@@ -341,30 +346,30 @@ static void sonic_tx_timeout(struct net_device *dev);as far as we can tell. */ /* OpenBSD calls this "SWO". I'd like to think that sonic_buf_put() is a much better name. */ -static inline void sonic_buf_put (void * base,int bitmode, +static inline void sonic_buf_put (u16 *base,int bitmode,int offset,__u16 val) { if (bitmode)#ifdef __BIG_ENDIAN - ((__u16 *) base + (offset*2 ))[1 ] = val; +__raw_writew (val, base + (offset *2 ) +1 );#else - ((__u16 *) base + (offset*2 ))[0 ] = val; +__raw_writew (val, base + (offset *2 ) +0 );#endif else - ((__u16 *) base)[offset] = val; + __raw_writew(val, base + (offset * 1) + 0); } -static inline __u16 sonic_buf_get (void * base,int bitmode, +static inline __u16 sonic_buf_get (u16 *base,int bitmode,int offset) { if (bitmode)#ifdef __BIG_ENDIAN -return ((volatile __u16 *) base + (offset*2 ))[1 ]; +return __raw_readw (base + (offset *2 ) +1 );#else -return ((volatile __u16 *) base + (offset*2 ))[0 ]; +return __raw_readw (base + (offset *2 ) +0 );#endif else - return ((volatile __u16 *) base)[offset]; + return __raw_readw(base + (offset * 1) + 0); }/* Inlines that you should actually use for reading/writing DMA buffers */
drivers/net/ethernet/stmicro/stmmac/common.h +2 -3
@@ -270,9 +270,8 @@ struct dma_features {unsigned int enh_desc; }; -/* GMAC TX FIFO is 8K, Rx FIFO is 16K */ -#define BUF_SIZE_16KiB 16384 -/* RX Buffer size must be < 8191 and multiple of 4/8/16 bytes */ +/* RX Buffer size must be multiple of 4/8/16 bytes */ +#define BUF_SIZE_16KiB 16368#define BUF_SIZE_8KiB 8188#define BUF_SIZE_4KiB 4096#define BUF_SIZE_2KiB 2048
drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c +1 -1
@@ -78,7 +78,7 @@ static int sun7i_gmac_init(struct platform_device *pdev, void *priv)* rate, which then uses the auto-reparenting feature of the * clock driver, and enabling/disabling the clock. */ -if (gmac->interface ==PHY_INTERFACE_MODE_RGMII ) { +if (phy_interface_mode_is_rgmii (gmac->interface)) {clk_set_rate (gmac->tx_clk,SUN7I_GMAC_GMII_RGMII_RATE );clk_prepare_enable (gmac->tx_clk); gmac->clk_enabled =1 ;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +3 -1
@@ -904,7 +904,9 @@ static int stmmac_set_bfsize(int mtu, int bufsize) {int ret = bufsize; -if (mtu >= BUF_SIZE_4KiB) +if (mtu >= BUF_SIZE_8KiB) + ret = BUF_SIZE_16KiB; +else if (mtu >= BUF_SIZE_4KiB) ret = BUF_SIZE_8KiB;else if (mtu >= BUF_SIZE_2KiB) ret = BUF_SIZE_4KiB;
drivers/net/hamradio/6pack.c +2 -2
@@ -685,10 +685,10 @@ static void sixpack_close(struct tty_struct *tty) {struct sixpack *sp; -write_lock_bh (&disc_data_lock); +write_lock_irq (&disc_data_lock); sp = tty->disc_data; tty->disc_data =NULL ; -write_unlock_bh (&disc_data_lock); +write_unlock_irq (&disc_data_lock);if (!sp)return ;
drivers/net/hamradio/mkiss.c +2 -2
@@ -811,10 +811,10 @@ static void mkiss_close(struct tty_struct *tty) {struct mkiss *ax; -write_lock_bh (&disc_data_lock); +write_lock_irq (&disc_data_lock); ax = tty->disc_data; tty->disc_data =NULL ; -write_unlock_bh (&disc_data_lock); +write_unlock_irq (&disc_data_lock);if (!ax)return ;
drivers/net/macvlan.c +2 -1
@@ -345,10 +345,11 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)const struct macvlan_dev *dest;if (vlan->mode ==MACVLAN_MODE_BRIDGE ) { -const struct ethhdr *eth = (void *)skb->data; +const struct ethhdr *eth =skb_eth_hdr (skb);/* send to other bridge ports directly */ if (is_multicast_ether_addr (eth->h_dest)) { +skb_reset_mac_header (skb);macvlan_broadcast (skb, port, dev,MACVLAN_MODE_BRIDGE ); goto xmit_world; }
drivers/net/slip/slip.c +10 -2
@@ -452,9 +452,16 @@ static void slip_transmit(struct work_struct *work)*/ static void slip_write_wakeup (struct tty_struct *tty) { -struct slip *sl = tty->disc_data; +struct slip *sl; + +rcu_read_lock (); + sl =rcu_dereference (tty->disc_data); +if (!sl) + goto out;schedule_work (&sl->tx_work); +out: +rcu_read_unlock (); }static void sl_tx_timeout (struct net_device *dev)
@@ -885,10 +892,11 @@ static void slip_close(struct tty_struct *tty)return ;spin_lock_bh (&sl->lock); - tty->disc_data =NULL ; +rcu_assign_pointer (tty->disc_data,NULL ); sl->tty =NULL ;spin_unlock_bh (&sl->lock); +synchronize_rcu ();flush_work (&sl->tx_work);/* VSV = very important to remove timers */
drivers/net/usb/r8152.c +3 -0
@@ -3425,6 +3425,9 @@ static int rtl8152_probe(struct usb_interface *intf,return -ENODEV ; } +if (intf->cur_altsetting->desc.bNumEndpoints <3 ) +return -ENODEV ; +usb_reset_device (udev); netdev =alloc_etherdev (sizeof (struct r8152 ));if (!netdev) {
drivers/net/vxlan.c +3 -2
@@ -1904,7 +1904,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,return ; } - tos =ip_tunnel_ecn_encap (tos, old_iph, skb); + tos =ip_tunnel_ecn_encap (RT_TOS (tos), old_iph, skb); ttl = ttl ? :ip4_dst_hoplimit (&rt->dst); err = vxlan_xmit_skb(vxlan->vn_sock, rt, skb,
@@ -1929,7 +1929,8 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, fl6.saddr = vxlan->saddr.sin6.sin6_addr; fl6.flowi6_proto =IPPROTO_UDP ; -if (ipv6_stub->ipv6_dst_lookup (sk, &ndst, &fl6)) { + ndst = ipv6_stub->ipv6_dst_lookup_flow (sk, &fl6,NULL ); +if (unlikely (IS_ERR (ndst))) {netdev_dbg (dev,"no route to %pI6\n" , &dst->sin6.sin6_addr); dev->stats.tx_carrier_errors++;
drivers/net/wireless/libertas/cfg.c +15 -3
@@ -272,6 +272,10 @@ add_ie_rates(u8 *tlv, const u8 *ie, int *nrates)int hw, ap, ap_max = ie[1 ];u8 hw_rate; +if (ap_max >MAX_RATES ) { +lbs_deb_assoc ("invalid rates\n" ); +return tlv; + }/* Advance past IE header */ ie +=2 ;
@@ -1785,6 +1789,9 @@ static int lbs_ibss_join_existing(struct lbs_private *priv,struct cmd_ds_802_11_ad_hoc_join cmd;u8 preamble =RADIO_PREAMBLE_SHORT ;int ret =0 ; +int hw, i; +u8 rates_max; +u8 *rates;lbs_deb_enter (LBS_DEB_CFG80211 );
@@ -1845,9 +1852,14 @@ static int lbs_ibss_join_existing(struct lbs_private *priv,if (!rates_eid) {lbs_add_rates (cmd.bss.rates); }else { -int hw, i; -u8 rates_max = rates_eid[1 ]; -u8 *rates = cmd.bss.rates; + rates_max = rates_eid[1 ]; +if (rates_max >MAX_RATES ) { +lbs_deb_join ("invalid rates" ); +rcu_read_unlock (); + ret = -EINVAL ; + goto out; + } + rates = cmd.bss.rates;for (hw =0 ; hw <ARRAY_SIZE (lbs_rates); hw++) {u8 hw_rate = lbs_rates[hw].bitrate /5 ;for (i =0 ; i < rates_max; i++) {
drivers/net/wireless/mwifiex/sta_ioctl.c +1 -0
@@ -226,6 +226,7 @@ static int mwifiex_process_country_ie(struct mwifiex_private *priv,if (country_ie_len > (IEEE80211_COUNTRY_STRING_LEN +MWIFIEX_MAX_TRIPLET_802_11D )) { +rcu_read_unlock ();wiphy_dbg (priv->wdev->wiphy,"11D: country_ie_len overflow!, deauth AP\n" );return -EINVAL ;
drivers/net/wireless/mwifiex/tdls.c +67 -7
124 lines not on this page · raw message
drivers/pinctrl/pinctrl-baytrail.c +131 -81
384 lines not on this page · raw message
drivers/platform/x86/asus-wmi.c +1 -7
@@ -386,13 +386,7 @@ static void kbd_led_update(struct work_struct *work) asus = container_of(work, struct asus_wmi, kbd_led_work); -/* -* bits 0-2: level -* bit 7: light on/off -*/ -if (asus->kbd_led_wk >0 ) - ctrl_param =0x80 | (asus->kbd_led_wk &0x7F ); - + ctrl_param =0x80 | (asus->kbd_led_wk &0x7F );asus_wmi_set_devstate (ASUS_WMI_DEVID_KBD_BACKLIGHT , ctrl_param,NULL ); }
drivers/platform/x86/hp-wmi.c +1 -1
@@ -309,7 +309,7 @@ static int __init hp_wmi_bios_2008_later(void)static int __init hp_wmi_bios_2009_later (void ) { -int state =0 ; +u8 state[128 ];int ret =hp_wmi_perform_query (HPWMI_FEATURE2_QUERY ,0 , &state,sizeof (state),sizeof (state));if (!ret)
drivers/ptp/ptp_clock.c +21 -21
88 lines not on this page · raw message
drivers/ptp/ptp_private.h +5 -4
@@ -40,7 +40,7 @@ struct timestamp_event_queue {struct ptp_clock {struct posix_clock clock; -struct device *dev; +struct device dev;struct ptp_clock_info *info;dev_t devid;int index;/* index into clocks.map */
@@ -54,6 +54,8 @@ struct ptp_clock {struct device_attribute *pin_dev_attr;struct attribute **pin_attr;struct attribute_group pin_attr_group; +/* 1st entry is a pointer to the real group, 2nd is NULL terminator */ +const struct attribute_group *pin_attr_groups[2 ]; };/*
@@ -94,8 +96,7 @@ uint ptp_poll(struct posix_clock *pc,extern const struct attribute_group *ptp_groups[]; -int ptp_cleanup_sysfs (struct ptp_clock *ptp); - -int ptp_populate_sysfs (struct ptp_clock *ptp); +int ptp_populate_pin_groups (struct ptp_clock *ptp); +void ptp_cleanup_pin_groups (struct ptp_clock *ptp);#endif
drivers/ptp/ptp_sysfs.c +63 -99
215 lines not on this page · raw message
drivers/scsi/fnic/vnic_dev.c +10 -10
@@ -445,26 +445,26 @@ int vnic_dev_soft_reset_done(struct vnic_dev *vdev, int *done)int vnic_dev_hang_notify (struct vnic_dev *vdev) { -u64 a0, a1; +u64 a0 =0 , a1 =0 ;int wait =1000 ;return vnic_dev_cmd (vdev,CMD_HANG_NOTIFY , &a0, &a1, wait); }int vnic_dev_mac_addr (struct vnic_dev *vdev,u8 *mac_addr) { -u64 a0, a1; +u64 a[2 ] = {};int wait =1000 ;int err, i;for (i =0 ; i <ETH_ALEN ; i++) mac_addr[i] =0 ; - err =vnic_dev_cmd (vdev,CMD_MAC_ADDR , &a0, &a1, wait); + err =vnic_dev_cmd (vdev,CMD_MAC_ADDR , &a[0 ], &a[1 ], wait);if (err)return err;for (i =0 ; i <ETH_ALEN ; i++) - mac_addr[i] = ((u8 *)&a0)[i]; + mac_addr[i] = ((u8 *)&a)[i];return 0 ; }
@@ -489,15 +489,15 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast,void vnic_dev_add_addr (struct vnic_dev *vdev,u8 *addr) { -u64 a0 =0 , a1 =0 ; +u64 a[2 ] = {};int wait =1000 ;int err;int i;for (i =0 ; i <ETH_ALEN ; i++) - ((u8 *)&a0)[i] = addr[i]; + ((u8 *)&a)[i] = addr[i]; - err =vnic_dev_cmd (vdev,CMD_ADDR_ADD , &a0, &a1, wait); + err =vnic_dev_cmd (vdev,CMD_ADDR_ADD , &a[0 ], &a[1 ], wait);if (err) printk(KERN_ERR "Can't add addr [%02x:%02x:%02x:%02x:%02x:%02x], %d\n",
@@ -507,15 +507,15 @@ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)void vnic_dev_del_addr (struct vnic_dev *vdev,u8 *addr) { -u64 a0 =0 , a1 =0 ; +u64 a[2 ] = {};int wait =1000 ;int err;int i;for (i =0 ; i <ETH_ALEN ; i++) - ((u8 *)&a0)[i] = addr[i]; + ((u8 *)&a)[i] = addr[i]; - err =vnic_dev_cmd (vdev,CMD_ADDR_DEL , &a0, &a1, wait); + err =vnic_dev_cmd (vdev,CMD_ADDR_DEL , &a[0 ], &a[1 ], wait);if (err) printk(KERN_ERR "Can't del addr [%02x:%02x:%02x:%02x:%02x:%02x], %d\n",
drivers/staging/rtl8188eu/os_dep/usb_intf.c +2 -1
Lines of this file are not shown. View the raw message.
drivers/usb/core/config.c +67 -10
77 lines not on this page · raw message
fs/btrfs/ctree.h +89 -68
157 lines not on this page · raw message
fs/btrfs/disk-io.c +12 -68
80 lines not on this page · raw message
fs/btrfs/extent-tree.c +107 -3
110 lines not on this page · raw message
fs/btrfs/extent_io.c +56 -42
98 lines not on this page · raw message
fs/btrfs/tree-checker.c new file +649 -0
649 lines not on this page · raw message
fs/btrfs/volumes.c +175 -31
206 lines not on this page · raw message
fs/char_dev.c +87 -1
88 lines not on this page · raw message
fs/ext4/extents.c +53 -36
89 lines not on this page · raw message
fs/ext4/inode.c +87 -30
117 lines not on this page · raw message
fs/namei.c +53 -3
56 lines not on this page · raw message
include/linux/netfilter_arp/arp_tables.h +1 -1
Lines of this file are not shown. View the raw message.
kernel/futex.c +55 -38
93 lines not on this page · raw message
kernel/trace/blktrace.c +88 -41
129 lines not on this page · raw message
net/bridge/netfilter/ebtables.c +33 -25
58 lines not on this page · raw message
net/ipv4/netfilter/arp_tables.c +24 -18
42 lines not on this page · raw message
net/mac80211/cfg.c +3 -52
55 lines not on this page · raw message
net/netfilter/ipset/ip_set_bitmap_gen.h +1 -1
Lines of this file are not shown. View the raw message.
net/wireless/util.c +45 -0
45 lines not on this page · raw message
sound/usb/pcm.c +21 -23
44 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.