* [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review
@ 2016-01-27 20:31 Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 001/268] drm/nouveau/nv46: Change mc subdev oclass from nv44 to nv4c Kamal Mostafa
` (267 more replies)
0 siblings, 268 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Kamal Mostafa
This is the start of the review cycle for the Linux 4.2.8-ckt3 stable kernel.
This version contains 268 new patches, summarized below. The new patches are
posted as replies to this message and also available in this git branch:
http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-review
git://kernel.ubuntu.com/ubuntu/linux.git linux-4.2.y-review
The review period for version 4.2.8-ckt3 will be open for the next three days.
To report a problem, please reply to the relevant follow-up patch message.
For more information about the Linux 4.2.y-ckt extended stable kernel version,
see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable .
-Kamal
--
MAINTAINERS | 6 +-
arch/arm/Kconfig.debug | 17 +-
arch/arm/boot/dts/armada-388-gp.dts | 10 --
arch/arm/boot/dts/r8a7740-armadillo800eva.dts | 2 +-
arch/arm/mach-imx/Kconfig | 1 +
arch/arm64/kernel/perf_event.c | 3 -
arch/arm64/kernel/ptrace.c | 6 +
arch/arm64/mm/mmu.c | 3 +
arch/arm64/mm/proc.S | 5 +-
arch/m32r/kernel/setup.c | 3 +
arch/m68k/atari/config.c | 4 +-
arch/m68k/sun3/config.c | 2 +-
arch/mips/include/asm/pgtable.h | 4 +-
arch/mips/loongson64/loongson-3/hpet.c | 10 +-
arch/mips/loongson64/loongson-3/smp.c | 20 ++-
arch/mips/mm/tlbex.c | 2 +-
arch/parisc/include/uapi/asm/siginfo.h | 4 +
arch/powerpc/include/asm/cmpxchg.h | 16 +-
arch/powerpc/include/asm/synch.h | 2 +-
arch/powerpc/include/uapi/asm/elf.h | 2 +
arch/powerpc/kernel/module_64.c | 27 ++++
arch/powerpc/kernel/pci_of_scan.c | 3 -
arch/s390/mm/extable.c | 8 +-
arch/sparc/kernel/sys_sparc_64.c | 2 +-
arch/um/os-Linux/start_up.c | 2 +
arch/x86/include/asm/boot.h | 2 +-
arch/x86/include/asm/mmu_context.h | 34 +++-
arch/x86/kernel/cpu/perf_event.c | 11 +-
arch/x86/kernel/cpu/perf_event_intel_ds.c | 9 +-
arch/x86/kernel/process_64.c | 2 +-
arch/x86/kernel/reboot.c | 8 +
arch/x86/kvm/trace.h | 2 +-
arch/x86/kvm/x86.c | 11 +-
arch/x86/mm/tlb.c | 29 +++-
arch/x86/um/Makefile | 2 +-
arch/x86/xen/suspend.c | 3 +-
crypto/af_alg.c | 55 ++++++-
crypto/ahash.c | 5 +-
crypto/algif_hash.c | 165 +++++++++++++++++++-
crypto/algif_skcipher.c | 172 +++++++++++++++++++--
crypto/crc32c_generic.c | 1 -
crypto/shash.c | 4 +-
drivers/acpi/acpi_lpss.c | 8 +-
drivers/acpi/acpi_video.c | 18 +++
drivers/base/firmware_class.c | 8 +-
drivers/block/zram/zcomp.c | 4 +-
drivers/block/zram/zcomp_lz4.c | 23 ++-
drivers/block/zram/zcomp_lzo.c | 23 ++-
drivers/block/zram/zram_drv.c | 7 +-
drivers/bluetooth/btusb.c | 4 +
drivers/char/tpm/tpm_tis.c | 2 +-
drivers/clk/clk-xgene.c | 3 +-
drivers/clk/samsung/clk-cpu.c | 10 +-
drivers/clk/st/clkgen-fsyn.c | 17 +-
drivers/clocksource/vt8500_timer.c | 6 +-
drivers/connector/connector.c | 11 +-
drivers/dma/at_xdmac.c | 3 +
drivers/dma/dw/core.c | 44 ++----
drivers/edac/edac_device.c | 11 +-
drivers/edac/edac_mc.c | 14 +-
drivers/edac/edac_mc_sysfs.c | 21 ++-
drivers/edac/edac_pci.c | 9 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 +-
drivers/gpu/drm/drm_dp_mst_topology.c | 141 ++++++++++++-----
drivers/gpu/drm/i915/i915_gem_context.c | 6 +-
drivers/gpu/drm/i915/i915_irq.c | 9 +-
drivers/gpu/drm/i915/intel_display.c | 21 ++-
drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +
drivers/gpu/drm/nouveau/nvkm/engine/device/nv40.c | 2 +-
drivers/gpu/drm/radeon/dce6_afmt.c | 16 ++
drivers/gpu/drm/radeon/radeon.h | 1 +
drivers/gpu/drm/radeon/radeon_atombios.c | 19 +--
drivers/gpu/drm/radeon/radeon_device.c | 1 +
drivers/gpu/drm/radeon/radeon_vm.c | 12 +-
drivers/gpu/drm/radeon/sid.h | 5 +
drivers/hv/channel.c | 18 +++
drivers/hv/hv_utils_transport.c | 18 ++-
drivers/hwtracing/coresight/coresight.c | 2 +-
drivers/infiniband/core/cm.c | 4 +-
drivers/infiniband/hw/mlx4/ah.c | 1 +
drivers/infiniband/hw/mlx5/main.c | 2 +-
drivers/infiniband/hw/qib/qib_qp.c | 46 ++++--
drivers/infiniband/hw/qib/qib_verbs_mcast.c | 35 ++---
drivers/input/mouse/elantech.c | 2 +-
drivers/input/serio/i8042-x86ia64io.h | 7 +
drivers/iommu/io-pgtable-arm.c | 11 +-
drivers/md/bcache/btree.c | 5 +-
drivers/md/bcache/super.c | 16 +-
drivers/md/bcache/writeback.c | 37 ++++-
drivers/md/bcache/writeback.h | 3 +-
drivers/md/dm-exception-store.h | 2 +-
drivers/md/dm-snap-persistent.c | 5 +-
drivers/md/dm-snap-transient.c | 4 +-
drivers/md/dm-snap.c | 20 +--
drivers/md/dm-thin.c | 4 +-
drivers/md/persistent-data/dm-space-map-metadata.c | 3 -
drivers/media/dvb-core/dvb_frontend.c | 6 +-
drivers/media/rc/rc-main.c | 2 +-
drivers/media/rc/sunxi-cir.c | 2 +
drivers/media/tuners/si2157.c | 1 +
drivers/media/usb/gspca/ov534.c | 9 +-
drivers/media/usb/gspca/topro.c | 6 +-
drivers/media/v4l2-core/videobuf2-core.c | 6 +-
drivers/misc/cxl/vphb.c | 2 +-
drivers/mmc/core/debugfs.c | 2 +-
drivers/mmc/core/mmc.c | 6 +-
drivers/mmc/core/sd.c | 20 ++-
drivers/mmc/core/sdio.c | 2 +-
drivers/mmc/host/mmci.c | 2 +-
drivers/mmc/host/sdhci-pci.c | 2 +-
drivers/mmc/host/sdhci.c | 32 ++--
drivers/mtd/nand/denali.c | 11 +-
drivers/net/bonding/bond_main.c | 5 +-
drivers/net/phy/micrel.c | 12 +-
drivers/net/team/team.c | 6 +-
drivers/net/usb/cdc_mbim.c | 2 +-
drivers/net/usb/cdc_ncm.c | 31 ++++
drivers/net/veth.c | 6 -
drivers/net/vxlan.c | 12 +-
drivers/net/wireless/ath/ath9k/htc_hst.c | 2 +-
drivers/net/wireless/iwlwifi/pcie/drv.c | 5 +-
drivers/net/wireless/iwlwifi/pcie/trans.c | 15 +-
drivers/net/wireless/rtlwifi/pci.c | 11 +-
drivers/net/wireless/rtlwifi/rtl8188ee/sw.c | 7 +-
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 2 +
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 2 +
drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 4 +-
drivers/net/wireless/rtlwifi/rtl8192se/sw.c | 6 +-
drivers/net/wireless/rtlwifi/rtl8723ae/sw.c | 9 ++
drivers/net/wireless/rtlwifi/rtl8723be/sw.c | 8 +-
drivers/net/wireless/rtlwifi/rtl8821ae/sw.c | 9 +-
drivers/net/wireless/rtlwifi/usb.c | 2 +
drivers/net/wireless/ti/wlcore/io.h | 10 +-
drivers/net/wireless/ti/wlcore/spi.c | 10 +-
drivers/pci/bus.c | 6 +-
drivers/pci/host/pci-dra7xx.c | 3 +-
drivers/pci/host/pci-exynos.c | 3 +-
drivers/pci/host/pci-imx6.c | 3 +-
drivers/pci/host/pci-tegra.c | 2 +-
drivers/pci/host/pcie-rcar.c | 6 +-
drivers/pci/host/pcie-spear13xx.c | 3 +-
drivers/pci/host/pcie-xilinx.c | 3 +-
drivers/pci/probe.c | 7 +-
drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 +-
drivers/platform/x86/ideapad-laptop.c | 14 ++
drivers/power/test_power.c | 2 +
drivers/regulator/axp20x-regulator.c | 4 +-
drivers/scsi/initio.c | 16 --
drivers/scsi/scsi_devinfo.c | 1 +
drivers/staging/media/lirc/lirc_imon.c | 2 +
drivers/target/iscsi/iscsi_target_configfs.c | 16 +-
drivers/target/target_core_configfs.c | 6 +-
drivers/thermal/step_wise.c | 17 +-
drivers/thermal/thermal_core.c | 75 ++++++++-
drivers/thermal/thermal_core.h | 1 +
drivers/tty/sysrq.c | 6 +
drivers/usb/host/xhci.c | 4 +
drivers/usb/serial/cp210x.c | 1 +
drivers/virtio/virtio_balloon.c | 2 +-
fs/btrfs/ctree.h | 2 +-
fs/btrfs/disk-io.c | 5 +-
fs/btrfs/extent-tree.c | 11 +-
fs/btrfs/inode.c | 4 -
fs/btrfs/volumes.c | 9 ++
fs/cifs/cifs_debug.c | 2 +-
fs/cifs/cifs_debug.h | 9 +-
fs/cifs/connect.c | 2 +-
fs/cifs/readdir.c | 1 +
fs/cifs/transport.c | 6 +-
fs/ext4/crypto_key.c | 6 +
fs/hostfs/hostfs_kern.c | 4 +-
fs/locks.c | 51 +++---
fs/nfs/dir.c | 21 ++-
fs/nfs/flexfilelayout/flexfilelayout.c | 6 +-
fs/nfs/inode.c | 54 +++++--
fs/nfs/nfs4proc.c | 2 +-
fs/ocfs2/dlm/dlmmaster.c | 26 ++--
fs/ocfs2/dlmglue.c | 6 +
fs/overlayfs/copy_up.c | 41 +++--
fs/overlayfs/inode.c | 13 ++
fs/overlayfs/readdir.c | 3 +-
fs/overlayfs/super.c | 5 +
fs/udf/inode.c | 15 ++
fs/udf/unicode.c | 21 ++-
fs/xfs/libxfs/xfs_dquot_buf.c | 35 ++++-
fs/xfs/libxfs/xfs_format.h | 2 +-
fs/xfs/libxfs/xfs_inode_buf.c | 14 +-
fs/xfs/libxfs/xfs_quota_defs.h | 2 +-
fs/xfs/libxfs/xfs_shared.h | 1 +
fs/xfs/xfs_buf.c | 17 ++
fs/xfs/xfs_log_recover.c | 9 +-
include/crypto/hash.h | 6 +
include/crypto/if_alg.h | 11 +-
include/drm/drm_dp_mst_helper.h | 2 -
include/linux/ceph/messenger.h | 2 +-
include/linux/console.h | 1 +
include/linux/hyperv.h | 18 +++
include/linux/memblock.h | 4 +-
include/linux/mlx4/device.h | 4 -
include/linux/mtd/nand.h | 4 +-
include/linux/pci.h | 2 -
include/linux/printk.h | 12 +-
include/linux/sched.h | 1 +
include/linux/shmem_fs.h | 5 +-
include/linux/skbuff.h | 3 +-
include/linux/thermal.h | 5 +
include/linux/usb/cdc_ncm.h | 1 +
include/linux/vmstat.h | 2 +
include/net/inet_ecn.h | 19 ++-
include/net/sock.h | 10 +-
kernel/bpf/verifier.c | 10 ++
kernel/futex.c | 5 +
kernel/panic.c | 12 ++
kernel/printk/printk.c | 35 ++++-
kernel/sched/idle.c | 1 +
kernel/sys.c | 20 +--
kernel/time/posix-clock.c | 4 +-
kernel/time/timekeeping.c | 3 +-
lib/Kconfig | 2 +
lib/dma-debug.c | 2 +-
lib/libcrc32c.c | 1 +
mm/balloon_compaction.c | 4 +-
mm/memcontrol.c | 11 +-
mm/memory-failure.c | 2 +-
mm/shmem.c | 9 +-
mm/vmstat.c | 69 ++++++---
mm/zsmalloc.c | 14 +-
net/batman-adv/bridge_loop_avoidance.c | 10 +-
net/batman-adv/hard-interface.h | 12 --
net/batman-adv/network-coding.c | 19 +--
net/batman-adv/originator.c | 149 +++++++-----------
net/batman-adv/originator.h | 1 -
net/batman-adv/translation-table.c | 28 ++--
net/bridge/br_device.c | 8 +
net/bridge/br_stp_if.c | 5 +-
net/ceph/messenger.c | 76 ++++++---
net/core/dev.c | 5 +
net/core/filter.c | 5 +
net/ipv4/ip_output.c | 3 +-
net/ipv4/tcp_yeah.c | 2 +-
net/ipv4/xfrm4_policy.c | 46 ++++--
net/ipv6/ip6_output.c | 2 +-
net/ipv6/tcp_ipv6.c | 2 +
net/ipv6/xfrm6_mode_tunnel.c | 2 +-
net/ipv6/xfrm6_policy.c | 53 +++++--
net/mac80211/offchannel.c | 5 +-
net/openvswitch/datapath.c | 5 +-
net/phonet/af_phonet.c | 4 +
net/sched/cls_flower.c | 10 +-
net/sctp/sm_statefuns.c | 6 +-
net/sctp/socket.c | 3 +-
net/sctp/sysctl.c | 2 +-
net/unix/af_unix.c | 90 +++++++----
net/unix/garbage.c | 13 +-
net/xfrm/xfrm_output.c | 2 +
net/xfrm/xfrm_policy.c | 38 -----
scripts/Makefile.extrawarn | 2 +
scripts/bloat-o-meter | 8 +-
scripts/kconfig/menu.c | 2 +-
scripts/recordmcount.pl | 3 +-
sound/core/control.c | 2 +
sound/core/hrtimer.c | 3 +-
sound/core/pcm_compat.c | 13 +-
sound/core/seq/seq_clientmgr.c | 2 +-
sound/core/seq/seq_compat.c | 9 +-
sound/core/seq/seq_queue.c | 2 +
sound/core/timer.c | 100 +++++++++---
sound/pci/fm801.c | 73 +++++----
sound/pci/hda/hda_intel.c | 10 +-
sound/pci/hda/patch_realtek.c | 15 ++
sound/soc/intel/atom/sst/sst_stream.c | 2 +-
sound/soc/soc-compress.c | 23 ++-
sound/soc/tegra/tegra_alc5632.c | 12 +-
sound/usb/mixer_quirks.c | 2 +-
sound/usb/quirks.c | 1 +
tools/hv/hv_vss_daemon.c | 2 +-
tools/lib/traceevent/event-parse.c | 5 +-
278 files changed, 2482 insertions(+), 1045 deletions(-)
Aaron Conole (1):
printk: help pr_debug and pr_devel to optimize out arguments
Adrian Hunter (4):
mmc: sdhci-pci: Do not default to 33 Ohm driver strength for Intel SPT
mmc: sdio: Fix invalid vdd in voltage switch power cycle
mmc: sdhci: Fix DMA descriptor with zero data length
mmc: sdhci: Fix sdhci_runtime_pm_bus_on/off()
Al Viro (2):
bcache: fix a leak in bch_cached_dev_run()
make sure that freeing shmem fast symlinks is RCU-delayed
Alex Deucher (3):
drm/amdgpu: call hpd_irq_event on resume
drm/radeon: call hpd_irq_event on resume
drm/radeon: clean up fujitsu quirks
Alexey Khoroshilov (1):
[media] lirc_imon: do not leave imon_probe() with mutex held
Andrew Donnellan (1):
cxl: use correct operator when writing pcie config space values
Andrew Elble (1):
nfs: Fix race in __update_open_stateid()
Andrew Gabbasov (2):
udf: Prevent buffer overrun with multi-byte characters
udf: Check output buffer length when converting name to CS0
Andy Lutomirski (2):
x86/mm: Add barriers and document switch_mm()-vs-flush synchronization
x86/mm: Improve switch_mm() barrier comments
Andy Shevchenko (4):
Revert "ACPI / LPSS: allow to use specific PM domain during ->probe()"
ALSA: fm801: explicitly free IRQ line
ALSA: fm801: propagate TUNER_ONLY bit when autodetected
ALSA: fm801: detect FM-only card earlier
Ani Sinha (1):
sysrq: Fix warning in sysrq generated crash.
Antonio Ospite (1):
[media] gspca: ov534/topro: prevent a division by 0
Ard Biesheuvel (1):
s390: fix normalization bug in exception table sorting
Arnd Bergmann (5):
lib: sw842: select crc32
ARM: debug-ll: fix BCM63xx entry for multiplatform
SCSI: initio: remove duplicate module device table
clk: st: avoid uninitialized variable use
ARM: imx: select SRC for i.MX7
Aurélien Francillon (1):
Input: i8042 - add Fujitsu Lifebook U745 to the nomux list
Bart Van Assche (2):
IB/cm: Fix a recently introduced deadlock
target: Fix a memory leak in target_dev_lba_map_store()
Ben Skeggs (1):
drm/nouveau/kms: take mode_config mutex in connector hotplug path
Benjamin Tissoires (1):
Input: elantech - mark protocols v2 and v3 as semi-mt
Bjørn Mork (1):
net: cdc_ncm: avoid changing RX/TX buffers on MTU changes
Boqun Feng (2):
powerpc: Make value-returning atomics fully ordered
powerpc: Make {cmp}xchg* and their atomic_ versions fully ordered
Boris BREZILLON (2):
mtd: nand: fix ONFI parameter page layout
mtd: nand: denali: add missing nand_release() call in denali_remove()
Borislav Petkov (2):
EDAC, mc_sysfs: Fix freeing bus' name
EDAC: Robustify workqueues destruction
Brian Norris (1):
firmware: actually return NULL on failed request_firmware_nowait()
Chen Yu (1):
Thermal: do thermal zone update after a cooling device registered
Chen-Yu Tsai (2):
regulator: axp20x: Fix GPIO LDO enable value for AXP22x
[media] rc: sunxi-cir: Initialize the spinlock properly
Chris Wilson (1):
drm/i915: Restore inhibiting the load of the default context
Christoph Biedl (1):
PCI: Fix minimum allocation address overwrite
Christoph Lameter (1):
vmstat: make vmstat_updater deferrable again and shut down on idle
Chuanxiao Dong (1):
mmc: debugfs: correct wrong voltage value
Dan Carpenter (3):
ASoC: Intel: pass correct parameter in sst_alloc_stream_mrfld()
ath9k_htc: check for underflow in ath9k_htc_rx_msg()
Btrfs: clean up an error code in btrfs_init_space_info()
Dan Streetman (1):
xfrm: dst_entries_init() per-net dst_ops
Darrick J. Wong (1):
libxfs: pack the agfl header structure so XFS_AGFL_SIZE is correct
Dave Chinner (3):
xfs: inode recovery readahead can race with inode buffer creation
xfs: handle dquot buffer readahead in log recovery correctly
xfs: log mount failures don't wait for buffers to be released
David Gibson (1):
time: Avoid signed overflow in timekeeping_get_ns()
David Henningsson (1):
ALSA: hda - Fixup inverted internal mic for Lenovo E50-80
David Sterba (1):
btrfs: handle invalid num_stripes in sys_array
Dexuan Cui (1):
tools: hv: vss: fix the write()'s argument: error -> vss_msg
Dmitry Tunin (1):
Bluetooth: Add support of Toshiba Broadcom based devices
Dmitry V. Levin (1):
sparc64: fix incorrect sign extension in sys_sparc64_personality
Emmanuel Grumbach (1):
iwlwifi: pcie: properly configure the debug buffer size for 8000
Eric Dumazet (3):
ipv6: tcp: add rcu locking in tcp_v6_send_synack()
phonet: properly unshare skbs in phonet_rcv()
ipv6: update skb->csum when CE mark is propagated
Felix Kuehling (2):
drm/radeon: Fix off-by-one errors in radeon_vm_bo_set_addr
drm/amdgpu: Fix off-by-one errors in amdgpu_vm_bo_map
Filipe Manana (1):
Btrfs: fix deadlock running delayed iputs at transaction commit time
Finn Thain (1):
m68k/atari, m68k/sun3: Fix SCSI platform device registration when driver is modular
Florian Fainelli (2):
MAINTAINERS: gpio-brcmstb: Remove stray '>'
include/linux/memblock.h: fix ordering of 'flags' argument in comments
Florian Westphal (1):
connector: bump skb->users before callback invocation
Gabriel de Perthuis (1):
bcache: allows use of register in udev to avoid "device_busy" error.
Geert Uytterhoeven (1):
ARM: dts: armadillo800eva Correct extal1 frequency to 24 MHz
Grygorii Strashko (1):
PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD
Guilherme G. Piccoli (1):
PCI/MSI: Initialize MSI capability for all architectures
H.J. Lu (1):
x86/boot: Double BOOT_HEAP_SIZE to 64KB
Hannes Frederic Sowa (1):
bridge: Only call /sbin/bridge-stp for the initial network namespace
Hans Verkuil (1):
[media] vb2: fix a regression in poll() behavior for output,streams
Hans de Goede (3):
drm/nouveau/nv46: Change mc subdev oclass from nv44 to nv4c
ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Portege R700
ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Satellite R830
Helge Deller (1):
parisc: Fix __ARCH_SI_PREAMBLE_SIZE
Herbert Xu (15):
crypto: algif_skcipher - Require setkey before accept(2)
crypto: af_alg - Disallow bind/setkey/... after accept(2)
crypto: af_alg - Fix socket double-free when accept fails
crypto: af_alg - Add nokey compatibility path
crypto: algif_skcipher - Add nokey compatibility path
crypto: hash - Add crypto_ahash_has_setkey
crypto: algif_hash - Require setkey before accept(2)
crypto: af_alg - Allow af_af_alg_release_parent to be called on nokey path
crypto: algif_hash - Remove custom release parent function
crypto: algif_skcipher - Remove custom release parent function
crypto: af_alg - Forbid bind(2) when nokey child sockets are present
crypto: algif_hash - Fix race condition in hash_check_key
crypto: algif_skcipher - Fix race condition in skcipher_check_key
crypto: algif_skcipher - Load TX SG list after waiting
crypto: algif_skcipher - sendmsg SG marking is off by one
Huacai Chen (3):
MIPS: Loongson-3: Fix SMP_ASK_C0COUNT IPI handler
MIPS: hpet: Choose a safe value for the ETIME check
MIPS: Fix some missing CONFIG_CPU_MIPSR6 #ifdefs
Hui Wang (1):
ALSA: hda - fix the headset mic detection problem for a Dell laptop
Ido Schimmel (1):
team: Replace rcu_read_lock with a mutex in team_vlan_rx_kill_vid
Ilya Dryomov (1):
libceph: fix ceph_msg_revoke()
Jamal Hadi Salim (1):
sched,cls_flower: set key address type when present
Jamie Bainbridge (1):
cifs: Ratelimit kernel log messages
Jan Beulich (1):
x86/LDT: Print the real LDT base address
Jason Gunthorpe (1):
tpm_tis: Use devm_free_irq not free_irq
Jean Delvare (1):
crypto: crc32c - Fix crc32c soft dependency
Jeff Layton (1):
locks: fix unlock when fcntl_setlk races with a close
Jerome Marchand (1):
zram: don't call idr_remove() from zram_remove()
Jisheng Zhang (1):
mmc: sdhci: restore behavior when setting VDD via external regulator
Johannes Berg (1):
mac80211: fix mgmt-tx abort cookie and leak
Johannes Weiner (1):
net: tcp_memcontrol: properly detect ancestor socket pressure
John Blackwood (1):
arm64: Clear out any singlestep state on a ptrace detach operation
Josh Boyer (2):
ideapad-laptop: Add Lenovo ideapad Y700-17ISK to no_hw_rfkill dmi list
ideapad-laptop: Add Lenovo Yoga 700 to no_hw_rfkill dmi list
Junil Lee (1):
zsmalloc: fix migrate_zspage-zs_free race condition
Jurgen Kramer (1):
ALSA: usb: Add native DSD support for Oppo HA-1
K. Y. Srinivasan (1):
Drivers: hv: vmbus: Fix a Host signaling bug
Karl Heiss (1):
bonding: Prevent IPv6 link local address on enslaved devices
Kent Overstreet (2):
bcache: Add a cond_resched() call to gc
bcache: Change refill_dirty() to always scan entire disk if necessary
Konstantin Khlebnikov (2):
ovl: check dentry positiveness in ovl_cleanup_whiteouts()
net: preserve IP control block during GSO segmentation
Kyeongdon Kim (1):
zram: try vmalloc() after kmalloc()
Larry Finger (9):
rtlwifi: rtl8723be: Fix module parameter initialization
rtlwifi: rtl8723ae: Fix initialization of module parameters
rtlwifi: rtl8821ae: Fix errors in parameter initialization
rtlwifi: rtl8188ee: Fix module parameter initialization
rtlwifi: rtl8192de: Fix incorrect module parameter descriptions
rtlwifi: rtl8192se: Fix module parameter initialization
rtlwifi: rtl8192ce: Fix handling of module parameters
rtlwifi: rtl8192cu: Add missing parameter setup
rtlwifi: rtl_pci: Fix kernel panic
Laura Abbott (2):
[media] si2157: return -EINVAL if firmware blob is too big
dma-debug: switch check from _text to _stext
Laurent Navet (1):
ext4 crypto: exit cleanly if ext4_derive_key_aes() fails
Lee Jones (1):
kbuild: Demote 'sign-compare' warning to W=2
Leon Romanovsky (1):
IB/mlx5: Expose correct maximum number of CQE capacity
Linus Walleij (1):
mmc: mmci: fix an ages old detection error
Loc Ho (1):
clk: xgene: Fix divider with non-zero shift value
Lorenzo Pieralisi (1):
arm64: kernel: enforce pmuserenr_el0 initialization and restore
Lukas Wunner (1):
drm/i915: On fb alloc failure, unref gem object where it gets refed
Lyude (1):
drm/i915: intel_hpd_init(): Fix suspend/resume reprobing
Malcolm Priestley (1):
[media] media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode
Mans Rullgard (2):
dmaengine: dw: fix cyclic transfer setup
dmaengine: dw: fix cyclic transfer callbacks
Marek Szyprowski (1):
clk: exynos: use irqsave version of spin_lock to avoid deadlock with irqs
Mario Kleiner (1):
x86/reboot/quirks: Add iMac10,1 to pci_reboot_dmi_table[]
Martijn Coenen (1):
memcg: only free spare array when readers are done
Matan Barak (1):
IB/mlx4: Initialize hop_limit when creating address handle
Mateusz Guzik (1):
prctl: take mmap sem for writing to protect against others
Mathieu Poirier (1):
coresight: checking for NULL string in coresight_name_match()
Michal Kubeček (1):
udp: disallow UFO for sockets with SO_NO_CHECK option
Mickaël Salaün (1):
um: Fix build error and kconfig for i386
Mike Christie (1):
scsi: add Synology to 1024 sector blacklist
Mike Marciniszyn (1):
IB/qib: fix mcast detach when qp not attached
Mike Snitzer (1):
dm space map metadata: remove unused variable in brb_pop()
Miklos Szeredi (3):
ovl: allow zero size xattr
ovl: root: copy attr
ovl: setattr: check permissions before copy-up
Mikulas Patocka (1):
dm snapshot: fix hung bios when copy error occurs
Minchan Kim (2):
virtio_balloon: fix race by fill and leak
virtio_balloon: fix race between migration and ballooning
Moni Shoua (1):
net/mlx4: Remove unused macro
Mykola Lysenko (4):
drm/dp/mst: process broadcast messages correctly
drm/dp/mst: always send reply for UP request
drm/dp/mst: fix in MSTB RAD initialization
drm/dp/mst: fix in RAD element access
Naoya Horiguchi (1):
mm: soft-offline: check return value in second __get_any_page() call
Neal Cardwell (1):
tcp_yeah: don't set ssthresh below 2
Nicholas Bellinger (1):
iscsi-target: Fix potential dead-lock during node acl delete
Nicolas Boichat (2):
ALSA: pcm: Fix snd_pcm_hw_params struct copy in compat mode
ALSA: seq: Fix snd_seq_call_port_info_ioctl in compat mode
Nicolas Dichtel (1):
vxlan: fix test which detect duplicate vxlan iface
Nikolay Aleksandrov (1):
bridge: fix lockdep addr_list_lock false positive splat
Nikolay Borisov (1):
dm thin: fix race condition when destroying thin pool workqueue
Olaf Hering (2):
Drivers: hv: util: catch allocation errors
Drivers: hv: utils: use memdup_user in hvt_op_write
Oliver Freyermuth (1):
USB: cp210x: add ID for ELV Marble Sound Board 1
Oliver Neukum (1):
xhci: refuse loading if nousb is used
Oren Givon (1):
iwlwifi: update and fix 7265 series PCI IDs
Ouyang Zhaowei (Charles) (1):
x86/xen: don't reset vcpu_info on a cancelled suspend
Paolo Bonzini (2):
KVM: x86: expose MSR_TSC_AUX to userspace
KVM: x86: correctly print #AC in traces
Peter Wu (1):
rtlwifi: fix memory leak for USB device
Rabin Vincent (2):
cifs: fix race between call_async() and reconnect()
net: bpf: reject invalid shifts
Rainer Weikusat (1):
af_unix: Fix splice-bind deadlock
Rich Felker (1):
MAINTAINERS: return arch/sh to maintained state, with new maintainers
Richard Cochran (1):
posix-clock: Fix return code on the poll method's error path
Roman Volkov (1):
clocksource/drivers/vt8500: Increase the minimum delta
Roosen Henri (1):
phy: micrel: Fix finding PHY properties in MAC node for KSZ9031.
Russell King (2):
[media] rc: allow rc modules to be loaded if rc-main is not a module
mmc: sd: limit SD card power limit according to cards capabilities
Sasha Levin (2):
power: test_power: correctly handle empty writes
net: sctp: prevent writes to cookie_hmac_alg from accessing invalid memory
Sebastian Andrzej Siewior (1):
btrfs: initialize the seq counter in struct btrfs_device
Sergey Senozhatsky (2):
scripts/bloat-o-meter: fix python3 syntax error
zram/zcomp: use GFP_NOIO to allocate streams
Slava Grigorev (1):
drm/radeon: Fix "slow" audio over DP on DCE8+
Songjun Wu (1):
dmaengine: at_xdmac: fix resume for cyclic transfers
Stefan Bader (1):
bcache: prevent crash on changing writeback_running
Stefan Wahren (1):
pinctrl: bcm2835: Fix memory leak in error path
Stephane Eranian (2):
perf/x86: Fix filter_events() bug with event mappings
perf/x86: fix PEBS issues on Intel Atom/Core2
Steven Rostedt (1):
tools lib traceevent: Fix output of %llu for 64 bit values read on 32 bit machines
Sudip Mukherjee (2):
m32r: fix m32104ut_defconfig build fail
ASoC: tegra_alc5632: check return value
Sven Eckelmann (7):
batman-adv: Avoid recursive call_rcu for batadv_bla_claim
batman-adv: Avoid recursive call_rcu for batadv_nc_node
batman-adv: Drop immediate batadv_orig_ifinfo free function
batman-adv: Drop immediate batadv_neigh_node free function
batman-adv: Drop immediate neigh_ifinfo free function
batman-adv: Drop immediate orig_node free function
batman-adv: Drop immediate batadv_hard_iface free function
Takashi Iwai (13):
ALSA: seq: Fix missing NULL check at remove_events ioctl
ALSA: seq: Fix race at timer setup and close
ALSA: hda - Fix white noise on Dell Latitude E5550
ALSA: usb-audio: Fix mixer ctl regression of Native Instrument devices
ALSA: timer: Fix double unlink of active_list
ALSA: timer: Fix race among timer ioctls
ALSA: hda - Add fixup for Dell Latitidue E6540
ALSA: timer: Harden slave timer list handling
ALSA: hda - Fix bass pin fixup for ASUS N550JX
ALSA: hrtimer: Fix stall by hrtimer_cancel()
ALSA: control: Avoid kernel warnings from tlv ioctl with numid 0
ALSA: hda - Flush the pending probe work at remove
ALSA: timer: Handle disconnection more safely
Tariq Saeed (1):
ocfs2: NFS hangs in __ocfs2_cluster_lock due to race with ocfs2_unblock_lock
Tejun Heo (1):
printk: do cond_resched() between lines while outputting to consoles
Theodore Ts'o (1):
ext4 crypto: add missing locking for keyring_key access
Thomas Gleixner (1):
futex: Drop refcount if requeue_pi() acquired the rtmutex
Thomas Petazzoni (1):
ARM: mvebu: remove duplicated regulator definition in Armada 388 GP
Trond Myklebust (4):
NFS: Fix attribute cache revalidation
pNFS/flexfiles: Fix an XDR encoding bug in layoutreturn
NFSv4: Don't perform cached access checks before we've OPENed the file
NFS: Ensure we revalidate attributes before using execute_ok()
Ulrich Weigand (2):
scripts/recordmcount.pl: support data in text section on powerpc
powerpc/module: Handle R_PPC64_ENTRY relocations
Uri Mashiach (2):
wlcore/wl12xx: spi: fix oops on firmware load
wlcore/wl12xx: spi: fix NULL pointer dereference (Oops)
Vasily Averin (1):
cifs_dbg() outputs an uninitialized buffer in cifs_readdir()
Vegard Nossum (4):
udf: limit the maximum number of indirect extents in a row
uml: fix hostfs mknod()
uml: flush stdout before forking
kconfig: return 'false' instead of 'no' in bool function
Vijay Pandurangan (1):
veth: don’t modify ip_summed; doing so treats packets with bad checksums as good.
Vinit Agnihotri (1):
IB/qib: Support creating qps with GFP_NOIO flag
Vinod Koul (1):
ASoC: compress: Fix compress device direction check
Vitaly Kuznetsov (2):
panic: release stale console lock to always get the logbuf printed out
kernel/panic.c: turn off locks debug before releasing console lock
Vito Caputo (1):
ovl: use a minimal buffer in ovl_copy_xattr
Wenkai Du (1):
mmc: mmc: Fix incorrect use of driver strength switching HS200 and HS400
Will Deacon (3):
arm64: mm: ensure that the zero page is visible to the page table walker
iommu/io-pgtable-arm: Ensure we free the final level on teardown
arm64: mdscr_el1: avoid exposing DCC to userspace
Xin Long (1):
sctp: sctp should release assoc when sctp_make_abort_user return NULL in sctp_close
Zhang Rui (2):
Thermal: initialize thermal zone device correctly
Thermal: handle thermal zone device properly during system sleep
Zheng Liu (3):
bcache: fix a livelock when we cause a huge number of cache misses
bcache: clear BCACHE_DEV_UNLINK_DONE flag when attaching a backing device
bcache: unregister reboot notifier if bcache fails to unregister device
willy tarreau (1):
unix: properly account for FDs passed over unix sockets
xuejiufei (1):
ocfs2/dlm: ignore cleaning the migration mle that is inuse
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 001/268] drm/nouveau/nv46: Change mc subdev oclass from nv44 to nv4c
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 002/268] ovl: allow zero size xattr Kamal Mostafa
` (266 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Hans de Goede, Ben Skeggs, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Hans de Goede <hdegoede@redhat.com>
commit 0a363e85cdafbceeee6a49b91c604d0d4d070dc7 upstream.
MSI interrupts appear to not work for nv46 based cards. Change the mc
subdev oclass for these cards from nv44 to nv4c, the nv4c mc code is
identical to the nv44 mc code except that it does not use msi
(it does not define a msi_rearm callback).
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90435
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/nouveau/nvkm/engine/device/nv40.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/nv40.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/nv40.c
index c630136..b4ad791 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/nv40.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/nv40.c
@@ -265,7 +265,7 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_CLK ] = &nv40_clk_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
- device->oclass[NVDEV_SUBDEV_MC ] = nv44_mc_oclass;
+ device->oclass[NVDEV_SUBDEV_MC ] = nv4c_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = nv31_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv46_fb_oclass;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 002/268] ovl: allow zero size xattr
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 001/268] drm/nouveau/nv46: Change mc subdev oclass from nv44 to nv4c Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 003/268] ovl: use a minimal buffer in ovl_copy_xattr Kamal Mostafa
` (265 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Miklos Szeredi, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Miklos Szeredi <miklos@szeredi.hu>
commit 97daf8b97ad6f913a34c82515be64dc9ac08d63e upstream.
When ovl_copy_xattr() encountered a zero size xattr no more xattrs were
copied and the function returned success. This is clearly not the desired
behavior.
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/overlayfs/copy_up.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index 871fcb6..394e87f 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -54,7 +54,7 @@ int ovl_copy_xattr(struct dentry *old, struct dentry *new)
for (name = buf; name < (buf + list_size); name += strlen(name) + 1) {
size = vfs_getxattr(old, name, value, XATTR_SIZE_MAX);
- if (size <= 0) {
+ if (size < 0) {
error = size;
goto out_free_value;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 003/268] ovl: use a minimal buffer in ovl_copy_xattr
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 001/268] drm/nouveau/nv46: Change mc subdev oclass from nv44 to nv4c Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 002/268] ovl: allow zero size xattr Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 004/268] [media] vb2: fix a regression in poll() behavior for output,streams Kamal Mostafa
` (264 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Miklos Szeredi, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Vito Caputo <vito.caputo@coreos.com>
commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe upstream.
Rather than always allocating the high-order XATTR_SIZE_MAX buffer
which is costly and prone to failure, only allocate what is needed and
realloc if necessary.
Fixes https://github.com/coreos/bugs/issues/489
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/overlayfs/copy_up.c | 39 +++++++++++++++++++++++++--------------
1 file changed, 25 insertions(+), 14 deletions(-)
diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index 394e87f..758012b 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -22,9 +22,9 @@
int ovl_copy_xattr(struct dentry *old, struct dentry *new)
{
- ssize_t list_size, size;
- char *buf, *name, *value;
- int error;
+ ssize_t list_size, size, value_size = 0;
+ char *buf, *name, *value = NULL;
+ int uninitialized_var(error);
if (!old->d_inode->i_op->getxattr ||
!new->d_inode->i_op->getxattr)
@@ -41,29 +41,40 @@ int ovl_copy_xattr(struct dentry *old, struct dentry *new)
if (!buf)
return -ENOMEM;
- error = -ENOMEM;
- value = kmalloc(XATTR_SIZE_MAX, GFP_KERNEL);
- if (!value)
- goto out;
-
list_size = vfs_listxattr(old, buf, list_size);
if (list_size <= 0) {
error = list_size;
- goto out_free_value;
+ goto out;
}
for (name = buf; name < (buf + list_size); name += strlen(name) + 1) {
- size = vfs_getxattr(old, name, value, XATTR_SIZE_MAX);
+retry:
+ size = vfs_getxattr(old, name, value, value_size);
+ if (size == -ERANGE)
+ size = vfs_getxattr(old, name, NULL, 0);
+
if (size < 0) {
error = size;
- goto out_free_value;
+ break;
+ }
+
+ if (size > value_size) {
+ void *new;
+
+ new = krealloc(value, size, GFP_KERNEL);
+ if (!new) {
+ error = -ENOMEM;
+ break;
+ }
+ value = new;
+ value_size = size;
+ goto retry;
}
+
error = vfs_setxattr(new, name, value, size, 0);
if (error)
- goto out_free_value;
+ break;
}
-
-out_free_value:
kfree(value);
out:
kfree(buf);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 004/268] [media] vb2: fix a regression in poll() behavior for output,streams
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (2 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 003/268] ovl: use a minimal buffer in ovl_copy_xattr Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 005/268] [media] gspca: ov534/topro: prevent a division by 0 Kamal Mostafa
` (263 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Hans Verkuil, Mauro Carvalho Chehab, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Hans Verkuil <hverkuil@xs4all.nl>
commit 4623e5967448444a4ea1e77beb58898c4af48693 upstream.
In the 3.17 kernel the poll() behavior changed for output streams:
as long as not all buffers were queued up poll() would return that
userspace can write. This is fine for the write() call, but when
using stream I/O this changed the behavior since the expectation
was that it would wait for buffers to become available for dequeuing.
This patch only enables the check whether you can queue buffers
for file I/O only, and skips it for stream I/O.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
[ kamal: backport to 4.2-stable: file rename; context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/media/v4l2-core/videobuf2-core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index a14c428..340f9ff 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -2686,10 +2686,10 @@ unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait)
return res | POLLERR;
/*
- * For output streams you can write as long as there are fewer buffers
- * queued than there are buffers available.
+ * For output streams you can call write() as long as there are fewer
+ * buffers queued than there are buffers available.
*/
- if (V4L2_TYPE_IS_OUTPUT(q->type) && q->queued_count < q->num_buffers)
+ if (V4L2_TYPE_IS_OUTPUT(q->type) && q->fileio && q->queued_count < q->num_buffers)
return res | POLLOUT | POLLWRNORM;
if (list_empty(&q->done_list)) {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 005/268] [media] gspca: ov534/topro: prevent a division by 0
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (3 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 004/268] [media] vb2: fix a regression in poll() behavior for output,streams Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 006/268] [media] media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode Kamal Mostafa
` (262 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Antonio Ospite, Hans Verkuil, Mauro Carvalho Chehab, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Antonio Ospite <ao2@ao2.it>
commit dcc7fdbec53a960588f2c40232db2c6466c09917 upstream.
v4l2-compliance sends a zeroed struct v4l2_streamparm in
v4l2-test-formats.cpp::testParmType(), and this results in a division by
0 in some gspca subdrivers:
divide error: 0000 [#1] SMP
Modules linked in: gspca_ov534 gspca_main ...
CPU: 0 PID: 17201 Comm: v4l2-compliance Not tainted 4.3.0-rc2-ao2 #1
Hardware name: System manufacturer System Product Name/M2N-E SLI, BIOS
ASUS M2N-E SLI ACPI BIOS Revision 1301 09/16/2010
task: ffff8800818306c0 ti: ffff880095c4c000 task.ti: ffff880095c4c000
RIP: 0010:[<ffffffffa079bd62>] [<ffffffffa079bd62>] sd_set_streamparm+0x12/0x60 [gspca_ov534]
RSP: 0018:ffff880095c4fce8 EFLAGS: 00010296
RAX: 0000000000000000 RBX: ffff8800c9522000 RCX: ffffffffa077a140
RDX: 0000000000000000 RSI: ffff880095e0c100 RDI: ffff8800c9522000
RBP: ffff880095e0c100 R08: ffffffffa077a100 R09: 00000000000000cc
R10: ffff880067ec7740 R11: 0000000000000016 R12: ffffffffa07bb400
R13: 0000000000000000 R14: ffff880081b6a800 R15: 0000000000000000
FS: 00007fda0de78740(0000) GS:ffff88012fc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000014630f8 CR3: 00000000cf349000 CR4: 00000000000006f0
Stack:
ffffffffa07a6431 ffff8800c9522000 ffffffffa077656e 00000000c0cc5616
ffff8800c9522000 ffffffffa07a5e20 ffff880095e0c100 0000000000000000
ffff880067ec7740 ffffffffa077a140 ffff880067ec7740 0000000000000016
Call Trace:
[<ffffffffa07a6431>] ? v4l_s_parm+0x21/0x50 [videodev]
[<ffffffffa077656e>] ? vidioc_s_parm+0x4e/0x60 [gspca_main]
[<ffffffffa07a5e20>] ? __video_do_ioctl+0x280/0x2f0 [videodev]
[<ffffffffa07a5ba0>] ? video_ioctl2+0x20/0x20 [videodev]
[<ffffffffa07a59b9>] ? video_usercopy+0x319/0x4e0 [videodev]
[<ffffffff81182dc1>] ? page_add_new_anon_rmap+0x71/0xa0
[<ffffffff811afb92>] ? mem_cgroup_commit_charge+0x52/0x90
[<ffffffff81179b18>] ? handle_mm_fault+0xc18/0x1680
[<ffffffffa07a15cc>] ? v4l2_ioctl+0xac/0xd0 [videodev]
[<ffffffff811c846f>] ? do_vfs_ioctl+0x28f/0x480
[<ffffffff811c86d4>] ? SyS_ioctl+0x74/0x80
[<ffffffff8154a8b6>] ? entry_SYSCALL_64_fastpath+0x16/0x75
Code: c7 93 d9 79 a0 5b 5d e9 f1 f3 9a e0 0f 1f 00 66 2e 0f 1f 84 00
00 00 00 00 66 66 66 66 90 53 31 d2 48 89 fb 48 83 ec 08 8b 46 10 <f7>
76 0c 80 bf ac 0c 00 00 00 88 87 4e 0e 00 00 74 09 80 bf 4f
RIP [<ffffffffa079bd62>] sd_set_streamparm+0x12/0x60 [gspca_ov534]
RSP <ffff880095c4fce8>
---[ end trace 279710c2c6c72080 ]---
Following what the doc says about a zeroed timeperframe (see
http://www.linuxtv.org/downloads/v4l-dvb-apis/vidioc-g-parm.html):
...
To reset manually applications can just set this field to zero.
fix the issue by resetting the frame rate to a default value in case of
an unusable timeperframe.
The fix is done in the subdrivers instead of gspca.c because only the
subdrivers have notion of a default frame rate to reset the camera to.
Signed-off-by: Antonio Ospite <ao2@ao2.it>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/media/usb/gspca/ov534.c | 9 +++++++--
drivers/media/usb/gspca/topro.c | 6 +++++-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/media/usb/gspca/ov534.c b/drivers/media/usb/gspca/ov534.c
index 146071b..bfff1d1 100644
--- a/drivers/media/usb/gspca/ov534.c
+++ b/drivers/media/usb/gspca/ov534.c
@@ -1491,8 +1491,13 @@ static void sd_set_streamparm(struct gspca_dev *gspca_dev,
struct v4l2_fract *tpf = &cp->timeperframe;
struct sd *sd = (struct sd *) gspca_dev;
- /* Set requested framerate */
- sd->frame_rate = tpf->denominator / tpf->numerator;
+ if (tpf->numerator == 0 || tpf->denominator == 0)
+ /* Set default framerate */
+ sd->frame_rate = 30;
+ else
+ /* Set requested framerate */
+ sd->frame_rate = tpf->denominator / tpf->numerator;
+
if (gspca_dev->streaming)
set_frame_rate(gspca_dev);
diff --git a/drivers/media/usb/gspca/topro.c b/drivers/media/usb/gspca/topro.c
index c70ff40..c028a5c 100644
--- a/drivers/media/usb/gspca/topro.c
+++ b/drivers/media/usb/gspca/topro.c
@@ -4802,7 +4802,11 @@ static void sd_set_streamparm(struct gspca_dev *gspca_dev,
struct v4l2_fract *tpf = &cp->timeperframe;
int fr, i;
- sd->framerate = tpf->denominator / tpf->numerator;
+ if (tpf->numerator == 0 || tpf->denominator == 0)
+ sd->framerate = 30;
+ else
+ sd->framerate = tpf->denominator / tpf->numerator;
+
if (gspca_dev->streaming)
setframerate(gspca_dev, v4l2_ctrl_g_ctrl(gspca_dev->exposure));
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 006/268] [media] media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (4 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 005/268] [media] gspca: ov534/topro: prevent a division by 0 Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 007/268] [media] si2157: return -EINVAL if firmware blob is too big Kamal Mostafa
` (261 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Malcolm Priestley, Mauro Carvalho Chehab, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Malcolm Priestley <tvboxspy@gmail.com>
commit c9d57de6103e343f2d4e04ea8d9e417e10a24da7 upstream.
When in FE_TUNE_MODE_ONESHOT the frontend must report
the actual capabilities so user can take appropriate
action.
With frontends that can't do auto inversion this is done
by dvb-core automatically so CAN_INVERSION_AUTO is valid.
However, when in FE_TUNE_MODE_ONESHOT this is not true.
So only set FE_CAN_INVERSION_AUTO in modes other than
FE_TUNE_MODE_ONESHOT
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/media/dvb-core/dvb_frontend.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index 842b9c8..565b615 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -2314,9 +2314,9 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
dev_dbg(fe->dvb->device, "%s: current delivery system on cache: %d, V3 type: %d\n",
__func__, c->delivery_system, fe->ops.info.type);
- /* Force the CAN_INVERSION_AUTO bit on. If the frontend doesn't
- * do it, it is done for it. */
- info->caps |= FE_CAN_INVERSION_AUTO;
+ /* Set CAN_INVERSION_AUTO bit on in other than oneshot mode */
+ if (!(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT))
+ info->caps |= FE_CAN_INVERSION_AUTO;
err = 0;
break;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 007/268] [media] si2157: return -EINVAL if firmware blob is too big
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (5 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 006/268] [media] media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 008/268] tools lib traceevent: Fix output of %llu for 64 bit values read on 32 bit machines Kamal Mostafa
` (260 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Laura Abbott, Mauro Carvalho Chehab, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Laura Abbott <labbott@fedoraproject.org>
commit d2cc2f0b35465951eaaf0387fd55e29835ed7ea6 upstream.
A previous patch added a check if the firmware is too big, but it didn't
set the return error code with the right value.
[mchehab@osg.samsung.com: I ended by applying a v1 of Laura's patch, without
the proper return code. This patch contains the difference between v2 and v1 of
the Laura's "si2157: Bounds check firmware" patch]
Signed-off-by: Laura Abbott <labbott@fedoraproject.org>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Tested-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/media/tuners/si2157.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
index 416c865..27241de 100644
--- a/drivers/media/tuners/si2157.c
+++ b/drivers/media/tuners/si2157.c
@@ -168,6 +168,7 @@ static int si2157_init(struct dvb_frontend *fe)
len = fw->data[fw->size - remaining];
if (len > SI2157_ARGLEN) {
dev_err(&client->dev, "Bad firmware length\n");
+ ret = -EINVAL;
goto err_release_firmware;
}
memcpy(cmd.args, &fw->data[(fw->size - remaining) + 1], len);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 008/268] tools lib traceevent: Fix output of %llu for 64 bit values read on 32 bit machines
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (6 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 007/268] [media] si2157: return -EINVAL if firmware blob is too big Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 009/268] cxl: use correct operator when writing pcie config space values Kamal Mostafa
` (259 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Steven Rostedt, Arnaldo Carvalho de Melo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Steven Rostedt <rostedt@goodmis.org>
commit 32abc2ede536aae52978d6c0a8944eb1df14f460 upstream.
When a long value is read on 32 bit machines for 64 bit output, the
parsing needs to change "%lu" into "%llu", as the value is read
natively.
Unfortunately, if "%llu" is already there, the code will add another "l"
to it and fail to parse it properly.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20151116172516.4b79b109@gandalf.local.home
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
tools/lib/traceevent/event-parse.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index a843bee..bcd5be7 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -4841,13 +4841,12 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
sizeof(long) != 8) {
char *p;
- ls = 2;
/* make %l into %ll */
- p = strchr(format, 'l');
- if (p)
+ if (ls == 1 && (p = strchr(format, 'l')))
memmove(p+1, p, strlen(p)+1);
else if (strcmp(format, "%p") == 0)
strcpy(format, "0x%llx");
+ ls = 2;
}
switch (ls) {
case -2:
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 009/268] cxl: use correct operator when writing pcie config space values
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (7 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 008/268] tools lib traceevent: Fix output of %llu for 64 bit values read on 32 bit machines Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 010/268] KVM: x86: expose MSR_TSC_AUX to userspace Kamal Mostafa
` (258 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andrew Donnellan, Michael Ellerman, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
commit 48f0f6b717e314a30be121b67e1d044f6d311d66 upstream.
When writing a value to config space, cxl_pcie_write_config() calls
cxl_pcie_config_info() to obtain a mask and shift value, shifts the new
value accordingly, then uses the mask to combine the shifted value with the
existing value at the address as part of a read-modify-write pattern.
Currently, we use a logical OR operator rather than a bitwise OR operator,
which means any use of this function results in an incorrect value being
written. Replace the logical OR operator with a bitwise OR operator so the
value is written correctly.
Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Fixes: 6f7f0b3df6d4 ("cxl: Add AFU virtual PHB and kernel API")
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/misc/cxl/vphb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/cxl/vphb.c b/drivers/misc/cxl/vphb.c
index 2eba002..15f154e 100644
--- a/drivers/misc/cxl/vphb.c
+++ b/drivers/misc/cxl/vphb.c
@@ -171,7 +171,7 @@ static int cxl_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
mask <<= shift;
val <<= shift;
- v = (in_le32(ioaddr) & ~mask) || (val & mask);
+ v = (in_le32(ioaddr) & ~mask) | (val & mask);
out_le32(ioaddr, v);
return PCIBIOS_SUCCESSFUL;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 010/268] KVM: x86: expose MSR_TSC_AUX to userspace
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (8 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 009/268] cxl: use correct operator when writing pcie config space values Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 011/268] KVM: x86: correctly print #AC in traces Kamal Mostafa
` (257 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Radim Krcmar, Paolo Bonzini, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Paolo Bonzini <pbonzini@redhat.com>
commit 9dbe6cf941a6fe82933aef565e4095fb10f65023 upstream.
If we do not do this, it is not properly saved and restored across
migration. Windows notices due to its self-protection mechanisms,
and is very upset about it (blue screen of death).
Cc: Radim Krcmar <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kvm/x86.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index d022b73..35b6bd2 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -941,7 +941,7 @@ static u32 msrs_to_save[] = {
MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR,
#endif
MSR_IA32_TSC, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA,
- MSR_IA32_FEATURE_CONTROL, MSR_IA32_BNDCFGS
+ MSR_IA32_FEATURE_CONTROL, MSR_IA32_BNDCFGS, MSR_TSC_AUX,
};
static unsigned num_msrs_to_save;
@@ -4053,16 +4053,17 @@ static void kvm_init_msr_list(void)
/*
* Even MSRs that are valid in the host may not be exposed
- * to the guests in some cases. We could work around this
- * in VMX with the generic MSR save/load machinery, but it
- * is not really worthwhile since it will really only
- * happen with nested virtualization.
+ * to the guests in some cases.
*/
switch (msrs_to_save[i]) {
case MSR_IA32_BNDCFGS:
if (!kvm_x86_ops->mpx_supported())
continue;
break;
+ case MSR_TSC_AUX:
+ if (!kvm_x86_ops->rdtscp_supported())
+ continue;
+ break;
default:
break;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 011/268] KVM: x86: correctly print #AC in traces
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (9 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 010/268] KVM: x86: expose MSR_TSC_AUX to userspace Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 012/268] drm/amdgpu: call hpd_irq_event on resume Kamal Mostafa
` (256 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Paolo Bonzini, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Paolo Bonzini <pbonzini@redhat.com>
commit aba2f06c070f604e388cf77b1dcc7f4cf4577eb0 upstream.
Poor #AC was so unimportant until a few days ago that we were
not even tracing its name correctly. But now it's all over
the place.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kvm/trace.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index 4eae7c3..08b668c 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -250,7 +250,7 @@ TRACE_EVENT(kvm_inj_virq,
#define kvm_trace_sym_exc \
EXS(DE), EXS(DB), EXS(BP), EXS(OF), EXS(BR), EXS(UD), EXS(NM), \
EXS(DF), EXS(TS), EXS(NP), EXS(SS), EXS(GP), EXS(PF), \
- EXS(MF), EXS(MC)
+ EXS(MF), EXS(AC), EXS(MC)
/*
* Tracepoint for kvm interrupt injection:
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 012/268] drm/amdgpu: call hpd_irq_event on resume
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (10 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 011/268] KVM: x86: correctly print #AC in traces Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 013/268] drm/radeon: " Kamal Mostafa
` (255 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit 54fb2a5cd0baf8e97d743de411e2f832d1afa68d upstream.
Need to call this on resume if displays changes during
suspend in order to properly be notified of changes.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 99f158e..e12f490 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1757,6 +1757,7 @@ int amdgpu_resume_kms(struct drm_device *dev, bool resume, bool fbcon)
}
drm_kms_helper_poll_enable(dev);
+ drm_helper_hpd_irq_event(dev);
if (fbcon) {
amdgpu_fbdev_set_suspend(adev, 0);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 013/268] drm/radeon: call hpd_irq_event on resume
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (11 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 012/268] drm/amdgpu: call hpd_irq_event on resume Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 014/268] xhci: refuse loading if nousb is used Kamal Mostafa
` (254 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit dbb17a21c131eca94eb31136eee9a7fe5aff00d9 upstream.
Need to call this on resume if displays changes during
suspend in order to properly be notified of changes.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon_device.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index d8319da..fa98309 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1740,6 +1740,7 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon)
}
drm_kms_helper_poll_enable(dev);
+ drm_helper_hpd_irq_event(dev);
/* set the power state here in case we are a PX system or headless */
if ((rdev->pm.pm_method == PM_METHOD_DPM) && rdev->pm.dpm_enabled)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 014/268] xhci: refuse loading if nousb is used
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (12 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 013/268] drm/radeon: " Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 015/268] ARM: mvebu: remove duplicated regulator definition in Armada 388 GP Kamal Mostafa
` (253 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Oliver Neukum, Greg Kroah-Hartman, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Oliver Neukum <oneukum@suse.com>
commit 1eaf35e4dd592c59041bc1ed3248c46326da1f5f upstream.
The module should fail to load.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/host/xhci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index b30f55e..8fe947c 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -5046,6 +5046,10 @@ static int __init xhci_hcd_init(void)
BUILD_BUG_ON(sizeof(struct xhci_intr_reg) != 8*32/8);
/* xhci_run_regs has eight fields and embeds 128 xhci_intr_regs */
BUILD_BUG_ON(sizeof(struct xhci_run_regs) != (8+8*128)*32/8);
+
+ if (usb_disabled())
+ return -ENODEV;
+
return 0;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 015/268] ARM: mvebu: remove duplicated regulator definition in Armada 388 GP
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (13 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 014/268] xhci: refuse loading if nousb is used Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 016/268] arm64: Clear out any singlestep state on a ptrace detach operation Kamal Mostafa
` (252 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Thomas Petazzoni, Gregory CLEMENT, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
commit 079ae0c121fd23287f4ad2be9e9f8a13f63cae73 upstream.
The Armada 388 GP Device Tree file describes two times a regulator
named 'reg_usb2_1_vbus', with the exact same description. This has
been wrong since Armada 388 GP support was introduced.
Fixes: 928413bd859c0 ("ARM: mvebu: Add Armada 388 General Purpose Development Board support")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/dts/armada-388-gp.dts | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/arch/arm/boot/dts/armada-388-gp.dts b/arch/arm/boot/dts/armada-388-gp.dts
index fd4f6fd..c79ca20 100644
--- a/arch/arm/boot/dts/armada-388-gp.dts
+++ b/arch/arm/boot/dts/armada-388-gp.dts
@@ -288,16 +288,6 @@
gpio = <&expander0 4 GPIO_ACTIVE_HIGH>;
};
- reg_usb2_1_vbus: v5-vbus1 {
- compatible = "regulator-fixed";
- regulator-name = "v5.0-vbus1";
- regulator-min-microvolt = <5000000>;
- regulator-max-microvolt = <5000000>;
- enable-active-high;
- regulator-always-on;
- gpio = <&expander0 4 GPIO_ACTIVE_HIGH>;
- };
-
reg_sata0: pwr-sata0 {
compatible = "regulator-fixed";
regulator-name = "pwr_en_sata0";
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 016/268] arm64: Clear out any singlestep state on a ptrace detach operation
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (14 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 015/268] ARM: mvebu: remove duplicated regulator definition in Armada 388 GP Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 017/268] time: Avoid signed overflow in timekeeping_get_ns() Kamal Mostafa
` (251 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: John Blackwood, Will Deacon, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: John Blackwood <john.blackwood@ccur.com>
commit 5db4fd8c52810bd9740c1240ebf89223b171aa70 upstream.
Make sure to clear out any ptrace singlestep state when a ptrace(2)
PTRACE_DETACH call is made on arm64 systems.
Otherwise, the previously ptraced task will die off with a SIGTRAP
signal if the debugger just previously singlestepped the ptraced task.
Signed-off-by: John Blackwood <john.blackwood@ccur.com>
[will: added comment to justify why this is in the arch code]
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm64/kernel/ptrace.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index d882b83..608ac6a 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -58,6 +58,12 @@
*/
void ptrace_disable(struct task_struct *child)
{
+ /*
+ * This would be better off in core code, but PTRACE_DETACH has
+ * grown its fair share of arch-specific worts and changing it
+ * is likely to cause regressions on obscure architectures.
+ */
+ user_disable_single_step(child);
}
#ifdef CONFIG_HAVE_HW_BREAKPOINT
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 017/268] time: Avoid signed overflow in timekeeping_get_ns()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (15 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 016/268] arm64: Clear out any singlestep state on a ptrace detach operation Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 018/268] ovl: root: copy attr Kamal Mostafa
` (250 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: David Gibson, John Stultz, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: David Gibson <david@gibson.dropbear.id.au>
commit 35a4933a895927990772ae96fdcfd2f806929ee2 upstream.
1e75fa8 "time: Condense timekeeper.xtime into xtime_sec" replaced a call to
clocksource_cyc2ns() from timekeeping_get_ns() with an open-coded version
of the same logic to avoid keeping a semi-redundant struct timespec
in struct timekeeper.
However, the commit also introduced a subtle semantic change - where
clocksource_cyc2ns() uses purely unsigned math, the new version introduces
a signed temporary, meaning that if (delta * tk->mult) has a 63-bit
overflow the following shift will still give a negative result. The
choice of 'maxsec' in __clocksource_updatefreq_scale() means this will
generally happen if there's a ~10 minute pause in examining the
clocksource.
This can be triggered on a powerpc KVM guest by stopping it from qemu for
a bit over 10 minutes. After resuming time has jumped backwards several
minutes causing numerous problems (jiffies does not advance, msleep()s can
be extended by minutes..). It doesn't happen on x86 KVM guests, because
the guest TSC is effectively frozen while the guest is stopped, which is
not the case for the powerpc timebase.
Obviously an unsigned (64 bit) overflow will only take twice as long as a
signed, 63-bit overflow. I don't know the time code well enough to know
if that will still cause incorrect calculations, or if a 64-bit overflow
is avoided elsewhere.
Still, an incorrect forwards clock adjustment will cause less trouble than
time going backwards. So, this patch removes the potential for
intermediate signed overflow.
Suggested-by: Laurent Vivier <lvivier@redhat.com>
Tested-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/time/timekeeping.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 3688f1e..afb50be 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -305,8 +305,7 @@ static inline s64 timekeeping_get_ns(struct tk_read_base *tkr)
delta = timekeeping_get_delta(tkr);
- nsec = delta * tkr->mult + tkr->xtime_nsec;
- nsec >>= tkr->shift;
+ nsec = (delta * tkr->mult + tkr->xtime_nsec) >> tkr->shift;
/* If arch requires, add in get_arch_timeoffset() */
return nsec + arch_gettimeoffset();
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 018/268] ovl: root: copy attr
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (16 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 017/268] time: Avoid signed overflow in timekeeping_get_ns() Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 019/268] Bluetooth: Add support of Toshiba Broadcom based devices Kamal Mostafa
` (249 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Miklos Szeredi, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Miklos Szeredi <miklos@szeredi.hu>
commit ed06e069775ad9236087594a1c1667367e983fb5 upstream.
We copy i_uid and i_gid of underlying inode into overlayfs inode. Except
for the root inode.
Fix this omission.
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/overlayfs/super.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index e38ee0f..ff82665 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1053,6 +1053,9 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
root_dentry->d_fsdata = oe;
+ ovl_copyattr(ovl_dentry_real(root_dentry)->d_inode,
+ root_dentry->d_inode);
+
sb->s_magic = OVERLAYFS_SUPER_MAGIC;
sb->s_op = &ovl_super_operations;
sb->s_root = root_dentry;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 019/268] Bluetooth: Add support of Toshiba Broadcom based devices
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (17 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 018/268] ovl: root: copy attr Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 020/268] ext4 crypto: exit cleanly if ext4_derive_key_aes() fails Kamal Mostafa
` (248 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dmitry Tunin, Marcel Holtmann, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Dmitry Tunin <hanipouspilot@gmail.com>
commit 1623d0bf847d3b38d8cf24367b3689ba0e3fe2aa upstream.
BugLink: https://bugs.launchpad.net/bugs/1522949
T: Bus=03 Lev=02 Prnt=02 Port=05 Cnt=02 Dev#= 4 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0930 ProdID=0225 Rev=01.12
S: Manufacturer=Broadcom Corp
S: Product=BCM43142A0
S: SerialNumber=4CBB58034671
C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/bluetooth/btusb.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 7d9b09f..f869fb1 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -145,6 +145,10 @@ static const struct usb_device_id btusb_table[] = {
{ USB_VENDOR_AND_INTERFACE_INFO(0x13d3, 0xff, 0x01, 0x01),
.driver_info = BTUSB_BCM_PATCHRAM },
+ /* Toshiba Corp - Broadcom based */
+ { USB_VENDOR_AND_INTERFACE_INFO(0x0930, 0xff, 0x01, 0x01),
+ .driver_info = BTUSB_BCM_PATCHRAM },
+
/* Intel Bluetooth USB Bootloader (RAM module) */
{ USB_DEVICE(0x8087, 0x0a5a),
.driver_info = BTUSB_INTEL_BOOT | BTUSB_BROKEN_ISOC },
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 020/268] ext4 crypto: exit cleanly if ext4_derive_key_aes() fails
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (18 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 019/268] Bluetooth: Add support of Toshiba Broadcom based devices Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 021/268] ext4 crypto: add missing locking for keyring_key access Kamal Mostafa
` (247 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Laurent Navet, Theodore Ts'o, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Laurent Navet <laurent.navet@gmail.com>
commit d76d99b219e1a233a720775c0451c310d34594e8 upstream.
Return value of ext4_derive_key_aes() is stored but not used.
Add test to exit cleanly if ext4_derive_key_aes() fail.
Also fix coverity CID 1309760.
Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/ext4/crypto_key.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
index 9bad113..dde261b 100644
--- a/fs/ext4/crypto_key.c
+++ b/fs/ext4/crypto_key.c
@@ -230,6 +230,8 @@ retry:
}
res = ext4_derive_key_aes(ctx.nonce, master_key->raw,
raw_key);
+ if (res)
+ goto out;
got_key:
ctfm = crypto_alloc_ablkcipher(cipher_str, 0, 0);
if (!ctfm || IS_ERR(ctfm)) {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 021/268] ext4 crypto: add missing locking for keyring_key access
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (19 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 020/268] ext4 crypto: exit cleanly if ext4_derive_key_aes() fails Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 022/268] rtlwifi: fix memory leak for USB device Kamal Mostafa
` (246 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Theodore Ts'o, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Theodore Ts'o <tytso@mit.edu>
commit db7730e3091a52c2fcd8fcc952b964d88998e675 upstream.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/ext4/crypto_key.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
index dde261b..5c13735 100644
--- a/fs/ext4/crypto_key.c
+++ b/fs/ext4/crypto_key.c
@@ -213,9 +213,11 @@ retry:
res = -ENOKEY;
goto out;
}
+ down_read(&keyring_key->sem);
ukp = ((struct user_key_payload *)keyring_key->payload.data);
if (ukp->datalen != sizeof(struct ext4_encryption_key)) {
res = -EINVAL;
+ up_read(&keyring_key->sem);
goto out;
}
master_key = (struct ext4_encryption_key *)ukp->data;
@@ -226,10 +228,12 @@ retry:
"ext4: key size incorrect: %d\n",
master_key->size);
res = -ENOKEY;
+ up_read(&keyring_key->sem);
goto out;
}
res = ext4_derive_key_aes(ctx.nonce, master_key->raw,
raw_key);
+ up_read(&keyring_key->sem);
if (res)
goto out;
got_key:
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 022/268] rtlwifi: fix memory leak for USB device
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (20 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 021/268] ext4 crypto: add missing locking for keyring_key access Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 023/268] wlcore/wl12xx: spi: fix oops on firmware load Kamal Mostafa
` (245 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Peter Wu, Kalle Valo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Peter Wu <peter@lekensteyn.nl>
commit 17bc55864f81dd730d05f09b1641312a7990d636 upstream.
Free skb for received frames with a wrong checksum. This can happen
pretty rapidly, exhausting all memory.
This fixes a memleak (detected with kmemleak). Originally found while
using monitor mode, but it also appears during managed mode (once the
link is up).
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/rtlwifi/usb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index 2721cf8..aac1ed3 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -531,6 +531,8 @@ static void _rtl_usb_rx_process_noagg(struct ieee80211_hw *hw,
ieee80211_rx(hw, skb);
else
dev_kfree_skb_any(skb);
+ } else {
+ dev_kfree_skb_any(skb);
}
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 023/268] wlcore/wl12xx: spi: fix oops on firmware load
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (21 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 022/268] rtlwifi: fix memory leak for USB device Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 024/268] ovl: setattr: check permissions before copy-up Kamal Mostafa
` (244 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Uri Mashiach, Kalle Valo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Uri Mashiach <uri.mashiach@compulab.co.il>
commit 9b2761cb72dc41e1948c8a5512b4efd384eda130 upstream.
The maximum chunks used by the function is
(SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE + 1).
The original commands array had space for
(SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE) commands.
When the last chunk is used (len > 4 * WSPI_MAX_CHUNK_SIZE), the last
command is stored outside the bounds of the commands array.
Oops 5 (page fault) is generated during current wl1271 firmware load
attempt:
root@debian-armhf:~# ifconfig wlan0 up
[ 294.312399] Unable to handle kernel paging request at virtual address
00203fc4
[ 294.320173] pgd = de528000
[ 294.323028] [00203fc4] *pgd=00000000
[ 294.326916] Internal error: Oops: 5 [#1] SMP ARM
[ 294.331789] Modules linked in: bnep rfcomm bluetooth ipv6 arc4 wl12xx
wlcore mac80211 musb_dsps cfg80211 musb_hdrc usbcore usb_common
wlcore_spi omap_rng rng_core musb_am335x omap_wdt cpufreq_dt thermal_sys
hwmon
[ 294.351838] CPU: 0 PID: 1827 Comm: ifconfig Not tainted
4.2.0-00002-g3e9ad27-dirty #78
[ 294.360154] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 294.366557] task: dc9d6d40 ti: de550000 task.ti: de550000
[ 294.372236] PC is at __spi_validate+0xa8/0x2ac
[ 294.376902] LR is at __spi_sync+0x78/0x210
[ 294.381200] pc : [<c049c760>] lr : [<c049ebe0>] psr: 60000013
[ 294.381200] sp : de551998 ip : de5519d8 fp : 00200000
[ 294.393242] r10: de551c8c r9 : de5519d8 r8 : de3a9000
[ 294.398730] r7 : de3a9258 r6 : de3a9400 r5 : de551a48 r4 :
00203fbc
[ 294.405577] r3 : 00000000 r2 : 00000000 r1 : 00000000 r0 :
de3a9000
[ 294.412420] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM
Segment user
[ 294.419918] Control: 10c5387d Table: 9e528019 DAC: 00000015
[ 294.425954] Process ifconfig (pid: 1827, stack limit = 0xde550218)
[ 294.432437] Stack: (0xde551998 to 0xde552000)
...
[ 294.883613] [<c049c760>] (__spi_validate) from [<c049ebe0>]
(__spi_sync+0x78/0x210)
[ 294.891670] [<c049ebe0>] (__spi_sync) from [<bf036598>]
(wl12xx_spi_raw_write+0xfc/0x148 [wlcore_spi])
[ 294.901661] [<bf036598>] (wl12xx_spi_raw_write [wlcore_spi]) from
[<bf21c694>] (wlcore_boot_upload_firmware+0x1ec/0x458 [wlcore])
[ 294.914038] [<bf21c694>] (wlcore_boot_upload_firmware [wlcore]) from
[<bf24532c>] (wl12xx_boot+0xc10/0xfac [wl12xx])
[ 294.925161] [<bf24532c>] (wl12xx_boot [wl12xx]) from [<bf20d5cc>]
(wl1271_op_add_interface+0x5b0/0x910 [wlcore])
[ 294.936364] [<bf20d5cc>] (wl1271_op_add_interface [wlcore]) from
[<bf15c4ac>] (ieee80211_do_open+0x44c/0xf7c [mac80211])
[ 294.947963] [<bf15c4ac>] (ieee80211_do_open [mac80211]) from
[<c0537978>] (__dev_open+0xa8/0x110)
[ 294.957307] [<c0537978>] (__dev_open) from [<c0537bf8>]
(__dev_change_flags+0x88/0x148)
[ 294.965713] [<c0537bf8>] (__dev_change_flags) from [<c0537cd0>]
(dev_change_flags+0x18/0x48)
[ 294.974576] [<c0537cd0>] (dev_change_flags) from [<c05a55a0>]
(devinet_ioctl+0x6b4/0x7d0)
[ 294.983191] [<c05a55a0>] (devinet_ioctl) from [<c0517040>]
(sock_ioctl+0x1e4/0x2bc)
[ 294.991244] [<c0517040>] (sock_ioctl) from [<c017d378>]
(do_vfs_ioctl+0x420/0x6b0)
[ 294.999208] [<c017d378>] (do_vfs_ioctl) from [<c017d674>]
(SyS_ioctl+0x6c/0x7c)
[ 295.006880] [<c017d674>] (SyS_ioctl) from [<c000f4c0>]
(ret_fast_syscall+0x0/0x54)
[ 295.014835] Code: e1550004 e2444034 0a00007d e5953018 (e5942008)
[ 295.021544] ---[ end trace 66ed188198f4e24e ]---
Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/ti/wlcore/spi.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index f1ac283..720e4e4 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -73,7 +73,10 @@
*/
#define SPI_AGGR_BUFFER_SIZE (4 * PAGE_SIZE)
-#define WSPI_MAX_NUM_OF_CHUNKS (SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE)
+/* Maximum number of SPI write chunks */
+#define WSPI_MAX_NUM_OF_CHUNKS \
+ ((SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE) + 1)
+
struct wl12xx_spi_glue {
struct device *dev;
@@ -268,9 +271,10 @@ static int __must_check wl12xx_spi_raw_write(struct device *child, int addr,
void *buf, size_t len, bool fixed)
{
struct wl12xx_spi_glue *glue = dev_get_drvdata(child->parent);
- struct spi_transfer t[2 * (WSPI_MAX_NUM_OF_CHUNKS + 1)];
+ /* SPI write buffers - 2 for each chunk */
+ struct spi_transfer t[2 * WSPI_MAX_NUM_OF_CHUNKS];
struct spi_message m;
- u32 commands[WSPI_MAX_NUM_OF_CHUNKS];
+ u32 commands[WSPI_MAX_NUM_OF_CHUNKS]; /* 1 command per chunk */
u32 *cmd;
u32 chunk_len;
int i;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 024/268] ovl: setattr: check permissions before copy-up
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (22 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 023/268] wlcore/wl12xx: spi: fix oops on firmware load Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 025/268] ovl: check dentry positiveness in ovl_cleanup_whiteouts() Kamal Mostafa
` (243 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Miklos Szeredi, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Miklos Szeredi <miklos@szeredi.hu>
commit cf9a6784f7c1b5ee2b9159a1246e327c331c5697 upstream.
Without this copy-up of a file can be forced, even without actually being
allowed to do anything on the file.
[Arnd Bergmann] include <linux/pagemap.h> for PAGE_CACHE_SIZE (used by
MAX_LFS_FILESIZE definition).
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/overlayfs/inode.c | 13 +++++++++++++
fs/overlayfs/super.c | 2 ++
2 files changed, 15 insertions(+)
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index 9612849..34300c2 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -45,6 +45,19 @@ int ovl_setattr(struct dentry *dentry, struct iattr *attr)
int err;
struct dentry *upperdentry;
+ /*
+ * Check for permissions before trying to copy-up. This is redundant
+ * since it will be rechecked later by ->setattr() on upper dentry. But
+ * without this, copy-up can be triggered by just about anybody.
+ *
+ * We don't initialize inode->size, which just means that
+ * inode_newsize_ok() will always check against MAX_LFS_FILESIZE and not
+ * check for a swapfile (which this won't be anyway).
+ */
+ err = inode_change_ok(dentry->d_inode, attr);
+ if (err)
+ return err;
+
err = ovl_want_write(dentry);
if (err)
goto out;
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index ff82665..f42c940 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -9,6 +9,7 @@
#include <linux/fs.h>
#include <linux/namei.h>
+#include <linux/pagemap.h>
#include <linux/xattr.h>
#include <linux/security.h>
#include <linux/mount.h>
@@ -910,6 +911,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
}
sb->s_stack_depth = 0;
+ sb->s_maxbytes = MAX_LFS_FILESIZE;
if (ufs->config.upperdir) {
if (!ufs->config.workdir) {
pr_err("overlayfs: missing 'workdir'\n");
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 025/268] ovl: check dentry positiveness in ovl_cleanup_whiteouts()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (23 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 024/268] ovl: setattr: check permissions before copy-up Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 026/268] EDAC, mc_sysfs: Fix freeing bus' name Kamal Mostafa
` (242 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Konstantin Khlebnikov, Miklos Szeredi, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
commit 84889d49335627bc770b32787c1ef9ebad1da232 upstream.
This patch fixes kernel crash at removing directory which contains
whiteouts from lower layers.
Cache of directory content passed as "list" contains entries from all
layers, including whiteouts from lower layers. So, lookup in upper dir
(moved into work at this stage) will return negative entry. Plus this
cache is filled long before and we can race with external removal.
Example:
mkdir -p lower0/dir lower1/dir upper work overlay
touch lower0/dir/a lower0/dir/b
mknod lower1/dir/a c 0 0
mount -t overlay none overlay -o lowerdir=lower1:lower0,upperdir=upper,workdir=work
rm -fr overlay/dir
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/overlayfs/readdir.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c
index 70e9af5..adcb139 100644
--- a/fs/overlayfs/readdir.c
+++ b/fs/overlayfs/readdir.c
@@ -571,7 +571,8 @@ void ovl_cleanup_whiteouts(struct dentry *upper, struct list_head *list)
(int) PTR_ERR(dentry));
continue;
}
- ovl_cleanup(upper->d_inode, dentry);
+ if (dentry->d_inode)
+ ovl_cleanup(upper->d_inode, dentry);
dput(dentry);
}
mutex_unlock(&upper->d_inode->i_mutex);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 026/268] EDAC, mc_sysfs: Fix freeing bus' name
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (24 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 025/268] ovl: check dentry positiveness in ovl_cleanup_whiteouts() Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 027/268] EDAC: Robustify workqueues destruction Kamal Mostafa
` (241 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Borislav Petkov, Mauro Carvalho Chehab, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Borislav Petkov <bp@suse.de>
commit 12e26969b32c79018165d52caff3762135614aa1 upstream.
I get the splat below when modprobing/rmmoding EDAC drivers. It happens
because bus->name is invalid after bus_unregister() has run. The Code: section
below corresponds to:
.loc 1 1108 0
movq 672(%rbx), %rax # mci_1(D)->bus, mci_1(D)->bus
.loc 1 1109 0
popq %rbx #
.loc 1 1108 0
movq (%rax), %rdi # _7->name,
jmp kfree #
and %rax has some funky stuff 2030203020312030 which looks a lot like
something walked over it.
Fix that by saving the name ptr before doing stuff to string it points to.
general protection fault: 0000 [#1] SMP
Modules linked in: ...
CPU: 4 PID: 10318 Comm: modprobe Tainted: G I EN 3.12.51-11-default+ #48
Hardware name: HP ProLiant DL380 G7, BIOS P67 05/05/2011
task: ffff880311320280 ti: ffff88030da3e000 task.ti: ffff88030da3e000
RIP: 0010:[<ffffffffa019da92>] [<ffffffffa019da92>] edac_unregister_sysfs+0x22/0x30 [edac_core]
RSP: 0018:ffff88030da3fe28 EFLAGS: 00010292
RAX: 2030203020312030 RBX: ffff880311b4e000 RCX: 000000000000095c
RDX: 0000000000000001 RSI: ffff880327bb9600 RDI: 0000000000000286
RBP: ffff880311b4e750 R08: 0000000000000000 R09: ffffffff81296110
R10: 0000000000000400 R11: 0000000000000000 R12: ffff88030ba1ac68
R13: 0000000000000001 R14: 00000000011b02f0 R15: 0000000000000000
FS: 00007fc9bf8f5700(0000) GS:ffff8801a7c40000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000403c90 CR3: 000000019ebdf000 CR4: 00000000000007e0
Stack:
Call Trace:
i7core_unregister_mci.isra.9
i7core_remove
pci_device_remove
__device_release_driver
driver_detach
bus_remove_driver
pci_unregister_driver
i7core_exit
SyS_delete_module
system_call_fastpath
0x7fc9bf426536
Code: 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 53 48 89 fb e8 52 2a 1f e1 48 8b bb a0 02 00 00 e8 46 59 1f e1 48 8b 83 a0 02 00 00 5b <48> 8b 38 e9 26 9a fe e0 66 0f 1f 44 00 00 66 66 66 66 90 48 8b
RIP [<ffffffffa019da92>] edac_unregister_sysfs+0x22/0x30 [edac_core]
RSP <ffff88030da3fe28>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Fixes: 7a623c039075 ("edac: rewrite the sysfs code to use struct device")
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/edac/edac_mc_sysfs.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index 33df7d9..c3711ae 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -972,21 +972,26 @@ nomem:
int edac_create_sysfs_mci_device(struct mem_ctl_info *mci,
const struct attribute_group **groups)
{
+ char *name;
int i, err;
/*
* The memory controller needs its own bus, in order to avoid
* namespace conflicts at /sys/bus/edac.
*/
- mci->bus->name = kasprintf(GFP_KERNEL, "mc%d", mci->mc_idx);
- if (!mci->bus->name)
+ name = kasprintf(GFP_KERNEL, "mc%d", mci->mc_idx);
+ if (!name)
return -ENOMEM;
+ mci->bus->name = name;
+
edac_dbg(0, "creating bus %s\n", mci->bus->name);
err = bus_register(mci->bus);
- if (err < 0)
- goto fail_free_name;
+ if (err < 0) {
+ kfree(name);
+ return err;
+ }
/* get the /sys/devices/system/edac subsys reference */
mci->dev.type = &mci_attr_type;
@@ -1055,8 +1060,8 @@ fail_unregister_dimm:
device_unregister(&mci->dev);
fail_unregister_bus:
bus_unregister(mci->bus);
-fail_free_name:
- kfree(mci->bus->name);
+ kfree(name);
+
return err;
}
@@ -1087,10 +1092,12 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
void edac_unregister_sysfs(struct mem_ctl_info *mci)
{
+ const char *name = mci->bus->name;
+
edac_dbg(1, "Unregistering device %s\n", dev_name(&mci->dev));
device_unregister(&mci->dev);
bus_unregister(mci->bus);
- kfree(mci->bus->name);
+ kfree(name);
}
static void mc_attr_release(struct device *dev)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 027/268] EDAC: Robustify workqueues destruction
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (25 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 026/268] EDAC, mc_sysfs: Fix freeing bus' name Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 028/268] arm64: mm: ensure that the zero page is visible to the page table walker Kamal Mostafa
` (240 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Borislav Petkov, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Borislav Petkov <bp@suse.de>
commit fcd5c4dd8201595d4c598c9cca5e54760277d687 upstream.
EDAC workqueue destruction is really fragile. We cancel delayed work
but if it is still running and requeues itself, we still go ahead and
destroy the workqueue and the queued work explodes when workqueue core
attempts to run it.
Make the destruction more robust by switching op_state to offline so
that requeuing stops. Cancel any pending work *synchronously* too.
EDAC i7core: Driver loaded.
general protection fault: 0000 [#1] SMP
CPU 12
Modules linked in:
Supported: Yes
Pid: 0, comm: kworker/0:1 Tainted: G IE 3.0.101-0-default #1 HP ProLiant DL380 G7
RIP: 0010:[<ffffffff8107dcd7>] [<ffffffff8107dcd7>] __queue_work+0x17/0x3f0
< ... regs ...>
Process kworker/0:1 (pid: 0, threadinfo ffff88019def6000, task ffff88019def4600)
Stack:
...
Call Trace:
call_timer_fn
run_timer_softirq
__do_softirq
call_softirq
do_softirq
irq_exit
smp_apic_timer_interrupt
apic_timer_interrupt
intel_idle
cpuidle_idle_call
cpu_idle
Code: ...
RIP __queue_work
RSP <...>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/edac/edac_device.c | 11 ++++-------
drivers/edac/edac_mc.c | 14 +++-----------
drivers/edac/edac_pci.c | 9 ++++-----
3 files changed, 11 insertions(+), 23 deletions(-)
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
index 592af5f..5358737 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
@@ -435,16 +435,13 @@ void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev,
*/
void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev)
{
- int status;
-
if (!edac_dev->edac_check)
return;
- status = cancel_delayed_work(&edac_dev->work);
- if (status == 0) {
- /* workq instance might be running, wait for it */
- flush_workqueue(edac_workqueue);
- }
+ edac_dev->op_state = OP_OFFLINE;
+
+ cancel_delayed_work_sync(&edac_dev->work);
+ flush_workqueue(edac_workqueue);
}
/*
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 943ed8c..e315e5e 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -586,18 +586,10 @@ static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec,
*/
static void edac_mc_workq_teardown(struct mem_ctl_info *mci)
{
- int status;
-
- if (mci->op_state != OP_RUNNING_POLL)
- return;
-
- status = cancel_delayed_work(&mci->work);
- if (status == 0) {
- edac_dbg(0, "not canceled, flush the queue\n");
+ mci->op_state = OP_OFFLINE;
- /* workq instance might be running, wait for it */
- flush_workqueue(edac_workqueue);
- }
+ cancel_delayed_work_sync(&mci->work);
+ flush_workqueue(edac_workqueue);
}
/*
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
index 2cf44b4d..b4b3860 100644
--- a/drivers/edac/edac_pci.c
+++ b/drivers/edac/edac_pci.c
@@ -274,13 +274,12 @@ static void edac_pci_workq_setup(struct edac_pci_ctl_info *pci,
*/
static void edac_pci_workq_teardown(struct edac_pci_ctl_info *pci)
{
- int status;
-
edac_dbg(0, "\n");
- status = cancel_delayed_work(&pci->work);
- if (status == 0)
- flush_workqueue(edac_workqueue);
+ pci->op_state = OP_OFFLINE;
+
+ cancel_delayed_work_sync(&pci->work);
+ flush_workqueue(edac_workqueue);
}
/*
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 028/268] arm64: mm: ensure that the zero page is visible to the page table walker
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (26 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 027/268] EDAC: Robustify workqueues destruction Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 029/268] powerpc: Make value-returning atomics fully ordered Kamal Mostafa
` (239 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Will Deacon, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Will Deacon <will.deacon@arm.com>
commit 32d6397805d00573ce1fa55f408ce2bca15b0ad3 upstream.
In paging_init, we allocate the zero page, memset it to zero and then
point TTBR0 to it in order to avoid speculative fetches through the
identity mapping.
In order to guarantee that the freshly zeroed page is indeed visible to
the page table walker, we need to execute a dsb instruction prior to
writing the TTBR.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm64/mm/mmu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 6a0dc30..3d016b9 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -451,6 +451,9 @@ void __init paging_init(void)
empty_zero_page = virt_to_page(zero_page);
+ /* Ensure the zero page is visible to the page table walker */
+ dsb(ishst);
+
/*
* TTBR0 is only used for the identity mapping at this stage. Make it
* point to zero page to avoid speculatively fetching new entries.
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 029/268] powerpc: Make value-returning atomics fully ordered
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (27 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 028/268] arm64: mm: ensure that the zero page is visible to the page table walker Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 030/268] powerpc: Make {cmp}xchg* and their atomic_ versions " Kamal Mostafa
` (238 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Boqun Feng, Michael Ellerman, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Boqun Feng <boqun.feng@gmail.com>
commit 49e9cf3f0c04bf76ffa59242254110309554861d upstream.
According to memory-barriers.txt:
> Any atomic operation that modifies some state in memory and returns
> information about the state (old or new) implies an SMP-conditional
> general memory barrier (smp_mb()) on each side of the actual
> operation ...
Which mean these operations should be fully ordered. However on PPC,
PPC_ATOMIC_ENTRY_BARRIER is the barrier before the actual operation,
which is currently "lwsync" if SMP=y. The leading "lwsync" can not
guarantee fully ordered atomics, according to Paul Mckenney:
https://lkml.org/lkml/2015/10/14/970
To fix this, we define PPC_ATOMIC_ENTRY_BARRIER as "sync" to guarantee
the fully-ordered semantics.
This also makes futex atomics fully ordered, which can avoid possible
memory ordering problems if userspace code relies on futex system call
for fully ordered semantics.
Fixes: b97021f85517 ("powerpc: Fix atomic_xxx_return barrier semantics")
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/powerpc/include/asm/synch.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/synch.h b/arch/powerpc/include/asm/synch.h
index e682a71..c508686 100644
--- a/arch/powerpc/include/asm/synch.h
+++ b/arch/powerpc/include/asm/synch.h
@@ -44,7 +44,7 @@ static inline void isync(void)
MAKE_LWSYNC_SECTION_ENTRY(97, __lwsync_fixup);
#define PPC_ACQUIRE_BARRIER "\n" stringify_in_c(__PPC_ACQUIRE_BARRIER)
#define PPC_RELEASE_BARRIER stringify_in_c(LWSYNC) "\n"
-#define PPC_ATOMIC_ENTRY_BARRIER "\n" stringify_in_c(LWSYNC) "\n"
+#define PPC_ATOMIC_ENTRY_BARRIER "\n" stringify_in_c(sync) "\n"
#define PPC_ATOMIC_EXIT_BARRIER "\n" stringify_in_c(sync) "\n"
#else
#define PPC_ACQUIRE_BARRIER
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 030/268] powerpc: Make {cmp}xchg* and their atomic_ versions fully ordered
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (28 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 029/268] powerpc: Make value-returning atomics fully ordered Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 031/268] dm space map metadata: remove unused variable in brb_pop() Kamal Mostafa
` (237 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Boqun Feng, Michael Ellerman, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Boqun Feng <boqun.feng@gmail.com>
commit 81d7a3294de7e9828310bbf986a67246b13fa01e upstream.
According to memory-barriers.txt, xchg*, cmpxchg* and their atomic_
versions all need to be fully ordered, however they are now just
RELEASE+ACQUIRE, which are not fully ordered.
So also replace PPC_RELEASE_BARRIER and PPC_ACQUIRE_BARRIER with
PPC_ATOMIC_ENTRY_BARRIER and PPC_ATOMIC_EXIT_BARRIER in
__{cmp,}xchg_{u32,u64} respectively to guarantee fully ordered semantics
of atomic{,64}_{cmp,}xchg() and {cmp,}xchg(), as a complement of commit
b97021f85517 ("powerpc: Fix atomic_xxx_return barrier semantics")
This patch depends on patch "powerpc: Make value-returning atomics fully
ordered" for PPC_ATOMIC_ENTRY_BARRIER definition.
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/powerpc/include/asm/cmpxchg.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/include/asm/cmpxchg.h b/arch/powerpc/include/asm/cmpxchg.h
index ad6263c..d1a8d93 100644
--- a/arch/powerpc/include/asm/cmpxchg.h
+++ b/arch/powerpc/include/asm/cmpxchg.h
@@ -18,12 +18,12 @@ __xchg_u32(volatile void *p, unsigned long val)
unsigned long prev;
__asm__ __volatile__(
- PPC_RELEASE_BARRIER
+ PPC_ATOMIC_ENTRY_BARRIER
"1: lwarx %0,0,%2 \n"
PPC405_ERR77(0,%2)
" stwcx. %3,0,%2 \n\
bne- 1b"
- PPC_ACQUIRE_BARRIER
+ PPC_ATOMIC_EXIT_BARRIER
: "=&r" (prev), "+m" (*(volatile unsigned int *)p)
: "r" (p), "r" (val)
: "cc", "memory");
@@ -61,12 +61,12 @@ __xchg_u64(volatile void *p, unsigned long val)
unsigned long prev;
__asm__ __volatile__(
- PPC_RELEASE_BARRIER
+ PPC_ATOMIC_ENTRY_BARRIER
"1: ldarx %0,0,%2 \n"
PPC405_ERR77(0,%2)
" stdcx. %3,0,%2 \n\
bne- 1b"
- PPC_ACQUIRE_BARRIER
+ PPC_ATOMIC_EXIT_BARRIER
: "=&r" (prev), "+m" (*(volatile unsigned long *)p)
: "r" (p), "r" (val)
: "cc", "memory");
@@ -151,14 +151,14 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
unsigned int prev;
__asm__ __volatile__ (
- PPC_RELEASE_BARRIER
+ PPC_ATOMIC_ENTRY_BARRIER
"1: lwarx %0,0,%2 # __cmpxchg_u32\n\
cmpw 0,%0,%3\n\
bne- 2f\n"
PPC405_ERR77(0,%2)
" stwcx. %4,0,%2\n\
bne- 1b"
- PPC_ACQUIRE_BARRIER
+ PPC_ATOMIC_EXIT_BARRIER
"\n\
2:"
: "=&r" (prev), "+m" (*p)
@@ -197,13 +197,13 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
unsigned long prev;
__asm__ __volatile__ (
- PPC_RELEASE_BARRIER
+ PPC_ATOMIC_ENTRY_BARRIER
"1: ldarx %0,0,%2 # __cmpxchg_u64\n\
cmpd 0,%0,%3\n\
bne- 2f\n\
stdcx. %4,0,%2\n\
bne- 1b"
- PPC_ACQUIRE_BARRIER
+ PPC_ATOMIC_EXIT_BARRIER
"\n\
2:"
: "=&r" (prev), "+m" (*p)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 031/268] dm space map metadata: remove unused variable in brb_pop()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (29 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 030/268] powerpc: Make {cmp}xchg* and their atomic_ versions " Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 032/268] Drivers: hv: vmbus: Fix a Host signaling bug Kamal Mostafa
` (236 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Mike Snitzer, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Mike Snitzer <snitzer@redhat.com>
commit 512167788a6fe9481a33a3cce5f80b684631a1bb upstream.
Remove the unused struct block_op pointer that was inadvertantly
introduced, via cut-and-paste of previous brb_op() code, as part of
commit 50dd842ad.
(Cc'ing stable@ because commit 50dd842ad did)
Fixes: 50dd842ad ("dm space map metadata: fix ref counting bug when bootstrapping a new space map")
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/persistent-data/dm-space-map-metadata.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/md/persistent-data/dm-space-map-metadata.c b/drivers/md/persistent-data/dm-space-map-metadata.c
index fca6dbc..7e44005 100644
--- a/drivers/md/persistent-data/dm-space-map-metadata.c
+++ b/drivers/md/persistent-data/dm-space-map-metadata.c
@@ -152,12 +152,9 @@ static int brb_peek(struct bop_ring_buffer *brb, struct block_op *result)
static int brb_pop(struct bop_ring_buffer *brb)
{
- struct block_op *bop;
-
if (brb_empty(brb))
return -ENODATA;
- bop = brb->bops + brb->begin;
brb->begin = brb_next(brb, brb->begin);
return 0;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 032/268] Drivers: hv: vmbus: Fix a Host signaling bug
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (30 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 031/268] dm space map metadata: remove unused variable in brb_pop() Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 033/268] tools: hv: vss: fix the write()'s argument: error -> vss_msg Kamal Mostafa
` (235 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: K. Y. Srinivasan, Greg Kroah-Hartman, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: "K. Y. Srinivasan" <kys@microsoft.com>
commit 8599846d73997cdbccf63f23394d871cfad1e5e6 upstream.
Currently we have two policies for deciding when to signal the host:
One based on the ring buffer state and the other based on what the
VMBUS client driver wants to do. Consider the case when the client
wants to explicitly control when to signal the host. In this case,
if the client were to defer signaling, we will not be able to signal
the host subsequently when the client does want to signal since the
ring buffer state will prevent the signaling. Implement logic to
have only one signaling policy in force for a given channel.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Tested-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/hv/channel.c | 18 ++++++++++++++++++
include/linux/hyperv.h | 18 ++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index 603ce97..cede914 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -628,10 +628,19 @@ int vmbus_sendpacket_ctl(struct vmbus_channel *channel, void *buffer,
* on the ring. We will not signal if more data is
* to be placed.
*
+ * Based on the channel signal state, we will decide
+ * which signaling policy will be applied.
+ *
* If we cannot write to the ring-buffer; signal the host
* even if we may not have written anything. This is a rare
* enough condition that it should not matter.
*/
+
+ if (channel->signal_policy)
+ signal = true;
+ else
+ kick_q = true;
+
if (((ret == 0) && kick_q && signal) || (ret))
vmbus_setevent(channel);
@@ -731,10 +740,19 @@ int vmbus_sendpacket_pagebuffer_ctl(struct vmbus_channel *channel,
* on the ring. We will not signal if more data is
* to be placed.
*
+ * Based on the channel signal state, we will decide
+ * which signaling policy will be applied.
+ *
* If we cannot write to the ring-buffer; signal the host
* even if we may not have written anything. This is a rare
* enough condition that it should not matter.
*/
+
+ if (channel->signal_policy)
+ signal = true;
+ else
+ kick_q = true;
+
if (((ret == 0) && kick_q && signal) || (ret))
vmbus_setevent(channel);
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 30d3a1f..115d8f5 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -629,6 +629,11 @@ struct hv_input_signal_event_buffer {
struct hv_input_signal_event event;
};
+enum hv_signal_policy {
+ HV_SIGNAL_POLICY_DEFAULT = 0,
+ HV_SIGNAL_POLICY_EXPLICIT,
+};
+
struct vmbus_channel {
/* Unique channel id */
int id;
@@ -756,8 +761,21 @@ struct vmbus_channel {
* link up channels based on their CPU affinity.
*/
struct list_head percpu_list;
+ /*
+ * Host signaling policy: The default policy will be
+ * based on the ring buffer state. We will also support
+ * a policy where the client driver can have explicit
+ * signaling control.
+ */
+ enum hv_signal_policy signal_policy;
};
+static inline void set_channel_signal_state(struct vmbus_channel *c,
+ enum hv_signal_policy policy)
+{
+ c->signal_policy = policy;
+}
+
static inline void set_channel_read_state(struct vmbus_channel *c, bool state)
{
c->batched_reading = state;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 033/268] tools: hv: vss: fix the write()'s argument: error -> vss_msg
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (31 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 032/268] Drivers: hv: vmbus: Fix a Host signaling bug Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 034/268] clk: exynos: use irqsave version of spin_lock to avoid deadlock with irqs Kamal Mostafa
` (234 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Vitaly Kuznetsov, K. Y. Srinivasan, Dexuan Cui,
Greg Kroah-Hartman, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Dexuan Cui <decui@microsoft.com>
commit a689d2510f188e75391dbebacbddfd74d42f2a7e upstream.
Fix the write()'s argument in the daemon code.
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
tools/hv/hv_vss_daemon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
index 96234b6..5d51d6f 100644
--- a/tools/hv/hv_vss_daemon.c
+++ b/tools/hv/hv_vss_daemon.c
@@ -254,7 +254,7 @@ int main(int argc, char *argv[])
syslog(LOG_ERR, "Illegal op:%d\n", op);
}
vss_msg->error = error;
- len = write(vss_fd, &error, sizeof(struct hv_vss_msg));
+ len = write(vss_fd, vss_msg, sizeof(struct hv_vss_msg));
if (len != sizeof(struct hv_vss_msg)) {
syslog(LOG_ERR, "write failed; error: %d %s", errno,
strerror(errno));
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 034/268] clk: exynos: use irqsave version of spin_lock to avoid deadlock with irqs
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (32 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 033/268] tools: hv: vss: fix the write()'s argument: error -> vss_msg Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 035/268] iommu/io-pgtable-arm: Ensure we free the final level on teardown Kamal Mostafa
` (233 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Marek Szyprowski, Sylwester Nawrocki, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Marek Szyprowski <m.szyprowski@samsung.com>
commit 6b4feaea251a97bf08c7d41eabdec07f63a11073 upstream.
It is allowed to enable/disable clocks from interrupts, so common Exynos
ARM clock management code for CPUfreq should use 'irqsave' version of
spin_lock calls to avoid potential deadlock caused by spin_lock recursion.
The same spin_lock is used by gate/mux clocks during enable/disable calls.
This deadlock, can be reproduced by enabling CPUfreq (ondemand or
userspace) and decoding video with s5p-mfc driver.
Relevant stack trace:
[ 5928.061534] BUG: spinlock recursion on CPU#0, bash/1252
[ 5928.061609] lock: 0xee80454c, .magic: dead4ead, .owner: bash/1252, .owner_cpu: 0
[ 5928.068586] CPU: 0 PID: 1252 Comm: bash Tainted: G W 4.4.0-rc4-00001-g447a7fd #678
[ 5928.077260] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[ 5928.083359] [<c00153dc>] (unwind_backtrace) from [<c00121b4>] (show_stack+0x10/0x14)
[ 5928.091072] [<c00121b4>] (show_stack) from [<c0213e28>] (dump_stack+0x68/0xb8)
[ 5928.098275] [<c0213e28>] (dump_stack) from [<c005c1ec>] (do_raw_spin_lock+0x184/0x1ac)
[ 5928.106177] [<c005c1ec>] (do_raw_spin_lock) from [<c05cfa98>] (_raw_spin_lock_irqsave+0x20/0x28)
[ 5928.114943] [<c05cfa98>] (_raw_spin_lock_irqsave) from [<c0468698>] (clk_gate_endisable+0x24/0x98)
[ 5928.123882] [<c0468698>] (clk_gate_endisable) from [<c0464d40>] (clk_core_disable+0x60/0x84)
[ 5928.132299] [<c0464d40>] (clk_core_disable) from [<c0465e00>] (clk_disable+0x24/0x30)
[ 5928.140117] [<c0465e00>] (clk_disable) from [<c03f3b80>] (s5p_mfc_handle_frame+0x254/0x860)
[ 5928.148445] [<c03f3b80>] (s5p_mfc_handle_frame) from [<c03f4b34>] (s5p_mfc_irq+0x890/0xa24)
[ 5928.156778] [<c03f4b34>] (s5p_mfc_irq) from [<c00627bc>] (handle_irq_event_percpu+0x50/0x14c)
[ 5928.165283] [<c00627bc>] (handle_irq_event_percpu) from [<c00628f0>] (handle_irq_event+0x38/0x5c)
[ 5928.174143] [<c00628f0>] (handle_irq_event) from [<c0065864>] (handle_fasteoi_irq+0xdc/0x1a4)
[ 5928.182645] [<c0065864>] (handle_fasteoi_irq) from [<c0062090>] (generic_handle_irq+0x18/0x28)
[ 5928.191236] [<c0062090>] (generic_handle_irq) from [<c00621a4>] (__handle_domain_irq+0x6c/0xdc)
[ 5928.199917] [<c00621a4>] (__handle_domain_irq) from [<c0009470>] (gic_handle_irq+0x4c/0x98)
[ 5928.208249] [<c0009470>] (gic_handle_irq) from [<c0012c54>] (__irq_svc+0x54/0x90)
[ 5928.215709] Exception stack(0xeddb5cb8 to 0xeddb5d00)
[ 5928.220745] 5ca0: ee80454c faddfadc
[ 5928.228906] 5cc0: 00000000 01000001 ee831ce0 f8114200 ee807c00 01130520 00000403 eddb5d84
[ 5928.237063] 5ce0: ee807c48 2faf0800 ee807c0c eddb5d08 c046b618 c046b634 20000053 ffffffff
[ 5928.245225] [<c0012c54>] (__irq_svc) from [<c046b634>] (exynos_cpuclk_notifier_cb+0x170/0x270)
[ 5928.253823] [<c046b634>] (exynos_cpuclk_notifier_cb) from [<c003cb58>] (notifier_call_chain+0x44/0x84)
[ 5928.263106] [<c003cb58>] (notifier_call_chain) from [<c003ccd4>] (__srcu_notifier_call_chain+0x6c/0x9c)
[ 5928.272480] [<c003ccd4>] (__srcu_notifier_call_chain) from [<c003cd1c>] (srcu_notifier_call_chain+0x18/0x20)
[ 5928.282288] [<c003cd1c>] (srcu_notifier_call_chain) from [<c0464ed0>] (__clk_notify+0x6c/0x74)
[ 5928.290881] [<c0464ed0>] (__clk_notify) from [<c0465388>] (clk_propagate_rate_change+0xa0/0xac)
[ 5928.299561] [<c0465388>] (clk_propagate_rate_change) from [<c0465378>] (clk_propagate_rate_change+0x90/0xac)
[ 5928.309370] [<c0465378>] (clk_propagate_rate_change) from [<c04666fc>] (clk_core_set_rate_nolock+0x64/0xa8)
[ 5928.319091] [<c04666fc>] (clk_core_set_rate_nolock) from [<c0466760>] (clk_set_rate+0x20/0x30)
[ 5928.327686] [<c0466760>] (clk_set_rate) from [<c0428c70>] (set_target+0xe8/0x23c)
[ 5928.335152] [<c0428c70>] (set_target) from [<c04244d0>] (__cpufreq_driver_target+0x184/0x29c)
[ 5928.343655] [<c04244d0>] (__cpufreq_driver_target) from [<c0427128>] (cpufreq_set+0x44/0x64)
[ 5928.352074] [<c0427128>] (cpufreq_set) from [<c0423948>] (store_scaling_setspeed+0x5c/0x74)
[ 5928.360407] [<c0423948>] (store_scaling_setspeed) from [<c04238d0>] (store+0x7c/0x98)
[ 5928.368221] [<c04238d0>] (store) from [<c0132540>] (sysfs_kf_write+0x44/0x48)
[ 5928.375338] [<c0132540>] (sysfs_kf_write) from [<c0131b9c>] (kernfs_fop_write+0xb8/0x1bc)
[ 5928.383496] [<c0131b9c>] (kernfs_fop_write) from [<c00d71f8>] (__vfs_write+0x2c/0xd4)
[ 5928.391308] [<c00d71f8>] (__vfs_write) from [<c00d7de8>] (vfs_write+0xa0/0x144)
[ 5928.398598] [<c00d7de8>] (vfs_write) from [<c00d8048>] (SyS_write+0x44/0x84)
[ 5928.405631] [<c00d8048>] (SyS_write) from [<c000f540>] (ret_fast_syscall+0x0/0x3c)
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/clk/samsung/clk-cpu.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/samsung/clk-cpu.c b/drivers/clk/samsung/clk-cpu.c
index dd02356..ae5b9c4 100644
--- a/drivers/clk/samsung/clk-cpu.c
+++ b/drivers/clk/samsung/clk-cpu.c
@@ -145,6 +145,7 @@ static int exynos_cpuclk_pre_rate_change(struct clk_notifier_data *ndata,
unsigned long alt_prate = clk_get_rate(cpuclk->alt_parent);
unsigned long alt_div = 0, alt_div_mask = DIV_MASK;
unsigned long div0, div1 = 0, mux_reg;
+ unsigned long flags;
/* find out the divider values to use for clock data */
while ((cfg_data->prate * 1000) != ndata->new_rate) {
@@ -153,7 +154,7 @@ static int exynos_cpuclk_pre_rate_change(struct clk_notifier_data *ndata,
cfg_data++;
}
- spin_lock(cpuclk->lock);
+ spin_lock_irqsave(cpuclk->lock, flags);
/*
* For the selected PLL clock frequency, get the pre-defined divider
@@ -209,7 +210,7 @@ static int exynos_cpuclk_pre_rate_change(struct clk_notifier_data *ndata,
DIV_MASK_ALL);
}
- spin_unlock(cpuclk->lock);
+ spin_unlock_irqrestore(cpuclk->lock, flags);
return 0;
}
@@ -220,6 +221,7 @@ static int exynos_cpuclk_post_rate_change(struct clk_notifier_data *ndata,
const struct exynos_cpuclk_cfg_data *cfg_data = cpuclk->cfg;
unsigned long div = 0, div_mask = DIV_MASK;
unsigned long mux_reg;
+ unsigned long flags;
/* find out the divider values to use for clock data */
if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) {
@@ -230,7 +232,7 @@ static int exynos_cpuclk_post_rate_change(struct clk_notifier_data *ndata,
}
}
- spin_lock(cpuclk->lock);
+ spin_lock_irqsave(cpuclk->lock, flags);
/* select mout_apll as the alternate parent */
mux_reg = readl(base + E4210_SRC_CPU);
@@ -243,7 +245,7 @@ static int exynos_cpuclk_post_rate_change(struct clk_notifier_data *ndata,
}
exynos_set_safe_div(base, div, div_mask);
- spin_unlock(cpuclk->lock);
+ spin_unlock_irqrestore(cpuclk->lock, flags);
return 0;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 035/268] iommu/io-pgtable-arm: Ensure we free the final level on teardown
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (33 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 034/268] clk: exynos: use irqsave version of spin_lock to avoid deadlock with irqs Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 036/268] dm thin: fix race condition when destroying thin pool workqueue Kamal Mostafa
` (232 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Will Deacon, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Will Deacon <will.deacon@arm.com>
commit 12c2ab09571e8aae3a87da2a4a452632a5fac1e5 upstream.
When tearing down page tables, we return early for the final level
since we know that we won't have any table pointers to follow.
Unfortunately, this also means that we forget to free the final level,
so we end up leaking memory.
Fix the issue by always freeing the current level, but just don't bother
to iterate over the ptes if we're at the final level.
Reported-by: Zhang Bo <zhangbo_a@xiaomi.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/iommu/io-pgtable-arm.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
index e29d5d7..937832c 100644
--- a/drivers/iommu/io-pgtable-arm.c
+++ b/drivers/iommu/io-pgtable-arm.c
@@ -341,17 +341,18 @@ static void __arm_lpae_free_pgtable(struct arm_lpae_io_pgtable *data, int lvl,
arm_lpae_iopte *start, *end;
unsigned long table_size;
- /* Only leaf entries at the last level */
- if (lvl == ARM_LPAE_MAX_LEVELS - 1)
- return;
-
if (lvl == ARM_LPAE_START_LVL(data))
table_size = data->pgd_size;
else
table_size = 1UL << data->pg_shift;
start = ptep;
- end = (void *)ptep + table_size;
+
+ /* Only leaf entries at the last level */
+ if (lvl == ARM_LPAE_MAX_LEVELS - 1)
+ end = ptep;
+ else
+ end = (void *)ptep + table_size;
while (ptep != end) {
arm_lpae_iopte pte = *ptep++;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 036/268] dm thin: fix race condition when destroying thin pool workqueue
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (34 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 035/268] iommu/io-pgtable-arm: Ensure we free the final level on teardown Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 037/268] drm/radeon: Fix "slow" audio over DP on DCE8+ Kamal Mostafa
` (231 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Nikolay Borisov, Mike Snitzer, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Nikolay Borisov <kernel@kyup.com>
commit 18d03e8c25f173f4107a40d0b8c24defb6ed69f3 upstream.
When a thin pool is being destroyed delayed work items are
cancelled using cancel_delayed_work(), which doesn't guarantee that on
return the delayed item isn't running. This can cause the work item to
requeue itself on an already destroyed workqueue. Fix this by using
cancel_delayed_work_sync() which guarantees that on return the work item
is not running anymore.
Fixes: 905e51b39a555 ("dm thin: commit outstanding data every second")
Fixes: 85ad643b7e7e5 ("dm thin: add timeout to stop out-of-data-space mode holding IO forever")
Signed-off-by: Nikolay Borisov <kernel@kyup.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/dm-thin.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 3efdddb..d6602ed 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -3507,8 +3507,8 @@ static void pool_postsuspend(struct dm_target *ti)
struct pool_c *pt = ti->private;
struct pool *pool = pt->pool;
- cancel_delayed_work(&pool->waker);
- cancel_delayed_work(&pool->no_space_timeout);
+ cancel_delayed_work_sync(&pool->waker);
+ cancel_delayed_work_sync(&pool->no_space_timeout);
flush_workqueue(pool->wq);
(void) commit(pool);
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 037/268] drm/radeon: Fix "slow" audio over DP on DCE8+
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (35 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 036/268] dm thin: fix race condition when destroying thin pool workqueue Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 038/268] futex: Drop refcount if requeue_pi() acquired the rtmutex Kamal Mostafa
` (230 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Slava Grigorev, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Slava Grigorev <slava.grigorev@amd.com>
commit ac4a9350abddc51ccb897abf0d9f3fd592b97e0b upstream.
DP audio is derived from the dfs clock.
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/dce6_afmt.c | 16 ++++++++++++++++
drivers/gpu/drm/radeon/radeon.h | 1 +
drivers/gpu/drm/radeon/radeon_atombios.c | 7 +++++++
drivers/gpu/drm/radeon/sid.h | 5 +++++
4 files changed, 29 insertions(+)
diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c b/drivers/gpu/drm/radeon/dce6_afmt.c
index 44480c1..883dce6 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -282,6 +282,22 @@ void dce6_dp_audio_set_dto(struct radeon_device *rdev,
* is the numerator, DCCG_AUDIO_DTOx_MODULE is the denominator
*/
if (ASIC_IS_DCE8(rdev)) {
+ unsigned int div = (RREG32(DENTIST_DISPCLK_CNTL) &
+ DENTIST_DPREFCLK_WDIVIDER_MASK) >>
+ DENTIST_DPREFCLK_WDIVIDER_SHIFT;
+
+ if (div < 128 && div >= 96)
+ div -= 64;
+ else if (div >= 64)
+ div = div / 2 - 16;
+ else if (div >= 8)
+ div /= 4;
+ else
+ div = 0;
+
+ if (div)
+ clock = rdev->clock.gpupll_outputfreq * 10 / div;
+
WREG32(DCE8_DCCG_AUDIO_DTO1_PHASE, 24000);
WREG32(DCE8_DCCG_AUDIO_DTO1_MODULE, clock);
} else {
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index b6cbd81..f0b0b6f 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -268,6 +268,7 @@ struct radeon_clock {
uint32_t current_dispclk;
uint32_t dp_extclk;
uint32_t max_pixel_clock;
+ uint32_t gpupll_outputfreq;
};
/*
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 8f28524..13e5513 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -1263,6 +1263,13 @@ bool radeon_atom_get_clock_info(struct drm_device *dev)
rdev->mode_info.firmware_flags =
le16_to_cpu(firmware_info->info.usFirmwareCapability.susAccess);
+ if (ASIC_IS_DCE8(rdev)) {
+ rdev->clock.gpupll_outputfreq =
+ le32_to_cpu(firmware_info->info_22.ulGPUPLL_OutputFreq);
+ if (rdev->clock.gpupll_outputfreq == 0)
+ rdev->clock.gpupll_outputfreq = 360000; /* 3.6 GHz */
+ }
+
return true;
}
diff --git a/drivers/gpu/drm/radeon/sid.h b/drivers/gpu/drm/radeon/sid.h
index 4c4a721..d1a7b58 100644
--- a/drivers/gpu/drm/radeon/sid.h
+++ b/drivers/gpu/drm/radeon/sid.h
@@ -915,6 +915,11 @@
#define DCCG_AUDIO_DTO1_PHASE 0x05c0
#define DCCG_AUDIO_DTO1_MODULE 0x05c4
+#define DENTIST_DISPCLK_CNTL 0x0490
+# define DENTIST_DPREFCLK_WDIVIDER(x) (((x) & 0x7f) << 24)
+# define DENTIST_DPREFCLK_WDIVIDER_MASK (0x7f << 24)
+# define DENTIST_DPREFCLK_WDIVIDER_SHIFT 24
+
#define AFMT_AUDIO_SRC_CONTROL 0x713c
#define AFMT_AUDIO_SRC_SELECT(x) (((x) & 7) << 0)
/* AFMT_AUDIO_SRC_SELECT
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 038/268] futex: Drop refcount if requeue_pi() acquired the rtmutex
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (36 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 037/268] drm/radeon: Fix "slow" audio over DP on DCE8+ Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 039/268] arm64: mdscr_el1: avoid exposing DCC to userspace Kamal Mostafa
` (229 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Thomas Gleixner, Peter Zijlstra, Darren Hart, Davidlohr Bueso,
Bhuvanesh_Surachari, Andy Lowe, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Thomas Gleixner <tglx@linutronix.de>
commit fb75a4282d0d9a3c7c44d940582c2d226cf3acfb upstream.
If the proxy lock in the requeue loop acquires the rtmutex for a
waiter then it acquired also refcount on the pi_state related to the
futex, but the waiter side does not drop the reference count.
Add the missing free_pi_state() call.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Darren Hart <darren@dvhart.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Bhuvanesh_Surachari@mentor.com
Cc: Andy Lowe <Andy_Lowe@mentor.com>
Link: http://lkml.kernel.org/r/20151219200607.178132067@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/futex.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kernel/futex.c b/kernel/futex.c
index c4a182f..f73be13 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2656,6 +2656,11 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
if (q.pi_state && (q.pi_state->owner != current)) {
spin_lock(q.lock_ptr);
ret = fixup_pi_state_owner(uaddr2, &q, current);
+ /*
+ * Drop the reference to the pi state which
+ * the requeue_pi() code acquired for us.
+ */
+ free_pi_state(q.pi_state);
spin_unlock(q.lock_ptr);
}
} else {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 039/268] arm64: mdscr_el1: avoid exposing DCC to userspace
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (37 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 038/268] futex: Drop refcount if requeue_pi() acquired the rtmutex Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 040/268] arm64: kernel: enforce pmuserenr_el0 initialization and restore Kamal Mostafa
` (228 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Will Deacon, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Will Deacon <will.deacon@arm.com>
commit d8d23fa0f27f3b2942a7bbc7378c7735324ed519 upstream.
We don't want to expose the DCC to userspace, particularly as there is
a kernel console driver for it.
This patch resets mdscr_el1 to disable userspace access to the DCC
registers on the cold boot path.
Signed-off-by: Will Deacon <will.deacon@arm.com>
[ kamal: 4.2-stable prereq for
60792ad arm64: kernel: enforce pmuserenr_el0 initialization and restore ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm64/mm/proc.S | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
index 39139a3..f28a1fe 100644
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -156,7 +156,8 @@ ENTRY(__cpu_setup)
mov x0, #3 << 20
msr cpacr_el1, x0 // Enable FP/ASIMD
- msr mdscr_el1, xzr // Reset mdscr_el1
+ mov x0, #1 << 12 // Reset mdscr_el1 and disable
+ msr mdscr_el1, x0 // access to the DCC from EL0
/*
* Memory region attributes for LPAE:
*
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 040/268] arm64: kernel: enforce pmuserenr_el0 initialization and restore
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (38 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 039/268] arm64: mdscr_el1: avoid exposing DCC to userspace Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 041/268] coresight: checking for NULL string in coresight_name_match() Kamal Mostafa
` (227 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mark Rutland, Lorenzo Pieralisi, Will Deacon, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
commit 60792ad349f3c6dc5735aafefe5dc9121c79e320 upstream.
The pmuserenr_el0 register value is architecturally UNKNOWN on reset.
Current kernel code resets that register value iff the core pmu device is
correctly probed in the kernel. On platforms with missing DT pmu nodes (or
disabled perf events in the kernel), the pmu is not probed, therefore the
pmuserenr_el0 register is not reset in the kernel, which means that its
value retains the reset value that is architecturally UNKNOWN (system
may run with eg pmuserenr_el0 == 0x1, which means that PMU counters access
is available at EL0, which must be disallowed).
This patch adds code that resets pmuserenr_el0 on cold boot and restores
it on core resume from shutdown, so that the pmuserenr_el0 setup is
always enforced in the kernel.
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm64/kernel/perf_event.c | 3 ---
arch/arm64/mm/proc.S | 2 ++
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index b31e9a4..b6c1301 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch/arm64/kernel/perf_event.c
@@ -1242,9 +1242,6 @@ static void armv8pmu_reset(void *info)
/* Initialize & Reset PMNC: C and P bits. */
armv8pmu_pmcr_write(ARMV8_PMCR_P | ARMV8_PMCR_C);
-
- /* Disable access from userspace. */
- asm volatile("msr pmuserenr_el0, %0" :: "r" (0));
}
static int armv8_pmuv3_map_event(struct perf_event *event)
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
index f28a1fe..4730e39 100644
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -119,6 +119,7 @@ ENTRY(cpu_do_resume)
*/
ubfx x11, x11, #1, #1
msr oslar_el1, x11
+ msr pmuserenr_el0, xzr // Disable PMU access from EL0
mov x0, x12
dsb nsh // Make sure local tlb invalidation completed
isb
@@ -158,6 +159,7 @@ ENTRY(__cpu_setup)
msr cpacr_el1, x0 // Enable FP/ASIMD
mov x0, #1 << 12 // Reset mdscr_el1 and disable
msr mdscr_el1, x0 // access to the DCC from EL0
+ msr pmuserenr_el0, xzr // Disable PMU access from EL0
/*
* Memory region attributes for LPAE:
*
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 041/268] coresight: checking for NULL string in coresight_name_match()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (39 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 040/268] arm64: kernel: enforce pmuserenr_el0 initialization and restore Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 042/268] drm/radeon: Fix off-by-one errors in radeon_vm_bo_set_addr Kamal Mostafa
` (226 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mathieu Poirier, Greg Kroah-Hartman, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Mathieu Poirier <mathieu.poirier@linaro.org>
commit fadf3a44e974b030e7145218ad1ab25e3ef91738 upstream.
Connection child names associated to ports can sometimes be NULL,
which is the case when booting a system on QEMU or when the Coresight
power domain isn't switched on.
This patch is adding a check to make sure a NULL string isn't fed
to strcmp(), something that avoid crashing the system.
Reported-by: Tyler Baker <tyler.baker@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/hwtracing/coresight/coresight.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c
index 894531d..046144f 100644
--- a/drivers/hwtracing/coresight/coresight.c
+++ b/drivers/hwtracing/coresight/coresight.c
@@ -543,7 +543,7 @@ static int coresight_name_match(struct device *dev, void *data)
to_match = data;
i_csdev = to_coresight_device(dev);
- if (!strcmp(to_match, dev_name(&i_csdev->dev)))
+ if (to_match && !strcmp(to_match, dev_name(&i_csdev->dev)))
return 1;
return 0;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 042/268] drm/radeon: Fix off-by-one errors in radeon_vm_bo_set_addr
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (40 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 041/268] coresight: checking for NULL string in coresight_name_match() Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 043/268] drm/amdgpu: Fix off-by-one errors in amdgpu_vm_bo_map Kamal Mostafa
` (225 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Felix.Kuehling, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Felix Kuehling <Felix.Kuehling@amd.com>
commit 42ef344c0994cc453477afdc7a8eadc578ed0257 upstream.
eoffset is sometimes treated as the last address inside the address
range, and sometimes as the first address outside the range. This
was resulting in errors when a test filled up the entire address
space. Make it consistent to always be the last address within the
range. Also fixed related errors when checking the VA limit and in
radeon_vm_fence_pts.
Signed-off-by: Felix.Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon_vm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
index 48d97c0..3979632 100644
--- a/drivers/gpu/drm/radeon/radeon_vm.c
+++ b/drivers/gpu/drm/radeon/radeon_vm.c
@@ -455,15 +455,15 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
if (soffset) {
/* make sure object fit at this offset */
- eoffset = soffset + size;
+ eoffset = soffset + size - 1;
if (soffset >= eoffset) {
r = -EINVAL;
goto error_unreserve;
}
last_pfn = eoffset / RADEON_GPU_PAGE_SIZE;
- if (last_pfn > rdev->vm_manager.max_pfn) {
- dev_err(rdev->dev, "va above limit (0x%08X > 0x%08X)\n",
+ if (last_pfn >= rdev->vm_manager.max_pfn) {
+ dev_err(rdev->dev, "va above limit (0x%08X >= 0x%08X)\n",
last_pfn, rdev->vm_manager.max_pfn);
r = -EINVAL;
goto error_unreserve;
@@ -478,7 +478,7 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
eoffset /= RADEON_GPU_PAGE_SIZE;
if (soffset || eoffset) {
struct interval_tree_node *it;
- it = interval_tree_iter_first(&vm->va, soffset, eoffset - 1);
+ it = interval_tree_iter_first(&vm->va, soffset, eoffset);
if (it && it != &bo_va->it) {
struct radeon_bo_va *tmp;
tmp = container_of(it, struct radeon_bo_va, it);
@@ -518,7 +518,7 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
if (soffset || eoffset) {
spin_lock(&vm->status_lock);
bo_va->it.start = soffset;
- bo_va->it.last = eoffset - 1;
+ bo_va->it.last = eoffset;
list_add(&bo_va->vm_status, &vm->cleared);
spin_unlock(&vm->status_lock);
interval_tree_insert(&bo_va->it, &vm->va);
@@ -888,7 +888,7 @@ static void radeon_vm_fence_pts(struct radeon_vm *vm,
unsigned i;
start >>= radeon_vm_block_size;
- end >>= radeon_vm_block_size;
+ end = (end - 1) >> radeon_vm_block_size;
for (i = start; i <= end; ++i)
radeon_bo_fence(vm->page_tables[i].bo, fence, true);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 043/268] drm/amdgpu: Fix off-by-one errors in amdgpu_vm_bo_map
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (41 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 042/268] drm/radeon: Fix off-by-one errors in radeon_vm_bo_set_addr Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 044/268] drm/radeon: clean up fujitsu quirks Kamal Mostafa
` (224 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Felix.Kuehling, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Felix Kuehling <Felix.Kuehling@amd.com>
commit 005ae95e6ec119c64e2d16eb65a94c49e1dcf9f0 upstream.
eaddr is sometimes treated as the last address inside the address
range, and sometimes as the first address outside the range. This
was resulting in errors when a test filled up the entire address
space. Make it consistent to always be the last address within the
range.
Signed-off-by: Felix.Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index b07402f..453c00b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -954,15 +954,15 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev,
}
/* make sure object fit at this offset */
- eaddr = saddr + size;
+ eaddr = saddr + size - 1;
if ((saddr >= eaddr) || (offset + size > amdgpu_bo_size(bo_va->bo))) {
amdgpu_bo_unreserve(bo_va->bo);
return -EINVAL;
}
last_pfn = eaddr / AMDGPU_GPU_PAGE_SIZE;
- if (last_pfn > adev->vm_manager.max_pfn) {
- dev_err(adev->dev, "va above limit (0x%08X > 0x%08X)\n",
+ if (last_pfn >= adev->vm_manager.max_pfn) {
+ dev_err(adev->dev, "va above limit (0x%08X >= 0x%08X)\n",
last_pfn, adev->vm_manager.max_pfn);
amdgpu_bo_unreserve(bo_va->bo);
return -EINVAL;
@@ -973,7 +973,7 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev,
saddr /= AMDGPU_GPU_PAGE_SIZE;
eaddr /= AMDGPU_GPU_PAGE_SIZE;
- it = interval_tree_iter_first(&vm->va, saddr, eaddr - 1);
+ it = interval_tree_iter_first(&vm->va, saddr, eaddr);
if (it) {
struct amdgpu_bo_va_mapping *tmp;
tmp = container_of(it, struct amdgpu_bo_va_mapping, it);
@@ -995,7 +995,7 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev,
INIT_LIST_HEAD(&mapping->list);
mapping->it.start = saddr;
- mapping->it.last = eaddr - 1;
+ mapping->it.last = eaddr;
mapping->offset = offset;
mapping->flags = flags;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 044/268] drm/radeon: clean up fujitsu quirks
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (42 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 043/268] drm/amdgpu: Fix off-by-one errors in amdgpu_vm_bo_map Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 045/268] mmc: mmc: Fix incorrect use of driver strength switching HS200 and HS400 Kamal Mostafa
` (223 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit 0eb1c3d4084eeb6fb3a703f88d6ce1521f8fcdd1 upstream.
Combine the two quirks.
bug:
https://bugzilla.kernel.org/show_bug.cgi?id=109481
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon_atombios.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 13e5513..08fc1b5 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -437,7 +437,9 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
}
/* Fujitsu D3003-S2 board lists DVI-I as DVI-D and VGA */
- if (((dev->pdev->device == 0x9802) || (dev->pdev->device == 0x9806)) &&
+ if (((dev->pdev->device == 0x9802) ||
+ (dev->pdev->device == 0x9805) ||
+ (dev->pdev->device == 0x9806)) &&
(dev->pdev->subsystem_vendor == 0x1734) &&
(dev->pdev->subsystem_device == 0x11bd)) {
if (*connector_type == DRM_MODE_CONNECTOR_VGA) {
@@ -448,14 +450,6 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
}
}
- /* Fujitsu D3003-S2 board lists DVI-I as DVI-I and VGA */
- if ((dev->pdev->device == 0x9805) &&
- (dev->pdev->subsystem_vendor == 0x1734) &&
- (dev->pdev->subsystem_device == 0x11bd)) {
- if (*connector_type == DRM_MODE_CONNECTOR_VGA)
- return false;
- }
-
return true;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 045/268] mmc: mmc: Fix incorrect use of driver strength switching HS200 and HS400
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (43 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 044/268] drm/radeon: clean up fujitsu quirks Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 046/268] mmc: sdhci-pci: Do not default to 33 Ohm driver strength for Intel SPT Kamal Mostafa
` (222 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Wenkai Du, Adrian Hunter, Ulf Hansson, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Wenkai Du <wenkai.du@intel.com>
commit adb24d42a516bca8b9741ed21206509daaab5b13 upstream.
Commit cc4f414c885c ("mmc: mmc: Add driver strength selection")
added driver strength selection for eMMC HS200 and HS400 modes.
That patch also set the driver stength when transitioning through
High Speed mode to HS200/HS400, but driver strength is not defined
for High Speed mode. While the JEDEC specification is not clear
on this point it has been observed to cause problems for some eMMC,
and removing the driver strength setting in this case makes it
consistent with the normal use of High Speed mode.
Signed-off-by: Wenkai Du <wenkai.du@intel.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mmc/core/mmc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 748eddf..c3c48b1 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1076,8 +1076,7 @@ static int mmc_select_hs400(struct mmc_card *card)
mmc_set_clock(host, max_dtr);
/* Switch card to HS mode */
- val = EXT_CSD_TIMING_HS |
- card->drive_strength << EXT_CSD_DRV_STR_SHIFT;
+ val = EXT_CSD_TIMING_HS;
err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
EXT_CSD_HS_TIMING, val,
card->ext_csd.generic_cmd6_time,
@@ -1160,8 +1159,7 @@ int mmc_hs400_to_hs200(struct mmc_card *card)
mmc_set_clock(host, max_dtr);
/* Switch HS400 to HS DDR */
- val = EXT_CSD_TIMING_HS |
- card->drive_strength << EXT_CSD_DRV_STR_SHIFT;
+ val = EXT_CSD_TIMING_HS;
err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING,
val, card->ext_csd.generic_cmd6_time,
true, send_status, true);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 046/268] mmc: sdhci-pci: Do not default to 33 Ohm driver strength for Intel SPT
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (44 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 045/268] mmc: mmc: Fix incorrect use of driver strength switching HS200 and HS400 Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 047/268] mmc: sdio: Fix invalid vdd in voltage switch power cycle Kamal Mostafa
` (221 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Adrian Hunter, Ulf Hansson, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Adrian Hunter <adrian.hunter@intel.com>
commit 1ca896856281d3f1ad4f6f7d4e32e2943452de23 upstream.
In some cases, the stronger 33 Ohm driver strength must not be used
so it is not a suitable default. Change it to the standard default
50 Ohm value.
The patch applies to v4.2+ except the file name changed. It is
drivers/mmc/host/sdhci-pci.c prior to v.4.4.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mmc/host/sdhci-pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index b3b0a3e..5d2e222 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -277,7 +277,7 @@ static int spt_select_drive_strength(struct sdhci_host *host,
if (sdhci_pci_spt_drive_strength > 0)
drive_strength = sdhci_pci_spt_drive_strength & 0xf;
else
- drive_strength = 1; /* 33-ohm */
+ drive_strength = 0; /* Default 50-ohm */
if ((mmc_driver_type_mask(drive_strength) & card_drv) == 0)
drive_strength = 0; /* Default 50-ohm */
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 047/268] mmc: sdio: Fix invalid vdd in voltage switch power cycle
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (45 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 046/268] mmc: sdhci-pci: Do not default to 33 Ohm driver strength for Intel SPT Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 048/268] mmc: sdhci: Fix DMA descriptor with zero data length Kamal Mostafa
` (220 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Adrian Hunter, Ulf Hansson, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Adrian Hunter <adrian.hunter@intel.com>
commit d9bfbb95ed598a09cf336adb0f190ee0ff802f0d upstream.
The 'ocr' parameter passed to mmc_set_signal_voltage()
defines the power-on voltage used when power cycling
after a failure to set the voltage. However, in the
case of mmc_sdio_init_card(), the value passed has the
R4_18V_PRESENT flag set which is not valid for power-on
and results in an invalid vdd. Fix by passing the card's
ocr value which does not have the flag.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mmc/core/sdio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index b91abed..5c9b344 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -630,7 +630,7 @@ try_again:
*/
if (!powered_resume && (rocr & ocr & R4_18V_PRESENT)) {
err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180,
- ocr);
+ ocr_card);
if (err == -EAGAIN) {
sdio_reset(host);
mmc_go_idle(host);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 048/268] mmc: sdhci: Fix DMA descriptor with zero data length
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (46 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 047/268] mmc: sdio: Fix invalid vdd in voltage switch power cycle Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 049/268] mmc: sdhci: Fix sdhci_runtime_pm_bus_on/off() Kamal Mostafa
` (219 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Adrian Hunter, Ulf Hansson, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Adrian Hunter <adrian.hunter@intel.com>
commit 347ea32dc118326c4f2636928239a29d192cc9b8 upstream.
SDHCI has built-in DMA called ADMA2. ADMA2 uses a descriptor
table to define DMA scatter-gather. Each desciptor can specify
a data length up to 65536 bytes, however the length field is
only 16-bits so zero means 65536. Consequently, putting zero
when the size is zero must not be allowed. This patch fixes
one case where zero data length could be set inadvertently.
The problem happens because unaligned data gets split and the
code did not consider that the remaining aligned portion might
be zero length. That case really only happens for SDIO because
SD and eMMC cards transfer blocks that are invariably sector-
aligned. For SDIO, access to function registers is done by
data transfer (CMD53) when the register is bigger than 1 byte.
Generally registers are 4 bytes but 2-byte registers are possible.
So DMA of 4 bytes or less can happen. When 32-bit DMA is used,
the data alignment must be 4, so 4-byte transfers won't casue a
problem, but a 2-byte transfer could. However with the introduction
of 64-bit DMA, the data alignment for 64-bit DMA was made 8 bytes,
so all 4-byte transfers not on 8-byte boundaries get "split" into
a 4-byte chunk and a 0-byte chunk, thereby hitting the bug.
In fact, a closer look at the SDHCI specs indicates that only the
descriptor table requires 8-byte alignment for 64-bit DMA. That
will be dealt with in a separate patch, but the potential for a
2-byte access remains, so this fix is needed anyway.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mmc/host/sdhci.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index b0c915a..1c4343d 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -541,9 +541,12 @@ static int sdhci_adma_table_pre(struct sdhci_host *host,
BUG_ON(len > 65536);
- /* tran, valid */
- sdhci_adma_write_desc(host, desc, addr, len, ADMA2_TRAN_VALID);
- desc += host->desc_sz;
+ if (len) {
+ /* tran, valid */
+ sdhci_adma_write_desc(host, desc, addr, len,
+ ADMA2_TRAN_VALID);
+ desc += host->desc_sz;
+ }
/*
* If this triggers then we have a calculation bug
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 049/268] mmc: sdhci: Fix sdhci_runtime_pm_bus_on/off()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (47 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 048/268] mmc: sdhci: Fix DMA descriptor with zero data length Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 050/268] regulator: axp20x: Fix GPIO LDO enable value for AXP22x Kamal Mostafa
` (218 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Adrian Hunter, Ulf Hansson, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Adrian Hunter <adrian.hunter@intel.com>
commit 5c671c410c8704800f4f1673b6f572137e7e6ddd upstream.
sdhci has a legacy facility to prevent runtime suspend if the
bus power is on. This is needed in cases where the power to
the card is dependent on the bus power. It is controlled by
a pair of functions: sdhci_runtime_pm_bus_on() and
sdhci_runtime_pm_bus_off(). These functions use a boolean
variable 'bus_on' to ensure changes are always paired.
There is an additional check for 'runtime_suspended' which is
the problem. In fact, its use is ill-conceived as the only
requirement for the logic is that 'on' and 'off' are paired,
which is actually broken by the check, for example if the bus
power is turned on during runtime resume. So remove the check.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mmc/host/sdhci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 1c4343d..cf31efa 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2741,7 +2741,7 @@ static int sdhci_runtime_pm_put(struct sdhci_host *host)
static void sdhci_runtime_pm_bus_on(struct sdhci_host *host)
{
- if (host->runtime_suspended || host->bus_on)
+ if (host->bus_on)
return;
host->bus_on = true;
pm_runtime_get_noresume(host->mmc->parent);
@@ -2749,7 +2749,7 @@ static void sdhci_runtime_pm_bus_on(struct sdhci_host *host)
static void sdhci_runtime_pm_bus_off(struct sdhci_host *host)
{
- if (host->runtime_suspended || !host->bus_on)
+ if (!host->bus_on)
return;
host->bus_on = false;
pm_runtime_put_noidle(host->mmc->parent);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 050/268] regulator: axp20x: Fix GPIO LDO enable value for AXP22x
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (48 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 049/268] mmc: sdhci: Fix sdhci_runtime_pm_bus_on/off() Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 051/268] udf: limit the maximum number of indirect extents in a row Kamal Mostafa
` (217 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Chen-Yu Tsai, Mark Brown, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Chen-Yu Tsai <wens@csie.org>
commit 3cb99e2ea99a454c8837a55aac88753ef05fc1eb upstream.
The enable/disable values for GPIO LDOs are reversed. It seems no one
noticed as AXP22x support was introduced recently, and no one was using
the GPIO LDOs, either because no designs actually use them or board
support hasn't caught up.
Fixes: 1b82b4e4f954 ("regulator: axp20x: Add support for AXP22X regulators")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/regulator/axp20x-regulator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 1dea0e8..168b5c3 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -27,8 +27,8 @@
#define AXP20X_IO_ENABLED 0x03
#define AXP20X_IO_DISABLED 0x07
-#define AXP22X_IO_ENABLED 0x04
-#define AXP22X_IO_DISABLED 0x03
+#define AXP22X_IO_ENABLED 0x03
+#define AXP22X_IO_DISABLED 0x04
#define AXP20X_WORKMODE_DCDC2_MASK BIT(2)
#define AXP20X_WORKMODE_DCDC3_MASK BIT(1)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 051/268] udf: limit the maximum number of indirect extents in a row
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (49 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 050/268] regulator: axp20x: Fix GPIO LDO enable value for AXP22x Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 052/268] [media] rc: sunxi-cir: Initialize the spinlock properly Kamal Mostafa
` (216 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Vegard Nossum, Jan Kara, Quentin Casasnovas, Andrew Morton,
Jan Kara, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Vegard Nossum <vegard.nossum@oracle.com>
commit b0918d9f476a8434b055e362b83fa4fd1d462c3f upstream.
udf_next_aext() just follows extent pointers while extents are marked as
indirect. This can loop forever for corrupted filesystem. Limit number
the of indirect extents we are willing to follow in a row.
[JK: Updated changelog, limit, style]
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Jan Kara <jack@suse.com>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/udf/inode.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 8d0b3ad..566df9b 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -2047,14 +2047,29 @@ void udf_write_aext(struct inode *inode, struct extent_position *epos,
epos->offset += adsize;
}
+/*
+ * Only 1 indirect extent in a row really makes sense but allow upto 16 in case
+ * someone does some weird stuff.
+ */
+#define UDF_MAX_INDIR_EXTS 16
+
int8_t udf_next_aext(struct inode *inode, struct extent_position *epos,
struct kernel_lb_addr *eloc, uint32_t *elen, int inc)
{
int8_t etype;
+ unsigned int indirections = 0;
while ((etype = udf_current_aext(inode, epos, eloc, elen, inc)) ==
(EXT_NEXT_EXTENT_ALLOCDECS >> 30)) {
int block;
+
+ if (++indirections > UDF_MAX_INDIR_EXTS) {
+ udf_err(inode->i_sb,
+ "too many indirect extents in inode %lu\n",
+ inode->i_ino);
+ return -1;
+ }
+
epos->block = *eloc;
epos->offset = sizeof(struct allocExtDesc);
brelse(epos->bh);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 052/268] [media] rc: sunxi-cir: Initialize the spinlock properly
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (50 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 051/268] udf: limit the maximum number of indirect extents in a row Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 053/268] nfs: Fix race in __update_open_stateid() Kamal Mostafa
` (215 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Chen-Yu Tsai, Mauro Carvalho Chehab, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Chen-Yu Tsai <wens@csie.org>
commit 768acf46e1320d6c41ed1b7c4952bab41c1cde79 upstream.
The driver allocates the spinlock but fails to initialize it correctly.
The kernel reports a BUG indicating bad spinlock magic when spinlock
debugging is enabled.
Call spin_lock_init() on it to initialize it correctly.
Fixes: b4e3e59fb59c ("[media] rc: add sunxi-ir driver")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/media/rc/sunxi-cir.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/rc/sunxi-cir.c b/drivers/media/rc/sunxi-cir.c
index 7830aef..40f7768 100644
--- a/drivers/media/rc/sunxi-cir.c
+++ b/drivers/media/rc/sunxi-cir.c
@@ -153,6 +153,8 @@ static int sunxi_ir_probe(struct platform_device *pdev)
if (!ir)
return -ENOMEM;
+ spin_lock_init(&ir->ir_lock);
+
if (of_device_is_compatible(dn, "allwinner,sun5i-a13-ir"))
ir->fifo_size = 64;
else
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 053/268] nfs: Fix race in __update_open_stateid()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (51 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 052/268] [media] rc: sunxi-cir: Initialize the spinlock properly Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 054/268] USB: cp210x: add ID for ELV Marble Sound Board 1 Kamal Mostafa
` (214 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andrew Elble, Trond Myklebust, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Andrew Elble <aweits@rit.edu>
commit 361cad3c89070aeb37560860ea8bfc092d545adc upstream.
We've seen this in a packet capture - I've intermixed what I
think was going on. The fix here is to grab the so_lock sooner.
1964379 -> #1 open (for write) reply seqid=1
1964393 -> #2 open (for read) reply seqid=2
__nfs4_close(), state->n_wronly--
nfs4_state_set_mode_locked(), changes state->state = [R]
state->flags is [RW]
state->state is [R], state->n_wronly == 0, state->n_rdonly == 1
1964398 -> #3 open (for write) call -> because close is already running
1964399 -> downgrade (to read) call seqid=2 (close of #1)
1964402 -> #3 open (for write) reply seqid=3
__update_open_stateid()
nfs_set_open_stateid_locked(), changes state->flags
state->flags is [RW]
state->state is [R], state->n_wronly == 0, state->n_rdonly == 1
new sequence number is exposed now via nfs4_stateid_copy()
next step would be update_open_stateflags(), pending so_lock
1964403 -> downgrade reply seqid=2, fails with OLD_STATEID (close of #1)
nfs4_close_prepare() gets so_lock and recalcs flags -> send close
1964405 -> downgrade (to read) call seqid=3 (close of #1 retry)
__update_open_stateid() gets so_lock
* update_open_stateflags() updates state->n_wronly.
nfs4_state_set_mode_locked() updates state->state
state->flags is [RW]
state->state is [RW], state->n_wronly == 1, state->n_rdonly == 1
* should have suppressed the preceding nfs4_close_prepare() from
sending open_downgrade
1964406 -> write call
1964408 -> downgrade (to read) reply seqid=4 (close of #1 retry)
nfs_clear_open_stateid_locked()
state->flags is [R]
state->state is [RW], state->n_wronly == 1, state->n_rdonly == 1
1964409 -> write reply (fails, openmode)
Signed-off-by: Andrew Elble <aweits@rit.edu>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/nfs4proc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index d2daaca..71e6b1b 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1303,6 +1303,7 @@ static void __update_open_stateid(struct nfs4_state *state, nfs4_stateid *open_s
* Protect the call to nfs4_state_set_mode_locked and
* serialise the stateid update
*/
+ spin_lock(&state->owner->so_lock);
write_seqlock(&state->seqlock);
if (deleg_stateid != NULL) {
nfs4_stateid_copy(&state->stateid, deleg_stateid);
@@ -1311,7 +1312,6 @@ static void __update_open_stateid(struct nfs4_state *state, nfs4_stateid *open_s
if (open_stateid != NULL)
nfs_set_open_stateid_locked(state, open_stateid, fmode);
write_sequnlock(&state->seqlock);
- spin_lock(&state->owner->so_lock);
update_open_stateflags(state, fmode);
spin_unlock(&state->owner->so_lock);
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 054/268] USB: cp210x: add ID for ELV Marble Sound Board 1
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (52 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 053/268] nfs: Fix race in __update_open_stateid() Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 055/268] Thermal: initialize thermal zone device correctly Kamal Mostafa
` (213 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Oliver Freyermuth, Johan Hovold, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Oliver Freyermuth <o.freyermuth@googlemail.com>
commit f7d7f59ab124748156ea551edf789994f05da342 upstream.
Add the USB device ID for ELV Marble Sound Board 1.
Signed-off-by: Oliver Freyermuth <o.freyermuth@googlemail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/cp210x.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 7d4f51a..59b2126 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -160,6 +160,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
{ 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(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */
{ USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */
{ USB_DEVICE(0x1BA4, 0x0002) }, /* Silicon Labs 358x factory default */
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 055/268] Thermal: initialize thermal zone device correctly
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (53 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 054/268] USB: cp210x: add ID for ELV Marble Sound Board 1 Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 056/268] Thermal: handle thermal zone device properly during system sleep Kamal Mostafa
` (212 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Zhang Rui, Chen Yu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Zhang Rui <rui.zhang@intel.com>
commit bb431ba26c5cd0a17c941ca6c3a195a3a6d5d461 upstream.
After thermal zone device registered, as we have not read any
temperature before, thus tz->temperature should not be 0,
which actually means 0C, and thermal trend is not available.
In this case, we need specially handling for the first
thermal_zone_device_update().
Both thermal core framework and step_wise governor is
enhanced to handle this. And since the step_wise governor
is the only one that uses trends, so it's the only thermal
governor that needs to be updated.
Tested-by: Manuel Krause <manuelkrause@netscape.net>
Tested-by: szegad <szegadlo@poczta.onet.pl>
Tested-by: prash <prash.n.rao@gmail.com>
Tested-by: amish <ammdispose-arch@yahoo.com>
Tested-by: Matthias <morpheusxyz123@yahoo.de>
Reviewed-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/thermal/step_wise.c | 17 +++++++++++++++--
drivers/thermal/thermal_core.c | 19 +++++++++++++++++--
drivers/thermal/thermal_core.h | 1 +
include/linux/thermal.h | 3 +++
4 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/step_wise.c b/drivers/thermal/step_wise.c
index 5a0f12d..ec4ea59 100644
--- a/drivers/thermal/step_wise.c
+++ b/drivers/thermal/step_wise.c
@@ -63,6 +63,19 @@ static unsigned long get_target_state(struct thermal_instance *instance,
next_target = instance->target;
dev_dbg(&cdev->device, "cur_state=%ld\n", cur_state);
+ if (!instance->initialized) {
+ if (throttle) {
+ next_target = (cur_state + 1) >= instance->upper ?
+ instance->upper :
+ ((cur_state + 1) < instance->lower ?
+ instance->lower : (cur_state + 1));
+ } else {
+ next_target = THERMAL_NO_TARGET;
+ }
+
+ return next_target;
+ }
+
switch (trend) {
case THERMAL_TREND_RAISING:
if (throttle) {
@@ -149,7 +162,7 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
dev_dbg(&instance->cdev->device, "old_target=%d, target=%d\n",
old_target, (int)instance->target);
- if (old_target == instance->target)
+ if (instance->initialized && old_target == instance->target)
continue;
/* Activate a passive thermal instance */
@@ -161,7 +174,7 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
instance->target == THERMAL_NO_TARGET)
update_passive_instance(tz, trip_type, -1);
-
+ instance->initialized = true;
instance->cdev->updated = false; /* cdev needs update */
}
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 4ca211b..8109029 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -534,8 +534,22 @@ static void update_temperature(struct thermal_zone_device *tz)
mutex_unlock(&tz->lock);
trace_thermal_temperature(tz);
- dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n",
- tz->last_temperature, tz->temperature);
+ if (tz->last_temperature == THERMAL_TEMP_INVALID)
+ dev_dbg(&tz->device, "last_temperature N/A, current_temperature=%d\n",
+ tz->temperature);
+ else
+ dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n",
+ tz->last_temperature, tz->temperature);
+}
+
+static void thermal_zone_device_reset(struct thermal_zone_device *tz)
+{
+ struct thermal_instance *pos;
+
+ tz->temperature = THERMAL_TEMP_INVALID;
+ tz->passive = 0;
+ list_for_each_entry(pos, &tz->thermal_instances, tz_node)
+ pos->initialized = false;
}
void thermal_zone_device_update(struct thermal_zone_device *tz)
@@ -1852,6 +1866,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
if (!tz->ops->get_temp)
thermal_zone_device_set_polling(tz, 0);
+ thermal_zone_device_reset(tz);
thermal_zone_device_update(tz);
return tz;
diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index d7ac1fc..749d41a 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -41,6 +41,7 @@ struct thermal_instance {
struct thermal_zone_device *tz;
struct thermal_cooling_device *cdev;
int trip;
+ bool initialized;
unsigned long upper; /* Highest cooling state for this trip point */
unsigned long lower; /* Lowest cooling state for this trip point */
unsigned long target; /* expected cooling state */
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index b5ea8e0..e103ff3 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -43,6 +43,9 @@
/* Default weight of a bound cooling device */
#define THERMAL_WEIGHT_DEFAULT 0
+/* use value, which < 0K, to indicate an invalid/uninitialized temperature */
+#define THERMAL_TEMP_INVALID -274000
+
/* Unit conversion macros */
#define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \
((long)t-2732+5)/10 : ((long)t-2732-5)/10)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 056/268] Thermal: handle thermal zone device properly during system sleep
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (54 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 055/268] Thermal: initialize thermal zone device correctly Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 057/268] Thermal: do thermal zone update after a cooling device registered Kamal Mostafa
` (211 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Zhang Rui, Chen Yu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Zhang Rui <rui.zhang@intel.com>
commit ff140fea847e1c2002a220571ab106c2456ed252 upstream.
Current thermal code does not handle system sleep well because
1. the cooling device cooling state may be changed during suspend
2. the previous temperature reading becomes invalid after resumed because
it is got before system sleep
3. updating thermal zone device during suspending/resuming
is wrong because some devices may have already been suspended
or may have not been resumed.
Thus, the proper way to do this is to cancel all thermal zone
device update requirements during suspend/resume, and after all
the devices have been resumed, reset and update every registered
thermal zone devices.
This also fixes a regression introduced by:
Commit 19593a1fb1f6 ("ACPI / fan: convert to platform driver")
Because, with above commit applied, all the fan devices are attached
to the acpi_general_pm_domain, and they are turned on by the pm_domain
automatically after resume, without the awareness of thermal core.
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=78201
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=91411
Tested-by: Manuel Krause <manuelkrause@netscape.net>
Tested-by: szegad <szegadlo@poczta.onet.pl>
Tested-by: prash <prash.n.rao@gmail.com>
Tested-by: amish <ammdispose-arch@yahoo.com>
Tested-by: Matthias <morpheusxyz123@yahoo.de>
Reviewed-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/thermal/thermal_core.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 8109029..480a222 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -37,6 +37,7 @@
#include <linux/of.h>
#include <net/netlink.h>
#include <net/genetlink.h>
+#include <linux/suspend.h>
#define CREATE_TRACE_POINTS
#include <trace/events/thermal.h>
@@ -59,6 +60,8 @@ static LIST_HEAD(thermal_governor_list);
static DEFINE_MUTEX(thermal_list_lock);
static DEFINE_MUTEX(thermal_governor_lock);
+static atomic_t in_suspend;
+
static struct thermal_governor *def_governor;
static struct thermal_governor *__find_governor(const char *name)
@@ -556,6 +559,9 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
{
int count;
+ if (atomic_read(&in_suspend))
+ return;
+
if (!tz->ops->get_temp)
return;
@@ -2106,6 +2112,36 @@ static void thermal_unregister_governors(void)
thermal_gov_power_allocator_unregister();
}
+static int thermal_pm_notify(struct notifier_block *nb,
+ unsigned long mode, void *_unused)
+{
+ struct thermal_zone_device *tz;
+
+ switch (mode) {
+ case PM_HIBERNATION_PREPARE:
+ case PM_RESTORE_PREPARE:
+ case PM_SUSPEND_PREPARE:
+ atomic_set(&in_suspend, 1);
+ break;
+ case PM_POST_HIBERNATION:
+ case PM_POST_RESTORE:
+ case PM_POST_SUSPEND:
+ atomic_set(&in_suspend, 0);
+ list_for_each_entry(tz, &thermal_tz_list, node) {
+ thermal_zone_device_reset(tz);
+ thermal_zone_device_update(tz);
+ }
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+static struct notifier_block thermal_pm_nb = {
+ .notifier_call = thermal_pm_notify,
+};
+
static int __init thermal_init(void)
{
int result;
@@ -2126,6 +2162,11 @@ static int __init thermal_init(void)
if (result)
goto exit_netlink;
+ result = register_pm_notifier(&thermal_pm_nb);
+ if (result)
+ pr_warn("Thermal: Can not register suspend notifier, return %d\n",
+ result);
+
return 0;
exit_netlink:
@@ -2145,6 +2186,7 @@ error:
static void __exit thermal_exit(void)
{
+ unregister_pm_notifier(&thermal_pm_nb);
of_thermal_destroy_zones();
genetlink_exit();
class_unregister(&thermal_class);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 057/268] Thermal: do thermal zone update after a cooling device registered
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (55 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 056/268] Thermal: handle thermal zone device properly during system sleep Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 058/268] posix-clock: Fix return code on the poll method's error path Kamal Mostafa
` (210 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Zhang Rui, Chen Yu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Chen Yu <yu.c.chen@intel.com>
commit 4511f7166a2deb5f7a578cf87fd2fe1ae83527e3 upstream.
When a new cooling device is registered, we need to update the
thermal zone to set the new registered cooling device to a proper
state.
This fixes a problem that the system is cool, while the fan devices
are left running on full speed after boot, if fan device is registered
after thermal zone device.
Here is the history of why current patch looks like this:
https://patchwork.kernel.org/patch/7273041/
Reference:https://bugzilla.kernel.org/show_bug.cgi?id=92431
Tested-by: Manuel Krause <manuelkrause@netscape.net>
Tested-by: szegad <szegadlo@poczta.onet.pl>
Tested-by: prash <prash.n.rao@gmail.com>
Tested-by: amish <ammdispose-arch@yahoo.com>
Reviewed-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/thermal/thermal_core.c | 14 +++++++++++++-
include/linux/thermal.h | 2 ++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 480a222..090da0c 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1296,6 +1296,7 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
if (!result) {
list_add_tail(&dev->tz_node, &tz->thermal_instances);
list_add_tail(&dev->cdev_node, &cdev->thermal_instances);
+ atomic_set(&tz->need_update, 1);
}
mutex_unlock(&cdev->lock);
mutex_unlock(&tz->lock);
@@ -1405,6 +1406,7 @@ __thermal_cooling_device_register(struct device_node *np,
const struct thermal_cooling_device_ops *ops)
{
struct thermal_cooling_device *cdev;
+ struct thermal_zone_device *pos = NULL;
int result;
if (type && strlen(type) >= THERMAL_NAME_LENGTH)
@@ -1449,6 +1451,12 @@ __thermal_cooling_device_register(struct device_node *np,
/* Update binding information for 'this' new cdev */
bind_cdev(cdev);
+ mutex_lock(&thermal_list_lock);
+ list_for_each_entry(pos, &thermal_tz_list, node)
+ if (atomic_cmpxchg(&pos->need_update, 1, 0))
+ thermal_zone_device_update(pos);
+ mutex_unlock(&thermal_list_lock);
+
return cdev;
}
@@ -1781,6 +1789,8 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
tz->trips = trips;
tz->passive_delay = passive_delay;
tz->polling_delay = polling_delay;
+ /* A new thermal zone needs to be updated anyway. */
+ atomic_set(&tz->need_update, 1);
dev_set_name(&tz->device, "thermal_zone%d", tz->id);
result = device_register(&tz->device);
@@ -1873,7 +1883,9 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
thermal_zone_device_set_polling(tz, 0);
thermal_zone_device_reset(tz);
- thermal_zone_device_update(tz);
+ /* Update the new thermal zone and mark it as already updated. */
+ if (atomic_cmpxchg(&tz->need_update, 1, 0))
+ thermal_zone_device_update(tz);
return tz;
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index e103ff3..601c4f8 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -172,6 +172,7 @@ struct thermal_attr {
* @forced_passive: If > 0, temperature at which to switch on all ACPI
* processor cooling devices. Currently only used by the
* step-wise governor.
+ * @need_update: if equals 1, thermal_zone_device_update needs to be invoked.
* @ops: operations this &thermal_zone_device supports
* @tzp: thermal zone parameters
* @governor: pointer to the governor for this thermal zone
@@ -199,6 +200,7 @@ struct thermal_zone_device {
int emul_temperature;
int passive;
unsigned int forced_passive;
+ atomic_t need_update;
struct thermal_zone_device_ops *ops;
struct thermal_zone_params *tzp;
struct thermal_governor *governor;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 058/268] posix-clock: Fix return code on the poll method's error path
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (56 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 057/268] Thermal: do thermal zone update after a cooling device registered Kamal Mostafa
@ 2016-01-27 20:31 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 059/268] rtlwifi: rtl8723be: Fix module parameter initialization Kamal Mostafa
` (209 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:31 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: John Stultz, Julia Lawall, Thomas Gleixner, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Richard Cochran <richardcochran@gmail.com>
commit 1b9f23727abb92c5e58f139e7d180befcaa06fe0 upstream.
The posix_clock_poll function is supposed to return a bit mask of
POLLxxx values. However, in case the hardware has disappeared (due to
hot plugging for example) this code returns -ENODEV in a futile
attempt to throw an error at the file descriptor level. The kernel's
file_operations interface does not accept such error codes from the
poll method. Instead, this function aught to return POLLERR.
The value -ENODEV does, in fact, contain the POLLERR bit (and almost
all the other POLLxxx bits as well), but only by chance. This patch
fixes code to return a proper bit mask.
Credit goes to Markus Elfring for pointing out the suspicious
signed/unsigned mismatch.
Reported-by: Markus Elfring <elfring@users.sourceforge.net>
igned-off-by: Richard Cochran <richardcochran@gmail.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Link: http://lkml.kernel.org/r/1450819198-17420-1-git-send-email-richardcochran@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/time/posix-clock.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c
index ce033c7..9cff0ab 100644
--- a/kernel/time/posix-clock.c
+++ b/kernel/time/posix-clock.c
@@ -69,10 +69,10 @@ static ssize_t posix_clock_read(struct file *fp, char __user *buf,
static unsigned int posix_clock_poll(struct file *fp, poll_table *wait)
{
struct posix_clock *clk = get_posix_clock(fp);
- int result = 0;
+ unsigned int result = 0;
if (!clk)
- return -ENODEV;
+ return POLLERR;
if (clk->ops.poll)
result = clk->ops.poll(clk, fp, wait);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 059/268] rtlwifi: rtl8723be: Fix module parameter initialization
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (57 preceding siblings ...)
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 058/268] posix-clock: Fix return code on the poll method's error path Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 060/268] rtlwifi: rtl8723ae: Fix initialization of module parameters Kamal Mostafa
` (208 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Larry Finger, Kalle Valo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Larry Finger <Larry.Finger@lwfinger.net>
commit 7079604ddb83f428359feace3aeaf8a9f435be4a upstream.
This driver has a number of errors in the module initialization. These
include the following:
Parameter msi_support is stored in two places - one is removed.
Paramters sw_crypto and disable_watchdog were never stored in the final
locations, nor were they initialized properly.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/rtlwifi/rtl8723be/sw.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/sw.c b/drivers/net/wireless/rtlwifi/rtl8723be/sw.c
index 7bf88d9..9df94b2 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723be/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723be/sw.c
@@ -93,7 +93,6 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw)
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
rtl8723be_bt_reg_init(hw);
- rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
rtlpriv->btcoexist.btc_ops = rtl_btc_get_ops_pointer();
rtlpriv->dm.dm_initialgain_enable = 1;
@@ -151,6 +150,10 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
+ rtlpriv->cfg->mod_params->sw_crypto =
+ rtlpriv->cfg->mod_params->sw_crypto;
+ rtlpriv->cfg->mod_params->disable_watchdog =
+ rtlpriv->cfg->mod_params->disable_watchdog;
if (rtlpriv->cfg->mod_params->disable_watchdog)
pr_info("watchdog disabled\n");
rtlpriv->psc.reg_fwctrl_lps = 3;
@@ -267,6 +270,9 @@ static struct rtl_mod_params rtl8723be_mod_params = {
.inactiveps = true,
.swctrl_lps = false,
.fwctrl_lps = true,
+ .msi_support = false,
+ .disable_watchdog = false,
+ .debug = DBG_EMERG,
};
static struct rtl_hal_cfg rtl8723be_hal_cfg = {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 060/268] rtlwifi: rtl8723ae: Fix initialization of module parameters
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (58 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 059/268] rtlwifi: rtl8723be: Fix module parameter initialization Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 061/268] rtlwifi: rtl8821ae: Fix errors in parameter initialization Kamal Mostafa
` (207 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Larry Finger, Kalle Valo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Larry Finger <Larry.Finger@lwfinger.net>
commit 793b09994211fbe0b5cd5f7b6dd8cc9b6256c3c6 upstream.
This driver has some errors in the handling of module parameters. These
include missing initialization for parameters msi_support and
disable_watchdog. In addition, neither of these parameters nor sw_crypto
are transferred into the locations used by the driver. A final fix is
adding parameter msi to the module named and description macros.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/rtlwifi/rtl8723ae/sw.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c b/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c
index 8280bab..9647164 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c
@@ -150,6 +150,11 @@ int rtl8723e_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
+ rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
+ rtlpriv->cfg->mod_params->sw_crypto =
+ rtlpriv->cfg->mod_params->sw_crypto;
+ rtlpriv->cfg->mod_params->disable_watchdog =
+ rtlpriv->cfg->mod_params->disable_watchdog;
if (rtlpriv->cfg->mod_params->disable_watchdog)
pr_info("watchdog disabled\n");
rtlpriv->psc.reg_fwctrl_lps = 3;
@@ -267,6 +272,8 @@ static struct rtl_mod_params rtl8723e_mod_params = {
.swctrl_lps = false,
.fwctrl_lps = true,
.debug = DBG_EMERG,
+ .msi_support = false,
+ .disable_watchdog = false,
};
static struct rtl_hal_cfg rtl8723e_hal_cfg = {
@@ -383,12 +390,14 @@ module_param_named(debug, rtl8723e_mod_params.debug, int, 0444);
module_param_named(ips, rtl8723e_mod_params.inactiveps, bool, 0444);
module_param_named(swlps, rtl8723e_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl8723e_mod_params.fwctrl_lps, bool, 0444);
+module_param_named(msi, rtl8723e_mod_params.msi_support, bool, 0444);
module_param_named(disable_watchdog, rtl8723e_mod_params.disable_watchdog,
bool, 0444);
MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
+MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 0)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n");
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 061/268] rtlwifi: rtl8821ae: Fix errors in parameter initialization
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (59 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 060/268] rtlwifi: rtl8723ae: Fix initialization of module parameters Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 062/268] rtlwifi: rtl8188ee: Fix module " Kamal Mostafa
` (206 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Larry Finger, Kalle Valo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Larry Finger <Larry.Finger@lwfinger.net>
commit 78bae1de422a7f6f2b4b61f6a5c379e3d7f96f44 upstream.
This driver failed to copy parameters sw_crypto and disable_watchdog into
the locations actually used by the driver. In addition, msi_support was
initialized three times and one of them used the wrong variable. The
initialization of parameter int_clear was moved so that it is near that
of the rest of the parameters.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/rtlwifi/rtl8821ae/sw.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/sw.c b/drivers/net/wireless/rtlwifi/rtl8821ae/sw.c
index 142bdff..4159f9b 100644
--- a/drivers/net/wireless/rtlwifi/rtl8821ae/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8821ae/sw.c
@@ -95,8 +95,6 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
rtl8821ae_bt_reg_init(hw);
- rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
- rtlpci->int_clear = rtlpriv->cfg->mod_params->int_clear;
rtlpriv->btcoexist.btc_ops = rtl_btc_get_ops_pointer();
rtlpriv->dm.dm_initialgain_enable = 1;
@@ -168,12 +166,15 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
- rtlpci->msi_support = rtlpriv->cfg->mod_params->int_clear;
+ rtlpci->int_clear = rtlpriv->cfg->mod_params->int_clear;
+ rtlpriv->cfg->mod_params->sw_crypto =
+ rtlpriv->cfg->mod_params->sw_crypto;
+ rtlpriv->cfg->mod_params->disable_watchdog =
+ rtlpriv->cfg->mod_params->disable_watchdog;
if (rtlpriv->cfg->mod_params->disable_watchdog)
pr_info("watchdog disabled\n");
rtlpriv->psc.reg_fwctrl_lps = 3;
rtlpriv->psc.reg_max_lps_awakeintvl = 5;
- rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
/* for ASPM, you can close aspm through
* set const_support_pciaspm = 0
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 062/268] rtlwifi: rtl8188ee: Fix module parameter initialization
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (60 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 061/268] rtlwifi: rtl8821ae: Fix errors in parameter initialization Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 063/268] rtlwifi: rtl8192de: Fix incorrect module parameter descriptions Kamal Mostafa
` (205 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Larry Finger, Kalle Valo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Larry Finger <Larry.Finger@lwfinger.net>
commit 06f34572c6110e2e2d5e653a957f1d74db9e3f2b upstream.
In this driver, parameters disable_watchdog and sw_crypto are never
copied into the locations used in the main code. While modifying the
parameter handling, the copying of parameter msi_support is moved to
be with the rest.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/rtlwifi/rtl8188ee/sw.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/sw.c b/drivers/net/wireless/rtlwifi/rtl8188ee/sw.c
index 1134412..47e32cb 100644
--- a/drivers/net/wireless/rtlwifi/rtl8188ee/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/sw.c
@@ -88,8 +88,6 @@ int rtl88e_init_sw_vars(struct ieee80211_hw *hw)
u8 tid;
rtl8188ee_bt_reg_init(hw);
- rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
-
rtlpriv->dm.dm_initialgain_enable = 1;
rtlpriv->dm.dm_flag = 0;
rtlpriv->dm.disable_framebursting = 0;
@@ -138,6 +136,11 @@ int rtl88e_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
+ rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
+ rtlpriv->cfg->mod_params->sw_crypto =
+ rtlpriv->cfg->mod_params->sw_crypto;
+ rtlpriv->cfg->mod_params->disable_watchdog =
+ rtlpriv->cfg->mod_params->disable_watchdog;
if (rtlpriv->cfg->mod_params->disable_watchdog)
pr_info("watchdog disabled\n");
if (!rtlpriv->psc.inactiveps)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 063/268] rtlwifi: rtl8192de: Fix incorrect module parameter descriptions
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (61 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 062/268] rtlwifi: rtl8188ee: Fix module " Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 064/268] rtlwifi: rtl8192se: Fix module parameter initialization Kamal Mostafa
` (204 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Larry Finger, Kalle Valo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Larry Finger <Larry.Finger@lwfinger.net>
commit d4d60b4caaa5926e1b243070770968f05656107a upstream.
Two of the module parameters are listed with incorrect default values.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
index b19d039..c6e09a1 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
@@ -376,8 +376,8 @@ module_param_named(swlps, rtl92de_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl92de_mod_params.fwctrl_lps, bool, 0444);
MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
-MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
-MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
+MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 1)\n");
+MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 0)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 064/268] rtlwifi: rtl8192se: Fix module parameter initialization
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (62 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 063/268] rtlwifi: rtl8192de: Fix incorrect module parameter descriptions Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 065/268] rtlwifi: rtl8192ce: Fix handling of module parameters Kamal Mostafa
` (203 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Larry Finger, Kalle Valo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Larry Finger <Larry.Finger@lwfinger.net>
commit 7503efbd82c15c4070adffff1344e5169d3634b4 upstream.
Two of the module parameter descriptions show incorrect default values.
In addition the value for software encryption is not transferred to
the locations used by the driver.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/rtlwifi/rtl8192se/sw.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
index e1fd27c..31baca41 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -187,6 +187,8 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
+ rtlpriv->cfg->mod_params->sw_crypto =
+ rtlpriv->cfg->mod_params->sw_crypto;
if (!rtlpriv->psc.inactiveps)
pr_info("Power Save off (module option)\n");
if (!rtlpriv->psc.fwctrl_lps)
@@ -425,8 +427,8 @@ module_param_named(swlps, rtl92se_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl92se_mod_params.fwctrl_lps, bool, 0444);
MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
-MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
-MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
+MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 1)\n");
+MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 0)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 065/268] rtlwifi: rtl8192ce: Fix handling of module parameters
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (63 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 064/268] rtlwifi: rtl8192se: Fix module parameter initialization Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 066/268] rtlwifi: rtl8192cu: Add missing parameter setup Kamal Mostafa
` (202 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Larry Finger, Kalle Valo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Larry Finger <Larry.Finger@lwfinger.net>
commit b24f19f16b9e43f54218c07609b783ea8625406a upstream.
The module parameter for software encryption was never transferred to
the location used by the driver.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
index de6cb6c..4780bdc 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
@@ -139,6 +139,8 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
+ rtlpriv->cfg->mod_params->sw_crypto =
+ rtlpriv->cfg->mod_params->sw_crypto;
if (!rtlpriv->psc.inactiveps)
pr_info("rtl8192ce: Power Save off (module option)\n");
if (!rtlpriv->psc.fwctrl_lps)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 066/268] rtlwifi: rtl8192cu: Add missing parameter setup
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (64 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 065/268] rtlwifi: rtl8192ce: Fix handling of module parameters Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 067/268] NFS: Fix attribute cache revalidation Kamal Mostafa
` (201 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Larry Finger, Kalle Valo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Larry Finger <Larry.Finger@lwfinger.net>
commit b68d0ae7e58624c33f2eddab471fee55db27dbf9 upstream.
This driver fails to copy the module parameter for software encryption
to the locations used by the main code.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index fd4a535..7c6f7f0 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -65,6 +65,8 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->dm.disable_framebursting = false;
rtlpriv->dm.thermalvalue = 0;
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
+ rtlpriv->cfg->mod_params->sw_crypto =
+ rtlpriv->cfg->mod_params->sw_crypto;
/* for firmware buf */
rtlpriv->rtlhal.pfirmware = vzalloc(0x4000);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 067/268] NFS: Fix attribute cache revalidation
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (65 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 066/268] rtlwifi: rtl8192cu: Add missing parameter setup Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 068/268] rtlwifi: rtl_pci: Fix kernel panic Kamal Mostafa
` (200 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Trond Myklebust, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Trond Myklebust <trond.myklebust@primarydata.com>
commit ade14a7df796d4e86bd9d181193c883a57b13db0 upstream.
If a NFSv4 client uses the cache_consistency_bitmask in order to
request only information about the change attribute, timestamps and
size, then it has not revalidated all attributes, and hence the
attribute timeout timestamp should not be updated.
Reported-by: Donald Buczek <buczek@molgen.mpg.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/inode.c | 54 +++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 39 insertions(+), 15 deletions(-)
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 1c65e3f..7bf2c65 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1630,6 +1630,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
unsigned long invalid = 0;
unsigned long now = jiffies;
unsigned long save_cache_validity;
+ bool cache_revalidated = true;
dfprintk(VFS, "NFS: %s(%s/%lu fh_crc=0x%08x ct=%d info=0x%x)\n",
__func__, inode->i_sb->s_id, inode->i_ino,
@@ -1691,22 +1692,28 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
nfs_force_lookup_revalidate(inode);
inode->i_version = fattr->change_attr;
}
- } else
+ } else {
nfsi->cache_validity |= save_cache_validity;
+ cache_revalidated = false;
+ }
if (fattr->valid & NFS_ATTR_FATTR_MTIME) {
memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime));
- } else if (server->caps & NFS_CAP_MTIME)
+ } else if (server->caps & NFS_CAP_MTIME) {
nfsi->cache_validity |= save_cache_validity &
(NFS_INO_INVALID_ATTR
| NFS_INO_REVAL_FORCED);
+ cache_revalidated = false;
+ }
if (fattr->valid & NFS_ATTR_FATTR_CTIME) {
memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime));
- } else if (server->caps & NFS_CAP_CTIME)
+ } else if (server->caps & NFS_CAP_CTIME) {
nfsi->cache_validity |= save_cache_validity &
(NFS_INO_INVALID_ATTR
| NFS_INO_REVAL_FORCED);
+ cache_revalidated = false;
+ }
/* Check if our cached file size is stale */
if (fattr->valid & NFS_ATTR_FATTR_SIZE) {
@@ -1726,19 +1733,23 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
(long long)cur_isize,
(long long)new_isize);
}
- } else
+ } else {
nfsi->cache_validity |= save_cache_validity &
(NFS_INO_INVALID_ATTR
| NFS_INO_REVAL_PAGECACHE
| NFS_INO_REVAL_FORCED);
+ cache_revalidated = false;
+ }
if (fattr->valid & NFS_ATTR_FATTR_ATIME)
memcpy(&inode->i_atime, &fattr->atime, sizeof(inode->i_atime));
- else if (server->caps & NFS_CAP_ATIME)
+ else if (server->caps & NFS_CAP_ATIME) {
nfsi->cache_validity |= save_cache_validity &
(NFS_INO_INVALID_ATIME
| NFS_INO_REVAL_FORCED);
+ cache_revalidated = false;
+ }
if (fattr->valid & NFS_ATTR_FATTR_MODE) {
if ((inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO)) {
@@ -1747,36 +1758,42 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
inode->i_mode = newmode;
invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL;
}
- } else if (server->caps & NFS_CAP_MODE)
+ } else if (server->caps & NFS_CAP_MODE) {
nfsi->cache_validity |= save_cache_validity &
(NFS_INO_INVALID_ATTR
| NFS_INO_INVALID_ACCESS
| NFS_INO_INVALID_ACL
| NFS_INO_REVAL_FORCED);
+ cache_revalidated = false;
+ }
if (fattr->valid & NFS_ATTR_FATTR_OWNER) {
if (!uid_eq(inode->i_uid, fattr->uid)) {
invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL;
inode->i_uid = fattr->uid;
}
- } else if (server->caps & NFS_CAP_OWNER)
+ } else if (server->caps & NFS_CAP_OWNER) {
nfsi->cache_validity |= save_cache_validity &
(NFS_INO_INVALID_ATTR
| NFS_INO_INVALID_ACCESS
| NFS_INO_INVALID_ACL
| NFS_INO_REVAL_FORCED);
+ cache_revalidated = false;
+ }
if (fattr->valid & NFS_ATTR_FATTR_GROUP) {
if (!gid_eq(inode->i_gid, fattr->gid)) {
invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL;
inode->i_gid = fattr->gid;
}
- } else if (server->caps & NFS_CAP_OWNER_GROUP)
+ } else if (server->caps & NFS_CAP_OWNER_GROUP) {
nfsi->cache_validity |= save_cache_validity &
(NFS_INO_INVALID_ATTR
| NFS_INO_INVALID_ACCESS
| NFS_INO_INVALID_ACL
| NFS_INO_REVAL_FORCED);
+ cache_revalidated = false;
+ }
if (fattr->valid & NFS_ATTR_FATTR_NLINK) {
if (inode->i_nlink != fattr->nlink) {
@@ -1785,19 +1802,22 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
invalid |= NFS_INO_INVALID_DATA;
set_nlink(inode, fattr->nlink);
}
- } else if (server->caps & NFS_CAP_NLINK)
+ } else if (server->caps & NFS_CAP_NLINK) {
nfsi->cache_validity |= save_cache_validity &
(NFS_INO_INVALID_ATTR
| NFS_INO_REVAL_FORCED);
+ cache_revalidated = false;
+ }
if (fattr->valid & NFS_ATTR_FATTR_SPACE_USED) {
/*
* report the blocks in 512byte units
*/
inode->i_blocks = nfs_calc_block_size(fattr->du.nfs3.used);
- }
- if (fattr->valid & NFS_ATTR_FATTR_BLOCKS_USED)
+ } else if (fattr->valid & NFS_ATTR_FATTR_BLOCKS_USED)
inode->i_blocks = fattr->du.nfs2.blocks;
+ else
+ cache_revalidated = false;
/* Update attrtimeo value if we're out of the unstable period */
if (invalid & NFS_INO_INVALID_ATTR) {
@@ -1807,9 +1827,13 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
/* Set barrier to be more recent than all outstanding updates */
nfsi->attr_gencount = nfs_inc_attr_generation_counter();
} else {
- if (!time_in_range_open(now, nfsi->attrtimeo_timestamp, nfsi->attrtimeo_timestamp + nfsi->attrtimeo)) {
- if ((nfsi->attrtimeo <<= 1) > NFS_MAXATTRTIMEO(inode))
- nfsi->attrtimeo = NFS_MAXATTRTIMEO(inode);
+ if (cache_revalidated) {
+ if (!time_in_range_open(now, nfsi->attrtimeo_timestamp,
+ nfsi->attrtimeo_timestamp + nfsi->attrtimeo)) {
+ nfsi->attrtimeo <<= 1;
+ if (nfsi->attrtimeo > NFS_MAXATTRTIMEO(inode))
+ nfsi->attrtimeo = NFS_MAXATTRTIMEO(inode);
+ }
nfsi->attrtimeo_timestamp = now;
}
/* Set the barrier to be more recent than this fattr */
@@ -1818,7 +1842,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
}
/* Don't declare attrcache up to date if there were no attrs! */
- if (fattr->valid != 0)
+ if (cache_revalidated)
invalid &= ~NFS_INO_INVALID_ATTR;
/* Don't invalidate the data if we were to blame */
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 068/268] rtlwifi: rtl_pci: Fix kernel panic
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (66 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 067/268] NFS: Fix attribute cache revalidation Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 069/268] bcache: fix a livelock when we cause a huge number of cache misses Kamal Mostafa
` (199 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Larry Finger, Kalle Valo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Larry Finger <Larry.Finger@lwfinger.net>
commit f99551a2d39dc26ea03dc6761be11ac913eb2d57 upstream.
In commit 38506ecefab9 (rtlwifi: rtl_pci: Start modification for new
drivers), a bug was introduced that causes a NULL pointer dereference.
As this bug only affects the infrequently used RTL8192EE and only under
low-memory conditions, it has taken a long time for the bug to show up.
The bug was reported on the linux-wireless mailing list and also at
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/ as
bug #1527603 (kernel crashes due to rtl8192ee driver on ubuntu 15.10).
Fixes: 38506ecefab9 ("rtlwifi: rtl_pci: Start modification for new drivers")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/rtlwifi/pci.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index f46c9d7..7f471bf 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -801,7 +801,9 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
hw_queue);
if (rx_remained_cnt == 0)
return;
-
+ buffer_desc = &rtlpci->rx_ring[rxring_idx].buffer_desc[
+ rtlpci->rx_ring[rxring_idx].idx];
+ pdesc = (struct rtl_rx_desc *)skb->data;
} else { /* rx descriptor */
pdesc = &rtlpci->rx_ring[rxring_idx].desc[
rtlpci->rx_ring[rxring_idx].idx];
@@ -824,13 +826,6 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
new_skb = dev_alloc_skb(rtlpci->rxbuffersize);
if (unlikely(!new_skb))
goto no_new;
- if (rtlpriv->use_new_trx_flow) {
- buffer_desc =
- &rtlpci->rx_ring[rxring_idx].buffer_desc
- [rtlpci->rx_ring[rxring_idx].idx];
- /*means rx wifi info*/
- pdesc = (struct rtl_rx_desc *)skb->data;
- }
memset(&rx_status , 0 , sizeof(rx_status));
rtlpriv->cfg->ops->query_rx_desc(hw, &stats,
&rx_status, (u8 *)pdesc, skb);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 069/268] bcache: fix a livelock when we cause a huge number of cache misses
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (67 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 068/268] rtlwifi: rtl_pci: Fix kernel panic Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 070/268] bcache: Add a cond_resched() call to gc Kamal Mostafa
` (198 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Zheng Liu, Joshua Schmid, Zhu Yanhai, Kent Overstreet,
Jens Axboe, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Zheng Liu <gnehzuil.liu@gmail.com>
commit 2ef9ccbfcb90cf84bdba320a571b18b05c41101b upstream.
Subject : [PATCH v2] bcache: fix a livelock in btree lock
Date : Wed, 25 Feb 2015 20:32:09 +0800 (02/25/2015 04:32:09 AM)
This commit tries to fix a livelock in bcache. This livelock might
happen when we causes a huge number of cache misses simultaneously.
When we get a cache miss, bcache will execute the following path.
->cached_dev_make_request()
->cached_dev_read()
->cached_lookup()
->bch->btree_map_keys()
->btree_root() <------------------------
->bch_btree_map_keys_recurse() |
->cache_lookup_fn() |
->cached_dev_cache_miss() |
->bch_btree_insert_check_key() -|
[If btree->seq is not equal to seq + 1, we should return
EINTR and traverse btree again.]
In bch_btree_insert_check_key() function we first need to check upgrade
flag (op->lock == -1), and when this flag is true we need to release
read btree->lock and try to take write btree->lock. During taking and
releasing this write lock, btree->seq will be monotone increased in
order to prevent other threads modify this in cache miss (see btree.h:74).
But if there are some cache misses caused by some requested, we could
meet a livelock because btree->seq is always changed by others. Thus no
one can make progress.
This commit will try to take write btree->lock if it encounters a race
when we traverse btree. Although it sacrifice the scalability but we
can ensure that only one can modify the btree.
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Tested-by: Joshua Schmid <jschmid@suse.com>
Tested-by: Eric Wheeler <bcache@linux.ewheeler.net>
Cc: Joshua Schmid <jschmid@suse.com>
Cc: Zhu Yanhai <zhu.yanhai@gmail.com>
Cc: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/bcache/btree.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 00cde40..9aaa8f8 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -2162,8 +2162,10 @@ int bch_btree_insert_check_key(struct btree *b, struct btree_op *op,
rw_lock(true, b, b->level);
if (b->key.ptr[0] != btree_ptr ||
- b->seq != seq + 1)
+ b->seq != seq + 1) {
+ op->lock = b->level;
goto out;
+ }
}
SET_KEY_PTRS(check_key, 1);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 070/268] bcache: Add a cond_resched() call to gc
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (68 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 069/268] bcache: fix a livelock when we cause a huge number of cache misses Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 071/268] bcache: clear BCACHE_DEV_UNLINK_DONE flag when attaching a backing device Kamal Mostafa
` (197 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Takashi Iwai, Kent Overstreet, Jens Axboe, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Kent Overstreet <kmo@daterainc.com>
commit c5f1e5adf956e3ba82d204c7c141a75da9fa449a upstream.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Eric Wheeler <bcache@linux.ewheeler.net>
Cc: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/bcache/btree.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 9aaa8f8..43829d9 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -1741,6 +1741,7 @@ static void bch_btree_gc(struct cache_set *c)
do {
ret = btree_root(gc_root, c, &op, &writes, &stats);
closure_sync(&writes);
+ cond_resched();
if (ret && ret != -EAGAIN)
pr_warn("gc failed!");
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 071/268] bcache: clear BCACHE_DEV_UNLINK_DONE flag when attaching a backing device
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (69 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 070/268] bcache: Add a cond_resched() call to gc Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 072/268] bcache: fix a leak in bch_cached_dev_run() Kamal Mostafa
` (196 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Zheng Liu, Kent Overstreet, Jens Axboe, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Zheng Liu <wenqing.lz@taobao.com>
commit fecaee6f20ee122ad75402c53d8278f9bb142ddc upstream.
This bug can be reproduced by the following script:
#!/bin/bash
bcache_sysfs="/sys/fs/bcache"
function clear_cache()
{
if [ ! -e $bcache_sysfs ]; then
echo "no bcache sysfs"
exit
fi
cset_uuid=$(ls -l $bcache_sysfs|head -n 2|tail -n 1|awk '{print $9}')
sudo sh -c "echo $cset_uuid > /sys/block/sdb/sdb1/bcache/detach"
sleep 5
sudo sh -c "echo $cset_uuid > /sys/block/sdb/sdb1/bcache/attach"
}
for ((i=0;i<10;i++)); do
clear_cache
done
The warning messages look like below:
[ 275.948611] ------------[ cut here ]------------
[ 275.963840] WARNING: at fs/sysfs/dir.c:512 sysfs_add_one+0xb8/0xd0() (Tainted: P W
--------------- )
[ 275.979253] Hardware name: Tecal RH2285
[ 275.994106] sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:09.0/0000:08:00.0/host4/target4:2:1/4:2:1:0/block/sdb/sdb1/bcache/cache'
[ 276.024105] Modules linked in: bcache tcp_diag inet_diag ipmi_devintf ipmi_si ipmi_msghandler
bonding 8021q garp stp llc ipv6 ext3 jbd loop sg iomemory_vsl(P) bnx2 microcode serio_raw i2c_i801
i2c_core iTCO_wdt iTCO_vendor_support i7core_edac edac_core shpchp ext4 jbd2 mbcache megaraid_sas
pata_acpi ata_generic ata_piix dm_mod [last unloaded: scsi_wait_scan]
[ 276.072643] Pid: 2765, comm: sh Tainted: P W --------------- 2.6.32 #1
[ 276.089315] Call Trace:
[ 276.105801] [<ffffffff81070fe7>] ? warn_slowpath_common+0x87/0xc0
[ 276.122650] [<ffffffff810710d6>] ? warn_slowpath_fmt+0x46/0x50
[ 276.139361] [<ffffffff81205c08>] ? sysfs_add_one+0xb8/0xd0
[ 276.156012] [<ffffffff8120609b>] ? sysfs_do_create_link+0x12b/0x170
[ 276.172682] [<ffffffff81206113>] ? sysfs_create_link+0x13/0x20
[ 276.189282] [<ffffffffa03bda21>] ? bcache_device_link+0xc1/0x110 [bcache]
[ 276.205993] [<ffffffffa03bfa08>] ? bch_cached_dev_attach+0x478/0x4f0 [bcache]
[ 276.222794] [<ffffffffa03c4a17>] ? bch_cached_dev_store+0x627/0x780 [bcache]
[ 276.239680] [<ffffffff8116783a>] ? alloc_pages_current+0xaa/0x110
[ 276.256594] [<ffffffff81203b15>] ? sysfs_write_file+0xe5/0x170
[ 276.273364] [<ffffffff811887b8>] ? vfs_write+0xb8/0x1a0
[ 276.290133] [<ffffffff811890b1>] ? sys_write+0x51/0x90
[ 276.306368] [<ffffffff8100c072>] ? system_call_fastpath+0x16/0x1b
[ 276.322301] ---[ end trace 9f5d4fcdd0c3edfb ]---
[ 276.338241] ------------[ cut here ]------------
[ 276.354109] WARNING: at /home/wenqing.lz/bcache/bcache/super.c:720
bcache_device_link+0xdf/0x110 [bcache]() (Tainted: P W --------------- )
[ 276.386017] Hardware name: Tecal RH2285
[ 276.401430] Couldn't create device <-> cache set symlinks
[ 276.401759] Modules linked in: bcache tcp_diag inet_diag ipmi_devintf ipmi_si ipmi_msghandler
bonding 8021q garp stp llc ipv6 ext3 jbd loop sg iomemory_vsl(P) bnx2 microcode serio_raw i2c_i801
i2c_core iTCO_wdt iTCO_vendor_support i7core_edac edac_core shpchp ext4 jbd2 mbcache megaraid_sas
pata_acpi ata_generic ata_piix dm_mod [last unloaded: scsi_wait_scan]
[ 276.465477] Pid: 2765, comm: sh Tainted: P W --------------- 2.6.32 #1
[ 276.482169] Call Trace:
[ 276.498610] [<ffffffff81070fe7>] ? warn_slowpath_common+0x87/0xc0
[ 276.515405] [<ffffffff810710d6>] ? warn_slowpath_fmt+0x46/0x50
[ 276.532059] [<ffffffffa03bda3f>] ? bcache_device_link+0xdf/0x110 [bcache]
[ 276.548808] [<ffffffffa03bfa08>] ? bch_cached_dev_attach+0x478/0x4f0 [bcache]
[ 276.565569] [<ffffffffa03c4a17>] ? bch_cached_dev_store+0x627/0x780 [bcache]
[ 276.582418] [<ffffffff8116783a>] ? alloc_pages_current+0xaa/0x110
[ 276.599341] [<ffffffff81203b15>] ? sysfs_write_file+0xe5/0x170
[ 276.616142] [<ffffffff811887b8>] ? vfs_write+0xb8/0x1a0
[ 276.632607] [<ffffffff811890b1>] ? sys_write+0x51/0x90
[ 276.648671] [<ffffffff8100c072>] ? system_call_fastpath+0x16/0x1b
[ 276.664756] ---[ end trace 9f5d4fcdd0c3edfc ]---
We forget to clear BCACHE_DEV_UNLINK_DONE flag in bcache_device_attach()
function when we attach a backing device first time. After detaching this
backing device, this flag will be true and sysfs_remove_link() isn't called in
bcache_device_unlink(). Then when we attach this backing device again,
sysfs_create_link() will return EEXIST error in bcache_device_link().
So the fix is trival and we clear this flag in bcache_device_link().
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Tested-by: Joshua Schmid <jschmid@suse.com>
Tested-by: Eric Wheeler <bcache@linux.ewheeler.net>
Cc: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/bcache/super.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 94980bf..17873b0 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -708,6 +708,8 @@ static void bcache_device_link(struct bcache_device *d, struct cache_set *c,
WARN(sysfs_create_link(&d->kobj, &c->kobj, "cache") ||
sysfs_create_link(&c->kobj, &d->kobj, d->name),
"Couldn't create device <-> cache set symlinks");
+
+ clear_bit(BCACHE_DEV_UNLINK_DONE, &d->flags);
}
static void bcache_device_detach(struct bcache_device *d)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 072/268] bcache: fix a leak in bch_cached_dev_run()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (70 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 071/268] bcache: clear BCACHE_DEV_UNLINK_DONE flag when attaching a backing device Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 073/268] bcache: unregister reboot notifier if bcache fails to unregister device Kamal Mostafa
` (195 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Al Viro, Kent Overstreet, Jens Axboe, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Al Viro <viro@ZenIV.linux.org.uk>
commit 4d4d8573a8451acc9f01cbea24b7e55f04a252fe upstream.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Joshua Schmid <jschmid@suse.com>
Tested-by: Eric Wheeler <bcache@linux.ewheeler.net>
Cc: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/bcache/super.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 17873b0..f13b0e2 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -874,8 +874,11 @@ void bch_cached_dev_run(struct cached_dev *dc)
buf[SB_LABEL_SIZE] = '\0';
env[2] = kasprintf(GFP_KERNEL, "CACHED_LABEL=%s", buf);
- if (atomic_xchg(&dc->running, 1))
+ if (atomic_xchg(&dc->running, 1)) {
+ kfree(env[1]);
+ kfree(env[2]);
return;
+ }
if (!d->c &&
BDEV_STATE(&dc->sb) != BDEV_STATE_NONE) {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 073/268] bcache: unregister reboot notifier if bcache fails to unregister device
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (71 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 072/268] bcache: fix a leak in bch_cached_dev_run() Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 074/268] bcache: allows use of register in udev to avoid "device_busy" error Kamal Mostafa
` (194 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Zheng Liu, Kent Overstreet, Jens Axboe, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Zheng Liu <wenqing.lz@taobao.com>
commit 2ecf0cdb2b437402110ab57546e02abfa68a716b upstream.
In bcache_init() function it forgot to unregister reboot notifier if
bcache fails to unregister a block device. This commit fixes this.
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Tested-by: Joshua Schmid <jschmid@suse.com>
Tested-by: Eric Wheeler <bcache@linux.ewheeler.net>
Cc: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/bcache/super.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index f13b0e2..c70755d 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -2099,8 +2099,10 @@ static int __init bcache_init(void)
closure_debug_init();
bcache_major = register_blkdev(0, "bcache");
- if (bcache_major < 0)
+ if (bcache_major < 0) {
+ unregister_reboot_notifier(&reboot);
return bcache_major;
+ }
if (!(bcache_wq = create_workqueue("bcache")) ||
!(bcache_kobj = kobject_create_and_add("bcache", fs_kobj)) ||
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 074/268] bcache: allows use of register in udev to avoid "device_busy" error.
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (72 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 073/268] bcache: unregister reboot notifier if bcache fails to unregister device Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 075/268] bcache: prevent crash on changing writeback_running Kamal Mostafa
` (193 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Denis Bychkov, Kent Overstreet, Eric Wheeler,
Gabriel de Perthuis, Jens Axboe, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Gabriel de Perthuis <g2p.code@gmail.com>
commit d7076f21629f8f329bca4a44dc408d94670f49e2 upstream.
Allows to use register, not register_quiet in udev to avoid "device_busy" error.
The initial patch proposed at https://lkml.org/lkml/2013/8/26/549 by Gabriel de Perthuis
<g2p.code@gmail.com> does not unlock the mutex and hangs the kernel.
See http://thread.gmane.org/gmane.linux.kernel.bcache.devel/2594 for the discussion.
Cc: Denis Bychkov <manover@gmail.com>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Cc: Eric Wheeler <bcache@linux.ewheeler.net>
Cc: Gabriel de Perthuis <g2p.code@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/bcache/super.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index c70755d..90bd95b 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1966,6 +1966,8 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
else
err = "device busy";
mutex_unlock(&bch_register_lock);
+ if (attr == &ksysfs_register_quiet)
+ goto out;
}
goto err;
}
@@ -2004,8 +2006,7 @@ out:
err_close:
blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);
err:
- if (attr != &ksysfs_register_quiet)
- pr_info("error opening %s: %s", path, err);
+ pr_info("error opening %s: %s", path, err);
ret = -EINVAL;
goto out;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 075/268] bcache: prevent crash on changing writeback_running
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (73 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 074/268] bcache: allows use of register in udev to avoid "device_busy" error Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 076/268] bcache: Change refill_dirty() to always scan entire disk if necessary Kamal Mostafa
` (192 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Stefan Bader, Kent Overstreet, Jens Axboe, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Stefan Bader <stefan.bader@canonical.com>
commit 8d16ce540c94c9d366eb36fc91b7154d92d6397b upstream.
Added a safeguard in the shutdown case. At least while not being
attached it is also possible to trigger a kernel bug by writing into
writeback_running. This change adds the same check before trying to
wake up the thread for that case.
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/bcache/writeback.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/md/bcache/writeback.h b/drivers/md/bcache/writeback.h
index 0a9dab1..073a042 100644
--- a/drivers/md/bcache/writeback.h
+++ b/drivers/md/bcache/writeback.h
@@ -63,7 +63,8 @@ static inline bool should_writeback(struct cached_dev *dc, struct bio *bio,
static inline void bch_writeback_queue(struct cached_dev *dc)
{
- wake_up_process(dc->writeback_thread);
+ if (!IS_ERR_OR_NULL(dc->writeback_thread))
+ wake_up_process(dc->writeback_thread);
}
static inline void bch_writeback_add(struct cached_dev *dc)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 076/268] bcache: Change refill_dirty() to always scan entire disk if necessary
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (74 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 075/268] bcache: prevent crash on changing writeback_running Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 077/268] wlcore/wl12xx: spi: fix NULL pointer dereference (Oops) Kamal Mostafa
` (191 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Kent Overstreet, Jens Axboe, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Kent Overstreet <kent.overstreet@gmail.com>
commit 627ccd20b4ad3ba836472468208e2ac4dfadbf03 upstream.
Previously, it would only scan the entire disk if it was starting from
the very start of the disk - i.e. if the previous scan got to the end.
This was broken by refill_full_stripes(), which updates last_scanned so
that refill_dirty was never triggering the searched_from_start path.
But if we change refill_dirty() to always scan the entire disk if
necessary, regardless of what last_scanned was, the code gets cleaner
and we fix that bug too.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/bcache/writeback.c | 37 ++++++++++++++++++++++++++++++-------
1 file changed, 30 insertions(+), 7 deletions(-)
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
index f1986bc..540256a 100644
--- a/drivers/md/bcache/writeback.c
+++ b/drivers/md/bcache/writeback.c
@@ -323,6 +323,10 @@ void bcache_dev_sectors_dirty_add(struct cache_set *c, unsigned inode,
static bool dirty_pred(struct keybuf *buf, struct bkey *k)
{
+ struct cached_dev *dc = container_of(buf, struct cached_dev, writeback_keys);
+
+ BUG_ON(KEY_INODE(k) != dc->disk.id);
+
return KEY_DIRTY(k);
}
@@ -372,11 +376,24 @@ next:
}
}
+/*
+ * Returns true if we scanned the entire disk
+ */
static bool refill_dirty(struct cached_dev *dc)
{
struct keybuf *buf = &dc->writeback_keys;
+ struct bkey start = KEY(dc->disk.id, 0, 0);
struct bkey end = KEY(dc->disk.id, MAX_KEY_OFFSET, 0);
- bool searched_from_start = false;
+ struct bkey start_pos;
+
+ /*
+ * make sure keybuf pos is inside the range for this disk - at bringup
+ * we might not be attached yet so this disk's inode nr isn't
+ * initialized then
+ */
+ if (bkey_cmp(&buf->last_scanned, &start) < 0 ||
+ bkey_cmp(&buf->last_scanned, &end) > 0)
+ buf->last_scanned = start;
if (dc->partial_stripes_expensive) {
refill_full_stripes(dc);
@@ -384,14 +401,20 @@ static bool refill_dirty(struct cached_dev *dc)
return false;
}
- if (bkey_cmp(&buf->last_scanned, &end) >= 0) {
- buf->last_scanned = KEY(dc->disk.id, 0, 0);
- searched_from_start = true;
- }
-
+ start_pos = buf->last_scanned;
bch_refill_keybuf(dc->disk.c, buf, &end, dirty_pred);
- return bkey_cmp(&buf->last_scanned, &end) >= 0 && searched_from_start;
+ if (bkey_cmp(&buf->last_scanned, &end) < 0)
+ return false;
+
+ /*
+ * If we get to the end start scanning again from the beginning, and
+ * only scan up to where we initially started scanning from:
+ */
+ buf->last_scanned = start;
+ bch_refill_keybuf(dc->disk.c, buf, &start_pos, dirty_pred);
+
+ return bkey_cmp(&buf->last_scanned, &start_pos) >= 0;
}
static int bch_writeback_thread(void *arg)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 077/268] wlcore/wl12xx: spi: fix NULL pointer dereference (Oops)
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (75 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 076/268] bcache: Change refill_dirty() to always scan entire disk if necessary Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 078/268] Input: i8042 - add Fujitsu Lifebook U745 to the nomux list Kamal Mostafa
` (190 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Uri Mashiach, Kalle Valo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Uri Mashiach <uri.mashiach@compulab.co.il>
commit e47301b06d5a65678690f04c2248fd181db1e59a upstream.
Fix the below Oops when trying to modprobe wlcore_spi.
The oops occurs because the wl1271_power_{off,on}()
function doesn't check the power() function pointer.
[ 23.401447] Unable to handle kernel NULL pointer dereference at
virtual address 00000000
[ 23.409954] pgd = c0004000
[ 23.412922] [00000000] *pgd=00000000
[ 23.416693] Internal error: Oops: 80000007 [#1] SMP ARM
[ 23.422168] Modules linked in: wl12xx wlcore mac80211 cfg80211
musb_dsps musb_hdrc usbcore usb_common snd_soc_simple_card evdev joydev
omap_rng wlcore_spi snd_soc_tlv320aic23_i2c rng_core snd_soc_tlv320aic23
c_can_platform c_can can_dev snd_soc_davinci_mcasp snd_soc_edma
snd_soc_omap omap_wdt musb_am335x cpufreq_dt thermal_sys hwmon
[ 23.453253] CPU: 0 PID: 36 Comm: kworker/0:2 Not tainted
4.2.0-00002-g951efee-dirty #233
[ 23.461720] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 23.468123] Workqueue: events request_firmware_work_func
[ 23.473690] task: de32efc0 ti: de4ee000 task.ti: de4ee000
[ 23.479341] PC is at 0x0
[ 23.482112] LR is at wl12xx_set_power_on+0x28/0x124 [wlcore]
[ 23.488074] pc : [<00000000>] lr : [<bf2581f0>] psr: 60000013
[ 23.488074] sp : de4efe50 ip : 00000002 fp : 00000000
[ 23.500162] r10: de7cdd00 r9 : dc848800 r8 : bf27af00
[ 23.505663] r7 : bf27a1a8 r6 : dcbd8a80 r5 : dce0e2e0 r4 :
dce0d2e0
[ 23.512536] r3 : 00000000 r2 : 00000000 r1 : 00000001 r0 :
dc848810
[ 23.519412] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM
Segment kernel
[ 23.527109] Control: 10c5387d Table: 9cb78019 DAC: 00000015
[ 23.533160] Process kworker/0:2 (pid: 36, stack limit = 0xde4ee218)
[ 23.539760] Stack: (0xde4efe50 to 0xde4f0000)
[...]
[ 23.665030] [<bf2581f0>] (wl12xx_set_power_on [wlcore]) from
[<bf25f7ac>] (wlcore_nvs_cb+0x118/0xa4c [wlcore])
[ 23.675604] [<bf25f7ac>] (wlcore_nvs_cb [wlcore]) from [<c04387ec>]
(request_firmware_work_func+0x30/0x58)
[ 23.685784] [<c04387ec>] (request_firmware_work_func) from
[<c0058e2c>] (process_one_work+0x1b4/0x4b4)
[ 23.695591] [<c0058e2c>] (process_one_work) from [<c0059168>]
(worker_thread+0x3c/0x4a4)
[ 23.704124] [<c0059168>] (worker_thread) from [<c005ee68>]
(kthread+0xd4/0xf0)
[ 23.711747] [<c005ee68>] (kthread) from [<c000f598>]
(ret_from_fork+0x14/0x3c)
[ 23.719357] Code: bad PC value
[ 23.722760] ---[ end trace 981be8510db9b3a9 ]---
Prevent oops by validationg power() pointer value before
calling the function.
Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/ti/wlcore/io.h | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ti/wlcore/io.h b/drivers/net/wireless/ti/wlcore/io.h
index 0305729..10cf374 100644
--- a/drivers/net/wireless/ti/wlcore/io.h
+++ b/drivers/net/wireless/ti/wlcore/io.h
@@ -207,19 +207,23 @@ static inline int __must_check wlcore_write_reg(struct wl1271 *wl, int reg,
static inline void wl1271_power_off(struct wl1271 *wl)
{
- int ret;
+ int ret = 0;
if (!test_bit(WL1271_FLAG_GPIO_POWER, &wl->flags))
return;
- ret = wl->if_ops->power(wl->dev, false);
+ if (wl->if_ops->power)
+ ret = wl->if_ops->power(wl->dev, false);
if (!ret)
clear_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
}
static inline int wl1271_power_on(struct wl1271 *wl)
{
- int ret = wl->if_ops->power(wl->dev, true);
+ int ret = 0;
+
+ if (wl->if_ops->power)
+ ret = wl->if_ops->power(wl->dev, true);
if (ret == 0)
set_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 078/268] Input: i8042 - add Fujitsu Lifebook U745 to the nomux list
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (76 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 077/268] wlcore/wl12xx: spi: fix NULL pointer dereference (Oops) Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 079/268] libxfs: pack the agfl header structure so XFS_AGFL_SIZE is correct Kamal Mostafa
` (189 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Aurélien Francillon, Dmitry Torokhov, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: =?UTF-8?q?Aur=C3=A9lien=20Francillon?= <aurelien@francillon.net>
commit dd0d0d4de582a6a61c032332c91f4f4cb2bab569 upstream.
Without i8042.nomux=1 the Elantech touch pad is not working at all on
a Fujitsu Lifebook U745. This patch does not seem necessary for all
U745 (maybe because of different BIOS versions?). However, it was
verified that the patch does not break those (see opensuse bug 883192:
https://bugzilla.opensuse.org/show_bug.cgi?id=883192).
Signed-off-by: Aurélien Francillon <aurelien@francillon.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/input/serio/i8042-x86ia64io.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index c115565..68f5f4a 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -258,6 +258,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
},
},
{
+ /* Fujitsu Lifebook U745 */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"),
+ },
+ },
+ {
/* Fujitsu T70H */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 079/268] libxfs: pack the agfl header structure so XFS_AGFL_SIZE is correct
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (77 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 078/268] Input: i8042 - add Fujitsu Lifebook U745 to the nomux list Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 080/268] x86/xen: don't reset vcpu_info on a cancelled suspend Kamal Mostafa
` (188 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Darrick J. Wong, Dave Chinner, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: "Darrick J. Wong" <darrick.wong@oracle.com>
commit 96f859d52bcb1c6ea6f3388d39862bf7143e2f30 upstream.
Because struct xfs_agfl is 36 bytes long and has a 64-bit integer
inside it, gcc will quietly round the structure size up to the nearest
64 bits -- in this case, 40 bytes. This results in the XFS_AGFL_SIZE
macro returning incorrect results for v5 filesystems on 64-bit
machines (118 items instead of 119). As a result, a 32-bit xfs_repair
will see garbage in AGFL item 119 and complain.
Therefore, tell gcc not to pad the structure so that the AGFL size
calculation is correct.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/xfs/libxfs/xfs_format.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
index a0ae572..cfb8dd6 100644
--- a/fs/xfs/libxfs/xfs_format.h
+++ b/fs/xfs/libxfs/xfs_format.h
@@ -762,7 +762,7 @@ typedef struct xfs_agfl {
__be64 agfl_lsn;
__be32 agfl_crc;
__be32 agfl_bno[]; /* actually XFS_AGFL_SIZE(mp) */
-} xfs_agfl_t;
+} __attribute__((packed)) xfs_agfl_t;
#define XFS_AGFL_CRC_OFF offsetof(struct xfs_agfl, agfl_crc)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 080/268] x86/xen: don't reset vcpu_info on a cancelled suspend
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (78 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 079/268] libxfs: pack the agfl header structure so XFS_AGFL_SIZE is correct Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 081/268] udf: Prevent buffer overrun with multi-byte characters Kamal Mostafa
` (187 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Charles Ouyang, David Vrabel, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: "Ouyang Zhaowei (Charles)" <ouyangzhaowei@huawei.com>
commit 6a1f513776b78c994045287073e55bae44ed9f8c upstream.
On a cancelled suspend the vcpu_info location does not change (it's
still in the per-cpu area registered by xen_vcpu_setup()). So do not
call xen_hvm_init_shared_info() which would make the kernel think its
back in the shared info. With the wrong vcpu_info, events cannot be
received and the domain will hang after a cancelled suspend.
Signed-off-by: Charles Ouyang <ouyangzhaowei@huawei.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/xen/suspend.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c
index 53b4c08..6d34151 100644
--- a/arch/x86/xen/suspend.c
+++ b/arch/x86/xen/suspend.c
@@ -32,7 +32,8 @@ static void xen_hvm_post_suspend(int suspend_cancelled)
{
#ifdef CONFIG_XEN_PVHVM
int cpu;
- xen_hvm_init_shared_info();
+ if (!suspend_cancelled)
+ xen_hvm_init_shared_info();
xen_callback_vector();
xen_unplug_emulated_devices();
if (xen_feature(XENFEAT_hvm_safe_pvclock)) {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 081/268] udf: Prevent buffer overrun with multi-byte characters
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (79 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 080/268] x86/xen: don't reset vcpu_info on a cancelled suspend Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 082/268] udf: Check output buffer length when converting name to CS0 Kamal Mostafa
` (186 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andrew Gabbasov, Jan Kara, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Andrew Gabbasov <andrew_gabbasov@mentor.com>
commit ad402b265ecf6fa22d04043b41444cdfcdf4f52d upstream.
udf_CS0toUTF8 function stops the conversion when the output buffer
length reaches UDF_NAME_LEN-2, which is correct maximum name length,
but, when checking, it leaves the space for a single byte only,
while multi-bytes output characters can take more space, causing
buffer overflow.
Similar error exists in udf_CS0toNLS function, that restricts
the output length to UDF_NAME_LEN, while actual maximum allowed
length is UDF_NAME_LEN-2.
In these cases the output can override not only the current buffer
length field, causing corruption of the name buffer itself, but also
following allocation structures, causing kernel crash.
Adjust the output length checks in both functions to prevent buffer
overruns in case of multi-bytes UTF8 or NLS characters.
Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/udf/unicode.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/fs/udf/unicode.c b/fs/udf/unicode.c
index ab478e6..95a224b 100644
--- a/fs/udf/unicode.c
+++ b/fs/udf/unicode.c
@@ -128,11 +128,15 @@ int udf_CS0toUTF8(struct ustr *utf_o, const struct ustr *ocu_i)
if (c < 0x80U)
utf_o->u_name[utf_o->u_len++] = (uint8_t)c;
else if (c < 0x800U) {
+ if (utf_o->u_len > (UDF_NAME_LEN - 4))
+ break;
utf_o->u_name[utf_o->u_len++] =
(uint8_t)(0xc0 | (c >> 6));
utf_o->u_name[utf_o->u_len++] =
(uint8_t)(0x80 | (c & 0x3f));
} else {
+ if (utf_o->u_len > (UDF_NAME_LEN - 5))
+ break;
utf_o->u_name[utf_o->u_len++] =
(uint8_t)(0xe0 | (c >> 12));
utf_o->u_name[utf_o->u_len++] =
@@ -277,7 +281,7 @@ static int udf_CS0toNLS(struct nls_table *nls, struct ustr *utf_o,
c = (c << 8) | ocu[i++];
len = nls->uni2char(c, &utf_o->u_name[utf_o->u_len],
- UDF_NAME_LEN - utf_o->u_len);
+ UDF_NAME_LEN - 2 - utf_o->u_len);
/* Valid character? */
if (len >= 0)
utf_o->u_len += len;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 082/268] udf: Check output buffer length when converting name to CS0
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (80 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 081/268] udf: Prevent buffer overrun with multi-byte characters Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 083/268] drm/dp/mst: process broadcast messages correctly Kamal Mostafa
` (185 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andrew Gabbasov, Jan Kara, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Andrew Gabbasov <andrew_gabbasov@mentor.com>
commit bb00c898ad1ce40c4bb422a8207ae562e9aea7ae upstream.
If a name contains at least some characters with Unicode values
exceeding single byte, the CS0 output should have 2 bytes per character.
And if other input characters have single byte Unicode values, then
the single input byte is converted to 2 output bytes, and the length
of output becomes larger than the length of input. And if the input
name is long enough, the output length may exceed the allocated buffer
length.
All this means that conversion from UTF8 or NLS to CS0 requires
checking of output length in order to stop when it exceeds the given
output buffer size.
[JK: Make code return -ENAMETOOLONG instead of silently truncating the
name]
Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/udf/unicode.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/fs/udf/unicode.c b/fs/udf/unicode.c
index 95a224b..e788a05 100644
--- a/fs/udf/unicode.c
+++ b/fs/udf/unicode.c
@@ -177,17 +177,22 @@ int udf_CS0toUTF8(struct ustr *utf_o, const struct ustr *ocu_i)
static int udf_UTF8toCS0(dstring *ocu, struct ustr *utf, int length)
{
unsigned c, i, max_val, utf_char;
- int utf_cnt, u_len;
+ int utf_cnt, u_len, u_ch;
memset(ocu, 0, sizeof(dstring) * length);
ocu[0] = 8;
max_val = 0xffU;
+ u_ch = 1;
try_again:
u_len = 0U;
utf_char = 0U;
utf_cnt = 0U;
for (i = 0U; i < utf->u_len; i++) {
+ /* Name didn't fit? */
+ if (u_len + 1 + u_ch >= length)
+ return 0;
+
c = (uint8_t)utf->u_name[i];
/* Complete a multi-byte UTF-8 character */
@@ -229,6 +234,7 @@ try_again:
if (max_val == 0xffU) {
max_val = 0xffffU;
ocu[0] = (uint8_t)0x10U;
+ u_ch = 2;
goto try_again;
}
goto error_out;
@@ -299,15 +305,19 @@ static int udf_NLStoCS0(struct nls_table *nls, dstring *ocu, struct ustr *uni,
int len;
unsigned i, max_val;
uint16_t uni_char;
- int u_len;
+ int u_len, u_ch;
memset(ocu, 0, sizeof(dstring) * length);
ocu[0] = 8;
max_val = 0xffU;
+ u_ch = 1;
try_again:
u_len = 0U;
for (i = 0U; i < uni->u_len; i++) {
+ /* Name didn't fit? */
+ if (u_len + 1 + u_ch >= length)
+ return 0;
len = nls->char2uni(&uni->u_name[i], uni->u_len - i, &uni_char);
if (!len)
continue;
@@ -320,6 +330,7 @@ try_again:
if (uni_char > max_val) {
max_val = 0xffffU;
ocu[0] = (uint8_t)0x10U;
+ u_ch = 2;
goto try_again;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 083/268] drm/dp/mst: process broadcast messages correctly
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (81 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 082/268] udf: Check output buffer length when converting name to CS0 Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 084/268] drm/dp/mst: always send reply for UP request Kamal Mostafa
` (184 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mykola Lysenko, Alex Deucher, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Mykola Lysenko <Mykola.Lysenko@amd.com>
commit bd9343208704fcc70a5b919f228a7d26ae472727 upstream.
In case broadcast message received in UP request,
RAD cannot be used to identify message originator.
Message should be parsed, originator should be found
by GUID from parsed message.
Also reply with broadcast in case broadcast message
received (for now it is always broadcast)
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Mykola Lysenko <Mykola.Lysenko@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 95 +++++++++++++++++++++++++++++++----
1 file changed, 84 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 1f94219..d2b69db 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -1209,6 +1209,50 @@ out:
return mstb;
}
+static struct drm_dp_mst_branch *get_mst_branch_device_by_guid_helper(
+ struct drm_dp_mst_branch *mstb,
+ uint8_t *guid)
+{
+ struct drm_dp_mst_branch *found_mstb;
+ struct drm_dp_mst_port *port;
+
+ list_for_each_entry(port, &mstb->ports, next) {
+ if (!port->mstb)
+ continue;
+
+ if (port->guid_valid && memcmp(port->guid, guid, 16) == 0)
+ return port->mstb;
+
+ found_mstb = get_mst_branch_device_by_guid_helper(port->mstb, guid);
+
+ if (found_mstb)
+ return found_mstb;
+ }
+
+ return NULL;
+}
+
+static struct drm_dp_mst_branch *drm_dp_get_mst_branch_device_by_guid(
+ struct drm_dp_mst_topology_mgr *mgr,
+ uint8_t *guid)
+{
+ struct drm_dp_mst_branch *mstb;
+
+ /* find the port by iterating down */
+ mutex_lock(&mgr->lock);
+
+ if (mgr->guid_valid && memcmp(mgr->guid, guid, 16) == 0)
+ mstb = mgr->mst_primary;
+ else
+ mstb = get_mst_branch_device_by_guid_helper(mgr->mst_primary, guid);
+
+ if (mstb)
+ kref_get(&mstb->kref);
+
+ mutex_unlock(&mgr->lock);
+ return mstb;
+}
+
static void drm_dp_check_and_send_link_address(struct drm_dp_mst_topology_mgr *mgr,
struct drm_dp_mst_branch *mstb)
{
@@ -1320,6 +1364,7 @@ static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr,
struct drm_dp_sideband_msg_tx *txmsg)
{
struct drm_dp_mst_branch *mstb = txmsg->dst;
+ u8 req_type;
/* both msg slots are full */
if (txmsg->seqno == -1) {
@@ -1336,7 +1381,13 @@ static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr,
txmsg->seqno = 1;
mstb->tx_slots[txmsg->seqno] = txmsg;
}
- hdr->broadcast = 0;
+
+ req_type = txmsg->msg[0] & 0x7f;
+ if (req_type == DP_CONNECTION_STATUS_NOTIFY ||
+ req_type == DP_RESOURCE_STATUS_NOTIFY)
+ hdr->broadcast = 1;
+ else
+ hdr->broadcast = 0;
hdr->path_msg = txmsg->path_msg;
hdr->lct = mstb->lct;
hdr->lcr = mstb->lct - 1;
@@ -2143,28 +2194,50 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
if (mgr->up_req_recv.have_eomt) {
struct drm_dp_sideband_msg_req_body msg;
- struct drm_dp_mst_branch *mstb;
+ struct drm_dp_mst_branch *mstb = NULL;
bool seqno;
- mstb = drm_dp_get_mst_branch_device(mgr,
- mgr->up_req_recv.initial_hdr.lct,
- mgr->up_req_recv.initial_hdr.rad);
- if (!mstb) {
- DRM_DEBUG_KMS("Got MST reply from unknown device %d\n", mgr->up_req_recv.initial_hdr.lct);
- memset(&mgr->up_req_recv, 0, sizeof(struct drm_dp_sideband_msg_rx));
- return 0;
+
+ if (!mgr->up_req_recv.initial_hdr.broadcast) {
+ mstb = drm_dp_get_mst_branch_device(mgr,
+ mgr->up_req_recv.initial_hdr.lct,
+ mgr->up_req_recv.initial_hdr.rad);
+ if (!mstb) {
+ DRM_DEBUG_KMS("Got MST reply from unknown device %d\n", mgr->up_req_recv.initial_hdr.lct);
+ memset(&mgr->up_req_recv, 0, sizeof(struct drm_dp_sideband_msg_rx));
+ return 0;
+ }
}
seqno = mgr->up_req_recv.initial_hdr.seqno;
drm_dp_sideband_parse_req(&mgr->up_req_recv, &msg);
if (msg.req_type == DP_CONNECTION_STATUS_NOTIFY) {
- drm_dp_send_up_ack_reply(mgr, mstb, msg.req_type, seqno, false);
+ drm_dp_send_up_ack_reply(mgr, mgr->mst_primary, msg.req_type, seqno, false);
+
+ if (!mstb)
+ mstb = drm_dp_get_mst_branch_device_by_guid(mgr, msg.u.conn_stat.guid);
+
+ if (!mstb) {
+ DRM_DEBUG_KMS("Got MST reply from unknown device %d\n", mgr->up_req_recv.initial_hdr.lct);
+ memset(&mgr->up_req_recv, 0, sizeof(struct drm_dp_sideband_msg_rx));
+ return 0;
+ }
+
drm_dp_update_port(mstb, &msg.u.conn_stat);
DRM_DEBUG_KMS("Got CSN: pn: %d ldps:%d ddps: %d mcs: %d ip: %d pdt: %d\n", msg.u.conn_stat.port_number, msg.u.conn_stat.legacy_device_plug_status, msg.u.conn_stat.displayport_device_plug_status, msg.u.conn_stat.message_capability_status, msg.u.conn_stat.input_port, msg.u.conn_stat.peer_device_type);
(*mgr->cbs->hotplug)(mgr);
} else if (msg.req_type == DP_RESOURCE_STATUS_NOTIFY) {
- drm_dp_send_up_ack_reply(mgr, mstb, msg.req_type, seqno, false);
+ drm_dp_send_up_ack_reply(mgr, mgr->mst_primary, msg.req_type, seqno, false);
+ if (!mstb)
+ mstb = drm_dp_get_mst_branch_device_by_guid(mgr, msg.u.resource_stat.guid);
+
+ if (!mstb) {
+ DRM_DEBUG_KMS("Got MST reply from unknown device %d\n", mgr->up_req_recv.initial_hdr.lct);
+ memset(&mgr->up_req_recv, 0, sizeof(struct drm_dp_sideband_msg_rx));
+ return 0;
+ }
+
DRM_DEBUG_KMS("Got RSN: pn: %d avail_pbn %d\n", msg.u.resource_stat.port_number, msg.u.resource_stat.available_pbn);
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 084/268] drm/dp/mst: always send reply for UP request
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (82 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 083/268] drm/dp/mst: process broadcast messages correctly Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 085/268] drm/dp/mst: fix in MSTB RAD initialization Kamal Mostafa
` (183 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mykola Lysenko, Alex Deucher, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Mykola Lysenko <Mykola.Lysenko@amd.com>
commit 1f16ee7fa13649f4e55aa48ad31c3eb0722a62d3 upstream.
We should always send reply for UP request in order
to make downstream device clean-up resources appropriately.
Issue was that reply for UP request was sent only once.
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Mykola Lysenko <Mykola.Lysenko@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 30 +++++++++++-------------------
include/drm/drm_dp_mst_helper.h | 2 --
2 files changed, 11 insertions(+), 21 deletions(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index d2b69db..d620fe9 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -1489,26 +1489,18 @@ static void process_single_down_tx_qlock(struct drm_dp_mst_topology_mgr *mgr)
}
/* called holding qlock */
-static void process_single_up_tx_qlock(struct drm_dp_mst_topology_mgr *mgr)
+static void process_single_up_tx_qlock(struct drm_dp_mst_topology_mgr *mgr,
+ struct drm_dp_sideband_msg_tx *txmsg)
{
- struct drm_dp_sideband_msg_tx *txmsg;
int ret;
/* construct a chunk from the first msg in the tx_msg queue */
- if (list_empty(&mgr->tx_msg_upq)) {
- mgr->tx_up_in_progress = false;
- return;
- }
-
- txmsg = list_first_entry(&mgr->tx_msg_upq, struct drm_dp_sideband_msg_tx, next);
ret = process_single_tx_qlock(mgr, txmsg, true);
- if (ret == 1) {
- /* up txmsgs aren't put in slots - so free after we send it */
- list_del(&txmsg->next);
- kfree(txmsg);
- } else if (ret)
+
+ if (ret != 1)
DRM_DEBUG_KMS("failed to send msg in q %d\n", ret);
- mgr->tx_up_in_progress = true;
+
+ txmsg->dst->tx_slots[txmsg->seqno] = NULL;
}
static void drm_dp_queue_down_tx(struct drm_dp_mst_topology_mgr *mgr,
@@ -1893,11 +1885,12 @@ static int drm_dp_send_up_ack_reply(struct drm_dp_mst_topology_mgr *mgr,
drm_dp_encode_up_ack_reply(txmsg, req_type);
mutex_lock(&mgr->qlock);
- list_add_tail(&txmsg->next, &mgr->tx_msg_upq);
- if (!mgr->tx_up_in_progress) {
- process_single_up_tx_qlock(mgr);
- }
+
+ process_single_up_tx_qlock(mgr, txmsg);
+
mutex_unlock(&mgr->qlock);
+
+ kfree(txmsg);
return 0;
}
@@ -2797,7 +2790,6 @@ int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr,
mutex_init(&mgr->qlock);
mutex_init(&mgr->payload_lock);
mutex_init(&mgr->destroy_connector_lock);
- INIT_LIST_HEAD(&mgr->tx_msg_upq);
INIT_LIST_HEAD(&mgr->tx_msg_downq);
INIT_LIST_HEAD(&mgr->destroy_connector_list);
INIT_WORK(&mgr->work, drm_dp_mst_link_probe_work);
diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h
index a89f505..c7f01d1 100644
--- a/include/drm/drm_dp_mst_helper.h
+++ b/include/drm/drm_dp_mst_helper.h
@@ -449,9 +449,7 @@ struct drm_dp_mst_topology_mgr {
the mstb tx_slots and txmsg->state once they are queued */
struct mutex qlock;
struct list_head tx_msg_downq;
- struct list_head tx_msg_upq;
bool tx_down_in_progress;
- bool tx_up_in_progress;
/* payload info + lock for it */
struct mutex payload_lock;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 085/268] drm/dp/mst: fix in MSTB RAD initialization
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (83 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 084/268] drm/dp/mst: always send reply for UP request Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 086/268] drm/dp/mst: fix in RAD element access Kamal Mostafa
` (182 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mykola Lysenko, Alex Deucher, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Mykola Lysenko <Mykola.Lysenko@amd.com>
commit 75af4c8c4c0f60d7ad135419805798f144e9baf9 upstream.
This fix is needed to support more then two
branch displays, so RAD address consist at
least of 2 elements
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Mykola Lysenko <Mykola.Lysenko@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index d620fe9..74c0c08 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -973,17 +973,17 @@ static struct drm_dp_mst_port *drm_dp_get_port(struct drm_dp_mst_branch *mstb, u
static u8 drm_dp_calculate_rad(struct drm_dp_mst_port *port,
u8 *rad)
{
- int lct = port->parent->lct;
+ int parent_lct = port->parent->lct;
int shift = 4;
- int idx = lct / 2;
- if (lct > 1) {
- memcpy(rad, port->parent->rad, idx);
- shift = (lct % 2) ? 4 : 0;
+ int idx = (parent_lct - 1) / 2;
+ if (parent_lct > 1) {
+ memcpy(rad, port->parent->rad, idx + 1);
+ shift = (parent_lct % 2) ? 4 : 0;
} else
rad[0] = 0;
rad[idx] |= port->port_num << shift;
- return lct + 1;
+ return parent_lct + 1;
}
/*
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 086/268] drm/dp/mst: fix in RAD element access
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (84 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 085/268] drm/dp/mst: fix in MSTB RAD initialization Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 087/268] PCI: Fix minimum allocation address overwrite Kamal Mostafa
` (181 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mykola Lysenko, Alex Deucher, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Mykola Lysenko <Mykola.Lysenko@amd.com>
commit 7a11a334aa6af4c65c6a0d81b60c97fc18673532 upstream.
This is needed to receive correct port
number from RAD, so MSTB could be found
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Mykola Lysenko <Mykola.Lysenko@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 74c0c08..3f8b30f 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -1039,7 +1039,7 @@ static void build_mst_prop_path(struct drm_dp_mst_port *port,
snprintf(proppath, proppath_size, "mst:%d", mstb->mgr->conn_base_id);
for (i = 0; i < (mstb->lct - 1); i++) {
int shift = (i % 2) ? 0 : 4;
- int port_num = mstb->rad[i / 2] >> shift;
+ int port_num = (mstb->rad[i / 2] >> shift) & 0xf;
snprintf(temp, sizeof(temp), "-%d", port_num);
strlcat(proppath, temp, proppath_size);
}
@@ -1189,7 +1189,7 @@ static struct drm_dp_mst_branch *drm_dp_get_mst_branch_device(struct drm_dp_mst_
for (i = 0; i < lct - 1; i++) {
int shift = (i % 2) ? 0 : 4;
- int port_num = rad[i / 2] >> shift;
+ int port_num = (rad[i / 2] >> shift) & 0xf;
list_for_each_entry(port, &mstb->ports, next) {
if (port->port_num == port_num) {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 087/268] PCI: Fix minimum allocation address overwrite
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (85 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 086/268] drm/dp/mst: fix in RAD element access Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 088/268] PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD Kamal Mostafa
` (180 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Christoph Biedl, Bjorn Helgaas, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
commit 3460baa620685c20f5ee19afb6d99d26150c382c upstream.
Commit 36e097a8a297 ("PCI: Split out bridge window override of minimum
allocation address") claimed to do no functional changes but unfortunately
did: The "min" variable is altered. At least the AVM A1 PCMCIA adapter was
no longer detected, breaking ISDN operation.
Use a local copy of "min" to restore the previous behaviour.
[bhelgaas: avoid gcc "?:" extension for portability and readability]
Fixes: 36e097a8a297 ("PCI: Split out bridge window override of minimum allocation address")
Signed-off-by: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/pci/bus.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index d3346d2..89b3bef 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -140,6 +140,8 @@ static int pci_bus_alloc_from_region(struct pci_bus *bus, struct resource *res,
type_mask |= IORESOURCE_TYPE_BITS;
pci_bus_for_each_resource(bus, r, i) {
+ resource_size_t min_used = min;
+
if (!r)
continue;
@@ -163,12 +165,12 @@ static int pci_bus_alloc_from_region(struct pci_bus *bus, struct resource *res,
* overrides "min".
*/
if (avail.start)
- min = avail.start;
+ min_used = avail.start;
max = avail.end;
/* Ok, try it out.. */
- ret = allocate_resource(r, res, size, min, max,
+ ret = allocate_resource(r, res, size, min_used, max,
align, alignf, alignf_data);
if (ret == 0)
return 0;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 088/268] PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (86 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 087/268] PCI: Fix minimum allocation address overwrite Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 089/268] btrfs: handle invalid num_stripes in sys_array Kamal Mostafa
` (179 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Grygorii Strashko, Bjorn Helgaas, Kishon Vijay Abraham I,
Jingoo Han, Kukjin Kim, Krzysztof Kozlowski, Richard Zhu,
Thierry Reding, Stephen Warren, Alexandre Courbot, Simon Horman,
Pratyush Anand, Michal Simek, Sören Brinkmann,
Sebastian Andrzej Siewior, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Grygorii Strashko <grygorii.strashko@ti.com>
commit 8ff0ef996ca00028519c70e8d51d32bd37eb51dc upstream.
On -RT and if kernel is booting with "threadirqs" cmd line parameter,
PCIe/PCI (MSI) IRQ cascade handlers (like dra7xx_pcie_msi_irq_handler())
will be forced threaded and, as result, will generate warnings like this:
WARNING: CPU: 1 PID: 82 at kernel/irq/handle.c:150 handle_irq_event_percpu+0x14c/0x174()
irq 460 handler irq_default_primary_handler+0x0/0x14 enabled interrupts
Backtrace:
(warn_slowpath_common) from (warn_slowpath_fmt+0x38/0x40)
(warn_slowpath_fmt) from (handle_irq_event_percpu+0x14c/0x174)
(handle_irq_event_percpu) from (handle_irq_event+0x84/0xb8)
(handle_irq_event) from (handle_simple_irq+0x90/0x118)
(handle_simple_irq) from (generic_handle_irq+0x30/0x44)
(generic_handle_irq) from (dra7xx_pcie_msi_irq_handler+0x7c/0x8c)
(dra7xx_pcie_msi_irq_handler) from (irq_forced_thread_fn+0x28/0x5c)
(irq_forced_thread_fn) from (irq_thread+0x128/0x204)
This happens because all of them invoke generic_handle_irq() from the
requested handler. generic_handle_irq() grabs raw_locks and thus needs to
run in raw-IRQ context.
This issue was originally reproduced on TI dra7-evem, but, as was
identified during discussion [1], other hosts can also suffer from this
issue. Fix all them at once by marking PCIe/PCI (MSI) IRQ cascade handlers
IRQF_NO_THREAD explicitly.
[1] http://lkml.kernel.org/r/1448027966-21610-1-git-send-email-grygorii.strashko@ti.com
[bhelgaas: add stable tag, fix typos]
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de> (for imx6)
CC: Kishon Vijay Abraham I <kishon@ti.com>
CC: Jingoo Han <jingoohan1@gmail.com>
CC: Kukjin Kim <kgene@kernel.org>
CC: Krzysztof Kozlowski <k.kozlowski@samsung.com>
CC: Richard Zhu <Richard.Zhu@freescale.com>
CC: Thierry Reding <thierry.reding@gmail.com>
CC: Stephen Warren <swarren@wwwdotorg.org>
CC: Alexandre Courbot <gnurou@gmail.com>
CC: Simon Horman <horms@verge.net.au>
CC: Pratyush Anand <pratyush.anand@gmail.com>
CC: Michal Simek <michal.simek@xilinx.com>
CC: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
CC: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/pci/host/pci-dra7xx.c | 3 ++-
drivers/pci/host/pci-exynos.c | 3 ++-
drivers/pci/host/pci-imx6.c | 3 ++-
drivers/pci/host/pci-tegra.c | 2 +-
drivers/pci/host/pcie-rcar.c | 6 ++++--
drivers/pci/host/pcie-spear13xx.c | 3 ++-
drivers/pci/host/pcie-xilinx.c | 3 ++-
7 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c
index 80db09e..66aa928 100644
--- a/drivers/pci/host/pci-dra7xx.c
+++ b/drivers/pci/host/pci-dra7xx.c
@@ -284,7 +284,8 @@ static int __init dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx,
}
ret = devm_request_irq(&pdev->dev, pp->irq,
- dra7xx_pcie_msi_irq_handler, IRQF_SHARED,
+ dra7xx_pcie_msi_irq_handler,
+ IRQF_SHARED | IRQF_NO_THREAD,
"dra7-pcie-msi", pp);
if (ret) {
dev_err(&pdev->dev, "failed to request irq\n");
diff --git a/drivers/pci/host/pci-exynos.c b/drivers/pci/host/pci-exynos.c
index f9f468d..7b6be77 100644
--- a/drivers/pci/host/pci-exynos.c
+++ b/drivers/pci/host/pci-exynos.c
@@ -523,7 +523,8 @@ static int __init exynos_add_pcie_port(struct pcie_port *pp,
ret = devm_request_irq(&pdev->dev, pp->msi_irq,
exynos_pcie_msi_irq_handler,
- IRQF_SHARED, "exynos-pcie", pp);
+ IRQF_SHARED | IRQF_NO_THREAD,
+ "exynos-pcie", pp);
if (ret) {
dev_err(&pdev->dev, "failed to request msi irq\n");
return ret;
diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index 233a196..fd5eb2e 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c
@@ -544,7 +544,8 @@ static int __init imx6_add_pcie_port(struct pcie_port *pp,
ret = devm_request_irq(&pdev->dev, pp->msi_irq,
imx6_pcie_msi_handler,
- IRQF_SHARED, "mx6-pcie-msi", pp);
+ IRQF_SHARED | IRQF_NO_THREAD,
+ "mx6-pcie-msi", pp);
if (ret) {
dev_err(&pdev->dev, "failed to request MSI irq\n");
return -ENODEV;
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 10c0571..60e3c46 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -1289,7 +1289,7 @@ static int tegra_pcie_enable_msi(struct tegra_pcie *pcie)
msi->irq = err;
- err = request_irq(msi->irq, tegra_pcie_msi_irq, 0,
+ err = request_irq(msi->irq, tegra_pcie_msi_irq, IRQF_NO_THREAD,
tegra_msi_irq_chip.name, pcie);
if (err < 0) {
dev_err(&pdev->dev, "failed to request IRQ: %d\n", err);
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index c086210..56ce564 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -695,14 +695,16 @@ static int rcar_pcie_enable_msi(struct rcar_pcie *pcie)
/* Two irqs are for MSI, but they are also used for non-MSI irqs */
err = devm_request_irq(&pdev->dev, msi->irq1, rcar_pcie_msi_irq,
- IRQF_SHARED, rcar_msi_irq_chip.name, pcie);
+ IRQF_SHARED | IRQF_NO_THREAD,
+ rcar_msi_irq_chip.name, pcie);
if (err < 0) {
dev_err(&pdev->dev, "failed to request IRQ: %d\n", err);
goto err;
}
err = devm_request_irq(&pdev->dev, msi->irq2, rcar_pcie_msi_irq,
- IRQF_SHARED, rcar_msi_irq_chip.name, pcie);
+ IRQF_SHARED | IRQF_NO_THREAD,
+ rcar_msi_irq_chip.name, pcie);
if (err < 0) {
dev_err(&pdev->dev, "failed to request IRQ: %d\n", err);
goto err;
diff --git a/drivers/pci/host/pcie-spear13xx.c b/drivers/pci/host/pcie-spear13xx.c
index 4086268..d877c3b 100644
--- a/drivers/pci/host/pcie-spear13xx.c
+++ b/drivers/pci/host/pcie-spear13xx.c
@@ -282,7 +282,8 @@ static int spear13xx_add_pcie_port(struct pcie_port *pp,
return -ENODEV;
}
ret = devm_request_irq(dev, pp->irq, spear13xx_pcie_irq_handler,
- IRQF_SHARED, "spear1340-pcie", pp);
+ IRQF_SHARED | IRQF_NO_THREAD,
+ "spear1340-pcie", pp);
if (ret) {
dev_err(dev, "failed to request irq %d\n", pp->irq);
return ret;
diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index f1a06a0..577fe5b 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -776,7 +776,8 @@ static int xilinx_pcie_parse_dt(struct xilinx_pcie_port *port)
port->irq = irq_of_parse_and_map(node, 0);
err = devm_request_irq(dev, port->irq, xilinx_pcie_intr_handler,
- IRQF_SHARED, "xilinx-pcie", port);
+ IRQF_SHARED | IRQF_NO_THREAD,
+ "xilinx-pcie", port);
if (err) {
dev_err(dev, "unable to request irq %d\n", port->irq);
return err;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 089/268] btrfs: handle invalid num_stripes in sys_array
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (87 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 088/268] PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 090/268] iwlwifi: update and fix 7265 series PCI IDs Kamal Mostafa
` (178 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: David Sterba, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: David Sterba <dsterba@suse.com>
commit f5cdedd73fa71b74dcc42f2a11a5735d89ce7c4f upstream.
We can handle the special case of num_stripes == 0 directly inside
btrfs_read_sys_array. The BUG_ON in btrfs_chunk_item_size is there to
catch other unhandled cases where we fail to validate external data.
A crafted or corrupted image crashes at mount time:
BTRFS: device fsid 9006933e-2a9a-44f0-917f-514252aeec2c devid 1 transid 7 /dev/loop0
BTRFS info (device loop0): disk space caching is enabled
BUG: failure at fs/btrfs/ctree.h:337/btrfs_chunk_item_size()!
Kernel panic - not syncing: BUG!
CPU: 0 PID: 313 Comm: mount Not tainted 4.2.5-00657-ge047887-dirty #25
Stack:
637af890 60062489 602aeb2e 604192ba
60387961 00000011 637af8a0 6038a835
637af9c0 6038776b 634ef32b 00000000
Call Trace:
[<6001c86d>] show_stack+0xfe/0x15b
[<6038a835>] dump_stack+0x2a/0x2c
[<6038776b>] panic+0x13e/0x2b3
[<6020f099>] btrfs_read_sys_array+0x25d/0x2ff
[<601cfbbe>] open_ctree+0x192d/0x27af
[<6019c2c1>] btrfs_mount+0x8f5/0xb9a
[<600bc9a7>] mount_fs+0x11/0xf3
[<600d5167>] vfs_kern_mount+0x75/0x11a
[<6019bcb0>] btrfs_mount+0x2e4/0xb9a
[<600bc9a7>] mount_fs+0x11/0xf3
[<600d5167>] vfs_kern_mount+0x75/0x11a
[<600d710b>] do_mount+0xa35/0xbc9
[<600d7557>] SyS_mount+0x95/0xc8
[<6001e884>] handle_syscall+0x6b/0x8e
Reported-by: Jiri Slaby <jslaby@suse.com>
Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/btrfs/volumes.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index fbe7c10..f5a3c5b 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -6476,6 +6476,14 @@ int btrfs_read_sys_array(struct btrfs_root *root)
goto out_short_read;
num_stripes = btrfs_chunk_num_stripes(sb, chunk);
+ if (!num_stripes) {
+ printk(KERN_ERR
+ "BTRFS: invalid number of stripes %u in sys_array at offset %u\n",
+ num_stripes, cur_offset);
+ ret = -EIO;
+ break;
+ }
+
len = btrfs_chunk_item_size(num_stripes);
if (cur_offset + len > array_size)
goto out_short_read;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 090/268] iwlwifi: update and fix 7265 series PCI IDs
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (88 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 089/268] btrfs: handle invalid num_stripes in sys_array Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 091/268] iwlwifi: pcie: properly configure the debug buffer size for 8000 Kamal Mostafa
` (177 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Oren Givon, Emmanuel Grumbach, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Oren Givon <oren.givon@intel.com>
commit 006bda75d81fd27a583a3b310e9444fea2aa6ef2 upstream.
Update and fix some 7265 PCI IDs entries.
Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/iwlwifi/pcie/drv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c
index fd6aef7..c670196 100644
--- a/drivers/net/wireless/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/iwlwifi/pcie/drv.c
@@ -384,6 +384,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
{IWL_PCI_DEVICE(0x095B, 0x5310, iwl7265_2ac_cfg)},
{IWL_PCI_DEVICE(0x095B, 0x5302, iwl7265_n_cfg)},
{IWL_PCI_DEVICE(0x095B, 0x5210, iwl7265_2ac_cfg)},
+ {IWL_PCI_DEVICE(0x095A, 0x5C10, iwl7265_2ac_cfg)},
{IWL_PCI_DEVICE(0x095A, 0x5012, iwl7265_2ac_cfg)},
{IWL_PCI_DEVICE(0x095A, 0x5412, iwl7265_2ac_cfg)},
{IWL_PCI_DEVICE(0x095A, 0x5410, iwl7265_2ac_cfg)},
@@ -401,10 +402,10 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
{IWL_PCI_DEVICE(0x095A, 0x900A, iwl7265_2ac_cfg)},
{IWL_PCI_DEVICE(0x095A, 0x9110, iwl7265_2ac_cfg)},
{IWL_PCI_DEVICE(0x095A, 0x9112, iwl7265_2ac_cfg)},
- {IWL_PCI_DEVICE(0x095A, 0x9210, iwl7265_2ac_cfg)},
+ {IWL_PCI_DEVICE(0x095B, 0x9210, iwl7265_2ac_cfg)},
{IWL_PCI_DEVICE(0x095B, 0x9200, iwl7265_2ac_cfg)},
{IWL_PCI_DEVICE(0x095A, 0x9510, iwl7265_2ac_cfg)},
- {IWL_PCI_DEVICE(0x095A, 0x9310, iwl7265_2ac_cfg)},
+ {IWL_PCI_DEVICE(0x095B, 0x9310, iwl7265_2ac_cfg)},
{IWL_PCI_DEVICE(0x095A, 0x9410, iwl7265_2ac_cfg)},
{IWL_PCI_DEVICE(0x095A, 0x5020, iwl7265_2n_cfg)},
{IWL_PCI_DEVICE(0x095A, 0x502A, iwl7265_2n_cfg)},
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 091/268] iwlwifi: pcie: properly configure the debug buffer size for 8000
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (89 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 090/268] iwlwifi: update and fix 7265 series PCI IDs Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 092/268] locks: fix unlock when fcntl_setlk races with a close Kamal Mostafa
` (176 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Emmanuel Grumbach, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
commit 62d7476d958ce06d7a10b02bdb30006870286fe2 upstream.
8000 device family has a new debug engine that needs to be
configured differently than 7000's.
The debug engine's DMA works in chunks of memory and the
size of the buffer really means the start of the last
chunk. Since one chunk is 256-byte long, we should
configure the device to write to buffer_size - 256.
This fixes a situation were the device would write to
memory it is not allowed to access.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/iwlwifi/pcie/trans.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index dab9b91..444cdb9 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -7,6 +7,7 @@
*
* Copyright(c) 2007 - 2015 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
+ * Copyright(c) 2016 Intel Deutschland GmbH
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
@@ -33,6 +34,7 @@
*
* Copyright(c) 2005 - 2015 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
+ * Copyright(c) 2016 Intel Deutschland GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -901,9 +903,16 @@ static void iwl_pcie_apply_destination(struct iwl_trans *trans)
if (dest->monitor_mode == EXTERNAL_MODE && trans_pcie->fw_mon_size) {
iwl_write_prph(trans, le32_to_cpu(dest->base_reg),
trans_pcie->fw_mon_phys >> dest->base_shift);
- iwl_write_prph(trans, le32_to_cpu(dest->end_reg),
- (trans_pcie->fw_mon_phys +
- trans_pcie->fw_mon_size) >> dest->end_shift);
+ if (trans->cfg->device_family == IWL_DEVICE_FAMILY_8000)
+ iwl_write_prph(trans, le32_to_cpu(dest->end_reg),
+ (trans_pcie->fw_mon_phys +
+ trans_pcie->fw_mon_size - 256) >>
+ dest->end_shift);
+ else
+ iwl_write_prph(trans, le32_to_cpu(dest->end_reg),
+ (trans_pcie->fw_mon_phys +
+ trans_pcie->fw_mon_size) >>
+ dest->end_shift);
}
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 092/268] locks: fix unlock when fcntl_setlk races with a close
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (90 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 091/268] iwlwifi: pcie: properly configure the debug buffer size for 8000 Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 093/268] scsi: add Synology to 1024 sector blacklist Kamal Mostafa
` (175 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Alexander Viro, Jeff Layton, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Jeff Layton <jeff.layton@primarydata.com>
commit 7f3697e24dc3820b10f445a4a7d914fc356012d1 upstream.
Dmitry reported that he was able to reproduce the WARN_ON_ONCE that
fires in locks_free_lock_context when the flc_posix list isn't empty.
The problem turns out to be that we're basically rebuilding the
file_lock from scratch in fcntl_setlk when we discover that the setlk
has raced with a close. If the l_whence field is SEEK_CUR or SEEK_END,
then we may end up with fl_start and fl_end values that differ from
when the lock was initially set, if the file position or length of the
file has changed in the interim.
Fix this by just reusing the same lock request structure, and simply
override fl_type value with F_UNLCK as appropriate. That ensures that
we really are unlocking the lock that was initially set.
While we're there, make sure that we do pop a WARN_ON_ONCE if the
removal ever fails. Also return -EBADF in this event, since that's
what we would have returned if the close had happened earlier.
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Fixes: c293621bbf67 (stale POSIX lock handling)
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Acked-by: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/locks.c | 51 ++++++++++++++++++++++++++++++---------------------
1 file changed, 30 insertions(+), 21 deletions(-)
diff --git a/fs/locks.c b/fs/locks.c
index d3d558b..8501eec 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -2154,7 +2154,6 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd,
goto out;
}
-again:
error = flock_to_posix_lock(filp, file_lock, &flock);
if (error)
goto out;
@@ -2196,19 +2195,22 @@ again:
* Attempt to detect a close/fcntl race and recover by
* releasing the lock that was just acquired.
*/
- /*
- * we need that spin_lock here - it prevents reordering between
- * update of i_flctx->flc_posix and check for it done in close().
- * rcu_read_lock() wouldn't do.
- */
- spin_lock(¤t->files->file_lock);
- f = fcheck(fd);
- spin_unlock(¤t->files->file_lock);
- if (!error && f != filp && flock.l_type != F_UNLCK) {
- flock.l_type = F_UNLCK;
- goto again;
+ if (!error && file_lock->fl_type != F_UNLCK) {
+ /*
+ * We need that spin_lock here - it prevents reordering between
+ * update of i_flctx->flc_posix and check for it done in
+ * close(). rcu_read_lock() wouldn't do.
+ */
+ spin_lock(¤t->files->file_lock);
+ f = fcheck(fd);
+ spin_unlock(¤t->files->file_lock);
+ if (f != filp) {
+ file_lock->fl_type = F_UNLCK;
+ error = do_lock_file_wait(filp, cmd, file_lock);
+ WARN_ON_ONCE(error);
+ error = -EBADF;
+ }
}
-
out:
locks_free_lock(file_lock);
return error;
@@ -2294,7 +2296,6 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd,
goto out;
}
-again:
error = flock64_to_posix_lock(filp, file_lock, &flock);
if (error)
goto out;
@@ -2336,14 +2337,22 @@ again:
* Attempt to detect a close/fcntl race and recover by
* releasing the lock that was just acquired.
*/
- spin_lock(¤t->files->file_lock);
- f = fcheck(fd);
- spin_unlock(¤t->files->file_lock);
- if (!error && f != filp && flock.l_type != F_UNLCK) {
- flock.l_type = F_UNLCK;
- goto again;
+ if (!error && file_lock->fl_type != F_UNLCK) {
+ /*
+ * We need that spin_lock here - it prevents reordering between
+ * update of i_flctx->flc_posix and check for it done in
+ * close(). rcu_read_lock() wouldn't do.
+ */
+ spin_lock(¤t->files->file_lock);
+ f = fcheck(fd);
+ spin_unlock(¤t->files->file_lock);
+ if (f != filp) {
+ file_lock->fl_type = F_UNLCK;
+ error = do_lock_file_wait(filp, cmd, file_lock);
+ WARN_ON_ONCE(error);
+ error = -EBADF;
+ }
}
-
out:
locks_free_lock(file_lock);
return error;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 093/268] scsi: add Synology to 1024 sector blacklist
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (91 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 092/268] locks: fix unlock when fcntl_setlk races with a close Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 094/268] ASoC: compress: Fix compress device direction check Kamal Mostafa
` (174 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mike Christie, Martin K. Petersen, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Mike Christie <mchristi@redhat.com>
commit 9055082fb100cc66e20c048251d05159f5f2cfba upstream.
Another iscsi target that cannot handle large IOs, but does not tell us
a limit.
The Synology iSCSI targets report:
Block limits VPD page (SBC):
Write same no zero (WSNZ): 0
Maximum compare and write length: 0 blocks
Optimal transfer length granularity: 0 blocks
Maximum transfer length: 0 blocks
Optimal transfer length: 0 blocks
Maximum prefetch length: 0 blocks
Maximum unmap LBA count: 0
Maximum unmap block descriptor count: 0
Optimal unmap granularity: 0
Unmap granularity alignment valid: 0
Unmap granularity alignment: 0
Maximum write same length: 0x0 blocks
and the size of the command it can handle seems to depend on how much
memory it can allocate at the time. This results in IO errors when
handling large IOs. This patch just has us use the old 1024 default
sectors for this target by adding it to the scsi blacklist. We do not
have good contacs with this vendors, so I have not been able to try and
fix on their side.
I have posted this a long while back, but it was not merged. This
version just fixes it up for merge/patch failures in the original
version.
Reported-by: Ancoron Luciferis <ancoron.luciferis@googlemail.com>
Reported-by: Michael Meyers <steltek@tcnnet.com>
Signed-off-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/scsi/scsi_devinfo.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index 9f77d23..64ed88a 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -227,6 +227,7 @@ static struct {
{"Promise", "VTrak E610f", NULL, BLIST_SPARSELUN | BLIST_NO_RSOC},
{"Promise", "", NULL, BLIST_SPARSELUN},
{"QNAP", "iSCSI Storage", NULL, BLIST_MAX_1024},
+ {"SYNOLOGY", "iSCSI Storage", NULL, BLIST_MAX_1024},
{"QUANTUM", "XP34301", "1071", BLIST_NOTQ},
{"REGAL", "CDC-4X", NULL, BLIST_MAX5LUN | BLIST_SINGLELUN},
{"SanDisk", "ImageMate CF-SD1", NULL, BLIST_FORCELUN},
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 094/268] ASoC: compress: Fix compress device direction check
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (92 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 093/268] scsi: add Synology to 1024 sector blacklist Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 095/268] dm snapshot: fix hung bios when copy error occurs Kamal Mostafa
` (173 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Vinod Koul, Mark Brown, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Vinod Koul <vinod.koul@intel.com>
commit a1068045883ed4a18363a4ebad0c3d55e473b716 upstream.
The detection of direction for compress was only taking into account codec
capabilities and not CPU ones. Fix this by checking the CPU side capabilities
as well
Tested-by: Ashish Panwar <ashish.panwar@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/soc-compress.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index 025c38f..1874cf0 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -623,6 +623,7 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
struct snd_pcm *be_pcm;
char new_name[64];
int ret = 0, direction = 0;
+ int playback = 0, capture = 0;
if (rtd->num_codecs > 1) {
dev_err(rtd->card->dev, "Multicodec not supported for compressed stream\n");
@@ -634,11 +635,27 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
rtd->dai_link->stream_name, codec_dai->name, num);
if (codec_dai->driver->playback.channels_min)
+ playback = 1;
+ if (codec_dai->driver->capture.channels_min)
+ capture = 1;
+
+ capture = capture && cpu_dai->driver->capture.channels_min;
+ playback = playback && cpu_dai->driver->playback.channels_min;
+
+ /*
+ * Compress devices are unidirectional so only one of the directions
+ * should be set, check for that (xor)
+ */
+ if (playback + capture != 1) {
+ dev_err(rtd->card->dev, "Invalid direction for compress P %d, C %d\n",
+ playback, capture);
+ return -EINVAL;
+ }
+
+ if(playback)
direction = SND_COMPRESS_PLAYBACK;
- else if (codec_dai->driver->capture.channels_min)
- direction = SND_COMPRESS_CAPTURE;
else
- return -EINVAL;
+ direction = SND_COMPRESS_CAPTURE;
compr = kzalloc(sizeof(*compr), GFP_KERNEL);
if (compr == NULL) {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 095/268] dm snapshot: fix hung bios when copy error occurs
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (93 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 094/268] ASoC: compress: Fix compress device direction check Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 096/268] uml: fix hostfs mknod() Kamal Mostafa
` (172 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mikulas Patocka, Mike Snitzer, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 385277bfb57faac44e92497104ba542cdd82d5fe upstream.
When there is an error copying a chunk dm-snapshot can incorrectly hold
associated bios indefinitely, resulting in hung IO.
The function copy_callback sets pe->error if there was error copying the
chunk, and then calls complete_exception. complete_exception calls
pending_complete on error, otherwise it calls commit_exception with
commit_callback (and commit_callback calls complete_exception).
The persistent exception store (dm-snap-persistent.c) assumes that calls
to prepare_exception and commit_exception are paired.
persistent_prepare_exception increases ps->pending_count and
persistent_commit_exception decreases it.
If there is a copy error, persistent_prepare_exception is called but
persistent_commit_exception is not. This results in the variable
ps->pending_count never returning to zero and that causes some pending
exceptions (and their associated bios) to be held forever.
Fix this by unconditionally calling commit_exception regardless of
whether the copy was successful. A new "valid" parameter is added to
commit_exception -- when the copy fails this parameter is set to zero so
that the chunk that failed to copy (and all following chunks) is not
recorded in the snapshot store. Also, remove commit_callback now that
it is merely a wrapper around pending_complete.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/dm-exception-store.h | 2 +-
drivers/md/dm-snap-persistent.c | 5 ++++-
drivers/md/dm-snap-transient.c | 4 ++--
drivers/md/dm-snap.c | 20 +++++---------------
4 files changed, 12 insertions(+), 19 deletions(-)
diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h
index 0b25362..84e2770 100644
--- a/drivers/md/dm-exception-store.h
+++ b/drivers/md/dm-exception-store.h
@@ -70,7 +70,7 @@ struct dm_exception_store_type {
* Update the metadata with this exception.
*/
void (*commit_exception) (struct dm_exception_store *store,
- struct dm_exception *e,
+ struct dm_exception *e, int valid,
void (*callback) (void *, int success),
void *callback_context);
diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c
index 808b841..9feb894 100644
--- a/drivers/md/dm-snap-persistent.c
+++ b/drivers/md/dm-snap-persistent.c
@@ -694,7 +694,7 @@ static int persistent_prepare_exception(struct dm_exception_store *store,
}
static void persistent_commit_exception(struct dm_exception_store *store,
- struct dm_exception *e,
+ struct dm_exception *e, int valid,
void (*callback) (void *, int success),
void *callback_context)
{
@@ -703,6 +703,9 @@ static void persistent_commit_exception(struct dm_exception_store *store,
struct core_exception ce;
struct commit_callback *cb;
+ if (!valid)
+ ps->valid = 0;
+
ce.old_chunk = e->old_chunk;
ce.new_chunk = e->new_chunk;
write_exception(ps, ps->current_committed++, &ce);
diff --git a/drivers/md/dm-snap-transient.c b/drivers/md/dm-snap-transient.c
index 1ce9a25..31439d5 100644
--- a/drivers/md/dm-snap-transient.c
+++ b/drivers/md/dm-snap-transient.c
@@ -52,12 +52,12 @@ static int transient_prepare_exception(struct dm_exception_store *store,
}
static void transient_commit_exception(struct dm_exception_store *store,
- struct dm_exception *e,
+ struct dm_exception *e, int valid,
void (*callback) (void *, int success),
void *callback_context)
{
/* Just succeed */
- callback(callback_context, 1);
+ callback(callback_context, valid);
}
static void transient_usage(struct dm_exception_store *store,
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 7c82d3c..75e1297 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1428,8 +1428,9 @@ static void __invalidate_snapshot(struct dm_snapshot *s, int err)
dm_table_event(s->ti->table);
}
-static void pending_complete(struct dm_snap_pending_exception *pe, int success)
+static void pending_complete(void *context, int success)
{
+ struct dm_snap_pending_exception *pe = context;
struct dm_exception *e;
struct dm_snapshot *s = pe->snap;
struct bio *origin_bios = NULL;
@@ -1499,24 +1500,13 @@ out:
free_pending_exception(pe);
}
-static void commit_callback(void *context, int success)
-{
- struct dm_snap_pending_exception *pe = context;
-
- pending_complete(pe, success);
-}
-
static void complete_exception(struct dm_snap_pending_exception *pe)
{
struct dm_snapshot *s = pe->snap;
- if (unlikely(pe->copy_error))
- pending_complete(pe, 0);
-
- else
- /* Update the metadata if we are persistent */
- s->store->type->commit_exception(s->store, &pe->e,
- commit_callback, pe);
+ /* Update the metadata if we are persistent */
+ s->store->type->commit_exception(s->store, &pe->e, !pe->copy_error,
+ pending_complete, pe);
}
/*
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 096/268] uml: fix hostfs mknod()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (94 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 095/268] dm snapshot: fix hung bios when copy error occurs Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 097/268] uml: flush stdout before forking Kamal Mostafa
` (171 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Vegard Nossum, Jeff Dike, Al Viro, Richard Weinberger, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Vegard Nossum <vegard.nossum@oracle.com>
commit 9f2dfda2f2f1c6181c3732c16b85c59ab2d195e0 upstream.
An inverted return value check in hostfs_mknod() caused the function
to return success after handling it as an error (and cleaning up).
It resulted in the following segfault when trying to bind() a named
unix socket:
Pid: 198, comm: a.out Not tainted 4.4.0-rc4
RIP: 0033:[<0000000061077df6>]
RSP: 00000000daae5d60 EFLAGS: 00010202
RAX: 0000000000000000 RBX: 000000006092a460 RCX: 00000000dfc54208
RDX: 0000000061073ef1 RSI: 0000000000000070 RDI: 00000000e027d600
RBP: 00000000daae5de0 R08: 00000000da980ac0 R09: 0000000000000000
R10: 0000000000000003 R11: 00007fb1ae08f72a R12: 0000000000000000
R13: 000000006092a460 R14: 00000000daaa97c0 R15: 00000000daaa9a88
Kernel panic - not syncing: Kernel mode fault at addr 0x40, ip 0x61077df6
CPU: 0 PID: 198 Comm: a.out Not tainted 4.4.0-rc4 #1
Stack:
e027d620 dfc54208 0000006f da981398
61bee000 0000c1ed daae5de0 0000006e
e027d620 dfcd4208 00000005 6092a460
Call Trace:
[<60dedc67>] SyS_bind+0xf7/0x110
[<600587be>] handle_syscall+0x7e/0x80
[<60066ad7>] userspace+0x3e7/0x4e0
[<6006321f>] ? save_registers+0x1f/0x40
[<6006c88e>] ? arch_prctl+0x1be/0x1f0
[<60054985>] fork_handler+0x85/0x90
Let's also get rid of the "cosmic ray protection" while we're at it.
Fixes: e9193059b1b3 "hostfs: fix races in dentry_name() and inode_name()"
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/hostfs/hostfs_kern.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 2ac99db..5a7b322 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -730,15 +730,13 @@ static int hostfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
init_special_inode(inode, mode, dev);
err = do_mknod(name, mode, MAJOR(dev), MINOR(dev));
- if (!err)
+ if (err)
goto out_free;
err = read_name(inode, name);
__putname(name);
if (err)
goto out_put;
- if (err)
- goto out_put;
d_instantiate(dentry, inode);
return 0;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 097/268] uml: flush stdout before forking
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (95 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 096/268] uml: fix hostfs mknod() Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 098/268] drm/nouveau/kms: take mode_config mutex in connector hotplug path Kamal Mostafa
` (170 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Vegard Nossum, Richard Weinberger, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Vegard Nossum <vegard.nossum@oracle.com>
commit 0754fb298f2f2719f0393491d010d46cfb25d043 upstream.
I was seeing some really weird behaviour where piping UML's output
somewhere would cause output to get duplicated:
$ ./vmlinux | head -n 40
Checking that ptrace can change system call numbers...Core dump limits :
soft - 0
hard - NONE
OK
Checking syscall emulation patch for ptrace...Core dump limits :
soft - 0
hard - NONE
OK
Checking advanced syscall emulation patch for ptrace...Core dump limits :
soft - 0
hard - NONE
OK
Core dump limits :
soft - 0
hard - NONE
This is because these tests do a fork() which duplicates the non-empty
stdout buffer, then glibc flushes the duplicated buffer as each child
exits.
A simple workaround is to flush before forking.
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/um/os-Linux/start_up.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index 47f1ff0..22a358e 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -94,6 +94,8 @@ static int start_ptraced_child(void)
{
int pid, n, status;
+ fflush(stdout);
+
pid = fork();
if (pid == 0)
ptrace_child();
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 098/268] drm/nouveau/kms: take mode_config mutex in connector hotplug path
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (96 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 097/268] uml: flush stdout before forking Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 099/268] ALSA: usb: Add native DSD support for Oppo HA-1 Kamal Mostafa
` (169 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Ben Skeggs, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Ben Skeggs <bskeggs@redhat.com>
commit 0a882cadbc63fd2da3994af7115b4ada2fcbd638 upstream.
fdo#93634
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 3162040..05490ef 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -969,10 +969,13 @@ nouveau_connector_hotplug(struct nvif_notify *notify)
NV_DEBUG(drm, "%splugged %s\n", plugged ? "" : "un", name);
+ mutex_lock(&drm->dev->mode_config.mutex);
if (plugged)
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
else
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
+ mutex_unlock(&drm->dev->mode_config.mutex);
+
drm_helper_hpd_irq_event(connector->dev);
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 099/268] ALSA: usb: Add native DSD support for Oppo HA-1
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (97 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 098/268] drm/nouveau/kms: take mode_config mutex in connector hotplug path Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 100/268] ALSA: hda - Fixup inverted internal mic for Lenovo E50-80 Kamal Mostafa
` (168 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jurgen Kramer, Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Jurgen Kramer <gtmkramer@xs4all.nl>
commit a4eae3a506ea4a7d4474cd74e20b423fa8053d91 upstream.
This patch adds native DSD support for the Oppo HA-1. It uses a XMOS chipset
but they use their own vendor ID.
Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/usb/quirks.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index c73c379..fb9a8a5 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1266,6 +1266,7 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
case USB_ID(0x20b1, 0x3008): /* iFi Audio micro/nano iDSD */
case USB_ID(0x20b1, 0x2008): /* Matrix Audio X-Sabre */
case USB_ID(0x20b1, 0x300a): /* Matrix Audio Mini-i Pro */
+ case USB_ID(0x22d8, 0x0416): /* OPPO HA-1*/
if (fp->altsetting == 2)
return SNDRV_PCM_FMTBIT_DSD_U32_BE;
break;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 100/268] ALSA: hda - Fixup inverted internal mic for Lenovo E50-80
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (98 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 099/268] ALSA: usb: Add native DSD support for Oppo HA-1 Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 101/268] x86/mm: Add barriers and document switch_mm()-vs-flush synchronization Kamal Mostafa
` (167 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: David Henningsson, Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: David Henningsson <david.henningsson@canonical.com>
commit 56f27013482c0803d978b667fe85de04ce9357cd upstream.
Inform userspace that one channel of the internal mic has reversed
polarity, so it does not attempt to add both channels together and
end up with silence.
Reported-by: Andrzej Mendel <andrzej.mendel@gmail.com>
Alsa-info: http://www.alsa-project.org/db/?f=3088f82a0cf977855f92af9db8ad406c04f71efa
BugLink: https://bugs.launchpad.net/bugs/1529624
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/patch_realtek.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 1e5627b..ede689d 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4676,6 +4676,7 @@ enum {
ALC290_FIXUP_SUBWOOFER,
ALC290_FIXUP_SUBWOOFER_HSJACK,
ALC269_FIXUP_THINKPAD_ACPI,
+ ALC269_FIXUP_DMIC_THINKPAD_ACPI,
ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
ALC255_FIXUP_HEADSET_MODE,
@@ -5113,6 +5114,12 @@ static const struct hda_fixup alc269_fixups[] = {
.type = HDA_FIXUP_FUNC,
.v.func = hda_fixup_thinkpad_acpi,
},
+ [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc_fixup_inv_dmic,
+ .chained = true,
+ .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
+ },
[ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
.type = HDA_FIXUP_PINS,
.v.pins = (const struct hda_pintbl[]) {
@@ -5467,6 +5474,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
+ SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP),
SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 101/268] x86/mm: Add barriers and document switch_mm()-vs-flush synchronization
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (99 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 100/268] ALSA: hda - Fixup inverted internal mic for Lenovo E50-80 Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 102/268] x86/boot: Double BOOT_HEAP_SIZE to 64KB Kamal Mostafa
` (166 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andy Lutomirski, Andrew Morton, Andy Lutomirski, Borislav Petkov,
Brian Gerst, Dave Hansen, Denys Vlasenko, H. Peter Anvin,
Linus Torvalds, Peter Zijlstra, Rik van Riel, Thomas Gleixner,
linux-mm, Ingo Molnar, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Andy Lutomirski <luto@kernel.org>
commit 71b3c126e61177eb693423f2e18a1914205b165e upstream.
When switch_mm() activates a new PGD, it also sets a bit that
tells other CPUs that the PGD is in use so that TLB flush IPIs
will be sent. In order for that to work correctly, the bit
needs to be visible prior to loading the PGD and therefore
starting to fill the local TLB.
Document all the barriers that make this work correctly and add
a couple that were missing.
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mm@kvack.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/include/asm/mmu_context.h | 33 ++++++++++++++++++++++++++++++++-
arch/x86/mm/tlb.c | 29 ++++++++++++++++++++++++++---
2 files changed, 58 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h
index 984abfe..48e8661 100644
--- a/arch/x86/include/asm/mmu_context.h
+++ b/arch/x86/include/asm/mmu_context.h
@@ -104,8 +104,34 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
#endif
cpumask_set_cpu(cpu, mm_cpumask(next));
- /* Re-load page tables */
+ /*
+ * Re-load page tables.
+ *
+ * This logic has an ordering constraint:
+ *
+ * CPU 0: Write to a PTE for 'next'
+ * CPU 0: load bit 1 in mm_cpumask. if nonzero, send IPI.
+ * CPU 1: set bit 1 in next's mm_cpumask
+ * CPU 1: load from the PTE that CPU 0 writes (implicit)
+ *
+ * We need to prevent an outcome in which CPU 1 observes
+ * the new PTE value and CPU 0 observes bit 1 clear in
+ * mm_cpumask. (If that occurs, then the IPI will never
+ * be sent, and CPU 0's TLB will contain a stale entry.)
+ *
+ * The bad outcome can occur if either CPU's load is
+ * reordered before that CPU's store, so both CPUs much
+ * execute full barriers to prevent this from happening.
+ *
+ * Thus, switch_mm needs a full barrier between the
+ * store to mm_cpumask and any operation that could load
+ * from next->pgd. This barrier synchronizes with
+ * remote TLB flushers. Fortunately, load_cr3 is
+ * serializing and thus acts as a full barrier.
+ *
+ */
load_cr3(next->pgd);
+
trace_tlb_flush(TLB_FLUSH_ON_TASK_SWITCH, TLB_FLUSH_ALL);
/* Stop flush ipis for the previous mm */
@@ -142,10 +168,15 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
* schedule, protecting us from simultaneous changes.
*/
cpumask_set_cpu(cpu, mm_cpumask(next));
+
/*
* We were in lazy tlb mode and leave_mm disabled
* tlb flush IPI delivery. We must reload CR3
* to make sure to use no freed page tables.
+ *
+ * As above, this is a barrier that forces
+ * TLB repopulation to be ordered after the
+ * store to mm_cpumask.
*/
load_cr3(next->pgd);
trace_tlb_flush(TLB_FLUSH_ON_TASK_SWITCH, TLB_FLUSH_ALL);
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 90b924a..061e011 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -160,7 +160,10 @@ void flush_tlb_current_task(void)
preempt_disable();
count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL);
+
+ /* This is an implicit full barrier that synchronizes with switch_mm. */
local_flush_tlb();
+
trace_tlb_flush(TLB_LOCAL_SHOOTDOWN, TLB_FLUSH_ALL);
if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids)
flush_tlb_others(mm_cpumask(mm), mm, 0UL, TLB_FLUSH_ALL);
@@ -187,17 +190,29 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
unsigned long base_pages_to_flush = TLB_FLUSH_ALL;
preempt_disable();
- if (current->active_mm != mm)
+ if (current->active_mm != mm) {
+ /* Synchronize with switch_mm. */
+ smp_mb();
+
goto out;
+ }
if (!current->mm) {
leave_mm(smp_processor_id());
+
+ /* Synchronize with switch_mm. */
+ smp_mb();
+
goto out;
}
if ((end != TLB_FLUSH_ALL) && !(vmflag & VM_HUGETLB))
base_pages_to_flush = (end - start) >> PAGE_SHIFT;
+ /*
+ * Both branches below are implicit full barriers (MOV to CR or
+ * INVLPG) that synchronize with switch_mm.
+ */
if (base_pages_to_flush > tlb_single_page_flush_ceiling) {
base_pages_to_flush = TLB_FLUSH_ALL;
count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL);
@@ -227,10 +242,18 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long start)
preempt_disable();
if (current->active_mm == mm) {
- if (current->mm)
+ if (current->mm) {
+ /*
+ * Implicit full barrier (INVLPG) that synchronizes
+ * with switch_mm.
+ */
__flush_tlb_one(start);
- else
+ } else {
leave_mm(smp_processor_id());
+
+ /* Synchronize with switch_mm. */
+ smp_mb();
+ }
}
if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 102/268] x86/boot: Double BOOT_HEAP_SIZE to 64KB
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (100 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 101/268] x86/mm: Add barriers and document switch_mm()-vs-flush synchronization Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 103/268] s390: fix normalization bug in exception table sorting Kamal Mostafa
` (165 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: H.J. Lu, Andy Lutomirski, Borislav Petkov, Brian Gerst,
Denys Vlasenko, Linus Torvalds, Peter Zijlstra, Thomas Gleixner,
Ingo Molnar, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: "H.J. Lu" <hjl.tools@gmail.com>
commit 8c31902cffc4d716450be549c66a67a8a3dd479c upstream.
When decompressing kernel image during x86 bootup, malloc memory
for ELF program headers may run out of heap space, which leads
to system halt. This patch doubles BOOT_HEAP_SIZE to 64KB.
Tested with 32-bit kernel which failed to boot without this patch.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/include/asm/boot.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h
index 4fa687a..6b8d6e8 100644
--- a/arch/x86/include/asm/boot.h
+++ b/arch/x86/include/asm/boot.h
@@ -27,7 +27,7 @@
#define BOOT_HEAP_SIZE 0x400000
#else /* !CONFIG_KERNEL_BZIP2 */
-#define BOOT_HEAP_SIZE 0x8000
+#define BOOT_HEAP_SIZE 0x10000
#endif /* !CONFIG_KERNEL_BZIP2 */
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 103/268] s390: fix normalization bug in exception table sorting
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (101 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 102/268] x86/boot: Double BOOT_HEAP_SIZE to 64KB Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 104/268] xfs: inode recovery readahead can race with inode buffer creation Kamal Mostafa
` (164 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ard Biesheuvel, Heiko Carstens, Martin Schwidefsky, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
commit bcb7825a77f41c7dd91da6f7ac10b928156a322e upstream.
The normalization pass in the sorting routine of the relative exception
table serves two purposes:
- it ensures that the address fields of the exception table entries are
fully ordered, so that no ambiguities arise between entries with
identical instruction offsets (i.e., when two instructions that are
exactly 8 bytes apart each have an exception table entry associated with
them)
- it ensures that the offsets of both the instruction and the fixup fields
of each entry are relative to their final location after sorting.
Commit eb608fb366de ("s390/exceptions: switch to relative exception table
entries") ported the relative exception table format from x86, but modified
the sorting routine to only normalize the instruction offset field and not
the fixup offset field. The result is that the fixup offset of each entry
will be relative to the original location of the entry before sorting,
likely leading to crashes when those entries are dereferenced.
Fixes: eb608fb366de ("s390/exceptions: switch to relative exception table entries")
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/s390/mm/extable.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/s390/mm/extable.c b/arch/s390/mm/extable.c
index 4d1ee88..18c8b81 100644
--- a/arch/s390/mm/extable.c
+++ b/arch/s390/mm/extable.c
@@ -52,12 +52,16 @@ void sort_extable(struct exception_table_entry *start,
int i;
/* Normalize entries to being relative to the start of the section */
- for (p = start, i = 0; p < finish; p++, i += 8)
+ for (p = start, i = 0; p < finish; p++, i += 8) {
p->insn += i;
+ p->fixup += i + 4;
+ }
sort(start, finish - start, sizeof(*start), cmp_ex, NULL);
/* Denormalize all entries */
- for (p = start, i = 0; p < finish; p++, i += 8)
+ for (p = start, i = 0; p < finish; p++, i += 8) {
p->insn -= i;
+ p->fixup -= i + 4;
+ }
}
#ifdef CONFIG_MODULES
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 104/268] xfs: inode recovery readahead can race with inode buffer creation
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (102 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 103/268] s390: fix normalization bug in exception table sorting Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 105/268] xfs: handle dquot buffer readahead in log recovery correctly Kamal Mostafa
` (163 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dave Chinner, Dave Chinner, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Dave Chinner <dchinner@redhat.com>
commit b79f4a1c68bb99152d0785ee4ea3ab4396cdacc6 upstream.
When we do inode readahead in log recovery, we do can do the
readahead before we've replayed the icreate transaction that stamps
the buffer with inode cores. The inode readahead verifier catches
this and marks the buffer as !done to indicate that it doesn't yet
contain valid inodes.
In adding buffer error notification (i.e. setting b_error = -EIO at
the same time as as we clear the done flag) to such a readahead
verifier failure, we can then get subsequent inode recovery failing
with this error:
XFS (dm-0): metadata I/O error: block 0xa00060 ("xlog_recover_do..(read#2)") error 5 numblks 32
This occurs when readahead completion races with icreate item replay
such as:
inode readahead
find buffer
lock buffer
submit RA io
....
icreate recovery
xfs_trans_get_buffer
find buffer
lock buffer
<blocks on RA completion>
.....
<ra completion>
fails verifier
clear XBF_DONE
set bp->b_error = -EIO
release and unlock buffer
<icreate gains lock>
icreate initialises buffer
marks buffer as done
adds buffer to delayed write queue
releases buffer
At this point, we have an initialised inode buffer that is up to
date but has an -EIO state registered against it. When we finally
get to recovering an inode in that buffer:
inode item recovery
xfs_trans_read_buffer
find buffer
lock buffer
sees XBF_DONE is set, returns buffer
sees bp->b_error is set
fail log recovery!
Essentially, we need xfs_trans_get_buf_map() to clear the error status of
the buffer when doing a lookup. This function returns uninitialised
buffers, so the buffer returned can not be in an error state and
none of the code that uses this function expects b_error to be set
on return. Indeed, there is an ASSERT(!bp->b_error); in the
transaction case in xfs_trans_get_buf_map() that would have caught
this if log recovery used transactions....
This patch firstly changes the inode readahead failure to set -EIO
on the buffer, and secondly changes xfs_buf_get_map() to never
return a buffer with an error state set so this first change doesn't
cause unexpected log recovery failures.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/xfs/libxfs/xfs_inode_buf.c | 12 +++++++-----
fs/xfs/xfs_buf.c | 7 +++++++
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
index 6526e76..24e5a35 100644
--- a/fs/xfs/libxfs/xfs_inode_buf.c
+++ b/fs/xfs/libxfs/xfs_inode_buf.c
@@ -62,11 +62,12 @@ xfs_inobp_check(
* has not had the inode cores stamped into it. Hence for readahead, the buffer
* may be potentially invalid.
*
- * If the readahead buffer is invalid, we don't want to mark it with an error,
- * but we do want to clear the DONE status of the buffer so that a followup read
- * will re-read it from disk. This will ensure that we don't get an unnecessary
- * warnings during log recovery and we don't get unnecssary panics on debug
- * kernels.
+ * If the readahead buffer is invalid, we need to mark it with an error and
+ * clear the DONE status of the buffer so that a followup read will re-read it
+ * from disk. We don't report the error otherwise to avoid warnings during log
+ * recovery and we don't get unnecssary panics on debug kernels. We use EIO here
+ * because all we want to do is say readahead failed; there is no-one to report
+ * the error to, so this will distinguish it from a non-ra verifier failure.
*/
static void
xfs_inode_buf_verify(
@@ -93,6 +94,7 @@ xfs_inode_buf_verify(
XFS_RANDOM_ITOBP_INOTOBP))) {
if (readahead) {
bp->b_flags &= ~XBF_DONE;
+ xfs_buf_ioerror(bp, -EIO);
return;
}
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index a4b7d92..98bf50c 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -605,6 +605,13 @@ found:
}
}
+ /*
+ * Clear b_error if this is a lookup from a caller that doesn't expect
+ * valid data to be found in the buffer.
+ */
+ if (!(flags & XBF_READ))
+ xfs_buf_ioerror(bp, 0);
+
XFS_STATS_INC(xb_get);
trace_xfs_buf_get(bp, flags, _RET_IP_);
return bp;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 105/268] xfs: handle dquot buffer readahead in log recovery correctly
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (103 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 104/268] xfs: inode recovery readahead can race with inode buffer creation Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 106/268] clocksource/drivers/vt8500: Increase the minimum delta Kamal Mostafa
` (162 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dave Chinner, Dave Chinner, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Dave Chinner <dchinner@redhat.com>
commit 7d6a13f023567d573ac362502bb702eda716e654 upstream.
When we do dquot readahead in log recovery, we do not use a verifier
as the underlying buffer may not have dquots in it. e.g. the
allocation operation hasn't yet been replayed. Hence we do not want
to fail recovery because we detect an operation to be replayed has
not been run yet. This problem was addressed for inodes in commit
d891400 ("xfs: inode buffers may not be valid during recovery
readahead") but the problem was not recognised to exist for dquots
and their buffers as the dquot readahead did not have a verifier.
The result of not using a verifier is that when the buffer is then
next read to replay a dquot modification, the dquot buffer verifier
will only be attached to the buffer if *readahead is not complete*.
Hence we can read the buffer, replay the dquot changes and then add
it to the delwri submission list without it having a verifier
attached to it. This then generates warnings in xfs_buf_ioapply(),
which catches and warns about this case.
Fix this and make it handle the same readahead verifier error cases
as for inode buffers by adding a new readahead verifier that has a
write operation as well as a read operation that marks the buffer as
not done if any corruption is detected. Also make sure we don't run
readahead if the dquot buffer has been marked as cancelled by
recovery.
This will result in readahead either succeeding and the buffer
having a valid write verifier, or readahead failing and the buffer
state requiring the subsequent read to resubmit the IO with the new
verifier. In either case, this will result in the buffer always
ending up with a valid write verifier on it.
Note: we also need to fix the inode buffer readahead error handling
to mark the buffer with EIO. Brian noticed the code I copied from
there wrong during review, so fix it at the same time. Add comments
linking the two functions that handle readahead verifier errors
together so we don't forget this behavioural link in future.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
[ kamal: backport to 4.2-stable: no .name member ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/xfs/libxfs/xfs_dquot_buf.c | 35 +++++++++++++++++++++++++++++------
fs/xfs/libxfs/xfs_inode_buf.c | 2 ++
fs/xfs/libxfs/xfs_quota_defs.h | 2 +-
fs/xfs/libxfs/xfs_shared.h | 1 +
fs/xfs/xfs_log_recover.c | 9 +++++++--
5 files changed, 40 insertions(+), 9 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_dquot_buf.c b/fs/xfs/libxfs/xfs_dquot_buf.c
index 6fbf2d8..48aff07 100644
--- a/fs/xfs/libxfs/xfs_dquot_buf.c
+++ b/fs/xfs/libxfs/xfs_dquot_buf.c
@@ -54,7 +54,7 @@ xfs_dqcheck(
xfs_dqid_t id,
uint type, /* used only when IO_dorepair is true */
uint flags,
- char *str)
+ const char *str)
{
xfs_dqblk_t *d = (xfs_dqblk_t *)ddq;
int errs = 0;
@@ -207,7 +207,8 @@ xfs_dquot_buf_verify_crc(
STATIC bool
xfs_dquot_buf_verify(
struct xfs_mount *mp,
- struct xfs_buf *bp)
+ struct xfs_buf *bp,
+ int warn)
{
struct xfs_dqblk *d = (struct xfs_dqblk *)bp->b_addr;
xfs_dqid_t id = 0;
@@ -240,8 +241,7 @@ xfs_dquot_buf_verify(
if (i == 0)
id = be32_to_cpu(ddq->d_id);
- error = xfs_dqcheck(mp, ddq, id + i, 0, XFS_QMOPT_DOWARN,
- "xfs_dquot_buf_verify");
+ error = xfs_dqcheck(mp, ddq, id + i, 0, warn, __func__);
if (error)
return false;
}
@@ -256,7 +256,7 @@ xfs_dquot_buf_read_verify(
if (!xfs_dquot_buf_verify_crc(mp, bp))
xfs_buf_ioerror(bp, -EFSBADCRC);
- else if (!xfs_dquot_buf_verify(mp, bp))
+ else if (!xfs_dquot_buf_verify(mp, bp, XFS_QMOPT_DOWARN))
xfs_buf_ioerror(bp, -EFSCORRUPTED);
if (bp->b_error)
@@ -264,6 +264,25 @@ xfs_dquot_buf_read_verify(
}
/*
+ * readahead errors are silent and simply leave the buffer as !done so a real
+ * read will then be run with the xfs_dquot_buf_ops verifier. See
+ * xfs_inode_buf_verify() for why we use EIO and ~XBF_DONE here rather than
+ * reporting the failure.
+ */
+static void
+xfs_dquot_buf_readahead_verify(
+ struct xfs_buf *bp)
+{
+ struct xfs_mount *mp = bp->b_target->bt_mount;
+
+ if (!xfs_dquot_buf_verify_crc(mp, bp) ||
+ !xfs_dquot_buf_verify(mp, bp, 0)) {
+ xfs_buf_ioerror(bp, -EIO);
+ bp->b_flags &= ~XBF_DONE;
+ }
+}
+
+/*
* we don't calculate the CRC here as that is done when the dquot is flushed to
* the buffer after the update is done. This ensures that the dquot in the
* buffer always has an up-to-date CRC value.
@@ -274,7 +293,7 @@ xfs_dquot_buf_write_verify(
{
struct xfs_mount *mp = bp->b_target->bt_mount;
- if (!xfs_dquot_buf_verify(mp, bp)) {
+ if (!xfs_dquot_buf_verify(mp, bp, XFS_QMOPT_DOWARN)) {
xfs_buf_ioerror(bp, -EFSCORRUPTED);
xfs_verifier_error(bp);
return;
@@ -286,3 +305,7 @@ const struct xfs_buf_ops xfs_dquot_buf_ops = {
.verify_write = xfs_dquot_buf_write_verify,
};
+const struct xfs_buf_ops xfs_dquot_buf_ra_ops = {
+ .verify_read = xfs_dquot_buf_readahead_verify,
+ .verify_write = xfs_dquot_buf_write_verify,
+};
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
index 24e5a35..a7064be 100644
--- a/fs/xfs/libxfs/xfs_inode_buf.c
+++ b/fs/xfs/libxfs/xfs_inode_buf.c
@@ -68,6 +68,8 @@ xfs_inobp_check(
* recovery and we don't get unnecssary panics on debug kernels. We use EIO here
* because all we want to do is say readahead failed; there is no-one to report
* the error to, so this will distinguish it from a non-ra verifier failure.
+ * Changes to this readahead error behavour also need to be reflected in
+ * xfs_dquot_buf_readahead_verify().
*/
static void
xfs_inode_buf_verify(
diff --git a/fs/xfs/libxfs/xfs_quota_defs.h b/fs/xfs/libxfs/xfs_quota_defs.h
index 1b0a083..f51078f 100644
--- a/fs/xfs/libxfs/xfs_quota_defs.h
+++ b/fs/xfs/libxfs/xfs_quota_defs.h
@@ -153,7 +153,7 @@ typedef __uint16_t xfs_qwarncnt_t;
#define XFS_QMOPT_RESBLK_MASK (XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_RES_RTBLKS)
extern int xfs_dqcheck(struct xfs_mount *mp, xfs_disk_dquot_t *ddq,
- xfs_dqid_t id, uint type, uint flags, char *str);
+ xfs_dqid_t id, uint type, uint flags, const char *str);
extern int xfs_calc_dquots_per_chunk(unsigned int nbblks);
#endif /* __XFS_QUOTA_H__ */
diff --git a/fs/xfs/libxfs/xfs_shared.h b/fs/xfs/libxfs/xfs_shared.h
index 5be5297..15c3ceb 100644
--- a/fs/xfs/libxfs/xfs_shared.h
+++ b/fs/xfs/libxfs/xfs_shared.h
@@ -49,6 +49,7 @@ extern const struct xfs_buf_ops xfs_inobt_buf_ops;
extern const struct xfs_buf_ops xfs_inode_buf_ops;
extern const struct xfs_buf_ops xfs_inode_buf_ra_ops;
extern const struct xfs_buf_ops xfs_dquot_buf_ops;
+extern const struct xfs_buf_ops xfs_dquot_buf_ra_ops;
extern const struct xfs_buf_ops xfs_sb_buf_ops;
extern const struct xfs_buf_ops xfs_sb_quiet_buf_ops;
extern const struct xfs_buf_ops xfs_symlink_buf_ops;
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 480ebba..3e34d84 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -3163,6 +3163,7 @@ xlog_recover_dquot_ra_pass2(
struct xfs_disk_dquot *recddq;
struct xfs_dq_logformat *dq_f;
uint type;
+ int len;
if (mp->m_qflags == 0)
@@ -3183,8 +3184,12 @@ xlog_recover_dquot_ra_pass2(
ASSERT(dq_f);
ASSERT(dq_f->qlf_len == 1);
- xfs_buf_readahead(mp->m_ddev_targp, dq_f->qlf_blkno,
- XFS_FSB_TO_BB(mp, dq_f->qlf_len), NULL);
+ len = XFS_FSB_TO_BB(mp, dq_f->qlf_len);
+ if (xlog_peek_buffer_cancelled(log, dq_f->qlf_blkno, len, 0))
+ return;
+
+ xfs_buf_readahead(mp->m_ddev_targp, dq_f->qlf_blkno, len,
+ &xfs_dquot_buf_ra_ops);
}
STATIC void
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 106/268] clocksource/drivers/vt8500: Increase the minimum delta
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (104 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 105/268] xfs: handle dquot buffer readahead in log recovery correctly Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 107/268] Input: elantech - mark protocols v2 and v3 as semi-mt Kamal Mostafa
` (161 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Russell King, Roman Volkov, Daniel Lezcano, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Roman Volkov <rvolkov@v1ros.org>
commit f9eccf24615672896dc13251410c3f2f33a14f95 upstream.
The vt8500 clocksource driver declares itself as capable to handle the
minimum delay of 4 cycles by passing the value into
clockevents_config_and_register(). The vt8500_timer_set_next_event()
requires the passed cycles value to be at least 16. The impact is that
userspace hangs in nanosleep() calls with small delay intervals.
This problem is reproducible in Linux 4.2 starting from:
c6eb3f70d448 ('hrtimer: Get rid of hrtimer softirq')
>From Russell King, more detailed explanation:
"It's a speciality of the StrongARM/PXA hardware. It takes a certain
number of OSCR cycles for the value written to hit the compare registers.
So, if a very small delta is written (eg, the compare register is written
with a value of OSCR + 1), the OSCR will have incremented past this value
before it hits the underlying hardware. The result is, that you end up
waiting a very long time for the OSCR to wrap before the event fires.
So, we introduce a check in set_next_event() to detect this and return
-ETIME if the calculated delta is too small, which causes the generic
clockevents code to retry after adding the min_delta specified in
clockevents_config_and_register() to the current time value.
min_delta must be sufficient that we don't re-trip the -ETIME check - if
we do, we will return -ETIME, forward the next event time, try to set it,
return -ETIME again, and basically lock the system up. So, min_delta
must be larger than the check inside set_next_event(). A factor of two
was chosen to ensure that this situation would never occur.
The PXA code worked on PXA systems for years, and I'd suggest no one
changes this mechanism without access to a wide range of PXA systems,
otherwise they're risking breakage."
Cc: Russell King <linux@arm.linux.org.uk>
Acked-by: Alexey Charkov <alchark@gmail.com>
Signed-off-by: Roman Volkov <rvolkov@v1ros.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/clocksource/vt8500_timer.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/vt8500_timer.c b/drivers/clocksource/vt8500_timer.c
index 1098ed3..dc45ddb 100644
--- a/drivers/clocksource/vt8500_timer.c
+++ b/drivers/clocksource/vt8500_timer.c
@@ -50,6 +50,8 @@
#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
+#define MIN_OSCR_DELTA 16
+
static void __iomem *regbase;
static cycle_t vt8500_timer_read(struct clocksource *cs)
@@ -80,7 +82,7 @@ static int vt8500_timer_set_next_event(unsigned long cycles,
cpu_relax();
writel((unsigned long)alarm, regbase + TIMER_MATCH_VAL);
- if ((signed)(alarm - clocksource.read(&clocksource)) <= 16)
+ if ((signed)(alarm - clocksource.read(&clocksource)) <= MIN_OSCR_DELTA)
return -ETIME;
writel(1, regbase + TIMER_IER_VAL);
@@ -160,7 +162,7 @@ static void __init vt8500_timer_init(struct device_node *np)
pr_err("%s: setup_irq failed for %s\n", __func__,
clockevent.name);
clockevents_config_and_register(&clockevent, VT8500_TIMER_HZ,
- 4, 0xf0000000);
+ MIN_OSCR_DELTA * 2, 0xf0000000);
}
CLOCKSOURCE_OF_DECLARE(vt8500, "via,vt8500-timer", vt8500_timer_init);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 107/268] Input: elantech - mark protocols v2 and v3 as semi-mt
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (105 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 106/268] clocksource/drivers/vt8500: Increase the minimum delta Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 108/268] x86/reboot/quirks: Add iMac10,1 to pci_reboot_dmi_table[] Kamal Mostafa
` (160 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Benjamin Tissoires, Dmitry Torokhov, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
commit 6544a1df11c48c8413071aac3316792e4678fbfb upstream.
When using a protocol v2 or v3 hardware, elantech uses the function
elantech_report_semi_mt_data() to report data. This devices are rather
creepy because if num_finger is 3, (x2,y2) is (0,0). Yes, only one valid
touch is reported.
Anyway, userspace (libinput) is now confused by these (0,0) touches,
and detect them as palm, and rejects them.
Commit 3c0213d17a09 ("Input: elantech - fix semi-mt protocol for v3 HW")
was sufficient enough for xf86-input-synaptics and libinput before it has
palm rejection. Now we need to actually tell libinput that this device is
a semi-mt one and it should not rely on the actual values of the 2 touches.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/input/mouse/elantech.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 537ebb0..78f93cf 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1222,7 +1222,7 @@ static int elantech_set_input_params(struct psmouse *psmouse)
input_set_abs_params(dev, ABS_TOOL_WIDTH, ETP_WMIN_V2,
ETP_WMAX_V2, 0, 0);
}
- input_mt_init_slots(dev, 2, 0);
+ input_mt_init_slots(dev, 2, INPUT_MT_SEMI_MT);
input_set_abs_params(dev, ABS_MT_POSITION_X, x_min, x_max, 0, 0);
input_set_abs_params(dev, ABS_MT_POSITION_Y, y_min, y_max, 0, 0);
break;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 108/268] x86/reboot/quirks: Add iMac10,1 to pci_reboot_dmi_table[]
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (106 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 107/268] Input: elantech - mark protocols v2 and v3 as semi-mt Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 109/268] ALSA: seq: Fix missing NULL check at remove_events ioctl Kamal Mostafa
` (159 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mario Kleiner, Andy Lutomirski, Borislav Petkov, Brian Gerst,
Dave Jones, Denys Vlasenko, H. Peter Anvin, Linus Torvalds,
Peter Zijlstra, Thomas Gleixner, Ingo Molnar, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Mario Kleiner <mario.kleiner.de@gmail.com>
commit 2f0c0b2d96b1205efb14347009748d786c2d9ba5 upstream.
Without the reboot=pci method, the iMac 10,1 simply
hangs after printing "Restarting system" at the point
when it should reboot. This fixes it.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Jones <davej@codemonkey.org.uk>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1450466646-26663-1-git-send-email-mario.kleiner.de@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kernel/reboot.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 86db4bc..0549ae3 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -182,6 +182,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),
},
},
+ { /* Handle problems with rebooting on the iMac10,1. */
+ .callback = set_pci_reboot,
+ .ident = "Apple iMac10,1",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "iMac10,1"),
+ },
+ },
/* ASRock */
{ /* Handle problems with rebooting on ASRock Q1900DC-ITX */
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 109/268] ALSA: seq: Fix missing NULL check at remove_events ioctl
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (107 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 108/268] x86/reboot/quirks: Add iMac10,1 to pci_reboot_dmi_table[] Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 110/268] ALSA: seq: Fix race at timer setup and close Kamal Mostafa
` (158 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Takashi Iwai <tiwai@suse.de>
commit 030e2c78d3a91dd0d27fef37e91950dde333eba1 upstream.
snd_seq_ioctl_remove_events() calls snd_seq_fifo_clear()
unconditionally even if there is no FIFO assigned, and this leads to
an Oops due to NULL dereference. The fix is just to add a proper NULL
check.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/core/seq/seq_clientmgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index b64f20d..13cfa81 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -1962,7 +1962,7 @@ static int snd_seq_ioctl_remove_events(struct snd_seq_client *client,
* No restrictions so for a user client we can clear
* the whole fifo
*/
- if (client->type == USER_CLIENT)
+ if (client->type == USER_CLIENT && client->data.user.fifo)
snd_seq_fifo_clear(client->data.user.fifo);
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 110/268] ALSA: seq: Fix race at timer setup and close
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (108 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 109/268] ALSA: seq: Fix missing NULL check at remove_events ioctl Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 111/268] virtio_balloon: fix race by fill and leak Kamal Mostafa
` (157 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Takashi Iwai <tiwai@suse.de>
commit 3567eb6af614dac436c4b16a8d426f9faed639b3 upstream.
ALSA sequencer code has an open race between the timer setup ioctl and
the close of the client. This was triggered by syzkaller fuzzer, and
a use-after-free was caught there as a result.
This patch papers over it by adding a proper queue->timer_mutex lock
around the timer-related calls in the relevant code path.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/core/seq/seq_queue.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c
index 7dfd0f4..0bec02e 100644
--- a/sound/core/seq/seq_queue.c
+++ b/sound/core/seq/seq_queue.c
@@ -142,8 +142,10 @@ static struct snd_seq_queue *queue_new(int owner, int locked)
static void queue_delete(struct snd_seq_queue *q)
{
/* stop and release the timer */
+ mutex_lock(&q->timer_mutex);
snd_seq_timer_stop(q->timer);
snd_seq_timer_close(q);
+ mutex_unlock(&q->timer_mutex);
/* wait until access free */
snd_use_lock_sync(&q->use_lock);
/* release resources... */
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 111/268] virtio_balloon: fix race by fill and leak
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (109 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 110/268] ALSA: seq: Fix race at timer setup and close Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 112/268] virtio_balloon: fix race between migration and ballooning Kamal Mostafa
` (156 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Minchan Kim, Michael S. Tsirkin, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Minchan Kim <minchan@kernel.org>
commit f68b992bbb474641881932c61c92dcfa6f5b3689 upstream.
During my compaction-related stuff, I encountered a bug
with ballooning.
With repeated inflating and deflating cycle, guest memory(
ie, cat /proc/meminfo | grep MemTotal) is decreased and
couldn't be recovered.
The reason is balloon_lock doesn't cover release_pages_balloon
so struct virtio_balloon fields could be overwritten by race
of fill_balloon(e,g, vb->*pfns could be critical).
This patch fixes it in my test.
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/virtio/virtio_balloon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 82e80e0..18fd1b2 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -205,8 +205,8 @@ static unsigned leak_balloon(struct virtio_balloon *vb, size_t num)
*/
if (vb->num_pfns != 0)
tell_host(vb, vb->deflate_vq);
- mutex_unlock(&vb->balloon_lock);
release_pages_by_pfn(vb->pfns, vb->num_pfns);
+ mutex_unlock(&vb->balloon_lock);
return num_freed_pages;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 112/268] virtio_balloon: fix race between migration and ballooning
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (110 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 111/268] virtio_balloon: fix race by fill and leak Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 113/268] ALSA: hda - Fix white noise on Dell Latitude E5550 Kamal Mostafa
` (155 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Minchan Kim, Michael S. Tsirkin, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Minchan Kim <minchan@kernel.org>
commit 21ea9fb69e7c4b1b1559c3e410943d3ff248ffcb upstream.
In balloon_page_dequeue, pages_lock should cover the loop
(ie, list_for_each_entry_safe). Otherwise, the cursor page could
be isolated by compaction and then list_del by isolation could
poison the page->lru.{prev,next} so the loop finally could
access wrong address like this. This patch fixes the bug.
general protection fault: 0000 [#1] SMP
Dumping ftrace buffer:
(ftrace buffer empty)
Modules linked in:
CPU: 2 PID: 82 Comm: vballoon Not tainted 4.4.0-rc5-mm1-access_bit+ #1906
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
task: ffff8800a7ff0000 ti: ffff8800a7fec000 task.ti: ffff8800a7fec000
RIP: 0010:[<ffffffff8115e754>] [<ffffffff8115e754>] balloon_page_dequeue+0x54/0x130
RSP: 0018:ffff8800a7fefdc0 EFLAGS: 00010246
RAX: ffff88013fff9a70 RBX: ffffea000056fe00 RCX: 0000000000002b7d
RDX: ffff88013fff9a70 RSI: ffffea000056fe00 RDI: ffff88013fff9a68
RBP: ffff8800a7fefde8 R08: ffffea000056fda0 R09: 0000000000000000
R10: ffff8800a7fefd90 R11: 0000000000000001 R12: dead0000000000e0
R13: ffffea000056fe20 R14: ffff880138809070 R15: ffff880138809060
FS: 0000000000000000(0000) GS:ffff88013fc40000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007f229c10e000 CR3: 00000000b8b53000 CR4: 00000000000006a0
Stack:
0000000000000100 ffff880138809088 ffff880138809000 ffff880138809060
0000000000000046 ffff8800a7fefe28 ffffffff812c86d3 ffff880138809020
ffff880138809000 fffffffffff91900 0000000000000100 ffff880138809060
Call Trace:
[<ffffffff812c86d3>] leak_balloon+0x93/0x1a0
[<ffffffff812c8bc7>] balloon+0x217/0x2a0
[<ffffffff8143739e>] ? __schedule+0x31e/0x8b0
[<ffffffff81078160>] ? abort_exclusive_wait+0xb0/0xb0
[<ffffffff812c89b0>] ? update_balloon_stats+0xf0/0xf0
[<ffffffff8105b6e9>] kthread+0xc9/0xe0
[<ffffffff8105b620>] ? kthread_park+0x60/0x60
[<ffffffff8143b4af>] ret_from_fork+0x3f/0x70
[<ffffffff8105b620>] ? kthread_park+0x60/0x60
Code: 8d 60 e0 0f 84 af 00 00 00 48 8b 43 20 a8 01 75 3b 48 89 d8 f0 0f ba 28 00 72 10 48 8b 03 f6 c4 08 75 2f 48 89 df e8 8c 83 f9 ff <49> 8b 44 24 20 4d 8d 6c 24 20 48 83 e8 20 4d 39 f5 74 7a 4c 89
RIP [<ffffffff8115e754>] balloon_page_dequeue+0x54/0x130
RSP <ffff8800a7fefdc0>
---[ end trace 43cf28060d708d5f ]---
Kernel panic - not syncing: Fatal exception
Dumping ftrace buffer:
(ftrace buffer empty)
Kernel Offset: disabled
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Rafael Aquini <aquini@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
mm/balloon_compaction.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/balloon_compaction.c b/mm/balloon_compaction.c
index fcad832..b640609 100644
--- a/mm/balloon_compaction.c
+++ b/mm/balloon_compaction.c
@@ -61,6 +61,7 @@ struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info)
bool dequeued_page;
dequeued_page = false;
+ spin_lock_irqsave(&b_dev_info->pages_lock, flags);
list_for_each_entry_safe(page, tmp, &b_dev_info->pages, lru) {
/*
* Block others from accessing the 'page' while we get around
@@ -75,15 +76,14 @@ struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info)
continue;
}
#endif
- spin_lock_irqsave(&b_dev_info->pages_lock, flags);
balloon_page_delete(page);
__count_vm_event(BALLOON_DEFLATE);
- spin_unlock_irqrestore(&b_dev_info->pages_lock, flags);
unlock_page(page);
dequeued_page = true;
break;
}
}
+ spin_unlock_irqrestore(&b_dev_info->pages_lock, flags);
if (!dequeued_page) {
/*
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 113/268] ALSA: hda - Fix white noise on Dell Latitude E5550
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (111 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 112/268] virtio_balloon: fix race between migration and ballooning Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 114/268] parisc: Fix __ARCH_SI_PREAMBLE_SIZE Kamal Mostafa
` (154 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Takashi Iwai <tiwai@suse.de>
commit 98070576c4f77509459c83cd2358617ef0769a38 upstream.
Dell Latitude E5550 (1028:062c) has a white noise problem like other
Latitude E models, and it gets fixed by the very same quirk as well.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=110591
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/patch_realtek.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index ede689d..33696c9 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5349,6 +5349,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
+ SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 114/268] parisc: Fix __ARCH_SI_PREAMBLE_SIZE
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (112 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 113/268] ALSA: hda - Fix white noise on Dell Latitude E5550 Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 115/268] scripts/recordmcount.pl: support data in text section on powerpc Kamal Mostafa
` (153 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Helge Deller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Helge Deller <deller@gmx.de>
commit e60fc5aa608eb38b47ba4ee058f306f739eb70a0 upstream.
On a 64bit kernel build the compiler aligns the _sifields union in the
struct siginfo_t on a 64bit address. The __ARCH_SI_PREAMBLE_SIZE define
compensates for this alignment and thus fixes the wait testcase of the
strace package.
The symptoms of a wrong __ARCH_SI_PREAMBLE_SIZE value is that
_sigchld.si_stime variable is missed to be copied and thus after a
copy_siginfo() will have uninitialized values.
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/parisc/include/uapi/asm/siginfo.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/parisc/include/uapi/asm/siginfo.h b/arch/parisc/include/uapi/asm/siginfo.h
index d703472..1c75565 100644
--- a/arch/parisc/include/uapi/asm/siginfo.h
+++ b/arch/parisc/include/uapi/asm/siginfo.h
@@ -1,6 +1,10 @@
#ifndef _PARISC_SIGINFO_H
#define _PARISC_SIGINFO_H
+#if defined(__LP64__)
+#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
+#endif
+
#include <asm-generic/siginfo.h>
#undef NSIGTRAP
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 115/268] scripts/recordmcount.pl: support data in text section on powerpc
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (113 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 114/268] parisc: Fix __ARCH_SI_PREAMBLE_SIZE Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 116/268] powerpc/module: Handle R_PPC64_ENTRY relocations Kamal Mostafa
` (152 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ulrich Weigand, Michael Ellerman, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Ulrich Weigand <ulrich.weigand@de.ibm.com>
commit 2e50c4bef77511b42cc226865d6bc568fa7f8769 upstream.
If a text section starts out with a data blob before the first
function start label, disassembly parsing doing in recordmcount.pl
gets confused on powerpc, leading to creation of corrupted module
objects.
This was not a problem so far since the compiler would never create
such text sections. However, this has changed with a recent change
in GCC 6 to support distances of > 2GB between a function and its
assoicated TOC in the ELFv2 ABI, exposing this problem.
There is already code in recordmcount.pl to handle such data blobs
on the sparc64 platform. This patch uses the same method to handle
those on powerpc as well.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
scripts/recordmcount.pl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 826470d..96e2486 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -263,7 +263,8 @@ if ($arch eq "x86_64") {
} elsif ($arch eq "powerpc") {
$local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)";
- $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?.*?)>:";
+ # See comment in the sparc64 section for why we use '\w'.
+ $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?\\w*?)>:";
$mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s\\.?_mcount\$";
if ($bits == 64) {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 116/268] powerpc/module: Handle R_PPC64_ENTRY relocations
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (114 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 115/268] scripts/recordmcount.pl: support data in text section on powerpc Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 117/268] ALSA: hda - fix the headset mic detection problem for a Dell laptop Kamal Mostafa
` (151 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ulrich Weigand, Michael Ellerman, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Ulrich Weigand <ulrich.weigand@de.ibm.com>
commit a61674bdfc7c2bf909c4010699607b62b69b7bec upstream.
GCC 6 will include changes to generated code with -mcmodel=large,
which is used to build kernel modules on powerpc64le. This was
necessary because the large model is supposed to allow arbitrary
sizes and locations of the code and data sections, but the ELFv2
global entry point prolog still made the unconditional assumption
that the TOC associated with any particular function can be found
within 2 GB of the function entry point:
func:
addis r2,r12,(.TOC.-func)@ha
addi r2,r2,(.TOC.-func)@l
.localentry func, .-func
To remove this assumption, GCC will now generate instead this global
entry point prolog sequence when using -mcmodel=large:
.quad .TOC.-func
func:
.reloc ., R_PPC64_ENTRY
ld r2, -8(r12)
add r2, r2, r12
.localentry func, .-func
The new .reloc triggers an optimization in the linker that will
replace this new prolog with the original code (see above) if the
linker determines that the distance between .TOC. and func is in
range after all.
Since this new relocation is now present in module object files,
the kernel module loader is required to handle them too. This
patch adds support for the new relocation and implements the
same optimization done by the GNU linker.
Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/powerpc/include/uapi/asm/elf.h | 2 ++
arch/powerpc/kernel/module_64.c | 27 +++++++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/arch/powerpc/include/uapi/asm/elf.h b/arch/powerpc/include/uapi/asm/elf.h
index 59dad11..c2d21d1 100644
--- a/arch/powerpc/include/uapi/asm/elf.h
+++ b/arch/powerpc/include/uapi/asm/elf.h
@@ -295,6 +295,8 @@ do { \
#define R_PPC64_TLSLD 108
#define R_PPC64_TOCSAVE 109
+#define R_PPC64_ENTRY 118
+
#define R_PPC64_REL16 249
#define R_PPC64_REL16_LO 250
#define R_PPC64_REL16_HI 251
diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c
index 6838451..59663af 100644
--- a/arch/powerpc/kernel/module_64.c
+++ b/arch/powerpc/kernel/module_64.c
@@ -635,6 +635,33 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
*/
break;
+ case R_PPC64_ENTRY:
+ /*
+ * Optimize ELFv2 large code model entry point if
+ * the TOC is within 2GB range of current location.
+ */
+ value = my_r2(sechdrs, me) - (unsigned long)location;
+ if (value + 0x80008000 > 0xffffffff)
+ break;
+ /*
+ * Check for the large code model prolog sequence:
+ * ld r2, ...(r12)
+ * add r2, r2, r12
+ */
+ if ((((uint32_t *)location)[0] & ~0xfffc)
+ != 0xe84c0000)
+ break;
+ if (((uint32_t *)location)[1] != 0x7c426214)
+ break;
+ /*
+ * If found, replace it with:
+ * addis r2, r12, (.TOC.-func)@ha
+ * addi r2, r12, (.TOC.-func)@l
+ */
+ ((uint32_t *)location)[0] = 0x3c4c0000 + PPC_HA(value);
+ ((uint32_t *)location)[1] = 0x38420000 + PPC_LO(value);
+ break;
+
case R_PPC64_REL16_HA:
/* Subtract location pointer */
value -= (unsigned long)location;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 117/268] ALSA: hda - fix the headset mic detection problem for a Dell laptop
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (115 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 116/268] powerpc/module: Handle R_PPC64_ENTRY relocations Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 118/268] ALSA: usb-audio: Fix mixer ctl regression of Native Instrument devices Kamal Mostafa
` (150 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Hui Wang, Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Hui Wang <hui.wang@canonical.com>
commit 0a1f90a982e85f4921bed606a6b41a24f4de2ae1 upstream.
The machine uses codec alc255, and the pin configuration value for
pin 0x14 on this machine is 0x90171130 which is not in the pin quirk
table yet.
BugLink: https://bugs.launchpad.net/bugs/1533461
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/patch_realtek.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 33696c9..228669d 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5719,6 +5719,10 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
ALC255_STANDARD_PINS,
{0x12, 0x90a60170},
+ {0x14, 0x90171130},
+ {0x21, 0x02211040}),
+ SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
+ {0x12, 0x90a60170},
{0x14, 0x90170140},
{0x17, 0x40000000},
{0x1d, 0x40700001},
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 118/268] ALSA: usb-audio: Fix mixer ctl regression of Native Instrument devices
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (116 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 117/268] ALSA: hda - fix the headset mic detection problem for a Dell laptop Kamal Mostafa
@ 2016-01-27 20:32 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 119/268] drm/i915: Restore inhibiting the load of the default context Kamal Mostafa
` (149 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:32 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Takashi Iwai <tiwai@suse.de>
commit c4a359a0049f2e17b012b31e801e96566f6391e5 upstream.
The commit [da6d276957ea: ALSA: usb-audio: Add resume support for
Native Instruments controls] brought a regression where the Native
Instrument audio devices don't get the correct value at update due to
the missing shift at writing. This patch addresses it.
Fixes: da6d276957ea ('ALSA: usb-audio: Add resume support for Native Instruments controls')
Reported-and-tested-by: Owen Williams <owilliams@mixxx.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/usb/mixer_quirks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 48a7450..db9547d 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -803,7 +803,7 @@ static int snd_nativeinstruments_control_put(struct snd_kcontrol *kcontrol,
return 0;
kcontrol->private_value &= ~(0xff << 24);
- kcontrol->private_value |= newval;
+ kcontrol->private_value |= (unsigned int)newval << 24;
err = snd_ni_update_cur_val(list);
return err < 0 ? err : 1;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 119/268] drm/i915: Restore inhibiting the load of the default context
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (117 preceding siblings ...)
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 118/268] ALSA: usb-audio: Fix mixer ctl regression of Native Instrument devices Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 120/268] drm/i915: intel_hpd_init(): Fix suspend/resume reprobing Kamal Mostafa
` (148 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Chris Wilson, Michel Thierry, Mika Kuoppala, Daniel Vetter,
Jani Nikula, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Chris Wilson <chris@chris-wilson.co.uk>
commit 06ef83a705a98da63797a5a570220b6ca36febd4 upstream.
Following a GPU reset, we may leave the context in a poorly defined
state, and reloading from that context will leave the GPU flummoxed. For
secondary contexts, this will lead to that context being banned - but
currently it is also causing the default context to become banned,
leading to turmoil in the shared state.
This is a regression from
commit 6702cf16e0ba8b0129f5aa1b6609d4e9c70bc13b [v4.1]
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date: Mon Mar 16 16:00:58 2015 +0000
drm/i915: Initialize all contexts
which quietly introduced the removal of the MI_RESTORE_INHIBIT on the
default context.
v2: Mark the global default context as uninitialized on GPU reset so
that the context-local workarounds are reloaded upon re-enabling.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michel Thierry <michel.thierry@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1448630935-27377-1-git-send-email-chris@chris-wilson.co.uk
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
[danvet: This seems to fix a gpu hand on after the first resume,
resulting in any future suspend operation failing with -EIO because
the gpu seems to be in a funky state. Somehow this patch fixes that.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 42f1cae8c079bcceb3cff079fddc3ff8852c788f)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/i915_gem_context.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 48afa77..2d96da6 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -317,6 +317,10 @@ void i915_gem_context_reset(struct drm_device *dev)
i915_gem_context_unreference(lctx);
ring->last_context = NULL;
}
+
+ /* Force the GPU state to be reinitialised on enabling */
+ if (ring->default_context)
+ ring->default_context->legacy_hw_ctx.initialized = false;
}
}
@@ -685,7 +689,7 @@ static int do_switch(struct intel_engine_cs *ring,
if (ret)
goto unpin_out;
- if (!to->legacy_hw_ctx.initialized) {
+ if (!to->legacy_hw_ctx.initialized || i915_gem_context_is_default(to)) {
hw_flags |= MI_RESTORE_INHIBIT;
/* NB: If we inhibit the restore, the context is not allowed to
* die because future work may end up depending on valid address
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 120/268] drm/i915: intel_hpd_init(): Fix suspend/resume reprobing
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (118 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 119/268] drm/i915: Restore inhibiting the load of the default context Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 121/268] x86/mm: Improve switch_mm() barrier comments Kamal Mostafa
` (147 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Lyude, Daniel Vetter, Jani Nikula, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Lyude <cpaul@redhat.com>
commit 2dc2f761dea65069485110d24eaa5b0d5d808b07 upstream.
This fixes reprobing of display connectors on resume. After some
talking with danvet on IRC, I learned that calling
drm_helper_hpd_irq_event() does actually trigger a full reprobe of each
connector's status. It turns out this is the actual reason reprobing on
resume hasn't been working (this was observed on a T440s):
- We call hpd_init()
- We check each connector for a couple of things before marking
connector->polled with DRM_CONNECTOR_POLL_HPD, one of which is an
active encoder. Of course, a disconnected port won't have an
active encoder, so we don't add the flag to any of the
connectors.
- We call drm_helper_hpd_irq_event()
- drm_helper_irq_event() checks each connector for the
DRM_CONNECTOR_POLL_HPD flag. The only one that has it is eDP-1,
so we skip reprobing each connector except that one.
In addition, we also now avoid setting connector->polled to
DRM_CONNECTOR_POLL_HPD for MST connectors, since their reprobing is
handled by the mst helpers. This is probably what was originally
intended to happen here.
Changes since V1:
* Use the explanation of the issue as the commit message instead
* Change the title of the commit, since this does more then just stop a
check for an encoder now
* Add "Fixes" line for the patch that introduced this regression
* Don't enable DRM_CONNECTOR_POLL_HPD for mst connectors
Changes since V2:
* Put patch changelog above Signed-off-by
* Follow Daniel Vetter's suggestion for making the code here a bit more
legible
Fixes: 0e32b39ceed6 ("drm/i915: add DP 1.2 MST support (v0.7)")
Signed-off-by: Lyude <cpaul@redhat.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1452181408-14777-1-git-send-email-cpaul@redhat.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 07c519134417d92c2e1a536e2b66d4ffff4b3be0)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/i915_irq.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 984e2fe..6a51bc6 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -4447,9 +4447,14 @@ void intel_hpd_init(struct drm_i915_private *dev_priv)
list_for_each_entry(connector, &mode_config->connector_list, head) {
struct intel_connector *intel_connector = to_intel_connector(connector);
connector->polled = intel_connector->polled;
- if (connector->encoder && !connector->polled && I915_HAS_HOTPLUG(dev) && intel_connector->encoder->hpd_pin > HPD_NONE)
- connector->polled = DRM_CONNECTOR_POLL_HPD;
+
+ /* MST has a dynamic intel_connector->encoder and it's reprobing
+ * is all handled by the MST helpers. */
if (intel_connector->mst_port)
+ continue;
+
+ if (!connector->polled && I915_HAS_HOTPLUG(dev) &&
+ intel_connector->encoder->hpd_pin > HPD_NONE)
connector->polled = DRM_CONNECTOR_POLL_HPD;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 121/268] x86/mm: Improve switch_mm() barrier comments
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (119 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 120/268] drm/i915: intel_hpd_init(): Fix suspend/resume reprobing Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 122/268] ALSA: timer: Fix double unlink of active_list Kamal Mostafa
` (146 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andy Lutomirski, Andy Lutomirski, Borislav Petkov, Brian Gerst,
Dave Hansen, Denys Vlasenko, H. Peter Anvin, Linus Torvalds,
Rik van Riel, Thomas Gleixner, Ingo Molnar, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Andy Lutomirski <luto@kernel.org>
commit 4eaffdd5a5fe6ff9f95e1ab4de1ac904d5e0fa8b upstream.
My previous comments were still a bit confusing and there was a
typo. Fix it up.
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 71b3c126e611 ("x86/mm: Add barriers and document switch_mm()-vs-flush synchronization")
Link: http://lkml.kernel.org/r/0a0b43cdcdd241c5faaaecfbcc91a155ddedc9a1.1452631609.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/include/asm/mmu_context.h | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h
index 48e8661..a009082 100644
--- a/arch/x86/include/asm/mmu_context.h
+++ b/arch/x86/include/asm/mmu_context.h
@@ -120,14 +120,16 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
* be sent, and CPU 0's TLB will contain a stale entry.)
*
* The bad outcome can occur if either CPU's load is
- * reordered before that CPU's store, so both CPUs much
+ * reordered before that CPU's store, so both CPUs must
* execute full barriers to prevent this from happening.
*
* Thus, switch_mm needs a full barrier between the
* store to mm_cpumask and any operation that could load
- * from next->pgd. This barrier synchronizes with
- * remote TLB flushers. Fortunately, load_cr3 is
- * serializing and thus acts as a full barrier.
+ * from next->pgd. TLB fills are special and can happen
+ * due to instruction fetches or for no reason at all,
+ * and neither LOCK nor MFENCE orders them.
+ * Fortunately, load_cr3() is serializing and gives the
+ * ordering guarantee we need.
*
*/
load_cr3(next->pgd);
@@ -174,9 +176,8 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
* tlb flush IPI delivery. We must reload CR3
* to make sure to use no freed page tables.
*
- * As above, this is a barrier that forces
- * TLB repopulation to be ordered after the
- * store to mm_cpumask.
+ * As above, load_cr3() is serializing and orders TLB
+ * fills with respect to the mm_cpumask write.
*/
load_cr3(next->pgd);
trace_tlb_flush(TLB_FLUSH_ON_TASK_SWITCH, TLB_FLUSH_ALL);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 122/268] ALSA: timer: Fix double unlink of active_list
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (120 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 121/268] x86/mm: Improve switch_mm() barrier comments Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 123/268] dmaengine: dw: fix cyclic transfer setup Kamal Mostafa
` (145 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Takashi Iwai <tiwai@suse.de>
commit ee8413b01045c74340aa13ad5bdf905de32be736 upstream.
ALSA timer instance object has a couple of linked lists and they are
unlinked unconditionally at snd_timer_stop(). Meanwhile
snd_timer_interrupt() unlinks it, but it calls list_del() which leaves
the element list itself unchanged. This ends up with unlinking twice,
and it was caught by syzkaller fuzzer.
The fix is to use list_del_init() variant properly there, too.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/core/timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 31f40f0..9241784df 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -694,7 +694,7 @@ void snd_timer_interrupt(struct snd_timer * timer, unsigned long ticks_left)
} else {
ti->flags &= ~SNDRV_TIMER_IFLG_RUNNING;
if (--timer->running)
- list_del(&ti->active_list);
+ list_del_init(&ti->active_list);
}
if ((timer->hw.flags & SNDRV_TIMER_HW_TASKLET) ||
(ti->flags & SNDRV_TIMER_IFLG_FAST))
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 123/268] dmaengine: dw: fix cyclic transfer setup
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (121 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 122/268] ALSA: timer: Fix double unlink of active_list Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 124/268] dmaengine: dw: fix cyclic transfer callbacks Kamal Mostafa
` (144 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mans Rullgard, Vinod Koul, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Mans Rullgard <mans@mansr.com>
commit df3bb8a0e619d501cd13334c3e0586edcdcbc716 upstream.
Commit 61e183f83069 ("dmaengine/dw_dmac: Reconfigure interrupt and
chan_cfg register on resume") moved some channel initialisation to
a new function which must be called before starting a transfer.
This updates dw_dma_cyclic_start() to use dwc_dostart() like the other
modes, thus ensuring dwc_initialize() gets called and removing some code
duplication.
Fixes: 61e183f83069 ("dmaengine/dw_dmac: Reconfigure interrupt and chan_cfg register on resume")
Signed-off-by: Mans Rullgard <mans@mansr.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/dma/dw/core.c | 23 +----------------------
1 file changed, 1 insertion(+), 22 deletions(-)
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index 4287c7c..70d3b21 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -1245,7 +1245,6 @@ static void dwc_free_chan_resources(struct dma_chan *chan)
int dw_dma_cyclic_start(struct dma_chan *chan)
{
struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
- struct dw_dma *dw = to_dw_dma(dwc->chan.device);
unsigned long flags;
if (!test_bit(DW_DMA_IS_CYCLIC, &dwc->flags)) {
@@ -1254,27 +1253,7 @@ int dw_dma_cyclic_start(struct dma_chan *chan)
}
spin_lock_irqsave(&dwc->lock, flags);
-
- /* Assert channel is idle */
- if (dma_readl(dw, CH_EN) & dwc->mask) {
- dev_err(chan2dev(&dwc->chan),
- "%s: BUG: Attempted to start non-idle channel\n",
- __func__);
- dwc_dump_chan_regs(dwc);
- spin_unlock_irqrestore(&dwc->lock, flags);
- return -EBUSY;
- }
-
- dma_writel(dw, CLEAR.ERROR, dwc->mask);
- dma_writel(dw, CLEAR.XFER, dwc->mask);
-
- /* Setup DMAC channel registers */
- channel_writel(dwc, LLP, dwc->cdesc->desc[0]->txd.phys);
- channel_writel(dwc, CTL_LO, DWC_CTLL_LLP_D_EN | DWC_CTLL_LLP_S_EN);
- channel_writel(dwc, CTL_HI, 0);
-
- channel_set_bit(dw, CH_EN, dwc->mask);
-
+ dwc_dostart(dwc, dwc->cdesc->desc[0]);
spin_unlock_irqrestore(&dwc->lock, flags);
return 0;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 124/268] dmaengine: dw: fix cyclic transfer callbacks
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (122 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 123/268] dmaengine: dw: fix cyclic transfer setup Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 125/268] mmc: mmci: fix an ages old detection error Kamal Mostafa
` (143 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mans Rullgard, Vinod Koul, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Mans Rullgard <mans@mansr.com>
commit 2895b2cad6e7a95104cf396e5330054453382ae1 upstream.
Cyclic transfer callbacks rely on block completion interrupts which were
disabled in commit ff7b05f29fd4 ("dmaengine/dw_dmac: Don't handle block
interrupts"). This re-enables block interrupts so the cyclic callbacks
can work. Other transfer types are not affected as they set the INT_EN
bit only on the last block.
Fixes: ff7b05f29fd4 ("dmaengine/dw_dmac: Don't handle block interrupts")
Signed-off-by: Mans Rullgard <mans@mansr.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/dma/dw/core.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index 70d3b21..a00d72f 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -156,6 +156,7 @@ static void dwc_initialize(struct dw_dma_chan *dwc)
/* Enable interrupts */
channel_set_bit(dw, MASK.XFER, dwc->mask);
+ channel_set_bit(dw, MASK.BLOCK, dwc->mask);
channel_set_bit(dw, MASK.ERROR, dwc->mask);
dwc->initialized = true;
@@ -536,16 +537,17 @@ EXPORT_SYMBOL(dw_dma_get_dst_addr);
/* Called with dwc->lock held and all DMAC interrupts disabled */
static void dwc_handle_cyclic(struct dw_dma *dw, struct dw_dma_chan *dwc,
- u32 status_err, u32 status_xfer)
+ u32 status_block, u32 status_err, u32 status_xfer)
{
unsigned long flags;
- if (dwc->mask) {
+ if (status_block & dwc->mask) {
void (*callback)(void *param);
void *callback_param;
dev_vdbg(chan2dev(&dwc->chan), "new cyclic period llp 0x%08x\n",
channel_readl(dwc, LLP));
+ dma_writel(dw, CLEAR.BLOCK, dwc->mask);
callback = dwc->cdesc->period_callback;
callback_param = dwc->cdesc->period_callback_param;
@@ -577,6 +579,7 @@ static void dwc_handle_cyclic(struct dw_dma *dw, struct dw_dma_chan *dwc,
channel_writel(dwc, CTL_LO, 0);
channel_writel(dwc, CTL_HI, 0);
+ dma_writel(dw, CLEAR.BLOCK, dwc->mask);
dma_writel(dw, CLEAR.ERROR, dwc->mask);
dma_writel(dw, CLEAR.XFER, dwc->mask);
@@ -593,10 +596,12 @@ static void dw_dma_tasklet(unsigned long data)
{
struct dw_dma *dw = (struct dw_dma *)data;
struct dw_dma_chan *dwc;
+ u32 status_block;
u32 status_xfer;
u32 status_err;
int i;
+ status_block = dma_readl(dw, RAW.BLOCK);
status_xfer = dma_readl(dw, RAW.XFER);
status_err = dma_readl(dw, RAW.ERROR);
@@ -605,7 +610,8 @@ static void dw_dma_tasklet(unsigned long data)
for (i = 0; i < dw->dma.chancnt; i++) {
dwc = &dw->chan[i];
if (test_bit(DW_DMA_IS_CYCLIC, &dwc->flags))
- dwc_handle_cyclic(dw, dwc, status_err, status_xfer);
+ dwc_handle_cyclic(dw, dwc, status_block, status_err,
+ status_xfer);
else if (status_err & (1 << i))
dwc_handle_error(dw, dwc);
else if (status_xfer & (1 << i))
@@ -616,6 +622,7 @@ static void dw_dma_tasklet(unsigned long data)
* Re-enable interrupts.
*/
channel_set_bit(dw, MASK.XFER, dw->all_chan_mask);
+ channel_set_bit(dw, MASK.BLOCK, dw->all_chan_mask);
channel_set_bit(dw, MASK.ERROR, dw->all_chan_mask);
}
@@ -635,6 +642,7 @@ static irqreturn_t dw_dma_interrupt(int irq, void *dev_id)
* softirq handler.
*/
channel_clear_bit(dw, MASK.XFER, dw->all_chan_mask);
+ channel_clear_bit(dw, MASK.BLOCK, dw->all_chan_mask);
channel_clear_bit(dw, MASK.ERROR, dw->all_chan_mask);
status = dma_readl(dw, STATUS_INT);
@@ -645,6 +653,7 @@ static irqreturn_t dw_dma_interrupt(int irq, void *dev_id)
/* Try to recover */
channel_clear_bit(dw, MASK.XFER, (1 << 8) - 1);
+ channel_clear_bit(dw, MASK.BLOCK, (1 << 8) - 1);
channel_clear_bit(dw, MASK.SRC_TRAN, (1 << 8) - 1);
channel_clear_bit(dw, MASK.DST_TRAN, (1 << 8) - 1);
channel_clear_bit(dw, MASK.ERROR, (1 << 8) - 1);
@@ -1111,6 +1120,7 @@ static void dw_dma_off(struct dw_dma *dw)
dma_writel(dw, CFG, 0);
channel_clear_bit(dw, MASK.XFER, dw->all_chan_mask);
+ channel_clear_bit(dw, MASK.BLOCK, dw->all_chan_mask);
channel_clear_bit(dw, MASK.SRC_TRAN, dw->all_chan_mask);
channel_clear_bit(dw, MASK.DST_TRAN, dw->all_chan_mask);
channel_clear_bit(dw, MASK.ERROR, dw->all_chan_mask);
@@ -1216,6 +1226,7 @@ static void dwc_free_chan_resources(struct dma_chan *chan)
/* Disable interrupts */
channel_clear_bit(dw, MASK.XFER, dwc->mask);
+ channel_clear_bit(dw, MASK.BLOCK, dwc->mask);
channel_clear_bit(dw, MASK.ERROR, dwc->mask);
spin_unlock_irqrestore(&dwc->lock, flags);
@@ -1458,6 +1469,7 @@ void dw_dma_cyclic_free(struct dma_chan *chan)
dwc_chan_disable(dw, dwc);
+ dma_writel(dw, CLEAR.BLOCK, dwc->mask);
dma_writel(dw, CLEAR.ERROR, dwc->mask);
dma_writel(dw, CLEAR.XFER, dwc->mask);
@@ -1548,9 +1560,6 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)
/* Force dma off, just in case */
dw_dma_off(dw);
- /* Disable BLOCK interrupts as well */
- channel_clear_bit(dw, MASK.BLOCK, dw->all_chan_mask);
-
/* Create a pool of consistent memory blocks for hardware descriptors */
dw->desc_pool = dmam_pool_create("dw_dmac_desc_pool", chip->dev,
sizeof(struct dw_desc), 4, 0);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 125/268] mmc: mmci: fix an ages old detection error
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (123 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 124/268] dmaengine: dw: fix cyclic transfer callbacks Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 126/268] ALSA: timer: Fix race among timer ioctls Kamal Mostafa
` (142 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Linus Walleij, Ulf Hansson, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Linus Walleij <linus.walleij@linaro.org>
commit 0bcb7efdff63564e80fe84dd36a9fbdfbf6697a4 upstream.
commit 4956e10903fd ("ARM: 6244/1: mmci: add variant data and default
MCICLOCK support") added variant data for ARM, U300 and Ux500 variants.
The Nomadik NHK8815/8820 variant was erroneously labeled as a U300
variant, and when the proper Nomadik variant was later introduced in
commit 34fd421349ff ("ARM: 7378/1: mmci: add support for the Nomadik MMCI
variant") this was not fixes. Let's say this fixes the latter commit as
there was no proper Nomadik support until then.
Fixes: 34fd421349ff ("ARM: 7378/1: mmci: add support for the Nomadik...")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mmc/host/mmci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index fb26674..acece32 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1886,7 +1886,7 @@ static struct amba_id mmci_ids[] = {
{
.id = 0x00280180,
.mask = 0x00ffffff,
- .data = &variant_u300,
+ .data = &variant_nomadik,
},
{
.id = 0x00480180,
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 126/268] ALSA: timer: Fix race among timer ioctls
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (124 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 125/268] mmc: mmci: fix an ages old detection error Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 127/268] sparc64: fix incorrect sign extension in sys_sparc64_personality Kamal Mostafa
` (141 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Takashi Iwai <tiwai@suse.de>
commit af368027a49a751d6ff4ee9e3f9961f35bb4fede upstream.
ALSA timer ioctls have an open race and this may lead to a
use-after-free of timer instance object. A simplistic fix is to make
each ioctl exclusive. We have already tread_sem for controlling the
tread, and extend this as a global mutex to be applied to each ioctl.
The downside is, of course, the worse concurrency. But these ioctls
aren't to be parallel accessible, in anyway, so it should be fine to
serialize there.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/core/timer.c | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 9241784df..3810ee8 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -73,7 +73,7 @@ struct snd_timer_user {
struct timespec tstamp; /* trigger tstamp */
wait_queue_head_t qchange_sleep;
struct fasync_struct *fasync;
- struct mutex tread_sem;
+ struct mutex ioctl_lock;
};
/* list of timers */
@@ -1253,7 +1253,7 @@ static int snd_timer_user_open(struct inode *inode, struct file *file)
return -ENOMEM;
spin_lock_init(&tu->qlock);
init_waitqueue_head(&tu->qchange_sleep);
- mutex_init(&tu->tread_sem);
+ mutex_init(&tu->ioctl_lock);
tu->ticks = 1;
tu->queue_size = 128;
tu->queue = kmalloc(tu->queue_size * sizeof(struct snd_timer_read),
@@ -1273,8 +1273,10 @@ static int snd_timer_user_release(struct inode *inode, struct file *file)
if (file->private_data) {
tu = file->private_data;
file->private_data = NULL;
+ mutex_lock(&tu->ioctl_lock);
if (tu->timeri)
snd_timer_close(tu->timeri);
+ mutex_unlock(&tu->ioctl_lock);
kfree(tu->queue);
kfree(tu->tqueue);
kfree(tu);
@@ -1512,7 +1514,6 @@ static int snd_timer_user_tselect(struct file *file,
int err = 0;
tu = file->private_data;
- mutex_lock(&tu->tread_sem);
if (tu->timeri) {
snd_timer_close(tu->timeri);
tu->timeri = NULL;
@@ -1556,7 +1557,6 @@ static int snd_timer_user_tselect(struct file *file,
}
__err:
- mutex_unlock(&tu->tread_sem);
return err;
}
@@ -1769,7 +1769,7 @@ enum {
SNDRV_TIMER_IOCTL_PAUSE_OLD = _IO('T', 0x23),
};
-static long snd_timer_user_ioctl(struct file *file, unsigned int cmd,
+static long __snd_timer_user_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
struct snd_timer_user *tu;
@@ -1786,17 +1786,11 @@ static long snd_timer_user_ioctl(struct file *file, unsigned int cmd,
{
int xarg;
- mutex_lock(&tu->tread_sem);
- if (tu->timeri) { /* too late */
- mutex_unlock(&tu->tread_sem);
+ if (tu->timeri) /* too late */
return -EBUSY;
- }
- if (get_user(xarg, p)) {
- mutex_unlock(&tu->tread_sem);
+ if (get_user(xarg, p))
return -EFAULT;
- }
tu->tread = xarg ? 1 : 0;
- mutex_unlock(&tu->tread_sem);
return 0;
}
case SNDRV_TIMER_IOCTL_GINFO:
@@ -1829,6 +1823,18 @@ static long snd_timer_user_ioctl(struct file *file, unsigned int cmd,
return -ENOTTY;
}
+static long snd_timer_user_ioctl(struct file *file, unsigned int cmd,
+ unsigned long arg)
+{
+ struct snd_timer_user *tu = file->private_data;
+ long ret;
+
+ mutex_lock(&tu->ioctl_lock);
+ ret = __snd_timer_user_ioctl(file, cmd, arg);
+ mutex_unlock(&tu->ioctl_lock);
+ return ret;
+}
+
static int snd_timer_user_fasync(int fd, struct file * file, int on)
{
struct snd_timer_user *tu;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 127/268] sparc64: fix incorrect sign extension in sys_sparc64_personality
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (125 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 126/268] ALSA: timer: Fix race among timer ioctls Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 128/268] cifs: Ratelimit kernel log messages Kamal Mostafa
` (140 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dmitry V. Levin, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: "Dmitry V. Levin" <ldv@altlinux.org>
commit 525fd5a94e1be0776fa652df5c687697db508c91 upstream.
The value returned by sys_personality has type "long int".
It is saved to a variable of type "int", which is not a problem
yet because the type of task_struct->pesonality is "unsigned int".
The problem is the sign extension from "int" to "long int"
that happens on return from sys_sparc64_personality.
For example, a userspace call personality((unsigned) -EINVAL) will
result to any subsequent personality call, including absolutely
harmless read-only personality(0xffffffff) call, failing with
errno set to EINVAL.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/sparc/kernel/sys_sparc_64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index 30e7ddb..c690c8e 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -413,7 +413,7 @@ out:
SYSCALL_DEFINE1(sparc64_personality, unsigned long, personality)
{
- int ret;
+ long ret;
if (personality(current->personality) == PER_LINUX32 &&
personality(personality) == PER_LINUX)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 128/268] cifs: Ratelimit kernel log messages
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (126 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 127/268] sparc64: fix incorrect sign extension in sys_sparc64_personality Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 129/268] cifs: fix race between call_async() and reconnect() Kamal Mostafa
` (139 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jamie Bainbridge, Steve French, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Jamie Bainbridge <jamie.bainbridge@gmail.com>
commit ec7147a99e33a9e4abad6fc6e1b40d15df045d53 upstream.
Under some conditions, CIFS can repeatedly call the cifs_dbg() logging
wrapper. If done rapidly enough, the console framebuffer can softlockup
or "rcu_sched self-detected stall". Apply the built-in log ratelimiters
to prevent such hangs.
Signed-off-by: Jamie Bainbridge <jamie.bainbridge@gmail.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/cifs/cifs_debug.c | 2 +-
fs/cifs/cifs_debug.h | 9 ++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index 7febcf2..50b2684 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -50,7 +50,7 @@ void cifs_vfs_err(const char *fmt, ...)
vaf.fmt = fmt;
vaf.va = &args;
- pr_err("CIFS VFS: %pV", &vaf);
+ pr_err_ratelimited("CIFS VFS: %pV", &vaf);
va_end(args);
}
diff --git a/fs/cifs/cifs_debug.h b/fs/cifs/cifs_debug.h
index f40fbac..66cf0f9 100644
--- a/fs/cifs/cifs_debug.h
+++ b/fs/cifs/cifs_debug.h
@@ -51,14 +51,13 @@ __printf(1, 2) void cifs_vfs_err(const char *fmt, ...);
/* information message: e.g., configuration, major event */
#define cifs_dbg(type, fmt, ...) \
do { \
- if (type == FYI) { \
- if (cifsFYI & CIFS_INFO) { \
- pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__); \
- } \
+ if (type == FYI && cifsFYI & CIFS_INFO) { \
+ pr_debug_ratelimited("%s: " \
+ fmt, __FILE__, ##__VA_ARGS__); \
} else if (type == VFS) { \
cifs_vfs_err(fmt, ##__VA_ARGS__); \
} else if (type == NOISY && type != 0) { \
- pr_debug(fmt, ##__VA_ARGS__); \
+ pr_debug_ratelimited(fmt, ##__VA_ARGS__); \
} \
} while (0)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 129/268] cifs: fix race between call_async() and reconnect()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (127 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 128/268] cifs: Ratelimit kernel log messages Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 130/268] cifs_dbg() outputs an uninitialized buffer in cifs_readdir() Kamal Mostafa
` (138 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Rabin Vincent, Steve French, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Rabin Vincent <rabin.vincent@axis.com>
commit 820962dc700598ffe8cd21b967e30e7520c34748 upstream.
cifs_call_async() queues the MID to the pending list and calls
smb_send_rqst(). If smb_send_rqst() performs a partial send, it sets
the tcpStatus to CifsNeedReconnect and returns an error code to
cifs_call_async(). In this case, cifs_call_async() removes the MID
from the list and returns to the caller.
However, cifs_call_async() releases the server mutex _before_ removing
the MID. This means that a cifs_reconnect() can race with this function
and manage to remove the MID from the list and delete the entry before
cifs_call_async() calls cifs_delete_mid(). This leads to various
crashes due to the use after free in cifs_delete_mid().
Task1 Task2
cifs_call_async():
- rc = -EAGAIN
- mutex_unlock(srv_mutex)
cifs_reconnect():
- mutex_lock(srv_mutex)
- mutex_unlock(srv_mutex)
- list_delete(mid)
- mid->callback()
cifs_writev_callback():
- mutex_lock(srv_mutex)
- delete(mid)
- mutex_unlock(srv_mutex)
- cifs_delete_mid(mid) <---- use after free
Fix this by removing the MID in cifs_call_async() before releasing the
srv_mutex. Also hold the srv_mutex in cifs_reconnect() until the MIDs
are moved out of the pending list.
Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Steve French <sfrench@localhost.localdomain>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/cifs/connect.c | 2 +-
fs/cifs/transport.c | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 773f4dc..f72a8a1 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -362,7 +362,6 @@ cifs_reconnect(struct TCP_Server_Info *server)
server->session_key.response = NULL;
server->session_key.len = 0;
server->lstrp = jiffies;
- mutex_unlock(&server->srv_mutex);
/* mark submitted MIDs for retry and issue callback */
INIT_LIST_HEAD(&retry_list);
@@ -375,6 +374,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
list_move(&mid_entry->qhead, &retry_list);
}
spin_unlock(&GlobalMid_Lock);
+ mutex_unlock(&server->srv_mutex);
cifs_dbg(FYI, "%s: issuing mid callbacks\n", __func__);
list_for_each_safe(tmp, tmp2, &retry_list) {
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 126f46b..66106f6 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -576,14 +576,16 @@ cifs_call_async(struct TCP_Server_Info *server, struct smb_rqst *rqst,
cifs_in_send_dec(server);
cifs_save_when_sent(mid);
- if (rc < 0)
+ if (rc < 0) {
server->sequence_number -= 2;
+ cifs_delete_mid(mid);
+ }
+
mutex_unlock(&server->srv_mutex);
if (rc == 0)
return 0;
- cifs_delete_mid(mid);
add_credits_and_wake_if(server, credits, optype);
return rc;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 130/268] cifs_dbg() outputs an uninitialized buffer in cifs_readdir()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (128 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 129/268] cifs: fix race between call_async() and reconnect() Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 131/268] m32r: fix m32104ut_defconfig build fail Kamal Mostafa
` (137 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Vasily Averin, Steve French, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Vasily Averin <vvs@virtuozzo.com>
commit 01b9b0b28626db4a47d7f48744d70abca9914ef1 upstream.
In some cases tmp_bug can be not filled in cifs_filldir and stay uninitialized,
therefore its printk with "%s" modifier can leak content of kernelspace memory.
If old content of this buffer does not contain '\0' access bejond end of
allocated object can crash the host.
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: Steve French <sfrench@localhost.localdomain>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/cifs/readdir.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index b1eede3..3634c7a 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -847,6 +847,7 @@ int cifs_readdir(struct file *file, struct dir_context *ctx)
* if buggy server returns . and .. late do we want to
* check for that here?
*/
+ *tmp_buf = 0;
rc = cifs_filldir(current_entry, file, ctx,
tmp_buf, max_len);
if (rc) {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 131/268] m32r: fix m32104ut_defconfig build fail
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (129 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 130/268] cifs_dbg() outputs an uninitialized buffer in cifs_readdir() Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 132/268] dma-debug: switch check from _text to _stext Kamal Mostafa
` (136 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sudip Mukherjee, Andrew Morton, Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
commit 601f1db653217f205ffa5fb33514b4e1711e56d1 upstream.
The build of m32104ut_defconfig for m32r arch was failing for long long
time with the error:
ERROR: "memory_start" [fs/udf/udf.ko] undefined!
ERROR: "memory_end" [fs/udf/udf.ko] undefined!
ERROR: "memory_end" [drivers/scsi/sg.ko] undefined!
ERROR: "memory_start" [drivers/scsi/sg.ko] undefined!
ERROR: "memory_end" [drivers/i2c/i2c-dev.ko] undefined!
ERROR: "memory_start" [drivers/i2c/i2c-dev.ko] undefined!
As done in other architectures export the symbols to fix the error.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/m32r/kernel/setup.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c
index 0392112..a5ecef7 100644
--- a/arch/m32r/kernel/setup.c
+++ b/arch/m32r/kernel/setup.c
@@ -81,7 +81,10 @@ static struct resource code_resource = {
};
unsigned long memory_start;
+EXPORT_SYMBOL(memory_start);
+
unsigned long memory_end;
+EXPORT_SYMBOL(memory_end);
void __init setup_arch(char **);
int get_cpuinfo(char *);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 132/268] dma-debug: switch check from _text to _stext
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (130 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 131/268] m32r: fix m32104ut_defconfig build fail Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 133/268] scripts/bloat-o-meter: fix python3 syntax error Kamal Mostafa
` (135 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Laura Abbott, Russell King, Arnd Bergmann, Andrew Morton,
Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Laura Abbott <labbott@fedoraproject.org>
commit ea535e418c01837d07b6c94e817540f50bfdadb0 upstream.
In include/asm-generic/sections.h:
/*
* Usage guidelines:
* _text, _data: architecture specific, don't use them in
* arch-independent code
* [_stext, _etext]: contains .text.* sections, may also contain
* .rodata.*
* and/or .init.* sections
_text is not guaranteed across architectures. Architectures such as ARM
may reuse parts which are not actually text and erroneously trigger a bug.
Switch to using _stext which is guaranteed to contain text sections.
Came out of https://lkml.kernel.org/g/<567B1176.4000106@redhat.com>
Signed-off-by: Laura Abbott <labbott@fedoraproject.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
lib/dma-debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index c5fddeb..d8b4df8 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -1181,7 +1181,7 @@ static inline bool overlap(void *addr, unsigned long len, void *start, void *end
static void check_for_illegal_area(struct device *dev, void *addr, unsigned long len)
{
- if (overlap(addr, len, _text, _etext) ||
+ if (overlap(addr, len, _stext, _etext) ||
overlap(addr, len, __start_rodata, __end_rodata))
err_printk(dev, NULL, "DMA-API: device driver maps memory from kernel text or rodata [addr=%p] [len=%lu]\n", addr, len);
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 133/268] scripts/bloat-o-meter: fix python3 syntax error
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (131 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 132/268] dma-debug: switch check from _text to _stext Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 134/268] ocfs2/dlm: ignore cleaning the migration mle that is inuse Kamal Mostafa
` (134 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sergey Senozhatsky, Andrew Morton, Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
commit 72214a24a7677d4c7501eecc9517ed681b5f2db2 upstream.
In Python3+ print is a function so the old syntax is not correct
anymore:
$ ./scripts/bloat-o-meter vmlinux.o vmlinux.o.old
File "./scripts/bloat-o-meter", line 61
print "add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s (%s)" % \
^
SyntaxError: invalid syntax
Fix by calling print as a function.
Tested on python 2.7.11, 3.5.1
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
scripts/bloat-o-meter | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
index 23e78dc..38b64f4 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -58,8 +58,8 @@ for name in common:
delta.sort()
delta.reverse()
-print "add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s (%s)" % \
- (add, remove, grow, shrink, up, -down, up-down)
-print "%-40s %7s %7s %+7s" % ("function", "old", "new", "delta")
+print("add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s (%s)" % \
+ (add, remove, grow, shrink, up, -down, up-down))
+print("%-40s %7s %7s %+7s" % ("function", "old", "new", "delta"))
for d, n in delta:
- if d: print "%-40s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d)
+ if d: print("%-40s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d))
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 134/268] ocfs2/dlm: ignore cleaning the migration mle that is inuse
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (132 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 133/268] scripts/bloat-o-meter: fix python3 syntax error Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 135/268] ALSA: hda - Add fixup for Dell Latitidue E6540 Kamal Mostafa
` (133 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jiufei Xue, Mark Fasheh, Joel Becker, Junxiao Bi, Andrew Morton,
Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: xuejiufei <xuejiufei@huawei.com>
commit bef5502de074b6f6fa647b94b73155d675694420 upstream.
We have found that migration source will trigger a BUG that the refcount
of mle is already zero before put when the target is down during
migration. The situation is as follows:
dlm_migrate_lockres
dlm_add_migration_mle
dlm_mark_lockres_migrating
dlm_get_mle_inuse
<<<<<< Now the refcount of the mle is 2.
dlm_send_one_lockres and wait for the target to become the
new master.
<<<<<< o2hb detect the target down and clean the migration
mle. Now the refcount is 1.
dlm_migrate_lockres woken, and put the mle twice when found the target
goes down which trigger the BUG with the following message:
"ERROR: bad mle: ".
Signed-off-by: Jiufei Xue <xuejiufei@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/ocfs2/dlm/dlmmaster.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index 482cfd3..523e485 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -2518,6 +2518,11 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
spin_lock(&dlm->master_lock);
ret = dlm_add_migration_mle(dlm, res, mle, &oldmle, name,
namelen, target, dlm->node_num);
+ /* get an extra reference on the mle.
+ * otherwise the assert_master from the new
+ * master will destroy this.
+ */
+ dlm_get_mle_inuse(mle);
spin_unlock(&dlm->master_lock);
spin_unlock(&dlm->spinlock);
@@ -2553,6 +2558,7 @@ fail:
if (mle_added) {
dlm_mle_detach_hb_events(dlm, mle);
dlm_put_mle(mle);
+ dlm_put_mle_inuse(mle);
} else if (mle) {
kmem_cache_free(dlm_mle_cache, mle);
mle = NULL;
@@ -2570,17 +2576,6 @@ fail:
* ensure that all assert_master work is flushed. */
flush_workqueue(dlm->dlm_worker);
- /* get an extra reference on the mle.
- * otherwise the assert_master from the new
- * master will destroy this.
- * also, make sure that all callers of dlm_get_mle
- * take both dlm->spinlock and dlm->master_lock */
- spin_lock(&dlm->spinlock);
- spin_lock(&dlm->master_lock);
- dlm_get_mle_inuse(mle);
- spin_unlock(&dlm->master_lock);
- spin_unlock(&dlm->spinlock);
-
/* notify new node and send all lock state */
/* call send_one_lockres with migration flag.
* this serves as notice to the target node that a
@@ -3309,6 +3304,15 @@ top:
mle->new_master != dead_node)
continue;
+ if (mle->new_master == dead_node && mle->inuse) {
+ mlog(ML_NOTICE, "%s: target %u died during "
+ "migration from %u, the MLE is "
+ "still keep used, ignore it!\n",
+ dlm->name, dead_node,
+ mle->master);
+ continue;
+ }
+
/* If we have reached this point, this mle needs to be
* removed from the list and freed. */
dlm_clean_migration_mle(dlm, mle);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 135/268] ALSA: hda - Add fixup for Dell Latitidue E6540
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (133 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 134/268] ocfs2/dlm: ignore cleaning the migration mle that is inuse Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 136/268] ALSA: timer: Harden slave timer list handling Kamal Mostafa
` (132 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Takashi Iwai <tiwai@suse.de>
commit cf52103a218744f3fd18111325c28e95aa9cd226 upstream.
Another Dell model, another fixup entry: Latitude E6540 needs the same
fixup as other Latitude E series as workaround for noise problems.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=104341
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/patch_realtek.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 228669d..c337197 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5341,6 +5341,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
+ SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 136/268] ALSA: timer: Harden slave timer list handling
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (134 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 135/268] ALSA: hda - Add fixup for Dell Latitidue E6540 Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 137/268] zram/zcomp: use GFP_NOIO to allocate streams Kamal Mostafa
` (131 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Takashi Iwai <tiwai@suse.de>
commit b5a663aa426f4884c71cd8580adae73f33570f0d upstream.
A slave timer instance might be still accessible in a racy way while
operating the master instance as it lacks of locking. Since the
master operation is mostly protected with timer->lock, we should cope
with it while changing the slave instance, too. Also, some linked
lists (active_list and ack_list) of slave instances aren't unlinked
immediately at stopping or closing, and this may lead to unexpected
accesses.
This patch tries to address these issues. It adds spin lock of
timer->lock (either from master or slave, which is equivalent) in a
few places. For avoiding a deadlock, we ensure that the global
slave_active_lock is always locked at first before each timer lock.
Also, ack and active_list of slave instances are properly unlinked at
snd_timer_stop() and snd_timer_close().
Last but not least, remove the superfluous call of _snd_timer_stop()
at removing slave links. This is a noop, and calling it may confuse
readers wrt locking. Further cleanup will follow in a later patch.
Actually we've got reports of use-after-free by syzkaller fuzzer, and
this hopefully fixes these issues.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/core/timer.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 3810ee8..4e8d7bf 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -215,11 +215,13 @@ static void snd_timer_check_master(struct snd_timer_instance *master)
slave->slave_id == master->slave_id) {
list_move_tail(&slave->open_list, &master->slave_list_head);
spin_lock_irq(&slave_active_lock);
+ spin_lock(&master->timer->lock);
slave->master = master;
slave->timer = master->timer;
if (slave->flags & SNDRV_TIMER_IFLG_RUNNING)
list_add_tail(&slave->active_list,
&master->slave_active_head);
+ spin_unlock(&master->timer->lock);
spin_unlock_irq(&slave_active_lock);
}
}
@@ -346,15 +348,18 @@ int snd_timer_close(struct snd_timer_instance *timeri)
timer->hw.close)
timer->hw.close(timer);
/* remove slave links */
+ spin_lock_irq(&slave_active_lock);
+ spin_lock(&timer->lock);
list_for_each_entry_safe(slave, tmp, &timeri->slave_list_head,
open_list) {
- spin_lock_irq(&slave_active_lock);
- _snd_timer_stop(slave, 1, SNDRV_TIMER_EVENT_RESOLUTION);
list_move_tail(&slave->open_list, &snd_timer_slave_list);
slave->master = NULL;
slave->timer = NULL;
- spin_unlock_irq(&slave_active_lock);
+ list_del_init(&slave->ack_list);
+ list_del_init(&slave->active_list);
}
+ spin_unlock(&timer->lock);
+ spin_unlock_irq(&slave_active_lock);
mutex_unlock(®ister_mutex);
}
out:
@@ -441,9 +446,12 @@ static int snd_timer_start_slave(struct snd_timer_instance *timeri)
spin_lock_irqsave(&slave_active_lock, flags);
timeri->flags |= SNDRV_TIMER_IFLG_RUNNING;
- if (timeri->master)
+ if (timeri->master && timeri->timer) {
+ spin_lock(&timeri->timer->lock);
list_add_tail(&timeri->active_list,
&timeri->master->slave_active_head);
+ spin_unlock(&timeri->timer->lock);
+ }
spin_unlock_irqrestore(&slave_active_lock, flags);
return 1; /* delayed start */
}
@@ -489,6 +497,8 @@ static int _snd_timer_stop(struct snd_timer_instance * timeri,
if (!keep_flag) {
spin_lock_irqsave(&slave_active_lock, flags);
timeri->flags &= ~SNDRV_TIMER_IFLG_RUNNING;
+ list_del_init(&timeri->ack_list);
+ list_del_init(&timeri->active_list);
spin_unlock_irqrestore(&slave_active_lock, flags);
}
goto __end;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 137/268] zram/zcomp: use GFP_NOIO to allocate streams
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (135 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 136/268] ALSA: timer: Harden slave timer list handling Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 138/268] zram: try vmalloc() after kmalloc() Kamal Mostafa
` (130 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sergey Senozhatsky, Kyeongdon Kim, Andrew Morton, Linus Torvalds,
Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
commit 3d5fe03a3ea013060ebba2a811aeb0f23f56aefa upstream.
We can end up allocating a new compression stream with GFP_KERNEL from
within the IO path, which may result is nested (recursive) IO
operations. That can introduce problems if the IO path in question is a
reclaimer, holding some locks that will deadlock nested IOs.
Allocate streams and working memory using GFP_NOIO flag, forbidding
recursive IO and FS operations.
An example:
inconsistent {IN-RECLAIM_FS-W} -> {RECLAIM_FS-ON-W} usage.
git/20158 [HC0[0]:SC0[0]:HE1:SE1] takes:
(jbd2_handle){+.+.?.}, at: start_this_handle+0x4ca/0x555
{IN-RECLAIM_FS-W} state was registered at:
__lock_acquire+0x8da/0x117b
lock_acquire+0x10c/0x1a7
start_this_handle+0x52d/0x555
jbd2__journal_start+0xb4/0x237
__ext4_journal_start_sb+0x108/0x17e
ext4_dirty_inode+0x32/0x61
__mark_inode_dirty+0x16b/0x60c
iput+0x11e/0x274
__dentry_kill+0x148/0x1b8
shrink_dentry_list+0x274/0x44a
prune_dcache_sb+0x4a/0x55
super_cache_scan+0xfc/0x176
shrink_slab.part.14.constprop.25+0x2a2/0x4d3
shrink_zone+0x74/0x140
kswapd+0x6b7/0x930
kthread+0x107/0x10f
ret_from_fork+0x3f/0x70
irq event stamp: 138297
hardirqs last enabled at (138297): debug_check_no_locks_freed+0x113/0x12f
hardirqs last disabled at (138296): debug_check_no_locks_freed+0x33/0x12f
softirqs last enabled at (137818): __do_softirq+0x2d3/0x3e9
softirqs last disabled at (137813): irq_exit+0x41/0x95
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(jbd2_handle);
<Interrupt>
lock(jbd2_handle);
*** DEADLOCK ***
5 locks held by git/20158:
#0: (sb_writers#7){.+.+.+}, at: [<ffffffff81155411>] mnt_want_write+0x24/0x4b
#1: (&type->i_mutex_dir_key#2/1){+.+.+.}, at: [<ffffffff81145087>] lock_rename+0xd9/0xe3
#2: (&sb->s_type->i_mutex_key#11){+.+.+.}, at: [<ffffffff8114f8e2>] lock_two_nondirectories+0x3f/0x6b
#3: (&sb->s_type->i_mutex_key#11/4){+.+.+.}, at: [<ffffffff8114f909>] lock_two_nondirectories+0x66/0x6b
#4: (jbd2_handle){+.+.?.}, at: [<ffffffff811e31db>] start_this_handle+0x4ca/0x555
stack backtrace:
CPU: 2 PID: 20158 Comm: git Not tainted 4.1.0-rc7-next-20150615-dbg-00016-g8bdf555-dirty #211
Call Trace:
dump_stack+0x4c/0x6e
mark_lock+0x384/0x56d
mark_held_locks+0x5f/0x76
lockdep_trace_alloc+0xb2/0xb5
kmem_cache_alloc_trace+0x32/0x1e2
zcomp_strm_alloc+0x25/0x73 [zram]
zcomp_strm_multi_find+0xe7/0x173 [zram]
zcomp_strm_find+0xc/0xe [zram]
zram_bvec_rw+0x2ca/0x7e0 [zram]
zram_make_request+0x1fa/0x301 [zram]
generic_make_request+0x9c/0xdb
submit_bio+0xf7/0x120
ext4_io_submit+0x2e/0x43
ext4_bio_write_page+0x1b7/0x300
mpage_submit_page+0x60/0x77
mpage_map_and_submit_buffers+0x10f/0x21d
ext4_writepages+0xc8c/0xe1b
do_writepages+0x23/0x2c
__filemap_fdatawrite_range+0x84/0x8b
filemap_flush+0x1c/0x1e
ext4_alloc_da_blocks+0xb8/0x117
ext4_rename+0x132/0x6dc
? mark_held_locks+0x5f/0x76
ext4_rename2+0x29/0x2b
vfs_rename+0x540/0x636
SyS_renameat2+0x359/0x44d
SyS_rename+0x1e/0x20
entry_SYSCALL_64_fastpath+0x12/0x6f
[minchan@kernel.org: add stable mark]
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Kyeongdon Kim <kyeongdon.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/block/zram/zcomp.c | 4 ++--
drivers/block/zram/zcomp_lz4.c | 2 +-
drivers/block/zram/zcomp_lzo.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c
index 5cb13ca..c536177 100644
--- a/drivers/block/zram/zcomp.c
+++ b/drivers/block/zram/zcomp.c
@@ -76,7 +76,7 @@ static void zcomp_strm_free(struct zcomp *comp, struct zcomp_strm *zstrm)
*/
static struct zcomp_strm *zcomp_strm_alloc(struct zcomp *comp)
{
- struct zcomp_strm *zstrm = kmalloc(sizeof(*zstrm), GFP_KERNEL);
+ struct zcomp_strm *zstrm = kmalloc(sizeof(*zstrm), GFP_NOIO);
if (!zstrm)
return NULL;
@@ -85,7 +85,7 @@ static struct zcomp_strm *zcomp_strm_alloc(struct zcomp *comp)
* allocate 2 pages. 1 for compressed data, plus 1 extra for the
* case when compressed size is larger than the original one
*/
- zstrm->buffer = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, 1);
+ zstrm->buffer = (void *)__get_free_pages(GFP_NOIO | __GFP_ZERO, 1);
if (!zstrm->private || !zstrm->buffer) {
zcomp_strm_free(comp, zstrm);
zstrm = NULL;
diff --git a/drivers/block/zram/zcomp_lz4.c b/drivers/block/zram/zcomp_lz4.c
index f2afb7e..ee44b51 100644
--- a/drivers/block/zram/zcomp_lz4.c
+++ b/drivers/block/zram/zcomp_lz4.c
@@ -15,7 +15,7 @@
static void *zcomp_lz4_create(void)
{
- return kzalloc(LZ4_MEM_COMPRESS, GFP_KERNEL);
+ return kzalloc(LZ4_MEM_COMPRESS, GFP_NOIO);
}
static void zcomp_lz4_destroy(void *private)
diff --git a/drivers/block/zram/zcomp_lzo.c b/drivers/block/zram/zcomp_lzo.c
index da1bc47..683ce04 100644
--- a/drivers/block/zram/zcomp_lzo.c
+++ b/drivers/block/zram/zcomp_lzo.c
@@ -15,7 +15,7 @@
static void *lzo_create(void)
{
- return kzalloc(LZO1X_MEM_COMPRESS, GFP_KERNEL);
+ return kzalloc(LZO1X_MEM_COMPRESS, GFP_NOIO);
}
static void lzo_destroy(void *private)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 138/268] zram: try vmalloc() after kmalloc()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (136 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 137/268] zram/zcomp: use GFP_NOIO to allocate streams Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 139/268] ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Portege R700 Kamal Mostafa
` (129 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Kyeongdon Kim, Minchan Kim, Andrew Morton, Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Kyeongdon Kim <kyeongdon.kim@lge.com>
commit d913897abace843bba20249f3190167f7895e9c3 upstream.
When we're using LZ4 multi compression streams for zram swap, we found
out page allocation failure message in system running test. That was
not only once, but a few(2 - 5 times per test). Also, some failure
cases were continually occurring to try allocation order 3.
In order to make parallel compression private data, we should call
kzalloc() with order 2/3 in runtime(lzo/lz4). But if there is no order
2/3 size memory to allocate in that time, page allocation fails. This
patch makes to use vmalloc() as fallback of kmalloc(), this prevents
page alloc failure warning.
After using this, we never found warning message in running test, also
It could reduce process startup latency about 60-120ms in each case.
For reference a call trace :
Binder_1: page allocation failure: order:3, mode:0x10c0d0
CPU: 0 PID: 424 Comm: Binder_1 Tainted: GW 3.10.49-perf-g991d02b-dirty #20
Call trace:
dump_backtrace+0x0/0x270
show_stack+0x10/0x1c
dump_stack+0x1c/0x28
warn_alloc_failed+0xfc/0x11c
__alloc_pages_nodemask+0x724/0x7f0
__get_free_pages+0x14/0x5c
kmalloc_order_trace+0x38/0xd8
zcomp_lz4_create+0x2c/0x38
zcomp_strm_alloc+0x34/0x78
zcomp_strm_multi_find+0x124/0x1ec
zcomp_strm_find+0xc/0x18
zram_bvec_rw+0x2fc/0x780
zram_make_request+0x25c/0x2d4
generic_make_request+0x80/0xbc
submit_bio+0xa4/0x15c
__swap_writepage+0x218/0x230
swap_writepage+0x3c/0x4c
shrink_page_list+0x51c/0x8d0
shrink_inactive_list+0x3f8/0x60c
shrink_lruvec+0x33c/0x4cc
shrink_zone+0x3c/0x100
try_to_free_pages+0x2b8/0x54c
__alloc_pages_nodemask+0x514/0x7f0
__get_free_pages+0x14/0x5c
proc_info_read+0x50/0xe4
vfs_read+0xa0/0x12c
SyS_read+0x44/0x74
DMA: 3397*4kB (MC) 26*8kB (RC) 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB
0*512kB 0*1024kB 0*2048kB 0*4096kB = 13796kB
[minchan@kernel.org: change vmalloc gfp and adding comment about gfp]
[sergey.senozhatsky@gmail.com: tweak comments and styles]
Signed-off-by: Kyeongdon Kim <kyeongdon.kim@lge.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/block/zram/zcomp_lz4.c | 23 +++++++++++++++++++++--
drivers/block/zram/zcomp_lzo.c | 23 +++++++++++++++++++++--
2 files changed, 42 insertions(+), 4 deletions(-)
diff --git a/drivers/block/zram/zcomp_lz4.c b/drivers/block/zram/zcomp_lz4.c
index ee44b51..dd60831 100644
--- a/drivers/block/zram/zcomp_lz4.c
+++ b/drivers/block/zram/zcomp_lz4.c
@@ -10,17 +10,36 @@
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/lz4.h>
+#include <linux/vmalloc.h>
+#include <linux/mm.h>
#include "zcomp_lz4.h"
static void *zcomp_lz4_create(void)
{
- return kzalloc(LZ4_MEM_COMPRESS, GFP_NOIO);
+ void *ret;
+
+ /*
+ * This function can be called in swapout/fs write path
+ * so we can't use GFP_FS|IO. And it assumes we already
+ * have at least one stream in zram initialization so we
+ * don't do best effort to allocate more stream in here.
+ * A default stream will work well without further multiple
+ * streams. That's why we use NORETRY | NOWARN.
+ */
+ ret = kzalloc(LZ4_MEM_COMPRESS, GFP_NOIO | __GFP_NORETRY |
+ __GFP_NOWARN);
+ if (!ret)
+ ret = __vmalloc(LZ4_MEM_COMPRESS,
+ GFP_NOIO | __GFP_NORETRY | __GFP_NOWARN |
+ __GFP_ZERO | __GFP_HIGHMEM,
+ PAGE_KERNEL);
+ return ret;
}
static void zcomp_lz4_destroy(void *private)
{
- kfree(private);
+ kvfree(private);
}
static int zcomp_lz4_compress(const unsigned char *src, unsigned char *dst,
diff --git a/drivers/block/zram/zcomp_lzo.c b/drivers/block/zram/zcomp_lzo.c
index 683ce04..edc5499 100644
--- a/drivers/block/zram/zcomp_lzo.c
+++ b/drivers/block/zram/zcomp_lzo.c
@@ -10,17 +10,36 @@
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/lzo.h>
+#include <linux/vmalloc.h>
+#include <linux/mm.h>
#include "zcomp_lzo.h"
static void *lzo_create(void)
{
- return kzalloc(LZO1X_MEM_COMPRESS, GFP_NOIO);
+ void *ret;
+
+ /*
+ * This function can be called in swapout/fs write path
+ * so we can't use GFP_FS|IO. And it assumes we already
+ * have at least one stream in zram initialization so we
+ * don't do best effort to allocate more stream in here.
+ * A default stream will work well without further multiple
+ * streams. That's why we use NORETRY | NOWARN.
+ */
+ ret = kzalloc(LZO1X_MEM_COMPRESS, GFP_NOIO | __GFP_NORETRY |
+ __GFP_NOWARN);
+ if (!ret)
+ ret = __vmalloc(LZO1X_MEM_COMPRESS,
+ GFP_NOIO | __GFP_NORETRY | __GFP_NOWARN |
+ __GFP_ZERO | __GFP_HIGHMEM,
+ PAGE_KERNEL);
+ return ret;
}
static void lzo_destroy(void *private)
{
- kfree(private);
+ kvfree(private);
}
static int lzo_compress(const unsigned char *src, unsigned char *dst,
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 139/268] ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Portege R700
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (137 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 138/268] zram: try vmalloc() after kmalloc() Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 140/268] ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Satellite R830 Kamal Mostafa
` (128 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Hans de Goede, Rafael J. Wysocki, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Hans de Goede <hdegoede@redhat.com>
commit de588b8ff057d4de0751f337b930f90ca522bab2 upstream.
The Toshiba Portege R700 needs disable_backlight_sysfs_if=1, just like
the Toshiba Portege R830. Add a quirk for this.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=21012
Tested-by: Emma Reisz <emmareisz@outlook.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/acpi/acpi_video.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index 8c2fe2f..11506c0 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -451,6 +451,15 @@ static struct dmi_system_id video_dmi_table[] = {
* as brightness control does not work.
*/
{
+ /* https://bugzilla.kernel.org/show_bug.cgi?id=21012 */
+ .callback = video_disable_backlight_sysfs_if,
+ .ident = "Toshiba Portege R700",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE R700"),
+ },
+ },
+ {
/* https://bugs.freedesktop.org/show_bug.cgi?id=82634 */
.callback = video_disable_backlight_sysfs_if,
.ident = "Toshiba Portege R830",
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 140/268] ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Satellite R830
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (138 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 139/268] ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Portege R700 Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 141/268] mm: soft-offline: check return value in second __get_any_page() call Kamal Mostafa
` (127 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Hans de Goede, Rafael J. Wysocki, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Hans de Goede <hdegoede@redhat.com>
commit b21f2e81bd3fd8ed260590e72901254bca2193cd upstream.
The Toshiba Satellite R830 needs disable_backlight_sysfs_if=1, just like
the Toshiba Portege R830. Add a quirk for this.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=21012
Tested-by: To Do <entodoays@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/acpi/acpi_video.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index 11506c0..586a87b 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -468,6 +468,15 @@ static struct dmi_system_id video_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE R830"),
},
},
+ {
+ /* https://bugzilla.kernel.org/show_bug.cgi?id=21012 */
+ .callback = video_disable_backlight_sysfs_if,
+ .ident = "Toshiba Satellite R830",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE R830"),
+ },
+ },
{}
};
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 141/268] mm: soft-offline: check return value in second __get_any_page() call
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (139 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 140/268] ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Satellite R830 Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 142/268] zram: don't call idr_remove() from zram_remove() Kamal Mostafa
` (126 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Naoya Horiguchi, Sasha Levin, Aneesh Kumar K.V, Vlastimil Babka,
Jerome Marchand, Andrea Arcangeli, Hugh Dickins, Dave Hansen,
Mel Gorman, Rik van Riel, Steve Capper, Johannes Weiner,
Michal Hocko, Christoph Lameter, David Rientjes, Andrew Morton,
Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
commit d96b339f453997f2f08c52da3f41423be48c978f upstream.
I saw the following BUG_ON triggered in a testcase where a process calls
madvise(MADV_SOFT_OFFLINE) on thps, along with a background process that
calls migratepages command repeatedly (doing ping-pong among different
NUMA nodes) for the first process:
Soft offlining page 0x60000 at 0x700000600000
__get_any_page: 0x60000 free buddy page
page:ffffea0001800000 count:0 mapcount:-127 mapping: (null) index:0x1
flags: 0x1fffc0000000000()
page dumped because: VM_BUG_ON_PAGE(atomic_read(&page->_count) == 0)
------------[ cut here ]------------
kernel BUG at /src/linux-dev/include/linux/mm.h:342!
invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
Modules linked in: cfg80211 rfkill crc32c_intel serio_raw virtio_balloon i2c_piix4 virtio_blk virtio_net ata_generic pata_acpi
CPU: 3 PID: 3035 Comm: test_alloc_gene Tainted: G O 4.4.0-rc8-v4.4-rc8-160107-1501-00000-rc8+ #74
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
task: ffff88007c63d5c0 ti: ffff88007c210000 task.ti: ffff88007c210000
RIP: 0010:[<ffffffff8118998c>] [<ffffffff8118998c>] put_page+0x5c/0x60
RSP: 0018:ffff88007c213e00 EFLAGS: 00010246
Call Trace:
put_hwpoison_page+0x4e/0x80
soft_offline_page+0x501/0x520
SyS_madvise+0x6bc/0x6f0
entry_SYSCALL_64_fastpath+0x12/0x6a
Code: 8b fc ff ff 5b 5d c3 48 89 df e8 b0 fa ff ff 48 89 df 31 f6 e8 c6 7d ff ff 5b 5d c3 48 c7 c6 08 54 a2 81 48 89 df e8 a4 c5 01 00 <0f> 0b 66 90 66 66 66 66 90 55 48 89 e5 41 55 41 54 53 48 8b 47
RIP [<ffffffff8118998c>] put_page+0x5c/0x60
RSP <ffff88007c213e00>
The root cause resides in get_any_page() which retries to get a refcount
of the page to be soft-offlined. This function calls
put_hwpoison_page(), expecting that the target page is putback to LRU
list. But it can be also freed to buddy. So the second check need to
care about such case.
Fixes: af8fae7c0886 ("mm/memory-failure.c: clean up soft_offline_page()")
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Steve Capper <steve.capper@linaro.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
mm/memory-failure.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 1f4446a..20cc5b7 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1540,7 +1540,7 @@ static int get_any_page(struct page *page, unsigned long pfn, int flags)
* Did it turn free?
*/
ret = __get_any_page(page, pfn, 0);
- if (!PageLRU(page)) {
+ if (ret == 1 && !PageLRU(page)) {
/* Drop page reference which is from __get_any_page() */
put_page(page);
pr_info("soft_offline: %#lx: unknown non LRU page type %lx\n",
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 142/268] zram: don't call idr_remove() from zram_remove()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (140 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 141/268] mm: soft-offline: check return value in second __get_any_page() call Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 143/268] memcg: only free spare array when readers are done Kamal Mostafa
` (125 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jerome Marchand, Minchan Kim, Andrew Morton, Linus Torvalds,
Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Jerome Marchand <jmarchan@redhat.com>
commit 17ec4cd985780a7e30aa45bb8f272237c12502a4 upstream.
The use of idr_remove() is forbidden in the callback functions of
idr_for_each(). It is therefore unsafe to call idr_remove in
zram_remove().
This patch moves the call to idr_remove() from zram_remove() to
hot_remove_store(). In the detroy_devices() path, idrs are removed by
idr_destroy(). This solves an use-after-free detected by KASan.
[akpm@linux-foundation.org: fix coding stype, per Sergey]
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/block/zram/zram_drv.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 763301c..6a706f5 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1319,7 +1319,6 @@ static int zram_remove(struct zram *zram)
pr_info("Removed device: %s\n", zram->disk->disk_name);
- idr_remove(&zram_index_idr, zram->disk->first_minor);
blk_cleanup_queue(zram->disk->queue);
del_gendisk(zram->disk);
put_disk(zram->disk);
@@ -1361,10 +1360,12 @@ static ssize_t hot_remove_store(struct class *class,
mutex_lock(&zram_index_mutex);
zram = idr_find(&zram_index_idr, dev_id);
- if (zram)
+ if (zram) {
ret = zram_remove(zram);
- else
+ idr_remove(&zram_index_idr, dev_id);
+ } else {
ret = -ENODEV;
+ }
mutex_unlock(&zram_index_mutex);
return ret ? ret : count;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 143/268] memcg: only free spare array when readers are done
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (141 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 142/268] zram: don't call idr_remove() from zram_remove() Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 144/268] panic: release stale console lock to always get the logbuf printed out Kamal Mostafa
` (124 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Martijn Coenen, Johannes Weiner, Vladimir Davydov, Andrew Morton,
Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Martijn Coenen <maco@google.com>
commit 6611d8d76132f86faa501de9451a89bf23fb2371 upstream.
A spare array holding mem cgroup threshold events is kept around to make
sure we can always safely deregister an event and have an array to store
the new set of events in.
In the scenario where we're going from 1 to 0 registered events, the
pointer to the primary array containing 1 event is copied to the spare
slot, and then the spare slot is freed because no events are left.
However, it is freed before calling synchronize_rcu(), which means
readers may still be accessing threshold->primary after it is freed.
Fixed by only freeing after synchronize_rcu().
Signed-off-by: Martijn Coenen <maco@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Vladimir Davydov <vdavydov@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
mm/memcontrol.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 364f972..48540e5 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3833,16 +3833,17 @@ static void __mem_cgroup_usage_unregister_event(struct mem_cgroup *memcg,
swap_buffers:
/* Swap primary and spare array */
thresholds->spare = thresholds->primary;
- /* If all events are unregistered, free the spare array */
- if (!new) {
- kfree(thresholds->spare);
- thresholds->spare = NULL;
- }
rcu_assign_pointer(thresholds->primary, new);
/* To be sure that nobody uses thresholds */
synchronize_rcu();
+
+ /* If all events are unregistered, free the spare array */
+ if (!new) {
+ kfree(thresholds->spare);
+ thresholds->spare = NULL;
+ }
unlock:
mutex_unlock(&memcg->thresholds_lock);
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 144/268] panic: release stale console lock to always get the logbuf printed out
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (142 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 143/268] memcg: only free spare array when readers are done Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 145/268] kernel/panic.c: turn off locks debug before releasing console lock Kamal Mostafa
` (123 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Vitaly Kuznetsov, HATAYAMA Daisuke, Masami Hiramatsu,
Jiri Kosina, Baoquan He, Prarit Bhargava, Xie XiuQi,
Seth Jennings, K. Y. Srinivasan, Jan Kara, Andrew Morton,
Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Vitaly Kuznetsov <vkuznets@redhat.com>
commit 08d78658f393fefaa2e6507ea052c6f8ef4002a2 upstream.
In some cases we may end up killing the CPU holding the console lock
while still having valuable data in logbuf. E.g. I'm observing the
following:
- A crash is happening on one CPU and console_unlock() is being called on
some other.
- console_unlock() tries to print out the buffer before releasing the lock
and on slow console it takes time.
- in the meanwhile crashing CPU does lots of printk()-s with valuable data
(which go to the logbuf) and sends IPIs to all other CPUs.
- console_unlock() finishes printing previous chunk and enables interrupts
before trying to print out the rest, the CPU catches the IPI and never
releases console lock.
This is not the only possible case: in VT/fb subsystems we have many other
console_lock()/console_unlock() users. Non-masked interrupts (or
receiving NMI in case of extreme slowness) will have the same result.
Getting the whole console buffer printed out on crash should be top
priority.
[akpm@linux-foundation.org: tweak comment text]
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Baoquan He <bhe@redhat.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Xie XiuQi <xiexiuqi@huawei.com>
Cc: Seth Jennings <sjenning@redhat.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ kamal: 4.2-stable prereq for
8d91f8b printk: do cond_resched() between lines while outputting to consoles ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/panic.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/kernel/panic.c b/kernel/panic.c
index 04e91ff..4579dbb 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -23,6 +23,7 @@
#include <linux/sysrq.h>
#include <linux/init.h>
#include <linux/nmi.h>
+#include <linux/console.h>
#define PANIC_TIMER_STEP 100
#define PANIC_BLINK_SPD 18
@@ -147,6 +148,15 @@ void panic(const char *fmt, ...)
bust_spinlocks(0);
+ /*
+ * We may have ended up stopping the CPU holding the lock (in
+ * smp_send_stop()) while still having some valuable data in the console
+ * buffer. Try to acquire the lock then release it regardless of the
+ * result. The release will also print the buffers out.
+ */
+ console_trylock();
+ console_unlock();
+
if (!panic_blink)
panic_blink = no_blink;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 145/268] kernel/panic.c: turn off locks debug before releasing console lock
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (143 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 144/268] panic: release stale console lock to always get the logbuf printed out Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 146/268] printk: do cond_resched() between lines while outputting to consoles Kamal Mostafa
` (122 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Vitaly Kuznetsov, HATAYAMA Daisuke, Masami Hiramatsu,
Jiri Kosina, Baoquan He, Prarit Bhargava, Xie XiuQi,
Seth Jennings, K. Y. Srinivasan, Jan Kara, Petr Mladek,
Yasuaki Ishimatsu, Andrew Morton, Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Vitaly Kuznetsov <vkuznets@redhat.com>
commit 7625b3a0007decf2b135cb47ca67abc78a7b1bc1 upstream.
Commit 08d78658f393 ("panic: release stale console lock to always get the
logbuf printed out") introduced an unwanted bad unlock balance report when
panic() is called directly and not from OOPS (e.g. from out_of_memory()).
The difference is that in case of OOPS we disable locks debug in
oops_enter() and on direct panic call nobody does that.
Fixes: 08d78658f393 ("panic: release stale console lock to always get the logbuf printed out")
Reported-by: kernel test robot <ying.huang@linux.intel.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Baoquan He <bhe@redhat.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Xie XiuQi <xiexiuqi@huawei.com>
Cc: Seth Jennings <sjenning@redhat.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Petr Mladek <pmladek@suse.cz>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ kamal: 4.2-stable prereq for
8d91f8b printk: do cond_resched() between lines while outputting to consoles ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/panic.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/panic.c b/kernel/panic.c
index 4579dbb..4b150bc 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -152,8 +152,11 @@ void panic(const char *fmt, ...)
* We may have ended up stopping the CPU holding the lock (in
* smp_send_stop()) while still having some valuable data in the console
* buffer. Try to acquire the lock then release it regardless of the
- * result. The release will also print the buffers out.
+ * result. The release will also print the buffers out. Locks debug
+ * should be disabled to avoid reporting bad unlock balance when
+ * panic() is not being callled from OOPS.
*/
+ debug_locks_off();
console_trylock();
console_unlock();
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 146/268] printk: do cond_resched() between lines while outputting to consoles
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (144 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 145/268] kernel/panic.c: turn off locks debug before releasing console lock Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 147/268] ALSA: hda - Fix bass pin fixup for ASUS N550JX Kamal Mostafa
` (121 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Tejun Heo, Dave Jones, Kyle McMartin, Andrew Morton,
Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Tejun Heo <tj@kernel.org>
commit 8d91f8b15361dfb438ab6eb3b319e2ded43458ff upstream.
@console_may_schedule tracks whether console_sem was acquired through
lock or trylock. If the former, we're inside a sleepable context and
console_conditional_schedule() performs cond_resched(). This allows
console drivers which use console_lock for synchronization to yield
while performing time-consuming operations such as scrolling.
However, the actual console outputting is performed while holding
irq-safe logbuf_lock, so console_unlock() clears @console_may_schedule
before starting outputting lines. Also, only a few drivers call
console_conditional_schedule() to begin with. This means that when a
lot of lines need to be output by console_unlock(), for example on a
console registration, the task doing console_unlock() may not yield for
a long time on a non-preemptible kernel.
If this happens with a slow console devices, for example a serial
console, the outputting task may occupy the cpu for a very long time.
Long enough to trigger softlockup and/or RCU stall warnings, which in
turn pile more messages, sometimes enough to trigger the next cycle of
warnings incapacitating the system.
Fix it by making console_unlock() insert cond_resched() between lines if
@console_may_schedule.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Calvin Owens <calvinowens@fb.com>
Acked-by: Jan Kara <jack@suse.com>
Cc: Dave Jones <davej@codemonkey.org.uk>
Cc: Kyle McMartin <kyle@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/console.h | 1 +
kernel/panic.c | 3 +--
kernel/printk/printk.c | 35 ++++++++++++++++++++++++++++++++++-
3 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/include/linux/console.h b/include/linux/console.h
index bd19434..ea731af 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -150,6 +150,7 @@ extern int console_trylock(void);
extern void console_unlock(void);
extern void console_conditional_schedule(void);
extern void console_unblank(void);
+extern void console_flush_on_panic(void);
extern struct tty_driver *console_device(int *);
extern void console_stop(struct console *);
extern void console_start(struct console *);
diff --git a/kernel/panic.c b/kernel/panic.c
index 4b150bc..41e2b54 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -157,8 +157,7 @@ void panic(const char *fmt, ...)
* panic() is not being callled from OOPS.
*/
debug_locks_off();
- console_trylock();
- console_unlock();
+ console_flush_on_panic();
if (!panic_blink)
panic_blink = no_blink;
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 2b0819b..66bfe91 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2232,13 +2232,24 @@ void console_unlock(void)
static u64 seen_seq;
unsigned long flags;
bool wake_klogd = false;
- bool retry;
+ bool do_cond_resched, retry;
if (console_suspended) {
up_console_sem();
return;
}
+ /*
+ * Console drivers are called under logbuf_lock, so
+ * @console_may_schedule should be cleared before; however, we may
+ * end up dumping a lot of lines, for example, if called from
+ * console registration path, and should invoke cond_resched()
+ * between lines if allowable. Not doing so can cause a very long
+ * scheduling stall on a slow console leading to RCU stall and
+ * softlockup warnings which exacerbate the issue with more
+ * messages practically incapacitating the system.
+ */
+ do_cond_resched = console_may_schedule;
console_may_schedule = 0;
/* flush buffered message fragment immediately to console */
@@ -2310,6 +2321,9 @@ skip:
call_console_drivers(level, ext_text, ext_len, text, len);
start_critical_timings();
local_irq_restore(flags);
+
+ if (do_cond_resched)
+ cond_resched();
}
console_locked = 0;
@@ -2377,6 +2391,25 @@ void console_unblank(void)
console_unlock();
}
+/**
+ * console_flush_on_panic - flush console content on panic
+ *
+ * Immediately output all pending messages no matter what.
+ */
+void console_flush_on_panic(void)
+{
+ /*
+ * If someone else is holding the console lock, trylock will fail
+ * and may_schedule may be set. Ignore and proceed to unlock so
+ * that messages are flushed out. As this can be called from any
+ * context and we don't want to get preempted while flushing,
+ * ensure may_schedule is cleared.
+ */
+ console_trylock();
+ console_may_schedule = 0;
+ console_unlock();
+}
+
/*
* Return the console tty driver structure and its associated index
*/
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 147/268] ALSA: hda - Fix bass pin fixup for ASUS N550JX
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (145 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 146/268] printk: do cond_resched() between lines while outputting to consoles Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 148/268] crypto: algif_skcipher - Require setkey before accept(2) Kamal Mostafa
` (120 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Takashi Iwai <tiwai@suse.de>
commit db8948e653e12b218058bb6696f4a33fa7845f64 upstream.
ASUS N550JX (PCI SSID 1043:13df) requires the same fixup for a bass
speaker output pin as other N550 models.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=110001
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/patch_realtek.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index c337197..7cace05 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6774,6 +6774,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A),
+ SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 148/268] crypto: algif_skcipher - Require setkey before accept(2)
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (146 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 147/268] ALSA: hda - Fix bass pin fixup for ASUS N550JX Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 149/268] crypto: af_alg - Disallow bind/setkey/... after accept(2) Kamal Mostafa
` (119 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit dd504589577d8e8e70f51f997ad487a4cb6c026f upstream.
Some cipher implementations will crash if you try to use them
without calling setkey first. This patch adds a check so that
the accept(2) call will fail with -ENOKEY if setkey hasn't been
done on the socket yet.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
[ kamal: backport to 4.2-stable: crypto_alloc_ablkcipher API ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/algif_skcipher.c | 48 +++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 41 insertions(+), 7 deletions(-)
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index 9450752..1e7e09b 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -31,6 +31,11 @@ struct skcipher_sg_list {
struct scatterlist sg[0];
};
+struct skcipher_tfm {
+ struct crypto_ablkcipher *skcipher;
+ bool has_key;
+};
+
struct skcipher_ctx {
struct list_head tsgl;
struct af_alg_sgl rsgl;
@@ -751,17 +756,41 @@ static struct proto_ops algif_skcipher_ops = {
static void *skcipher_bind(const char *name, u32 type, u32 mask)
{
- return crypto_alloc_ablkcipher(name, type, mask);
+ struct skcipher_tfm *tfm;
+ struct crypto_ablkcipher *skcipher;
+
+ tfm = kzalloc(sizeof(*tfm), GFP_KERNEL);
+ if (!tfm)
+ return ERR_PTR(-ENOMEM);
+
+ skcipher = crypto_alloc_ablkcipher(name, type, mask);
+ if (IS_ERR(skcipher)) {
+ kfree(tfm);
+ return ERR_CAST(skcipher);
+ }
+
+ tfm->skcipher = skcipher;
+
+ return tfm;
}
static void skcipher_release(void *private)
{
- crypto_free_ablkcipher(private);
+ struct skcipher_tfm *tfm = private;
+
+ crypto_free_ablkcipher(tfm->skcipher);
+ kfree(tfm);
}
static int skcipher_setkey(void *private, const u8 *key, unsigned int keylen)
{
- return crypto_ablkcipher_setkey(private, key, keylen);
+ struct skcipher_tfm *tfm = private;
+ int err;
+
+ err = crypto_ablkcipher_setkey(tfm->skcipher, key, keylen);
+ tfm->has_key = !err;
+
+ return err;
}
static void skcipher_wait(struct sock *sk)
@@ -793,20 +822,25 @@ static int skcipher_accept_parent(void *private, struct sock *sk)
{
struct skcipher_ctx *ctx;
struct alg_sock *ask = alg_sk(sk);
- unsigned int len = sizeof(*ctx) + crypto_ablkcipher_reqsize(private);
+ struct skcipher_tfm *tfm = private;
+ struct crypto_ablkcipher *skcipher = tfm->skcipher;
+ unsigned int len = sizeof(*ctx) + crypto_ablkcipher_reqsize(skcipher);
+
+ if (!tfm->has_key)
+ return -ENOKEY;
ctx = sock_kmalloc(sk, len, GFP_KERNEL);
if (!ctx)
return -ENOMEM;
- ctx->iv = sock_kmalloc(sk, crypto_ablkcipher_ivsize(private),
+ ctx->iv = sock_kmalloc(sk, crypto_ablkcipher_ivsize(skcipher),
GFP_KERNEL);
if (!ctx->iv) {
sock_kfree_s(sk, ctx, len);
return -ENOMEM;
}
- memset(ctx->iv, 0, crypto_ablkcipher_ivsize(private));
+ memset(ctx->iv, 0, crypto_ablkcipher_ivsize(skcipher));
INIT_LIST_HEAD(&ctx->tsgl);
ctx->len = len;
@@ -819,7 +853,7 @@ static int skcipher_accept_parent(void *private, struct sock *sk)
ask->private = ctx;
- ablkcipher_request_set_tfm(&ctx->req, private);
+ ablkcipher_request_set_tfm(&ctx->req, skcipher);
ablkcipher_request_set_callback(&ctx->req, CRYPTO_TFM_REQ_MAY_BACKLOG,
af_alg_complete, &ctx->completion);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 149/268] crypto: af_alg - Disallow bind/setkey/... after accept(2)
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (147 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 148/268] crypto: algif_skcipher - Require setkey before accept(2) Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 150/268] crypto: af_alg - Fix socket double-free when accept fails Kamal Mostafa
` (118 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit c840ac6af3f8713a71b4d2363419145760bd6044 upstream.
Each af_alg parent socket obtained by socket(2) corresponds to a
tfm object once bind(2) has succeeded. An accept(2) call on that
parent socket creates a context which then uses the tfm object.
Therefore as long as any child sockets created by accept(2) exist
the parent socket must not be modified or freed.
This patch guarantees this by using locks and a reference count
on the parent socket. Any attempt to modify the parent socket will
fail with EBUSY.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/af_alg.c | 35 ++++++++++++++++++++++++++++++++---
include/crypto/if_alg.h | 8 +++-----
2 files changed, 35 insertions(+), 8 deletions(-)
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index a8e7aa3..7b5b592 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -125,6 +125,23 @@ int af_alg_release(struct socket *sock)
}
EXPORT_SYMBOL_GPL(af_alg_release);
+void af_alg_release_parent(struct sock *sk)
+{
+ struct alg_sock *ask = alg_sk(sk);
+ bool last;
+
+ sk = ask->parent;
+ ask = alg_sk(sk);
+
+ lock_sock(sk);
+ last = !--ask->refcnt;
+ release_sock(sk);
+
+ if (last)
+ sock_put(sk);
+}
+EXPORT_SYMBOL_GPL(af_alg_release_parent);
+
static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
const u32 forbidden = CRYPTO_ALG_INTERNAL;
@@ -133,6 +150,7 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
struct sockaddr_alg *sa = (void *)uaddr;
const struct af_alg_type *type;
void *private;
+ int err;
if (sock->state == SS_CONNECTED)
return -EINVAL;
@@ -160,16 +178,22 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
return PTR_ERR(private);
}
+ err = -EBUSY;
lock_sock(sk);
+ if (ask->refcnt)
+ goto unlock;
swap(ask->type, type);
swap(ask->private, private);
+ err = 0;
+
+unlock:
release_sock(sk);
alg_do_release(type, private);
- return 0;
+ return err;
}
static int alg_setkey(struct sock *sk, char __user *ukey,
@@ -202,11 +226,15 @@ static int alg_setsockopt(struct socket *sock, int level, int optname,
struct sock *sk = sock->sk;
struct alg_sock *ask = alg_sk(sk);
const struct af_alg_type *type;
- int err = -ENOPROTOOPT;
+ int err = -EBUSY;
lock_sock(sk);
+ if (ask->refcnt)
+ goto unlock;
+
type = ask->type;
+ err = -ENOPROTOOPT;
if (level != SOL_ALG || !type)
goto unlock;
@@ -264,7 +292,8 @@ int af_alg_accept(struct sock *sk, struct socket *newsock)
sk2->sk_family = PF_ALG;
- sock_hold(sk);
+ if (!ask->refcnt++)
+ sock_hold(sk);
alg_sk(sk2)->parent = sk;
alg_sk(sk2)->type = type;
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
index 018afb2..589716f 100644
--- a/include/crypto/if_alg.h
+++ b/include/crypto/if_alg.h
@@ -30,6 +30,8 @@ struct alg_sock {
struct sock *parent;
+ unsigned int refcnt;
+
const struct af_alg_type *type;
void *private;
};
@@ -67,6 +69,7 @@ int af_alg_register_type(const struct af_alg_type *type);
int af_alg_unregister_type(const struct af_alg_type *type);
int af_alg_release(struct socket *sock);
+void af_alg_release_parent(struct sock *sk);
int af_alg_accept(struct sock *sk, struct socket *newsock);
int af_alg_make_sg(struct af_alg_sgl *sgl, struct iov_iter *iter, int len);
@@ -83,11 +86,6 @@ static inline struct alg_sock *alg_sk(struct sock *sk)
return (struct alg_sock *)sk;
}
-static inline void af_alg_release_parent(struct sock *sk)
-{
- sock_put(alg_sk(sk)->parent);
-}
-
static inline void af_alg_init_completion(struct af_alg_completion *completion)
{
init_completion(&completion->completion);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 150/268] crypto: af_alg - Fix socket double-free when accept fails
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (148 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 149/268] crypto: af_alg - Disallow bind/setkey/... after accept(2) Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 151/268] crypto: af_alg - Add nokey compatibility path Kamal Mostafa
` (117 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit a383292c86663bbc31ac62cc0c04fc77504636a6 upstream.
When we fail an accept(2) call we will end up freeing the socket
twice, once due to the direct sk_free call and once again through
newsock.
This patch fixes this by removing the sk_free call.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/af_alg.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 7b5b592..eaf98e2 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -285,10 +285,8 @@ int af_alg_accept(struct sock *sk, struct socket *newsock)
security_sk_clone(sk, sk2);
err = type->accept(ask->private, sk2);
- if (err) {
- sk_free(sk2);
+ if (err)
goto unlock;
- }
sk2->sk_family = PF_ALG;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 151/268] crypto: af_alg - Add nokey compatibility path
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (149 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 150/268] crypto: af_alg - Fix socket double-free when accept fails Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 152/268] crypto: algif_skcipher " Kamal Mostafa
` (116 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit 37766586c965d63758ad542325a96d5384f4a8c9 upstream.
This patch adds a compatibility path to support old applications
that do acept(2) before setkey.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/af_alg.c | 13 ++++++++++++-
include/crypto/if_alg.h | 2 ++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index eaf98e2..6566d2e 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -76,6 +76,8 @@ int af_alg_register_type(const struct af_alg_type *type)
goto unlock;
type->ops->owner = THIS_MODULE;
+ if (type->ops_nokey)
+ type->ops_nokey->owner = THIS_MODULE;
node->type = type;
list_add(&node->list, &alg_types);
err = 0;
@@ -267,6 +269,7 @@ int af_alg_accept(struct sock *sk, struct socket *newsock)
const struct af_alg_type *type;
struct sock *sk2;
int err;
+ bool nokey;
lock_sock(sk);
type = ask->type;
@@ -285,12 +288,17 @@ int af_alg_accept(struct sock *sk, struct socket *newsock)
security_sk_clone(sk, sk2);
err = type->accept(ask->private, sk2);
+
+ nokey = err == -ENOKEY;
+ if (nokey && type->accept_nokey)
+ err = type->accept_nokey(ask->private, sk2);
+
if (err)
goto unlock;
sk2->sk_family = PF_ALG;
- if (!ask->refcnt++)
+ if (nokey || !ask->refcnt++)
sock_hold(sk);
alg_sk(sk2)->parent = sk;
alg_sk(sk2)->type = type;
@@ -298,6 +306,9 @@ int af_alg_accept(struct sock *sk, struct socket *newsock)
newsock->ops = type->ops;
newsock->state = SS_CONNECTED;
+ if (nokey)
+ newsock->ops = type->ops_nokey;
+
err = 0;
unlock:
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
index 589716f..df82844 100644
--- a/include/crypto/if_alg.h
+++ b/include/crypto/if_alg.h
@@ -52,9 +52,11 @@ struct af_alg_type {
void (*release)(void *private);
int (*setkey)(void *private, const u8 *key, unsigned int keylen);
int (*accept)(void *private, struct sock *sk);
+ int (*accept_nokey)(void *private, struct sock *sk);
int (*setauthsize)(void *private, unsigned int authsize);
struct proto_ops *ops;
+ struct proto_ops *ops_nokey;
struct module *owner;
char name[14];
};
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 152/268] crypto: algif_skcipher - Add nokey compatibility path
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (150 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 151/268] crypto: af_alg - Add nokey compatibility path Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 153/268] crypto: hash - Add crypto_ahash_has_setkey Kamal Mostafa
` (115 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit a0fa2d037129a9849918a92d91b79ed6c7bd2818 upstream.
This patch adds a compatibility path to support old applications
that do acept(2) before setkey.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/algif_skcipher.c | 149 ++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 144 insertions(+), 5 deletions(-)
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index 1e7e09b..cdfb1bf 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -754,6 +754,99 @@ static struct proto_ops algif_skcipher_ops = {
.poll = skcipher_poll,
};
+static int skcipher_check_key(struct socket *sock)
+{
+ int err;
+ struct sock *psk;
+ struct alg_sock *pask;
+ struct skcipher_tfm *tfm;
+ struct sock *sk = sock->sk;
+ struct alg_sock *ask = alg_sk(sk);
+
+ if (ask->refcnt)
+ return 0;
+
+ psk = ask->parent;
+ pask = alg_sk(ask->parent);
+ tfm = pask->private;
+
+ err = -ENOKEY;
+ lock_sock(psk);
+ if (!tfm->has_key)
+ goto unlock;
+
+ if (!pask->refcnt++)
+ sock_hold(psk);
+
+ ask->refcnt = 1;
+ sock_put(psk);
+
+ err = 0;
+
+unlock:
+ release_sock(psk);
+
+ return err;
+}
+
+static int skcipher_sendmsg_nokey(struct socket *sock, struct msghdr *msg,
+ size_t size)
+{
+ int err;
+
+ err = skcipher_check_key(sock);
+ if (err)
+ return err;
+
+ return skcipher_sendmsg(sock, msg, size);
+}
+
+static ssize_t skcipher_sendpage_nokey(struct socket *sock, struct page *page,
+ int offset, size_t size, int flags)
+{
+ int err;
+
+ err = skcipher_check_key(sock);
+ if (err)
+ return err;
+
+ return skcipher_sendpage(sock, page, offset, size, flags);
+}
+
+static int skcipher_recvmsg_nokey(struct socket *sock, struct msghdr *msg,
+ size_t ignored, int flags)
+{
+ int err;
+
+ err = skcipher_check_key(sock);
+ if (err)
+ return err;
+
+ return skcipher_recvmsg(sock, msg, ignored, flags);
+}
+
+static struct proto_ops algif_skcipher_ops_nokey = {
+ .family = PF_ALG,
+
+ .connect = sock_no_connect,
+ .socketpair = sock_no_socketpair,
+ .getname = sock_no_getname,
+ .ioctl = sock_no_ioctl,
+ .listen = sock_no_listen,
+ .shutdown = sock_no_shutdown,
+ .getsockopt = sock_no_getsockopt,
+ .mmap = sock_no_mmap,
+ .bind = sock_no_bind,
+ .accept = sock_no_accept,
+ .setsockopt = sock_no_setsockopt,
+
+ .release = af_alg_release,
+ .sendmsg = skcipher_sendmsg_nokey,
+ .sendpage = skcipher_sendpage_nokey,
+ .recvmsg = skcipher_recvmsg_nokey,
+ .poll = skcipher_poll,
+};
+
static void *skcipher_bind(const char *name, u32 type, u32 mask)
{
struct skcipher_tfm *tfm;
@@ -803,7 +896,7 @@ static void skcipher_wait(struct sock *sk)
msleep(100);
}
-static void skcipher_sock_destruct(struct sock *sk)
+static void skcipher_sock_destruct_common(struct sock *sk)
{
struct alg_sock *ask = alg_sk(sk);
struct skcipher_ctx *ctx = ask->private;
@@ -815,10 +908,33 @@ static void skcipher_sock_destruct(struct sock *sk)
skcipher_free_sgl(sk);
sock_kzfree_s(sk, ctx->iv, crypto_ablkcipher_ivsize(tfm));
sock_kfree_s(sk, ctx, ctx->len);
+}
+
+static void skcipher_sock_destruct(struct sock *sk)
+{
+ skcipher_sock_destruct_common(sk);
af_alg_release_parent(sk);
}
-static int skcipher_accept_parent(void *private, struct sock *sk)
+static void skcipher_release_parent_nokey(struct sock *sk)
+{
+ struct alg_sock *ask = alg_sk(sk);
+
+ if (!ask->refcnt) {
+ sock_put(ask->parent);
+ return;
+ }
+
+ af_alg_release_parent(sk);
+}
+
+static void skcipher_sock_destruct_nokey(struct sock *sk)
+{
+ skcipher_sock_destruct_common(sk);
+ skcipher_release_parent_nokey(sk);
+}
+
+static int skcipher_accept_parent_common(void *private, struct sock *sk)
{
struct skcipher_ctx *ctx;
struct alg_sock *ask = alg_sk(sk);
@@ -826,9 +942,6 @@ static int skcipher_accept_parent(void *private, struct sock *sk)
struct crypto_ablkcipher *skcipher = tfm->skcipher;
unsigned int len = sizeof(*ctx) + crypto_ablkcipher_reqsize(skcipher);
- if (!tfm->has_key)
- return -ENOKEY;
-
ctx = sock_kmalloc(sk, len, GFP_KERNEL);
if (!ctx)
return -ENOMEM;
@@ -862,12 +975,38 @@ static int skcipher_accept_parent(void *private, struct sock *sk)
return 0;
}
+static int skcipher_accept_parent(void *private, struct sock *sk)
+{
+ struct skcipher_tfm *tfm = private;
+
+ if (!tfm->has_key)
+ return -ENOKEY;
+
+ return skcipher_accept_parent_common(private, sk);
+}
+
+static int skcipher_accept_parent_nokey(void *private, struct sock *sk)
+{
+ int err;
+
+ err = skcipher_accept_parent_common(private, sk);
+ if (err)
+ goto out;
+
+ sk->sk_destruct = skcipher_sock_destruct_nokey;
+
+out:
+ return err;
+}
+
static const struct af_alg_type algif_type_skcipher = {
.bind = skcipher_bind,
.release = skcipher_release,
.setkey = skcipher_setkey,
.accept = skcipher_accept_parent,
+ .accept_nokey = skcipher_accept_parent_nokey,
.ops = &algif_skcipher_ops,
+ .ops_nokey = &algif_skcipher_ops_nokey,
.name = "skcipher",
.owner = THIS_MODULE
};
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 153/268] crypto: hash - Add crypto_ahash_has_setkey
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (151 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 152/268] crypto: algif_skcipher " Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 154/268] crypto: algif_hash - Require setkey before accept(2) Kamal Mostafa
` (114 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit a5596d6332787fd383b3b5427b41f94254430827 upstream.
This patch adds a way for ahash users to determine whether a key
is required by a crypto_ahash transform.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/ahash.c | 5 ++++-
crypto/shash.c | 4 +++-
include/crypto/hash.h | 6 ++++++
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/crypto/ahash.c b/crypto/ahash.c
index 9c1dc8d..d19b523 100644
--- a/crypto/ahash.c
+++ b/crypto/ahash.c
@@ -451,6 +451,7 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm)
struct ahash_alg *alg = crypto_ahash_alg(hash);
hash->setkey = ahash_nosetkey;
+ hash->has_setkey = false;
hash->export = ahash_no_export;
hash->import = ahash_no_import;
@@ -463,8 +464,10 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm)
hash->finup = alg->finup ?: ahash_def_finup;
hash->digest = alg->digest;
- if (alg->setkey)
+ if (alg->setkey) {
hash->setkey = alg->setkey;
+ hash->has_setkey = true;
+ }
if (alg->export)
hash->export = alg->export;
if (alg->import)
diff --git a/crypto/shash.c b/crypto/shash.c
index ecb1e3d..88a27de 100644
--- a/crypto/shash.c
+++ b/crypto/shash.c
@@ -355,8 +355,10 @@ int crypto_init_shash_ops_async(struct crypto_tfm *tfm)
crt->finup = shash_async_finup;
crt->digest = shash_async_digest;
- if (alg->setkey)
+ if (alg->setkey) {
crt->setkey = shash_async_setkey;
+ crt->has_setkey = true;
+ }
if (alg->export)
crt->export = shash_async_export;
if (alg->import)
diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index 57c8a6e..07c3a93 100644
--- a/include/crypto/hash.h
+++ b/include/crypto/hash.h
@@ -199,6 +199,7 @@ struct crypto_ahash {
unsigned int keylen);
unsigned int reqsize;
+ bool has_setkey;
struct crypto_tfm base;
};
@@ -356,6 +357,11 @@ static inline void *ahash_request_ctx(struct ahash_request *req)
int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen);
+static inline bool crypto_ahash_has_setkey(struct crypto_ahash *tfm)
+{
+ return tfm->has_setkey;
+}
+
/**
* crypto_ahash_finup() - update and finalize message digest
* @req: reference to the ahash_request handle that holds all information
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 154/268] crypto: algif_hash - Require setkey before accept(2)
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (152 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 153/268] crypto: hash - Add crypto_ahash_has_setkey Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 155/268] crypto: af_alg - Allow af_af_alg_release_parent to be called on nokey path Kamal Mostafa
` (113 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit 6de62f15b581f920ade22d758f4c338311c2f0d4 upstream.
Hash implementations that require a key may crash if you use
them without setting a key. This patch adds the necessary checks
so that if you do attempt to use them without a key that we return
-ENOKEY instead of proceeding.
This patch also adds a compatibility path to support old applications
that do acept(2) before setkey.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/algif_hash.c | 201 +++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 193 insertions(+), 8 deletions(-)
diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c
index b4c24fe..46637be 100644
--- a/crypto/algif_hash.c
+++ b/crypto/algif_hash.c
@@ -34,6 +34,11 @@ struct hash_ctx {
struct ahash_request req;
};
+struct algif_hash_tfm {
+ struct crypto_ahash *hash;
+ bool has_key;
+};
+
static int hash_sendmsg(struct socket *sock, struct msghdr *msg,
size_t ignored)
{
@@ -235,22 +240,151 @@ static struct proto_ops algif_hash_ops = {
.accept = hash_accept,
};
+static int hash_check_key(struct socket *sock)
+{
+ int err;
+ struct sock *psk;
+ struct alg_sock *pask;
+ struct algif_hash_tfm *tfm;
+ struct sock *sk = sock->sk;
+ struct alg_sock *ask = alg_sk(sk);
+
+ if (ask->refcnt)
+ return 0;
+
+ psk = ask->parent;
+ pask = alg_sk(ask->parent);
+ tfm = pask->private;
+
+ err = -ENOKEY;
+ lock_sock(psk);
+ if (!tfm->has_key)
+ goto unlock;
+
+ if (!pask->refcnt++)
+ sock_hold(psk);
+
+ ask->refcnt = 1;
+ sock_put(psk);
+
+ err = 0;
+
+unlock:
+ release_sock(psk);
+
+ return err;
+}
+
+static int hash_sendmsg_nokey(struct socket *sock, struct msghdr *msg,
+ size_t size)
+{
+ int err;
+
+ err = hash_check_key(sock);
+ if (err)
+ return err;
+
+ return hash_sendmsg(sock, msg, size);
+}
+
+static ssize_t hash_sendpage_nokey(struct socket *sock, struct page *page,
+ int offset, size_t size, int flags)
+{
+ int err;
+
+ err = hash_check_key(sock);
+ if (err)
+ return err;
+
+ return hash_sendpage(sock, page, offset, size, flags);
+}
+
+static int hash_recvmsg_nokey(struct socket *sock, struct msghdr *msg,
+ size_t ignored, int flags)
+{
+ int err;
+
+ err = hash_check_key(sock);
+ if (err)
+ return err;
+
+ return hash_recvmsg(sock, msg, ignored, flags);
+}
+
+static int hash_accept_nokey(struct socket *sock, struct socket *newsock,
+ int flags)
+{
+ int err;
+
+ err = hash_check_key(sock);
+ if (err)
+ return err;
+
+ return hash_accept(sock, newsock, flags);
+}
+
+static struct proto_ops algif_hash_ops_nokey = {
+ .family = PF_ALG,
+
+ .connect = sock_no_connect,
+ .socketpair = sock_no_socketpair,
+ .getname = sock_no_getname,
+ .ioctl = sock_no_ioctl,
+ .listen = sock_no_listen,
+ .shutdown = sock_no_shutdown,
+ .getsockopt = sock_no_getsockopt,
+ .mmap = sock_no_mmap,
+ .bind = sock_no_bind,
+ .setsockopt = sock_no_setsockopt,
+ .poll = sock_no_poll,
+
+ .release = af_alg_release,
+ .sendmsg = hash_sendmsg_nokey,
+ .sendpage = hash_sendpage_nokey,
+ .recvmsg = hash_recvmsg_nokey,
+ .accept = hash_accept_nokey,
+};
+
static void *hash_bind(const char *name, u32 type, u32 mask)
{
- return crypto_alloc_ahash(name, type, mask);
+ struct algif_hash_tfm *tfm;
+ struct crypto_ahash *hash;
+
+ tfm = kzalloc(sizeof(*tfm), GFP_KERNEL);
+ if (!tfm)
+ return ERR_PTR(-ENOMEM);
+
+ hash = crypto_alloc_ahash(name, type, mask);
+ if (IS_ERR(hash)) {
+ kfree(tfm);
+ return ERR_CAST(hash);
+ }
+
+ tfm->hash = hash;
+
+ return tfm;
}
static void hash_release(void *private)
{
- crypto_free_ahash(private);
+ struct algif_hash_tfm *tfm = private;
+
+ crypto_free_ahash(tfm->hash);
+ kfree(tfm);
}
static int hash_setkey(void *private, const u8 *key, unsigned int keylen)
{
- return crypto_ahash_setkey(private, key, keylen);
+ struct algif_hash_tfm *tfm = private;
+ int err;
+
+ err = crypto_ahash_setkey(tfm->hash, key, keylen);
+ tfm->has_key = !err;
+
+ return err;
}
-static void hash_sock_destruct(struct sock *sk)
+static void hash_sock_destruct_common(struct sock *sk)
{
struct alg_sock *ask = alg_sk(sk);
struct hash_ctx *ctx = ask->private;
@@ -258,15 +392,40 @@ static void hash_sock_destruct(struct sock *sk)
sock_kzfree_s(sk, ctx->result,
crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req)));
sock_kfree_s(sk, ctx, ctx->len);
+}
+
+static void hash_sock_destruct(struct sock *sk)
+{
+ hash_sock_destruct_common(sk);
af_alg_release_parent(sk);
}
-static int hash_accept_parent(void *private, struct sock *sk)
+static void hash_release_parent_nokey(struct sock *sk)
+{
+ struct alg_sock *ask = alg_sk(sk);
+
+ if (!ask->refcnt) {
+ sock_put(ask->parent);
+ return;
+ }
+
+ af_alg_release_parent(sk);
+}
+
+static void hash_sock_destruct_nokey(struct sock *sk)
+{
+ hash_sock_destruct_common(sk);
+ hash_release_parent_nokey(sk);
+}
+
+static int hash_accept_parent_common(void *private, struct sock *sk)
{
struct hash_ctx *ctx;
struct alg_sock *ask = alg_sk(sk);
- unsigned len = sizeof(*ctx) + crypto_ahash_reqsize(private);
- unsigned ds = crypto_ahash_digestsize(private);
+ struct algif_hash_tfm *tfm = private;
+ struct crypto_ahash *hash = tfm->hash;
+ unsigned len = sizeof(*ctx) + crypto_ahash_reqsize(hash);
+ unsigned ds = crypto_ahash_digestsize(hash);
ctx = sock_kmalloc(sk, len, GFP_KERNEL);
if (!ctx)
@@ -286,7 +445,7 @@ static int hash_accept_parent(void *private, struct sock *sk)
ask->private = ctx;
- ahash_request_set_tfm(&ctx->req, private);
+ ahash_request_set_tfm(&ctx->req, hash);
ahash_request_set_callback(&ctx->req, CRYPTO_TFM_REQ_MAY_BACKLOG,
af_alg_complete, &ctx->completion);
@@ -295,12 +454,38 @@ static int hash_accept_parent(void *private, struct sock *sk)
return 0;
}
+static int hash_accept_parent(void *private, struct sock *sk)
+{
+ struct algif_hash_tfm *tfm = private;
+
+ if (!tfm->has_key && crypto_ahash_has_setkey(tfm->hash))
+ return -ENOKEY;
+
+ return hash_accept_parent_common(private, sk);
+}
+
+static int hash_accept_parent_nokey(void *private, struct sock *sk)
+{
+ int err;
+
+ err = hash_accept_parent_common(private, sk);
+ if (err)
+ goto out;
+
+ sk->sk_destruct = hash_sock_destruct_nokey;
+
+out:
+ return err;
+}
+
static const struct af_alg_type algif_type_hash = {
.bind = hash_bind,
.release = hash_release,
.setkey = hash_setkey,
.accept = hash_accept_parent,
+ .accept_nokey = hash_accept_parent_nokey,
.ops = &algif_hash_ops,
+ .ops_nokey = &algif_hash_ops_nokey,
.name = "hash",
.owner = THIS_MODULE
};
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 155/268] crypto: af_alg - Allow af_af_alg_release_parent to be called on nokey path
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (153 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 154/268] crypto: algif_hash - Require setkey before accept(2) Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 156/268] crypto: algif_hash - Remove custom release parent function Kamal Mostafa
` (112 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit 6a935170a980024dd29199e9dbb5c4da4767a1b9 upstream.
This patch allows af_alg_release_parent to be called even for
nokey sockets.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/af_alg.c | 9 ++++++++-
include/crypto/if_alg.h | 1 +
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 6566d2e..e7cb836 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -133,6 +133,12 @@ void af_alg_release_parent(struct sock *sk)
bool last;
sk = ask->parent;
+
+ if (ask->nokey_refcnt && !ask->refcnt) {
+ sock_put(sk);
+ return;
+ }
+
ask = alg_sk(sk);
lock_sock(sk);
@@ -268,8 +274,8 @@ int af_alg_accept(struct sock *sk, struct socket *newsock)
struct alg_sock *ask = alg_sk(sk);
const struct af_alg_type *type;
struct sock *sk2;
+ unsigned int nokey;
int err;
- bool nokey;
lock_sock(sk);
type = ask->type;
@@ -302,6 +308,7 @@ int af_alg_accept(struct sock *sk, struct socket *newsock)
sock_hold(sk);
alg_sk(sk2)->parent = sk;
alg_sk(sk2)->type = type;
+ alg_sk(sk2)->nokey_refcnt = nokey;
newsock->ops = type->ops;
newsock->state = SS_CONNECTED;
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
index df82844..a2bfd78 100644
--- a/include/crypto/if_alg.h
+++ b/include/crypto/if_alg.h
@@ -31,6 +31,7 @@ struct alg_sock {
struct sock *parent;
unsigned int refcnt;
+ unsigned int nokey_refcnt;
const struct af_alg_type *type;
void *private;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 156/268] crypto: algif_hash - Remove custom release parent function
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (154 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 155/268] crypto: af_alg - Allow af_af_alg_release_parent to be called on nokey path Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 157/268] crypto: algif_skcipher " Kamal Mostafa
` (111 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit f1d84af1835846a5a2b827382c5848faf2bb0e75 upstream.
This patch removes the custom release parent function as the
generic af_alg_release_parent now works for nokey sockets too.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/algif_hash.c | 43 +++----------------------------------------
1 file changed, 3 insertions(+), 40 deletions(-)
diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c
index 46637be..3653ab6 100644
--- a/crypto/algif_hash.c
+++ b/crypto/algif_hash.c
@@ -384,7 +384,7 @@ static int hash_setkey(void *private, const u8 *key, unsigned int keylen)
return err;
}
-static void hash_sock_destruct_common(struct sock *sk)
+static void hash_sock_destruct(struct sock *sk)
{
struct alg_sock *ask = alg_sk(sk);
struct hash_ctx *ctx = ask->private;
@@ -392,33 +392,10 @@ static void hash_sock_destruct_common(struct sock *sk)
sock_kzfree_s(sk, ctx->result,
crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req)));
sock_kfree_s(sk, ctx, ctx->len);
-}
-
-static void hash_sock_destruct(struct sock *sk)
-{
- hash_sock_destruct_common(sk);
- af_alg_release_parent(sk);
-}
-
-static void hash_release_parent_nokey(struct sock *sk)
-{
- struct alg_sock *ask = alg_sk(sk);
-
- if (!ask->refcnt) {
- sock_put(ask->parent);
- return;
- }
-
af_alg_release_parent(sk);
}
-static void hash_sock_destruct_nokey(struct sock *sk)
-{
- hash_sock_destruct_common(sk);
- hash_release_parent_nokey(sk);
-}
-
-static int hash_accept_parent_common(void *private, struct sock *sk)
+static int hash_accept_parent_nokey(void *private, struct sock *sk)
{
struct hash_ctx *ctx;
struct alg_sock *ask = alg_sk(sk);
@@ -461,21 +438,7 @@ static int hash_accept_parent(void *private, struct sock *sk)
if (!tfm->has_key && crypto_ahash_has_setkey(tfm->hash))
return -ENOKEY;
- return hash_accept_parent_common(private, sk);
-}
-
-static int hash_accept_parent_nokey(void *private, struct sock *sk)
-{
- int err;
-
- err = hash_accept_parent_common(private, sk);
- if (err)
- goto out;
-
- sk->sk_destruct = hash_sock_destruct_nokey;
-
-out:
- return err;
+ return hash_accept_parent_nokey(private, sk);
}
static const struct af_alg_type algif_type_hash = {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 157/268] crypto: algif_skcipher - Remove custom release parent function
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (155 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 156/268] crypto: algif_hash - Remove custom release parent function Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 158/268] crypto: af_alg - Forbid bind(2) when nokey child sockets are present Kamal Mostafa
` (110 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit d7b65aee1e7b4c87922b0232eaba56a8a143a4a0 upstream.
This patch removes the custom release parent function as the
generic af_alg_release_parent now works for nokey sockets too.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/algif_skcipher.c | 43 +++----------------------------------------
1 file changed, 3 insertions(+), 40 deletions(-)
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index cdfb1bf..8d4bf6e 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -896,7 +896,7 @@ static void skcipher_wait(struct sock *sk)
msleep(100);
}
-static void skcipher_sock_destruct_common(struct sock *sk)
+static void skcipher_sock_destruct(struct sock *sk)
{
struct alg_sock *ask = alg_sk(sk);
struct skcipher_ctx *ctx = ask->private;
@@ -908,33 +908,10 @@ static void skcipher_sock_destruct_common(struct sock *sk)
skcipher_free_sgl(sk);
sock_kzfree_s(sk, ctx->iv, crypto_ablkcipher_ivsize(tfm));
sock_kfree_s(sk, ctx, ctx->len);
-}
-
-static void skcipher_sock_destruct(struct sock *sk)
-{
- skcipher_sock_destruct_common(sk);
- af_alg_release_parent(sk);
-}
-
-static void skcipher_release_parent_nokey(struct sock *sk)
-{
- struct alg_sock *ask = alg_sk(sk);
-
- if (!ask->refcnt) {
- sock_put(ask->parent);
- return;
- }
-
af_alg_release_parent(sk);
}
-static void skcipher_sock_destruct_nokey(struct sock *sk)
-{
- skcipher_sock_destruct_common(sk);
- skcipher_release_parent_nokey(sk);
-}
-
-static int skcipher_accept_parent_common(void *private, struct sock *sk)
+static int skcipher_accept_parent_nokey(void *private, struct sock *sk)
{
struct skcipher_ctx *ctx;
struct alg_sock *ask = alg_sk(sk);
@@ -982,21 +959,7 @@ static int skcipher_accept_parent(void *private, struct sock *sk)
if (!tfm->has_key)
return -ENOKEY;
- return skcipher_accept_parent_common(private, sk);
-}
-
-static int skcipher_accept_parent_nokey(void *private, struct sock *sk)
-{
- int err;
-
- err = skcipher_accept_parent_common(private, sk);
- if (err)
- goto out;
-
- sk->sk_destruct = skcipher_sock_destruct_nokey;
-
-out:
- return err;
+ return skcipher_accept_parent_nokey(private, sk);
}
static const struct af_alg_type algif_type_skcipher = {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 158/268] crypto: af_alg - Forbid bind(2) when nokey child sockets are present
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (156 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 157/268] crypto: algif_skcipher " Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 159/268] lib: sw842: select crc32 Kamal Mostafa
` (109 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit a6a48c565f6f112c6983e2a02b1602189ed6e26e upstream.
This patch forbids the calling of bind(2) when there are child
sockets created by accept(2) in existence, even if they are created
on the nokey path.
This is needed as those child sockets have references to the tfm
object which bind(2) will destroy.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/af_alg.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index e7cb836..f5e18c2 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -130,19 +130,16 @@ EXPORT_SYMBOL_GPL(af_alg_release);
void af_alg_release_parent(struct sock *sk)
{
struct alg_sock *ask = alg_sk(sk);
- bool last;
+ unsigned int nokey = ask->nokey_refcnt;
+ bool last = nokey && !ask->refcnt;
sk = ask->parent;
-
- if (ask->nokey_refcnt && !ask->refcnt) {
- sock_put(sk);
- return;
- }
-
ask = alg_sk(sk);
lock_sock(sk);
- last = !--ask->refcnt;
+ ask->nokey_refcnt -= nokey;
+ if (!last)
+ last = !--ask->refcnt;
release_sock(sk);
if (last)
@@ -188,7 +185,7 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
err = -EBUSY;
lock_sock(sk);
- if (ask->refcnt)
+ if (ask->refcnt | ask->nokey_refcnt)
goto unlock;
swap(ask->type, type);
@@ -306,6 +303,7 @@ int af_alg_accept(struct sock *sk, struct socket *newsock)
if (nokey || !ask->refcnt++)
sock_hold(sk);
+ ask->nokey_refcnt += nokey;
alg_sk(sk2)->parent = sk;
alg_sk(sk2)->type = type;
alg_sk(sk2)->nokey_refcnt = nokey;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 159/268] lib: sw842: select crc32
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (157 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 158/268] crypto: af_alg - Forbid bind(2) when nokey child sockets are present Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 160/268] crypto: algif_hash - Fix race condition in hash_check_key Kamal Mostafa
` (108 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Arnd Bergmann, Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Arnd Bergmann <arnd@arndb.de>
commit 5b57167749274961baf15ed1f05a4996b3ab0487 upstream.
The sw842 library code was merged in linux-4.1 and causes a very rare randconfig
failure when CONFIG_CRC32 is not set:
lib/built-in.o: In function `sw842_compress':
oid_registry.c:(.text+0x12ddc): undefined reference to `crc32_be'
lib/built-in.o: In function `sw842_decompress':
oid_registry.c:(.text+0x137e4): undefined reference to `crc32_be'
This adds an explict 'select CRC32' statement, similar to what the other users
of the crc32 code have. In practice, CRC32 is always enabled anyway because
over 100 other symbols select it.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 2da572c959dd ("lib: add software 842 compression/decompression")
Acked-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
lib/Kconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/Kconfig b/lib/Kconfig
index 3a2ef67..7ceb4ca 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -213,9 +213,11 @@ config RANDOM32_SELFTEST
# compression support is select'ed if needed
#
config 842_COMPRESS
+ select CRC32
tristate
config 842_DECOMPRESS
+ select CRC32
tristate
config ZLIB_INFLATE
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 160/268] crypto: algif_hash - Fix race condition in hash_check_key
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (158 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 159/268] lib: sw842: select crc32 Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 161/268] crypto: algif_skcipher - Fix race condition in skcipher_check_key Kamal Mostafa
` (107 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit ad46d7e33219218605ea619e32553daf4f346b9f upstream.
We need to lock the child socket in hash_check_key as otherwise
two simultaneous calls can cause the parent socket to be freed.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/algif_hash.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c
index 3653ab6..608a756 100644
--- a/crypto/algif_hash.c
+++ b/crypto/algif_hash.c
@@ -242,22 +242,23 @@ static struct proto_ops algif_hash_ops = {
static int hash_check_key(struct socket *sock)
{
- int err;
+ int err = 0;
struct sock *psk;
struct alg_sock *pask;
struct algif_hash_tfm *tfm;
struct sock *sk = sock->sk;
struct alg_sock *ask = alg_sk(sk);
+ lock_sock(sk);
if (ask->refcnt)
- return 0;
+ goto unlock_child;
psk = ask->parent;
pask = alg_sk(ask->parent);
tfm = pask->private;
err = -ENOKEY;
- lock_sock(psk);
+ lock_sock_nested(psk, SINGLE_DEPTH_NESTING);
if (!tfm->has_key)
goto unlock;
@@ -271,6 +272,8 @@ static int hash_check_key(struct socket *sock)
unlock:
release_sock(psk);
+unlock_child:
+ release_sock(sk);
return err;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 161/268] crypto: algif_skcipher - Fix race condition in skcipher_check_key
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (159 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 160/268] crypto: algif_hash - Fix race condition in hash_check_key Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 162/268] ALSA: hrtimer: Fix stall by hrtimer_cancel() Kamal Mostafa
` (106 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit 1822793a523e5d5730b19cc21160ff1717421bc8 upstream.
We need to lock the child socket in skcipher_check_key as otherwise
two simultaneous calls can cause the parent socket to be freed.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/algif_skcipher.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index 8d4bf6e..74ffe56 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -756,22 +756,23 @@ static struct proto_ops algif_skcipher_ops = {
static int skcipher_check_key(struct socket *sock)
{
- int err;
+ int err = 0;
struct sock *psk;
struct alg_sock *pask;
struct skcipher_tfm *tfm;
struct sock *sk = sock->sk;
struct alg_sock *ask = alg_sk(sk);
+ lock_sock(sk);
if (ask->refcnt)
- return 0;
+ goto unlock_child;
psk = ask->parent;
pask = alg_sk(ask->parent);
tfm = pask->private;
err = -ENOKEY;
- lock_sock(psk);
+ lock_sock_nested(psk, SINGLE_DEPTH_NESTING);
if (!tfm->has_key)
goto unlock;
@@ -785,6 +786,8 @@ static int skcipher_check_key(struct socket *sock)
unlock:
release_sock(psk);
+unlock_child:
+ release_sock(sk);
return err;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 162/268] ALSA: hrtimer: Fix stall by hrtimer_cancel()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (160 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 161/268] crypto: algif_skcipher - Fix race condition in skcipher_check_key Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 163/268] dmaengine: at_xdmac: fix resume for cyclic transfers Kamal Mostafa
` (105 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Takashi Iwai <tiwai@suse.de>
commit 2ba1fe7a06d3624f9a7586d672b55f08f7c670f3 upstream.
hrtimer_cancel() waits for the completion from the callback, thus it
must not be called inside the callback itself. This was already a
problem in the past with ALSA hrtimer driver, and the early commit
[fcfdebe70759: ALSA: hrtimer - Fix lock-up] tried to address it.
However, the previous fix is still insufficient: it may still cause a
lockup when the ALSA timer instance reprograms itself in its callback.
Then it invokes the start function even in snd_timer_interrupt() that
is called in hrtimer callback itself, results in a CPU stall. This is
no hypothetical problem but actually triggered by syzkaller fuzzer.
This patch tries to fix the issue again. Now we call
hrtimer_try_to_cancel() at both start and stop functions so that it
won't fall into a deadlock, yet giving some chance to cancel the queue
if the functions have been called outside the callback. The proper
hrtimer_cancel() is called in anyway at closing, so this should be
enough.
Reported-and-tested-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/core/hrtimer.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/core/hrtimer.c b/sound/core/hrtimer.c
index f845ecf..656d9a9 100644
--- a/sound/core/hrtimer.c
+++ b/sound/core/hrtimer.c
@@ -90,7 +90,7 @@ static int snd_hrtimer_start(struct snd_timer *t)
struct snd_hrtimer *stime = t->private_data;
atomic_set(&stime->running, 0);
- hrtimer_cancel(&stime->hrt);
+ hrtimer_try_to_cancel(&stime->hrt);
hrtimer_start(&stime->hrt, ns_to_ktime(t->sticks * resolution),
HRTIMER_MODE_REL);
atomic_set(&stime->running, 1);
@@ -101,6 +101,7 @@ static int snd_hrtimer_stop(struct snd_timer *t)
{
struct snd_hrtimer *stime = t->private_data;
atomic_set(&stime->running, 0);
+ hrtimer_try_to_cancel(&stime->hrt);
return 0;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 163/268] dmaengine: at_xdmac: fix resume for cyclic transfers
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (161 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 162/268] ALSA: hrtimer: Fix stall by hrtimer_cancel() Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 164/268] ALSA: pcm: Fix snd_pcm_hw_params struct copy in compat mode Kamal Mostafa
` (104 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Songjun Wu, Ludovic Desroches, Vinod Koul, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Songjun Wu <songjun.wu@atmel.com>
commit 611dcadb01c89d1d3521450c05a4ded332e5a32d upstream.
When having cyclic transfers, the channel was paused when performing
suspend but was not correctly resumed.
Signed-off-by: Songjun Wu <songjun.wu@atmel.com>
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel
eXtended DMA Controller driver")
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/dma/at_xdmac.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
index c01cdec..756210a 100644
--- a/drivers/dma/at_xdmac.c
+++ b/drivers/dma/at_xdmac.c
@@ -1524,6 +1524,7 @@ static int at_xdmac_device_terminate_all(struct dma_chan *chan)
list_for_each_entry_safe(desc, _desc, &atchan->xfers_list, xfer_node)
at_xdmac_remove_xfer(atchan, desc);
+ clear_bit(AT_XDMAC_CHAN_IS_PAUSED, &atchan->status);
clear_bit(AT_XDMAC_CHAN_IS_CYCLIC, &atchan->status);
spin_unlock_irqrestore(&atchan->lock, flags);
@@ -1656,6 +1657,8 @@ static int atmel_xdmac_resume(struct device *dev)
atchan = to_at_xdmac_chan(chan);
at_xdmac_chan_write(atchan, AT_XDMAC_CC, atchan->save_cc);
if (at_xdmac_chan_is_cyclic(atchan)) {
+ if (at_xdmac_chan_is_paused(atchan))
+ at_xdmac_device_resume(chan);
at_xdmac_chan_write(atchan, AT_XDMAC_CNDA, atchan->save_cnda);
at_xdmac_chan_write(atchan, AT_XDMAC_CNDC, atchan->save_cndc);
at_xdmac_chan_write(atchan, AT_XDMAC_CIE, atchan->save_cim);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 164/268] ALSA: pcm: Fix snd_pcm_hw_params struct copy in compat mode
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (162 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 163/268] dmaengine: at_xdmac: fix resume for cyclic transfers Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 165/268] ALSA: seq: Fix snd_seq_call_port_info_ioctl " Kamal Mostafa
` (103 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Nicolas Boichat, Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Nicolas Boichat <drinkcat@chromium.org>
commit 43c54b8c7cfe22f868a751ba8a59abf1724160b1 upstream.
This reverts one hunk of
commit ef44a1ec6eee ("ALSA: sound/core: use memdup_user()"), which
replaced a number of kmalloc followed by memcpy with memdup calls.
In this case, we are copying from a struct snd_pcm_hw_params32 to
a struct snd_pcm_hw_params, but the latter is 4 bytes longer than
the 32-bit version, so we need to separate kmalloc and copy calls.
This actually leads to an out-of-bounds memory access later on
in sound/soc/soc-pcm.c:soc_pcm_hw_params() (detected using KASan).
Fixes: ef44a1ec6eee ('ALSA: sound/core: use memdup_user()')
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/core/pcm_compat.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
index b48b434..9630e9f 100644
--- a/sound/core/pcm_compat.c
+++ b/sound/core/pcm_compat.c
@@ -255,10 +255,15 @@ static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream,
if (! (runtime = substream->runtime))
return -ENOTTY;
- /* only fifo_size is different, so just copy all */
- data = memdup_user(data32, sizeof(*data32));
- if (IS_ERR(data))
- return PTR_ERR(data);
+ data = kmalloc(sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ /* only fifo_size (RO from userspace) is different, so just copy all */
+ if (copy_from_user(data, data32, sizeof(*data32))) {
+ err = -EFAULT;
+ goto error;
+ }
if (refine)
err = snd_pcm_hw_refine(substream, data);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 165/268] ALSA: seq: Fix snd_seq_call_port_info_ioctl in compat mode
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (163 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 164/268] ALSA: pcm: Fix snd_pcm_hw_params struct copy in compat mode Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 166/268] ALSA: control: Avoid kernel warnings from tlv ioctl with numid 0 Kamal Mostafa
` (102 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Nicolas Boichat, Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Nicolas Boichat <drinkcat@chromium.org>
commit 9586495dc3011a80602329094e746dbce16cb1f1 upstream.
This reverts one hunk of
commit ef44a1ec6eee ("ALSA: sound/core: use memdup_user()"), which
replaced a number of kmalloc followed by memcpy with memdup calls.
In this case, we are copying from a struct snd_seq_port_info32 to a
struct snd_seq_port_info, but the latter is 4 bytes longer than the
32-bit version, so we need to separate kmalloc and copy calls.
Fixes: ef44a1ec6eee ('ALSA: sound/core: use memdup_user()')
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/core/seq/seq_compat.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/sound/core/seq/seq_compat.c b/sound/core/seq/seq_compat.c
index 81f7c10..6517590 100644
--- a/sound/core/seq/seq_compat.c
+++ b/sound/core/seq/seq_compat.c
@@ -49,11 +49,12 @@ static int snd_seq_call_port_info_ioctl(struct snd_seq_client *client, unsigned
struct snd_seq_port_info *data;
mm_segment_t fs;
- data = memdup_user(data32, sizeof(*data32));
- if (IS_ERR(data))
- return PTR_ERR(data);
+ data = kmalloc(sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
- if (get_user(data->flags, &data32->flags) ||
+ if (copy_from_user(data, data32, sizeof(*data32)) ||
+ get_user(data->flags, &data32->flags) ||
get_user(data->time_queue, &data32->time_queue))
goto error;
data->kernel = NULL;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 166/268] ALSA: control: Avoid kernel warnings from tlv ioctl with numid 0
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (164 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 165/268] ALSA: seq: Fix snd_seq_call_port_info_ioctl " Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 167/268] ARM: debug-ll: fix BCM63xx entry for multiplatform Kamal Mostafa
` (101 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Takashi Iwai <tiwai@suse.de>
commit c0bcdbdff3ff73a54161fca3cb8b6cdbd0bb8762 upstream.
When a TLV ioctl with numid zero is handled, the driver may spew a
kernel warning with a stack trace at each call. The check was
intended obviously only for a kernel driver, but not for a user
interaction. Let's fix it.
This was spotted by syzkaller fuzzer.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/core/control.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/core/control.c b/sound/core/control.c
index 196a6fe..a85d455 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1405,6 +1405,8 @@ static int snd_ctl_tlv_ioctl(struct snd_ctl_file *file,
return -EFAULT;
if (tlv.length < sizeof(unsigned int) * 2)
return -EINVAL;
+ if (!tlv.numid)
+ return -EINVAL;
down_read(&card->controls_rwsem);
kctl = snd_ctl_find_numid(card, tlv.numid);
if (kctl == NULL) {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 167/268] ARM: debug-ll: fix BCM63xx entry for multiplatform
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (165 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 166/268] ALSA: control: Avoid kernel warnings from tlv ioctl with numid 0 Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 168/268] xfs: log mount failures don't wait for buffers to be released Kamal Mostafa
` (100 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Arnd Bergmann, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Arnd Bergmann <arnd@arndb.de>
commit 6c54809977de3c9e2ef9e9934a2c6625f7e161e7 upstream.
During my randconfig build testing, I found that a kernel with
DEBUG_AT91_UART and ARCH_BCM_63XX fails to build:
arch/arm/include/debug/at91.S:18:0: error: "CONFIG_DEBUG_UART_VIRT" redefined [-Werror]
It turns out that the DEBUG_UART_BCM63XX option is enabled whenever
the ARCH_BCM_63XX is, and that breaks multiplatform kernels because
we then end up using the UART address from BCM63XX rather than the
one we actually configured (if any).
This changes the BCM63XX options to only have one Kconfig option,
and only enable that if the user explicitly turns it on.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: b51312bebfa4 ("ARM: BCM63XX: add low-level UART debug support")
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/Kconfig.debug | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index a2e16f9..55ef850 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -162,10 +162,9 @@ choice
mobile SoCs in the Kona family of chips (e.g. bcm28155,
bcm11351, etc...)
- config DEBUG_BCM63XX
+ config DEBUG_BCM63XX_UART
bool "Kernel low-level debugging on BCM63XX UART"
depends on ARCH_BCM_63XX
- select DEBUG_UART_BCM63XX
config DEBUG_BERLIN_UART
bool "Marvell Berlin SoC Debug UART"
@@ -1343,7 +1342,7 @@ config DEBUG_LL_INCLUDE
default "debug/vf.S" if DEBUG_VF_UART
default "debug/vt8500.S" if DEBUG_VT8500_UART0
default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1
- default "debug/bcm63xx.S" if DEBUG_UART_BCM63XX
+ default "debug/bcm63xx.S" if DEBUG_BCM63XX_UART
default "debug/digicolor.S" if DEBUG_DIGICOLOR_UA0
default "mach/debug-macro.S"
@@ -1359,10 +1358,6 @@ config DEBUG_UART_8250
ARCH_IOP33X || ARCH_IXP4XX || \
ARCH_LPC32XX || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC
-# Compatibility options for BCM63xx
-config DEBUG_UART_BCM63XX
- def_bool ARCH_BCM_63XX
-
config DEBUG_UART_PHYS
hex "Physical base address of debug UART"
default 0x00100a00 if DEBUG_NETX_UART
@@ -1457,7 +1452,7 @@ config DEBUG_UART_PHYS
default 0xfffb0000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1
default 0xfffb0800 if DEBUG_OMAP1UART2 || DEBUG_OMAP7XXUART2
default 0xfffb9800 if DEBUG_OMAP1UART3 || DEBUG_OMAP7XXUART3
- default 0xfffe8600 if DEBUG_UART_BCM63XX
+ default 0xfffe8600 if DEBUG_BCM63XX_UART
default 0xfffff700 if ARCH_IOP33X
depends on ARCH_EP93XX || \
DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
@@ -1469,7 +1464,7 @@ config DEBUG_UART_PHYS
DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF2 || \
DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \
DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \
- DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
+ DEBUG_BCM63XX_UART || DEBUG_ASM9260_UART || \
DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0
config DEBUG_UART_VIRT
@@ -1509,7 +1504,7 @@ config DEBUG_UART_VIRT
default 0xfb10c000 if DEBUG_REALVIEW_PB1176_PORT
default 0xfc40ab00 if DEBUG_BRCMSTB_UART
default 0xfc705000 if DEBUG_ZTE_ZX
- default 0xfcfe8600 if DEBUG_UART_BCM63XX
+ default 0xfcfe8600 if DEBUG_BCM63XX_UART
default 0xfd000000 if ARCH_SPEAR3XX || ARCH_SPEAR6XX
default 0xfd000000 if ARCH_SPEAR13XX
default 0xfd012000 if ARCH_MV78XX0
@@ -1560,7 +1555,7 @@ config DEBUG_UART_VIRT
DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \
DEBUG_NETX_UART || \
DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART || \
- DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
+ DEBUG_BCM63XX_UART || DEBUG_ASM9260_UART || \
DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0
config DEBUG_UART_8250_SHIFT
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 168/268] xfs: log mount failures don't wait for buffers to be released
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (166 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 167/268] ARM: debug-ll: fix BCM63xx entry for multiplatform Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 169/268] crypto: algif_skcipher - Load TX SG list after waiting Kamal Mostafa
` (99 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dave Chinner, Dave Chinner, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Dave Chinner <dchinner@redhat.com>
commit 85bec5460ad8e05e0a8d70fb0f6750eb719ad092 upstream.
Recently I've been seeing xfs/051 fail on 1k block size filesystems.
Trying to trace the events during the test lead to the problem going
away, indicating that it was a race condition that lead to this
ASSERT failure:
XFS: Assertion failed: atomic_read(&pag->pag_ref) == 0, file: fs/xfs/xfs_mount.c, line: 156
.....
[<ffffffff814e1257>] xfs_free_perag+0x87/0xb0
[<ffffffff814e21b9>] xfs_mountfs+0x4d9/0x900
[<ffffffff814e5dff>] xfs_fs_fill_super+0x3bf/0x4d0
[<ffffffff811d8800>] mount_bdev+0x180/0x1b0
[<ffffffff814e3ff5>] xfs_fs_mount+0x15/0x20
[<ffffffff811d90a8>] mount_fs+0x38/0x170
[<ffffffff811f4347>] vfs_kern_mount+0x67/0x120
[<ffffffff811f7018>] do_mount+0x218/0xd60
[<ffffffff811f7e5b>] SyS_mount+0x8b/0xd0
When I finally caught it with tracing enabled, I saw that AG 2 had
an elevated reference count and a buffer was responsible for it. I
tracked down the specific buffer, and found that it was missing the
final reference count release that would put it back on the LRU and
hence be found by xfs_wait_buftarg() calls in the log mount failure
handling.
The last four traces for the buffer before the assert were (trimmed
for relevance)
kworker/0:1-5259 xfs_buf_iodone: hold 2 lock 0 flags ASYNC
kworker/0:1-5259 xfs_buf_ioerror: hold 2 lock 0 error -5
mount-7163 xfs_buf_lock_done: hold 2 lock 0 flags ASYNC
mount-7163 xfs_buf_unlock: hold 2 lock 1 flags ASYNC
This is an async write that is completing, so there's nobody waiting
for it directly. Hence we call xfs_buf_relse() once all the
processing is complete. That does:
static inline void xfs_buf_relse(xfs_buf_t *bp)
{
xfs_buf_unlock(bp);
xfs_buf_rele(bp);
}
Now, it's clear that mount is waiting on the buffer lock, and that
it has been released by xfs_buf_relse() and gained by mount. This is
expected, because at this point the mount process is in
xfs_buf_delwri_submit() waiting for all the IO it submitted to
complete.
The mount process, however, is waiting on the lock for the buffer
because it is in xfs_buf_delwri_submit(). This waits for IO
completion, but it doesn't wait for the buffer reference owned by
the IO to go away. The mount process collects all the completions,
fails the log recovery, and the higher level code then calls
xfs_wait_buftarg() to free all the remaining buffers in the
filesystem.
The issue is that on unlocking the buffer, the scheduler has decided
that the mount process has higher priority than the the kworker
thread that is running the IO completion, and so immediately
switched contexts to the mount process from the semaphore unlock
code, hence preventing the kworker thread from finishing the IO
completion and releasing the IO reference to the buffer.
Hence by the time that xfs_wait_buftarg() is run, the buffer still
has an active reference and so isn't on the LRU list that the
function walks to free the remaining buffers. Hence we miss that
buffer and continue onwards to tear down the mount structures,
at which time we get find a stray reference count on the perag
structure. On a non-debug kernel, this will be ignored and the
structure torn down and freed. Hence when the kworker thread is then
rescheduled and the buffer released and freed, it will access a
freed perag structure.
The problem here is that when the log mount fails, we still need to
quiesce the log to ensure that the IO workqueues have returned to
idle before we run xfs_wait_buftarg(). By synchronising the
workqueues, we ensure that all IO completions are fully processed,
not just to the point where buffers have been unlocked. This ensures
we don't end up in the situation above.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/xfs/xfs_buf.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 98bf50c..7cc9cf4 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1529,6 +1529,16 @@ xfs_wait_buftarg(
LIST_HEAD(dispose);
int loop = 0;
+ /*
+ * We need to flush the buffer workqueue to ensure that all IO
+ * completion processing is 100% done. Just waiting on buffer locks is
+ * not sufficient for async IO as the reference count held over IO is
+ * not released until after the buffer lock is dropped. Hence we need to
+ * ensure here that all reference counts have been dropped before we
+ * start walking the LRU list.
+ */
+ drain_workqueue(btp->bt_mount->m_buf_workqueue);
+
/* loop until there is nothing left on the lru list. */
while (list_lru_count(&btp->bt_lru)) {
list_lru_walk(&btp->bt_lru, xfs_buftarg_wait_rele,
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 169/268] crypto: algif_skcipher - Load TX SG list after waiting
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (167 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 168/268] xfs: log mount failures don't wait for buffers to be released Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 170/268] crypto: crc32c - Fix crc32c soft dependency Kamal Mostafa
` (98 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit 4f0414e54e4d1893c6f08260693f8ef84c929293 upstream.
We need to load the TX SG list in sendmsg(2) after waiting for
incoming data, not before.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/algif_skcipher.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index 74ffe56..1a0fe4f 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -647,13 +647,6 @@ static int skcipher_recvmsg_sync(struct socket *sock, struct msghdr *msg,
lock_sock(sk);
while (msg_data_left(msg)) {
- sgl = list_first_entry(&ctx->tsgl,
- struct skcipher_sg_list, list);
- sg = sgl->sg;
-
- while (!sg->length)
- sg++;
-
if (!ctx->used) {
err = skcipher_wait_for_data(sk, flags);
if (err)
@@ -674,6 +667,13 @@ static int skcipher_recvmsg_sync(struct socket *sock, struct msghdr *msg,
if (!used)
goto free;
+ sgl = list_first_entry(&ctx->tsgl,
+ struct skcipher_sg_list, list);
+ sg = sgl->sg;
+
+ while (!sg->length)
+ sg++;
+
ablkcipher_request_set_crypt(&ctx->req, sg,
ctx->rsgl.sg, used,
ctx->iv);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 170/268] crypto: crc32c - Fix crc32c soft dependency
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (168 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 169/268] crypto: algif_skcipher - Load TX SG list after waiting Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 171/268] IB/qib: fix mcast detach when qp not attached Kamal Mostafa
` (97 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Tim Chen, David S. Miller, Jean Delvare, Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Jean Delvare <jdelvare@suse.de>
commit fd7f6727102a1ccf6b4c1dfcc631f9b546526b26 upstream.
I don't think it makes sense for a module to have a soft dependency
on itself. This seems quite cyclic by nature and I can't see what
purpose it could serve.
OTOH libcrc32c calls crypto_alloc_shash("crc32c", 0, 0) so it pretty
much assumes that some incarnation of the "crc32c" hash algorithm has
been loaded. Therefore it makes sense to have the soft dependency
there (as crc-t10dif does.)
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/crc32c_generic.c | 1 -
lib/libcrc32c.c | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/crypto/crc32c_generic.c b/crypto/crc32c_generic.c
index 06f1b60..4c0a0e2 100644
--- a/crypto/crc32c_generic.c
+++ b/crypto/crc32c_generic.c
@@ -172,4 +172,3 @@ MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations wrapper for lib/crc32c");
MODULE_LICENSE("GPL");
MODULE_ALIAS_CRYPTO("crc32c");
MODULE_ALIAS_CRYPTO("crc32c-generic");
-MODULE_SOFTDEP("pre: crc32c");
diff --git a/lib/libcrc32c.c b/lib/libcrc32c.c
index 6a08ce7..acf9da4 100644
--- a/lib/libcrc32c.c
+++ b/lib/libcrc32c.c
@@ -74,3 +74,4 @@ module_exit(libcrc32c_mod_fini);
MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>");
MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations");
MODULE_LICENSE("GPL");
+MODULE_SOFTDEP("pre: crc32c");
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 171/268] IB/qib: fix mcast detach when qp not attached
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (169 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 170/268] crypto: crc32c - Fix crc32c soft dependency Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 172/268] IB/qib: Support creating qps with GFP_NOIO flag Kamal Mostafa
` (96 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mike Marciniszyn, Doug Ledford, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Mike Marciniszyn <mike.marciniszyn@intel.com>
commit 09dc9cd6528f5b52bcbd3292a6312e762c85260f upstream.
The code produces the following trace:
[1750924.419007] general protection fault: 0000 [#3] SMP
[1750924.420364] Modules linked in: nfnetlink autofs4 rpcsec_gss_krb5 nfsv4
dcdbas rfcomm bnep bluetooth nfsd auth_rpcgss nfs_acl dm_multipath nfs lockd
scsi_dh sunrpc fscache radeon ttm drm_kms_helper drm serio_raw parport_pc
ppdev i2c_algo_bit lpc_ich ipmi_si ib_mthca ib_qib dca lp parport ib_ipoib
mac_hid ib_cm i3000_edac ib_sa ib_uverbs edac_core ib_umad ib_mad ib_core
ib_addr tg3 ptp dm_mirror dm_region_hash dm_log psmouse pps_core
[1750924.420364] CPU: 1 PID: 8401 Comm: python Tainted: G D
3.13.0-39-generic #66-Ubuntu
[1750924.420364] Hardware name: Dell Computer Corporation PowerEdge
860/0XM089, BIOS A04 07/24/2007
[1750924.420364] task: ffff8800366a9800 ti: ffff88007af1c000 task.ti:
ffff88007af1c000
[1750924.420364] RIP: 0010:[<ffffffffa0131d51>] [<ffffffffa0131d51>]
qib_mcast_qp_free+0x11/0x50 [ib_qib]
[1750924.420364] RSP: 0018:ffff88007af1dd70 EFLAGS: 00010246
[1750924.420364] RAX: 0000000000000001 RBX: ffff88007b822688 RCX:
000000000000000f
[1750924.420364] RDX: ffff88007b822688 RSI: ffff8800366c15a0 RDI:
6764697200000000
[1750924.420364] RBP: ffff88007af1dd78 R08: 0000000000000001 R09:
0000000000000000
[1750924.420364] R10: 0000000000000011 R11: 0000000000000246 R12:
ffff88007baa1d98
[1750924.420364] R13: ffff88003ecab000 R14: ffff88007b822660 R15:
0000000000000000
[1750924.420364] FS: 00007ffff7fd8740(0000) GS:ffff88007fc80000(0000)
knlGS:0000000000000000
[1750924.420364] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[1750924.420364] CR2: 00007ffff597c750 CR3: 000000006860b000 CR4:
00000000000007e0
[1750924.420364] Stack:
[1750924.420364] ffff88007b822688 ffff88007af1ddf0 ffffffffa0132429
000000007af1de20
[1750924.420364] ffff88007baa1dc8 ffff88007baa0000 ffff88007af1de70
ffffffffa00cb313
[1750924.420364] 00007fffffffde88 0000000000000000 0000000000000008
ffff88003ecab000
[1750924.420364] Call Trace:
[1750924.420364] [<ffffffffa0132429>] qib_multicast_detach+0x1e9/0x350
[ib_qib]
[1750924.568035] [<ffffffffa00cb313>] ? ib_uverbs_modify_qp+0x323/0x3d0
[ib_uverbs]
[1750924.568035] [<ffffffffa0092d61>] ib_detach_mcast+0x31/0x50 [ib_core]
[1750924.568035] [<ffffffffa00cc213>] ib_uverbs_detach_mcast+0x93/0x170
[ib_uverbs]
[1750924.568035] [<ffffffffa00c61f6>] ib_uverbs_write+0xc6/0x2c0 [ib_uverbs]
[1750924.568035] [<ffffffff81312e68>] ? apparmor_file_permission+0x18/0x20
[1750924.568035] [<ffffffff812d4cd3>] ? security_file_permission+0x23/0xa0
[1750924.568035] [<ffffffff811bd214>] vfs_write+0xb4/0x1f0
[1750924.568035] [<ffffffff811bdc49>] SyS_write+0x49/0xa0
[1750924.568035] [<ffffffff8172f7ed>] system_call_fastpath+0x1a/0x1f
[1750924.568035] Code: 66 2e 0f 1f 84 00 00 00 00 00 31 c0 5d c3 66 2e 0f 1f
84 00 00 00 00 00 66 90 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb 48 8b 7f 10
<f0> ff 8f 40 01 00 00 74 0e 48 89 df e8 8e f8 06 e1 5b 5d c3 0f
[1750924.568035] RIP [<ffffffffa0131d51>] qib_mcast_qp_free+0x11/0x50
[ib_qib]
[1750924.568035] RSP <ffff88007af1dd70>
[1750924.650439] ---[ end trace 73d5d4b3f8ad4851 ]
The fix is to note the qib_mcast_qp that was found. If none is found, then
return EINVAL indicating the error.
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reported-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/infiniband/hw/qib/qib_verbs_mcast.c | 35 +++++++++++++----------------
1 file changed, 15 insertions(+), 20 deletions(-)
diff --git a/drivers/infiniband/hw/qib/qib_verbs_mcast.c b/drivers/infiniband/hw/qib/qib_verbs_mcast.c
index f8ea069..b2fb528 100644
--- a/drivers/infiniband/hw/qib/qib_verbs_mcast.c
+++ b/drivers/infiniband/hw/qib/qib_verbs_mcast.c
@@ -286,15 +286,13 @@ int qib_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
struct qib_ibdev *dev = to_idev(ibqp->device);
struct qib_ibport *ibp = to_iport(ibqp->device, qp->port_num);
struct qib_mcast *mcast = NULL;
- struct qib_mcast_qp *p, *tmp;
+ struct qib_mcast_qp *p, *tmp, *delp = NULL;
struct rb_node *n;
int last = 0;
int ret;
- if (ibqp->qp_num <= 1 || qp->state == IB_QPS_RESET) {
- ret = -EINVAL;
- goto bail;
- }
+ if (ibqp->qp_num <= 1 || qp->state == IB_QPS_RESET)
+ return -EINVAL;
spin_lock_irq(&ibp->lock);
@@ -303,8 +301,7 @@ int qib_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
while (1) {
if (n == NULL) {
spin_unlock_irq(&ibp->lock);
- ret = -EINVAL;
- goto bail;
+ return -EINVAL;
}
mcast = rb_entry(n, struct qib_mcast, rb_node);
@@ -328,6 +325,7 @@ int qib_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
*/
list_del_rcu(&p->list);
mcast->n_attached--;
+ delp = p;
/* If this was the last attached QP, remove the GID too. */
if (list_empty(&mcast->qp_list)) {
@@ -338,15 +336,16 @@ int qib_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
}
spin_unlock_irq(&ibp->lock);
+ /* QP not attached */
+ if (!delp)
+ return -EINVAL;
+ /*
+ * Wait for any list walkers to finish before freeing the
+ * list element.
+ */
+ wait_event(mcast->wait, atomic_read(&mcast->refcount) <= 1);
+ qib_mcast_qp_free(delp);
- if (p) {
- /*
- * Wait for any list walkers to finish before freeing the
- * list element.
- */
- wait_event(mcast->wait, atomic_read(&mcast->refcount) <= 1);
- qib_mcast_qp_free(p);
- }
if (last) {
atomic_dec(&mcast->refcount);
wait_event(mcast->wait, !atomic_read(&mcast->refcount));
@@ -355,11 +354,7 @@ int qib_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
dev->n_mcast_grps_allocated--;
spin_unlock_irq(&dev->n_mcast_grps_lock);
}
-
- ret = 0;
-
-bail:
- return ret;
+ return 0;
}
int qib_mcast_tree_empty(struct qib_ibport *ibp)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 172/268] IB/qib: Support creating qps with GFP_NOIO flag
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (170 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 171/268] IB/qib: fix mcast detach when qp not attached Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 173/268] IB/mlx5: Expose correct maximum number of CQE capacity Kamal Mostafa
` (95 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Vinit Agnihotri, Doug Ledford, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Vinit Agnihotri <vinit.abhay.agnihotri@intel.com>
commit fbbeb8632bf0b46ab44cfcedc4654cd7831b7161 upstream.
The current code is problematic when the QP creation and ipoib is used to
support NFS and NFS desires to do IO for paging purposes. In that case, the
GFP_KERNEL allocation in qib_qp.c causes a deadlock in tight memory
situations.
This fix adds support to create queue pair with GFP_NOIO flag for connected
mode only to cleanly fail the create queue pair in those situations.
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Vinit Agnihotri <vinit.abhay.agnihotri@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/infiniband/hw/qib/qib_qp.c | 46 ++++++++++++++++++++++++++------------
1 file changed, 32 insertions(+), 14 deletions(-)
diff --git a/drivers/infiniband/hw/qib/qib_qp.c b/drivers/infiniband/hw/qib/qib_qp.c
index 4fa88ba..1319943 100644
--- a/drivers/infiniband/hw/qib/qib_qp.c
+++ b/drivers/infiniband/hw/qib/qib_qp.c
@@ -100,9 +100,10 @@ static u32 credit_table[31] = {
32768 /* 1E */
};
-static void get_map_page(struct qib_qpn_table *qpt, struct qpn_map *map)
+static void get_map_page(struct qib_qpn_table *qpt, struct qpn_map *map,
+ gfp_t gfp)
{
- unsigned long page = get_zeroed_page(GFP_KERNEL);
+ unsigned long page = get_zeroed_page(gfp);
/*
* Free the page if someone raced with us installing it.
@@ -121,7 +122,7 @@ static void get_map_page(struct qib_qpn_table *qpt, struct qpn_map *map)
* zero/one for QP type IB_QPT_SMI/IB_QPT_GSI.
*/
static int alloc_qpn(struct qib_devdata *dd, struct qib_qpn_table *qpt,
- enum ib_qp_type type, u8 port)
+ enum ib_qp_type type, u8 port, gfp_t gfp)
{
u32 i, offset, max_scan, qpn;
struct qpn_map *map;
@@ -151,7 +152,7 @@ static int alloc_qpn(struct qib_devdata *dd, struct qib_qpn_table *qpt,
max_scan = qpt->nmaps - !offset;
for (i = 0;;) {
if (unlikely(!map->page)) {
- get_map_page(qpt, map);
+ get_map_page(qpt, map, gfp);
if (unlikely(!map->page))
break;
}
@@ -983,13 +984,21 @@ struct ib_qp *qib_create_qp(struct ib_pd *ibpd,
size_t sz;
size_t sg_list_sz;
struct ib_qp *ret;
+ gfp_t gfp;
+
if (init_attr->cap.max_send_sge > ib_qib_max_sges ||
init_attr->cap.max_send_wr > ib_qib_max_qp_wrs ||
- init_attr->create_flags) {
- ret = ERR_PTR(-EINVAL);
- goto bail;
- }
+ init_attr->create_flags & ~(IB_QP_CREATE_USE_GFP_NOIO))
+ return ERR_PTR(-EINVAL);
+
+ /* GFP_NOIO is applicable in RC QPs only */
+ if (init_attr->create_flags & IB_QP_CREATE_USE_GFP_NOIO &&
+ init_attr->qp_type != IB_QPT_RC)
+ return ERR_PTR(-EINVAL);
+
+ gfp = init_attr->create_flags & IB_QP_CREATE_USE_GFP_NOIO ?
+ GFP_NOIO : GFP_KERNEL;
/* Check receive queue parameters if no SRQ is specified. */
if (!init_attr->srq) {
@@ -1021,7 +1030,8 @@ struct ib_qp *qib_create_qp(struct ib_pd *ibpd,
sz = sizeof(struct qib_sge) *
init_attr->cap.max_send_sge +
sizeof(struct qib_swqe);
- swq = vmalloc((init_attr->cap.max_send_wr + 1) * sz);
+ swq = __vmalloc((init_attr->cap.max_send_wr + 1) * sz,
+ gfp, PAGE_KERNEL);
if (swq == NULL) {
ret = ERR_PTR(-ENOMEM);
goto bail;
@@ -1037,13 +1047,13 @@ struct ib_qp *qib_create_qp(struct ib_pd *ibpd,
} else if (init_attr->cap.max_recv_sge > 1)
sg_list_sz = sizeof(*qp->r_sg_list) *
(init_attr->cap.max_recv_sge - 1);
- qp = kzalloc(sz + sg_list_sz, GFP_KERNEL);
+ qp = kzalloc(sz + sg_list_sz, gfp);
if (!qp) {
ret = ERR_PTR(-ENOMEM);
goto bail_swq;
}
RCU_INIT_POINTER(qp->next, NULL);
- qp->s_hdr = kzalloc(sizeof(*qp->s_hdr), GFP_KERNEL);
+ qp->s_hdr = kzalloc(sizeof(*qp->s_hdr), gfp);
if (!qp->s_hdr) {
ret = ERR_PTR(-ENOMEM);
goto bail_qp;
@@ -1058,8 +1068,16 @@ struct ib_qp *qib_create_qp(struct ib_pd *ibpd,
qp->r_rq.max_sge = init_attr->cap.max_recv_sge;
sz = (sizeof(struct ib_sge) * qp->r_rq.max_sge) +
sizeof(struct qib_rwqe);
- qp->r_rq.wq = vmalloc_user(sizeof(struct qib_rwq) +
- qp->r_rq.size * sz);
+ if (gfp != GFP_NOIO)
+ qp->r_rq.wq = vmalloc_user(
+ sizeof(struct qib_rwq) +
+ qp->r_rq.size * sz);
+ else
+ qp->r_rq.wq = __vmalloc(
+ sizeof(struct qib_rwq) +
+ qp->r_rq.size * sz,
+ gfp, PAGE_KERNEL);
+
if (!qp->r_rq.wq) {
ret = ERR_PTR(-ENOMEM);
goto bail_qp;
@@ -1090,7 +1108,7 @@ struct ib_qp *qib_create_qp(struct ib_pd *ibpd,
dev = to_idev(ibpd->device);
dd = dd_from_dev(dev);
err = alloc_qpn(dd, &dev->qpn_table, init_attr->qp_type,
- init_attr->port_num);
+ init_attr->port_num, gfp);
if (err < 0) {
ret = ERR_PTR(err);
vfree(qp->r_rq.wq);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 173/268] IB/mlx5: Expose correct maximum number of CQE capacity
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (171 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 172/268] IB/qib: Support creating qps with GFP_NOIO flag Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 174/268] IB/cm: Fix a recently introduced deadlock Kamal Mostafa
` (94 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Leon Romanovsky, Doug Ledford, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Leon Romanovsky <leonro@mellanox.com>
commit 9f17768611ebf81dfac69948dd12622b6f2e45fc upstream.
Maximum number of EQE capacity per CQ was mistakenly exposed
as CQE. Fix that.
Fixes: 938fe83c8dcb ("net/mlx5_core: New device capabilities handling")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/infiniband/hw/mlx5/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 085c24b..aa64c7b 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -274,7 +274,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
sizeof(struct mlx5_wqe_data_seg);
props->max_sge = min(max_rq_sg, max_sq_sg);
props->max_cq = 1 << MLX5_CAP_GEN(mdev, log_max_cq);
- props->max_cqe = (1 << MLX5_CAP_GEN(mdev, log_max_eq_sz)) - 1;
+ props->max_cqe = (1 << MLX5_CAP_GEN(mdev, log_max_cq_sz)) - 1;
props->max_mr = 1 << MLX5_CAP_GEN(mdev, log_max_mkey);
props->max_pd = 1 << MLX5_CAP_GEN(mdev, log_max_pd);
props->max_qp_rd_atom = 1 << MLX5_CAP_GEN(mdev, log_max_ra_req_qp);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 174/268] IB/cm: Fix a recently introduced deadlock
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (172 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 173/268] IB/mlx5: Expose correct maximum number of CQE capacity Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 175/268] ideapad-laptop: Add Lenovo ideapad Y700-17ISK to no_hw_rfkill dmi list Kamal Mostafa
` (93 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Bart Van Assche, Erez Shitrit, Doug Ledford, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Bart Van Assche <bart.vanassche@sandisk.com>
commit 4bfdf635c668869c69fd18ece37ec66fb6f38fcf upstream.
ib_send_cm_drep() calls cm_enter_timewait() while holding a spinlock
that can be locked from inside an interrupt handler. Hence do not
enable interrupts inside cm_enter_timewait() if called with interrupts
disabled.
This patch fixes e.g. the following deadlock:
Acked-by: Erez Shitrit <erezsh@mellanox.com>
=================================
[ INFO: inconsistent lock state ]
4.4.0-rc7+ #1 Tainted: G E
---------------------------------
inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
swapper/8/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
(&(&cm_id_priv->lock)->rlock){?.+...}, at: [<ffffffffa036eec4>] cm_establish+0x
74/0x1b0 [ib_cm]
{HARDIRQ-ON-W} state was registered at:
[<ffffffff810a3c11>] mark_held_locks+0x71/0x90
[<ffffffff810a3e87>] trace_hardirqs_on_caller+0xa7/0x1c0
[<ffffffff810a3fad>] trace_hardirqs_on+0xd/0x10
[<ffffffff8151c40b>] _raw_spin_unlock_irq+0x2b/0x40
[<ffffffffa036ea8e>] cm_enter_timewait+0xae/0x100 [ib_cm]
[<ffffffffa036ff76>] ib_send_cm_drep+0xb6/0x190 [ib_cm]
[<ffffffffa052ed08>] srp_cm_handler+0x128/0x1a0 [ib_srp]
[<ffffffffa0370340>] cm_process_work+0x20/0xf0 [ib_cm]
[<ffffffffa0371335>] cm_dreq_handler+0x135/0x2c0 [ib_cm]
[<ffffffffa03733c5>] cm_work_handler+0x75/0xd0 [ib_cm]
[<ffffffff8107184d>] process_one_work+0x1bd/0x460
[<ffffffff81073148>] worker_thread+0x118/0x420
[<ffffffff81078454>] kthread+0xe4/0x100
[<ffffffff8151cbbf>] ret_from_fork+0x3f/0x70
irq event stamp: 1672286
hardirqs last enabled at (1672283): [<ffffffff81408ec0>] poll_idle+0x10/0x80
hardirqs last disabled at (1672284): [<ffffffff8151d304>] common_interrupt+0x84/0x89
softirqs last enabled at (1672286): [<ffffffff8105b4dc>] _local_bh_enable+0x1c/0x50
softirqs last disabled at (1672285): [<ffffffff8105b697>] irq_enter+0x47/0x70
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&(&cm_id_priv->lock)->rlock);
<Interrupt>
lock(&(&cm_id_priv->lock)->rlock);
*** DEADLOCK ***
no locks held by swapper/8/0.
stack backtrace:
CPU: 8 PID: 0 Comm: swapper/8 Tainted: G E 4.4.0-rc7+ #1
Hardware name: Dell Inc. PowerEdge R430/03XKDV, BIOS 1.0.2 11/17/2014
ffff88045af5e950 ffff88046e503a88 ffffffff81251c1b 0000000000000007
0000000000000006 0000000000000003 ffff88045af5ddc0 ffff88046e503ad8
ffffffff810a32f4 0000000000000000 0000000000000000 0000000000000001
Call Trace:
<IRQ> [<ffffffff81251c1b>] dump_stack+0x4f/0x74
[<ffffffff810a32f4>] print_usage_bug+0x184/0x190
[<ffffffff810a36e2>] mark_lock_irq+0xf2/0x290
[<ffffffff810a3995>] mark_lock+0x115/0x1b0
[<ffffffff810a3b8c>] mark_irqflags+0x15c/0x170
[<ffffffff810a4fef>] __lock_acquire+0x1ef/0x560
[<ffffffff810a53c2>] lock_acquire+0x62/0x80
[<ffffffff8151bd33>] _raw_spin_lock_irqsave+0x43/0x60
[<ffffffffa036eec4>] cm_establish+0x74/0x1b0 [ib_cm]
[<ffffffffa036f031>] ib_cm_notify+0x31/0x100 [ib_cm]
[<ffffffffa0637f24>] srpt_qp_event+0x54/0xd0 [ib_srpt]
[<ffffffffa0196052>] mlx4_ib_qp_event+0x72/0xc0 [mlx4_ib]
[<ffffffffa00775b9>] mlx4_qp_event+0x69/0xd0 [mlx4_core]
[<ffffffffa006000e>] mlx4_eq_int+0x51e/0xd50 [mlx4_core]
[<ffffffffa006084f>] mlx4_msi_x_interrupt+0xf/0x20 [mlx4_core]
[<ffffffff810b67b0>] handle_irq_event_percpu+0x40/0x110
[<ffffffff810b68bf>] handle_irq_event+0x3f/0x70
[<ffffffff810ba7f9>] handle_edge_irq+0x79/0x120
[<ffffffff81007f3d>] handle_irq+0x5d/0x130
[<ffffffff810071fd>] do_IRQ+0x6d/0x130
[<ffffffff8151d309>] common_interrupt+0x89/0x89
<EOI> [<ffffffff8140895f>] cpuidle_enter_state+0xcf/0x200
[<ffffffff81408aa2>] cpuidle_enter+0x12/0x20
[<ffffffff810990d6>] call_cpuidle+0x36/0x60
[<ffffffff81099163>] cpuidle_idle_call+0x63/0x110
[<ffffffff8109930a>] cpu_idle_loop+0xfa/0x130
[<ffffffff8109934e>] cpu_startup_entry+0xe/0x10
[<ffffffff8103c443>] start_secondary+0x83/0x90
Fixes: commit be4b499323bf ("IB/cm: Do not queue work to a device that's going away")
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/infiniband/core/cm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 8be7352..27919bb 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -826,11 +826,11 @@ static void cm_enter_timewait(struct cm_id_private *cm_id_priv)
wait_time = cm_convert_to_ms(cm_id_priv->av.timeout);
/* Check if the device started its remove_one */
- spin_lock_irq(&cm.lock);
+ spin_lock_irqsave(&cm.lock, flags);
if (!cm_dev->going_down)
queue_delayed_work(cm.wq, &cm_id_priv->timewait_info->work.work,
msecs_to_jiffies(wait_time));
- spin_unlock_irq(&cm.lock);
+ spin_unlock_irqrestore(&cm.lock, flags);
cm_id_priv->timewait_info = NULL;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 175/268] ideapad-laptop: Add Lenovo ideapad Y700-17ISK to no_hw_rfkill dmi list
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (173 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 174/268] IB/cm: Fix a recently introduced deadlock Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 176/268] Btrfs: fix deadlock running delayed iputs at transaction commit time Kamal Mostafa
` (92 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Josh Boyer, Darren Hart, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Josh Boyer <jwboyer@fedoraproject.org>
commit edde316acb5f07c04abf09a92f59db5d2efd14e2 upstream.
One of the newest ideapad models also lacks a physical hw rfkill switch,
and trying to read the hw rfkill switch through the ideapad module
causes it to always reported blocking breaking wifi.
Fix it by adding this model to the DMI list.
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1286293
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/platform/x86/ideapad-laptop.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index db567b7..468c566 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -846,6 +846,13 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
},
},
{
+ .ident = "Lenovo ideapad Y700-17ISK",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700-17ISK"),
+ },
+ },
+ {
.ident = "Lenovo Yoga 2 11 / 13 / Pro",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 176/268] Btrfs: fix deadlock running delayed iputs at transaction commit time
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (174 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 175/268] ideapad-laptop: Add Lenovo ideapad Y700-17ISK to no_hw_rfkill dmi list Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 177/268] iscsi-target: Fix potential dead-lock during node acl delete Kamal Mostafa
` (91 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Filipe Manana, Chris Mason, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Filipe Manana <fdmanana@suse.com>
commit c2d6cb1636d235257086f939a8194ef0bf93af6e upstream.
While running a stress test I ran into a deadlock when running the delayed
iputs at transaction time, which produced the following report and trace:
[ 886.399989] =============================================
[ 886.400871] [ INFO: possible recursive locking detected ]
[ 886.401663] 4.4.0-rc6-btrfs-next-18+ #1 Not tainted
[ 886.402384] ---------------------------------------------
[ 886.403182] fio/8277 is trying to acquire lock:
[ 886.403568] (&fs_info->delayed_iput_sem){++++..}, at: [<ffffffffa0538823>] btrfs_run_delayed_iputs+0x36/0xbf [btrfs]
[ 886.403568]
[ 886.403568] but task is already holding lock:
[ 886.403568] (&fs_info->delayed_iput_sem){++++..}, at: [<ffffffffa0538823>] btrfs_run_delayed_iputs+0x36/0xbf [btrfs]
[ 886.403568]
[ 886.403568] other info that might help us debug this:
[ 886.403568] Possible unsafe locking scenario:
[ 886.403568]
[ 886.403568] CPU0
[ 886.403568] ----
[ 886.403568] lock(&fs_info->delayed_iput_sem);
[ 886.403568] lock(&fs_info->delayed_iput_sem);
[ 886.403568]
[ 886.403568] *** DEADLOCK ***
[ 886.403568]
[ 886.403568] May be due to missing lock nesting notation
[ 886.403568]
[ 886.403568] 3 locks held by fio/8277:
[ 886.403568] #0: (sb_writers#11){.+.+.+}, at: [<ffffffff81174c4c>] __sb_start_write+0x5f/0xb0
[ 886.403568] #1: (&sb->s_type->i_mutex_key#15){+.+.+.}, at: [<ffffffffa054620d>] btrfs_file_write_iter+0x73/0x408 [btrfs]
[ 886.403568] #2: (&fs_info->delayed_iput_sem){++++..}, at: [<ffffffffa0538823>] btrfs_run_delayed_iputs+0x36/0xbf [btrfs]
[ 886.403568]
[ 886.403568] stack backtrace:
[ 886.403568] CPU: 6 PID: 8277 Comm: fio Not tainted 4.4.0-rc6-btrfs-next-18+ #1
[ 886.403568] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS by qemu-project.org 04/01/2014
[ 886.403568] 0000000000000000 ffff88009f80f770 ffffffff8125d4fd ffffffff82af1fc0
[ 886.403568] ffff88009f80f830 ffffffff8108e5f9 0000000200000000 ffff88009fd92290
[ 886.403568] 0000000000000000 ffffffff82af1fc0 ffffffff829cfb01 00042b216d008804
[ 886.403568] Call Trace:
[ 886.403568] [<ffffffff8125d4fd>] dump_stack+0x4e/0x79
[ 886.403568] [<ffffffff8108e5f9>] __lock_acquire+0xd42/0xf0b
[ 886.403568] [<ffffffff810c22db>] ? __module_address+0xdf/0x108
[ 886.403568] [<ffffffff8108eb77>] lock_acquire+0x10d/0x194
[ 886.403568] [<ffffffff8108eb77>] ? lock_acquire+0x10d/0x194
[ 886.403568] [<ffffffffa0538823>] ? btrfs_run_delayed_iputs+0x36/0xbf [btrfs]
[ 886.489542] [<ffffffff8148556b>] down_read+0x3e/0x4d
[ 886.489542] [<ffffffffa0538823>] ? btrfs_run_delayed_iputs+0x36/0xbf [btrfs]
[ 886.489542] [<ffffffffa0538823>] btrfs_run_delayed_iputs+0x36/0xbf [btrfs]
[ 886.489542] [<ffffffffa0533953>] btrfs_commit_transaction+0x8f5/0x96e [btrfs]
[ 886.489542] [<ffffffffa0521d7a>] flush_space+0x435/0x44a [btrfs]
[ 886.489542] [<ffffffffa052218b>] ? reserve_metadata_bytes+0x26a/0x384 [btrfs]
[ 886.489542] [<ffffffffa05221ae>] reserve_metadata_bytes+0x28d/0x384 [btrfs]
[ 886.489542] [<ffffffffa052256c>] ? btrfs_block_rsv_refill+0x58/0x96 [btrfs]
[ 886.489542] [<ffffffffa0522584>] btrfs_block_rsv_refill+0x70/0x96 [btrfs]
[ 886.489542] [<ffffffffa053d747>] btrfs_evict_inode+0x394/0x55a [btrfs]
[ 886.489542] [<ffffffff81188e31>] evict+0xa7/0x15c
[ 886.489542] [<ffffffff81189878>] iput+0x1d3/0x266
[ 886.489542] [<ffffffffa053887c>] btrfs_run_delayed_iputs+0x8f/0xbf [btrfs]
[ 886.489542] [<ffffffffa0533953>] btrfs_commit_transaction+0x8f5/0x96e [btrfs]
[ 886.489542] [<ffffffff81085096>] ? signal_pending_state+0x31/0x31
[ 886.489542] [<ffffffffa0521191>] btrfs_alloc_data_chunk_ondemand+0x1d7/0x288 [btrfs]
[ 886.489542] [<ffffffffa0521282>] btrfs_check_data_free_space+0x40/0x59 [btrfs]
[ 886.489542] [<ffffffffa05228f5>] btrfs_delalloc_reserve_space+0x1e/0x4e [btrfs]
[ 886.489542] [<ffffffffa053620a>] btrfs_direct_IO+0x10c/0x27e [btrfs]
[ 886.489542] [<ffffffff8111d9a1>] generic_file_direct_write+0xb3/0x128
[ 886.489542] [<ffffffffa05463c3>] btrfs_file_write_iter+0x229/0x408 [btrfs]
[ 886.489542] [<ffffffff8108ae38>] ? __lock_is_held+0x38/0x50
[ 886.489542] [<ffffffff8117279e>] __vfs_write+0x7c/0xa5
[ 886.489542] [<ffffffff81172cda>] vfs_write+0xa0/0xe4
[ 886.489542] [<ffffffff811734cc>] SyS_write+0x50/0x7e
[ 886.489542] [<ffffffff814872d7>] entry_SYSCALL_64_fastpath+0x12/0x6f
[ 1081.852335] INFO: task fio:8244 blocked for more than 120 seconds.
[ 1081.854348] Not tainted 4.4.0-rc6-btrfs-next-18+ #1
[ 1081.857560] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 1081.863227] fio D ffff880213f9bb28 0 8244 8240 0x00000000
[ 1081.868719] ffff880213f9bb28 00ffffff810fc6b0 ffffffff0000000a ffff88023ed55240
[ 1081.872499] ffff880206b5d400 ffff880213f9c000 ffff88020a4d5318 ffff880206b5d400
[ 1081.876834] ffffffff00000001 ffff880206b5d400 ffff880213f9bb40 ffffffff81482ba4
[ 1081.880782] Call Trace:
[ 1081.881793] [<ffffffff81482ba4>] schedule+0x7f/0x97
[ 1081.883340] [<ffffffff81485eb5>] rwsem_down_write_failed+0x2d5/0x325
[ 1081.895525] [<ffffffff8108d48d>] ? trace_hardirqs_on_caller+0x16/0x1ab
[ 1081.897419] [<ffffffff81269723>] call_rwsem_down_write_failed+0x13/0x20
[ 1081.899251] [<ffffffff81269723>] ? call_rwsem_down_write_failed+0x13/0x20
[ 1081.901063] [<ffffffff81089fae>] ? __down_write_nested.isra.0+0x1f/0x21
[ 1081.902365] [<ffffffff814855bd>] down_write+0x43/0x57
[ 1081.903846] [<ffffffffa05211b0>] ? btrfs_alloc_data_chunk_ondemand+0x1f6/0x288 [btrfs]
[ 1081.906078] [<ffffffffa05211b0>] btrfs_alloc_data_chunk_ondemand+0x1f6/0x288 [btrfs]
[ 1081.908846] [<ffffffff8108d461>] ? mark_held_locks+0x56/0x6c
[ 1081.910409] [<ffffffffa0521282>] btrfs_check_data_free_space+0x40/0x59 [btrfs]
[ 1081.912482] [<ffffffffa05228f5>] btrfs_delalloc_reserve_space+0x1e/0x4e [btrfs]
[ 1081.914597] [<ffffffffa053620a>] btrfs_direct_IO+0x10c/0x27e [btrfs]
[ 1081.919037] [<ffffffff8111d9a1>] generic_file_direct_write+0xb3/0x128
[ 1081.920754] [<ffffffffa05463c3>] btrfs_file_write_iter+0x229/0x408 [btrfs]
[ 1081.922496] [<ffffffff8108ae38>] ? __lock_is_held+0x38/0x50
[ 1081.923922] [<ffffffff8117279e>] __vfs_write+0x7c/0xa5
[ 1081.925275] [<ffffffff81172cda>] vfs_write+0xa0/0xe4
[ 1081.926584] [<ffffffff811734cc>] SyS_write+0x50/0x7e
[ 1081.927968] [<ffffffff814872d7>] entry_SYSCALL_64_fastpath+0x12/0x6f
[ 1081.985293] INFO: lockdep is turned off.
[ 1081.986132] INFO: task fio:8249 blocked for more than 120 seconds.
[ 1081.987434] Not tainted 4.4.0-rc6-btrfs-next-18+ #1
[ 1081.988534] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 1081.990147] fio D ffff880218febbb8 0 8249 8240 0x00000000
[ 1081.991626] ffff880218febbb8 00ffffff81486b8e ffff88020000000b ffff88023ed75240
[ 1081.993258] ffff8802120a9a00 ffff880218fec000 ffff88020a4d5318 ffff8802120a9a00
[ 1081.994850] ffffffff00000001 ffff8802120a9a00 ffff880218febbd0 ffffffff81482ba4
[ 1081.996485] Call Trace:
[ 1081.997037] [<ffffffff81482ba4>] schedule+0x7f/0x97
[ 1081.998017] [<ffffffff81485eb5>] rwsem_down_write_failed+0x2d5/0x325
[ 1081.999241] [<ffffffff810852a5>] ? finish_wait+0x6d/0x76
[ 1082.000306] [<ffffffff81269723>] call_rwsem_down_write_failed+0x13/0x20
[ 1082.001533] [<ffffffff81269723>] ? call_rwsem_down_write_failed+0x13/0x20
[ 1082.002776] [<ffffffff81089fae>] ? __down_write_nested.isra.0+0x1f/0x21
[ 1082.003995] [<ffffffff814855bd>] down_write+0x43/0x57
[ 1082.005000] [<ffffffffa05211b0>] ? btrfs_alloc_data_chunk_ondemand+0x1f6/0x288 [btrfs]
[ 1082.007403] [<ffffffffa05211b0>] btrfs_alloc_data_chunk_ondemand+0x1f6/0x288 [btrfs]
[ 1082.008988] [<ffffffffa0545064>] btrfs_fallocate+0x7c1/0xc2f [btrfs]
[ 1082.010193] [<ffffffff8108a1ba>] ? percpu_down_read+0x4e/0x77
[ 1082.011280] [<ffffffff81174c4c>] ? __sb_start_write+0x5f/0xb0
[ 1082.012265] [<ffffffff81174c4c>] ? __sb_start_write+0x5f/0xb0
[ 1082.013021] [<ffffffff811712e4>] vfs_fallocate+0x170/0x1ff
[ 1082.013738] [<ffffffff81181ebb>] ioctl_preallocate+0x89/0x9b
[ 1082.014778] [<ffffffff811822d7>] do_vfs_ioctl+0x40a/0x4ea
[ 1082.015778] [<ffffffff81176ea7>] ? SYSC_newfstat+0x25/0x2e
[ 1082.016806] [<ffffffff8118b4de>] ? __fget_light+0x4d/0x71
[ 1082.017789] [<ffffffff8118240e>] SyS_ioctl+0x57/0x79
[ 1082.018706] [<ffffffff814872d7>] entry_SYSCALL_64_fastpath+0x12/0x6f
This happens because we can recursively acquire the semaphore
fs_info->delayed_iput_sem when attempting to allocate space to satisfy
a file write request as shown in the first trace above - when committing
a transaction we acquire (down_read) the semaphore before running the
delayed iputs, and when running a delayed iput() we can end up calling
an inode's eviction handler, which in turn commits another transaction
and attempts to acquire (down_read) again the semaphore to run more
delayed iput operations.
This results in a deadlock because if a task acquires multiple times a
semaphore it should invoke down_read_nested() with a different lockdep
class for each level of recursion.
Fix this by simplifying the implementation and use a mutex instead that
is acquired by the cleaner kthread before it runs the delayed iputs
instead of always acquiring a semaphore before delayed references are
run from anywhere.
Fixes: d7c151717a1e (btrfs: Fix NO_SPACE bug caused by delayed-iput)
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/btrfs/ctree.h | 2 +-
fs/btrfs/disk-io.c | 5 ++++-
fs/btrfs/extent-tree.c | 9 +++++----
fs/btrfs/inode.c | 4 ----
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index bb25b8d..6bd8ea5 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1544,7 +1544,7 @@ struct btrfs_fs_info {
spinlock_t delayed_iput_lock;
struct list_head delayed_iputs;
- struct rw_semaphore delayed_iput_sem;
+ struct mutex cleaner_delayed_iput_mutex;
/* this protects tree_mod_seq_list */
spinlock_t tree_mod_seq_lock;
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index f556c37..36dd336 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1772,7 +1772,10 @@ static int cleaner_kthread(void *arg)
goto sleep;
}
+ mutex_lock(&root->fs_info->cleaner_delayed_iput_mutex);
btrfs_run_delayed_iputs(root);
+ mutex_unlock(&root->fs_info->cleaner_delayed_iput_mutex);
+
again = btrfs_clean_one_deleted_snapshot(root);
mutex_unlock(&root->fs_info->cleaner_mutex);
@@ -2533,8 +2536,8 @@ int open_ctree(struct super_block *sb,
mutex_init(&fs_info->delete_unused_bgs_mutex);
mutex_init(&fs_info->reloc_mutex);
mutex_init(&fs_info->delalloc_root_mutex);
+ mutex_init(&fs_info->cleaner_delayed_iput_mutex);
seqlock_init(&fs_info->profiles_lock);
- init_rwsem(&fs_info->delayed_iput_sem);
INIT_LIST_HEAD(&fs_info->dirty_cowonly_roots);
INIT_LIST_HEAD(&fs_info->space_info);
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 5d870c4..c73c4ce 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3950,11 +3950,12 @@ commit_trans:
if (ret)
return ret;
/*
- * make sure that all running delayed iput are
- * done
+ * The cleaner kthread might still be doing iput
+ * operations. Wait for it to finish so that
+ * more space is released.
*/
- down_write(&root->fs_info->delayed_iput_sem);
- up_write(&root->fs_info->delayed_iput_sem);
+ mutex_lock(&root->fs_info->cleaner_delayed_iput_mutex);
+ mutex_unlock(&root->fs_info->cleaner_delayed_iput_mutex);
goto again;
} else {
btrfs_end_transaction(trans, root);
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 9aabff2..f3b2661 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3116,8 +3116,6 @@ void btrfs_run_delayed_iputs(struct btrfs_root *root)
if (empty)
return;
- down_read(&fs_info->delayed_iput_sem);
-
spin_lock(&fs_info->delayed_iput_lock);
list_splice_init(&fs_info->delayed_iputs, &list);
spin_unlock(&fs_info->delayed_iput_lock);
@@ -3128,8 +3126,6 @@ void btrfs_run_delayed_iputs(struct btrfs_root *root)
iput(delayed->inode);
kfree(delayed);
}
-
- up_read(&root->fs_info->delayed_iput_sem);
}
/*
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 177/268] iscsi-target: Fix potential dead-lock during node acl delete
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (175 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 176/268] Btrfs: fix deadlock running delayed iputs at transaction commit time Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 178/268] crypto: algif_skcipher - sendmsg SG marking is off by one Kamal Mostafa
` (90 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Christoph Hellwig, Hannes Reinecke, Andy Grover, Mike Christie,
Nicholas Bellinger, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Nicholas Bellinger <nab@linux-iscsi.org>
commit 26a99c19f810b2593410899a5b304b21b47428a6 upstream.
This patch is a iscsi-target specific bug-fix for a dead-lock
that can occur during explicit struct se_node_acl->acl_group
se_session deletion via configfs rmdir(2), when iscsi-target
time2retain timer is still active.
It changes iscsi-target to obtain se_portal_group->session_lock
internally using spin_in_locked() to check for the specific
se_node_acl configfs shutdown rmdir(2) case.
Note this patch is intended for stable, and the subsequent
v4.5-rc patch converts target_core_tpg.c to use proper
se_sess->sess_kref reference counting for both se_node_acl
deletion + se_node_acl->queue_depth se_session restart.
Reported-by:: Sagi Grimberg <sagig@mellanox.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Andy Grover <agrover@redhat.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/target/iscsi/iscsi_target_configfs.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c
index db3b9b9..a13d59e 100644
--- a/drivers/target/iscsi/iscsi_target_configfs.c
+++ b/drivers/target/iscsi/iscsi_target_configfs.c
@@ -1834,7 +1834,8 @@ static int lio_tpg_check_prot_fabric_only(
}
/*
- * Called with spin_lock_bh(struct se_portal_group->session_lock) held..
+ * Called with spin_lock_irq(struct se_portal_group->session_lock) held
+ * or not held.
*
* Also, this function calls iscsit_inc_session_usage_count() on the
* struct iscsi_session in question.
@@ -1842,19 +1843,32 @@ static int lio_tpg_check_prot_fabric_only(
static int lio_tpg_shutdown_session(struct se_session *se_sess)
{
struct iscsi_session *sess = se_sess->fabric_sess_ptr;
+ struct se_portal_group *se_tpg = se_sess->se_tpg;
+ bool local_lock = false;
+
+ if (!spin_is_locked(&se_tpg->session_lock)) {
+ spin_lock_irq(&se_tpg->session_lock);
+ local_lock = true;
+ }
spin_lock(&sess->conn_lock);
if (atomic_read(&sess->session_fall_back_to_erl0) ||
atomic_read(&sess->session_logout) ||
(sess->time2retain_timer_flags & ISCSI_TF_EXPIRED)) {
spin_unlock(&sess->conn_lock);
+ if (local_lock)
+ spin_unlock_irq(&sess->conn_lock);
return 0;
}
atomic_set(&sess->session_reinstatement, 1);
spin_unlock(&sess->conn_lock);
iscsit_stop_time2retain_timer(sess);
+ spin_unlock_irq(&se_tpg->session_lock);
+
iscsit_stop_session(sess, 1, 1);
+ if (!local_lock)
+ spin_lock_irq(&se_tpg->session_lock);
return 1;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 178/268] crypto: algif_skcipher - sendmsg SG marking is off by one
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (176 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 177/268] iscsi-target: Fix potential dead-lock during node acl delete Kamal Mostafa
@ 2016-01-27 20:33 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 179/268] ALSA: hda - Flush the pending probe work at remove Kamal Mostafa
` (89 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:33 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Herbert Xu, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
commit 202736d99b7f29279db9da61587f11a08a04a9c6 upstream.
We mark the end of the SG list in sendmsg and sendpage and unmark
it on the next send call. Unfortunately the unmarking in sendmsg
is off-by-one, leading to an SG list that is too short.
Fixes: 0f477b655a52 ("crypto: algif - Mark sgl end at the end of data")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
crypto/algif_skcipher.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index 1a0fe4f..9565568 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -392,7 +392,8 @@ static int skcipher_sendmsg(struct socket *sock, struct msghdr *msg,
sgl = list_entry(ctx->tsgl.prev, struct skcipher_sg_list, list);
sg = sgl->sg;
- sg_unmark_end(sg + sgl->cur);
+ if (sgl->cur)
+ sg_unmark_end(sg + sgl->cur - 1);
do {
i = sgl->cur;
plen = min_t(int, len, PAGE_SIZE);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 179/268] ALSA: hda - Flush the pending probe work at remove
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (177 preceding siblings ...)
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 178/268] crypto: algif_skcipher - sendmsg SG marking is off by one Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 180/268] zsmalloc: fix migrate_zspage-zs_free race condition Kamal Mostafa
` (88 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Takashi Iwai <tiwai@suse.de>
commit 991f86d7ae4e1f8c15806e62f97af519e3cdd860 upstream.
As HD-audio driver does deferred probe internally via workqueue, the
driver might go into the mixed state doing both probe and remove when
the module gets unloaded during the probe work. This eventually
triggers an Oops, unsurprisingly.
For avoiding this race, we just need to flush the pending probe work
explicitly before actually starting the resource release.
Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=960710
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/hda_intel.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index de2b2e2..e61fbf4 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2100,9 +2100,17 @@ i915_power_fail:
static void azx_remove(struct pci_dev *pci)
{
struct snd_card *card = pci_get_drvdata(pci);
+ struct azx *chip;
+ struct hda_intel *hda;
+
+ if (card) {
+ /* flush the pending probing work */
+ chip = card->private_data;
+ hda = container_of(chip, struct hda_intel, chip);
+ flush_work(&hda->probe_work);
- if (card)
snd_card_free(card);
+ }
}
static void azx_shutdown(struct pci_dev *pci)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 180/268] zsmalloc: fix migrate_zspage-zs_free race condition
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (178 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 179/268] ALSA: hda - Flush the pending probe work at remove Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 181/268] prctl: take mmap sem for writing to protect against others Kamal Mostafa
` (87 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Junil Lee, Minchan Kim, Sergey Senozhatsky, Andrew Morton,
Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Junil Lee <junil0814.lee@lge.com>
commit c102f07ca0b04f2cb49cfc161c83f6239d17f491 upstream.
record_obj() in migrate_zspage() does not preserve handle's
HANDLE_PIN_BIT, set by find_aloced_obj()->trypin_tag(), and implicitly
(accidentally) un-pins the handle, while migrate_zspage() still performs
an explicit unpin_tag() on the that handle. This additional explicit
unpin_tag() introduces a race condition with zs_free(), which can pin
that handle by this time, so the handle becomes un-pinned.
Schematically, it goes like this:
CPU0 CPU1
migrate_zspage
find_alloced_obj
trypin_tag
set HANDLE_PIN_BIT zs_free()
pin_tag()
obj_malloc() -- new object, no tag
record_obj() -- remove HANDLE_PIN_BIT set HANDLE_PIN_BIT
unpin_tag() -- remove zs_free's HANDLE_PIN_BIT
The race condition may result in a NULL pointer dereference:
Unable to handle kernel NULL pointer dereference at virtual address 00000000
CPU: 0 PID: 19001 Comm: CookieMonsterCl Tainted:
PC is at get_zspage_mapping+0x0/0x24
LR is at obj_free.isra.22+0x64/0x128
Call trace:
get_zspage_mapping+0x0/0x24
zs_free+0x88/0x114
zram_free_page+0x64/0xcc
zram_slot_free_notify+0x90/0x108
swap_entry_free+0x278/0x294
free_swap_and_cache+0x38/0x11c
unmap_single_vma+0x480/0x5c8
unmap_vmas+0x44/0x60
exit_mmap+0x50/0x110
mmput+0x58/0xe0
do_exit+0x320/0x8dc
do_group_exit+0x44/0xa8
get_signal+0x538/0x580
do_signal+0x98/0x4b8
do_notify_resume+0x14/0x5c
This patch keeps the lock bit in migration path and update value
atomically.
Signed-off-by: Junil Lee <junil0814.lee@lge.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
mm/zsmalloc.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 0a7f81a..88fbc8b 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -302,7 +302,12 @@ static void free_handle(struct zs_pool *pool, unsigned long handle)
static void record_obj(unsigned long handle, unsigned long obj)
{
- *(unsigned long *)handle = obj;
+ /*
+ * lsb of @obj represents handle lock while other bits
+ * represent object value the handle is pointing so
+ * updating shouldn't do store tearing.
+ */
+ WRITE_ONCE(*(unsigned long *)handle, obj);
}
/* zpool driver */
@@ -1638,6 +1643,13 @@ static int migrate_zspage(struct zs_pool *pool, struct size_class *class,
free_obj = obj_malloc(d_page, class, handle);
zs_object_copy(used_obj, free_obj, class);
index++;
+ /*
+ * record_obj updates handle's value to free_obj and it will
+ * invalidate lock bit(ie, HANDLE_PIN_BIT) of handle, which
+ * breaks synchronization using pin_tag(e,g, zs_free) so
+ * let's keep the lock bit.
+ */
+ free_obj |= BIT(HANDLE_PIN_BIT);
record_obj(handle, free_obj);
unpin_tag(handle);
obj_free(pool, class, used_obj);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 181/268] prctl: take mmap sem for writing to protect against others
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (179 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 180/268] zsmalloc: fix migrate_zspage-zs_free race condition Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 182/268] ALSA: timer: Handle disconnection more safely Kamal Mostafa
` (86 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mateusz Guzik, Alexey Dobriyan, Jarod Wilson, Jan Stancek,
Al Viro, Anshuman Khandual, Andrew Morton, Linus Torvalds,
Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Mateusz Guzik <mguzik@redhat.com>
commit ddf1d398e517e660207e2c807f76a90df543a217 upstream.
An unprivileged user can trigger an oops on a kernel with
CONFIG_CHECKPOINT_RESTORE.
proc_pid_cmdline_read takes mmap_sem for reading and obtains args + env
start/end values. These get sanity checked as follows:
BUG_ON(arg_start > arg_end);
BUG_ON(env_start > env_end);
These can be changed by prctl_set_mm. Turns out also takes the semaphore for
reading, effectively rendering it useless. This results in:
kernel BUG at fs/proc/base.c:240!
invalid opcode: 0000 [#1] SMP
Modules linked in: virtio_net
CPU: 0 PID: 925 Comm: a.out Not tainted 4.4.0-rc8-next-20160105dupa+ #71
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
task: ffff880077a68000 ti: ffff8800784d0000 task.ti: ffff8800784d0000
RIP: proc_pid_cmdline_read+0x520/0x530
RSP: 0018:ffff8800784d3db8 EFLAGS: 00010206
RAX: ffff880077c5b6b0 RBX: ffff8800784d3f18 RCX: 0000000000000000
RDX: 0000000000000002 RSI: 00007f78e8857000 RDI: 0000000000000246
RBP: ffff8800784d3e40 R08: 0000000000000008 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000050
R13: 00007f78e8857800 R14: ffff88006fcef000 R15: ffff880077c5b600
FS: 00007f78e884a740(0000) GS:ffff88007b200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007f78e8361770 CR3: 00000000790a5000 CR4: 00000000000006f0
Call Trace:
__vfs_read+0x37/0x100
vfs_read+0x82/0x130
SyS_read+0x58/0xd0
entry_SYSCALL_64_fastpath+0x12/0x76
Code: 4c 8b 7d a8 eb e9 48 8b 9d 78 ff ff ff 4c 8b 7d 90 48 8b 03 48 39 45 a8 0f 87 f0 fe ff ff e9 d1 fe ff ff 4c 8b 7d 90 eb c6 0f 0b <0f> 0b 0f 0b 66 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
RIP proc_pid_cmdline_read+0x520/0x530
---[ end trace 97882617ae9c6818 ]---
Turns out there are instances where the code just reads aformentioned
values without locking whatsoever - namely environ_read and get_cmdline.
Interestingly these functions look quite resilient against bogus values,
but I don't believe this should be relied upon.
The first patch gets rid of the oops bug by grabbing mmap_sem for
writing.
The second patch is optional and puts locking around aformentioned
consumers for safety. Consumers of other fields don't seem to benefit
from similar treatment and are left untouched.
This patch (of 2):
The code was taking the semaphore for reading, which does not protect
against readers nor concurrent modifications.
The problem could cause a sanity checks to fail in procfs's cmdline
reader, resulting in an OOPS.
Note that some functions perform an unlocked read of various mm fields,
but they seem to be fine despite possible modificaton.
Signed-off-by: Mateusz Guzik <mguzik@redhat.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Jarod Wilson <jarod@redhat.com>
Cc: Jan Stancek <jstancek@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Anshuman Khandual <anshuman.linux@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/sys.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/kernel/sys.c b/kernel/sys.c
index 259fda2..af8c0b55 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1854,11 +1854,13 @@ static int prctl_set_mm_map(int opt, const void __user *addr, unsigned long data
user_auxv[AT_VECTOR_SIZE - 1] = AT_NULL;
}
- if (prctl_map.exe_fd != (u32)-1)
+ if (prctl_map.exe_fd != (u32)-1) {
error = prctl_set_mm_exe_file(mm, prctl_map.exe_fd);
- down_read(&mm->mmap_sem);
- if (error)
- goto out;
+ if (error)
+ return error;
+ }
+
+ down_write(&mm->mmap_sem);
/*
* We don't validate if these members are pointing to
@@ -1895,10 +1897,8 @@ static int prctl_set_mm_map(int opt, const void __user *addr, unsigned long data
if (prctl_map.auxv_size)
memcpy(mm->saved_auxv, user_auxv, sizeof(user_auxv));
- error = 0;
-out:
- up_read(&mm->mmap_sem);
- return error;
+ up_write(&mm->mmap_sem);
+ return 0;
}
#endif /* CONFIG_CHECKPOINT_RESTORE */
@@ -1964,7 +1964,7 @@ static int prctl_set_mm(int opt, unsigned long addr,
error = -EINVAL;
- down_read(&mm->mmap_sem);
+ down_write(&mm->mmap_sem);
vma = find_vma(mm, addr);
prctl_map.start_code = mm->start_code;
@@ -2057,7 +2057,7 @@ static int prctl_set_mm(int opt, unsigned long addr,
error = 0;
out:
- up_read(&mm->mmap_sem);
+ up_write(&mm->mmap_sem);
return error;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 182/268] ALSA: timer: Handle disconnection more safely
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (180 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 181/268] prctl: take mmap sem for writing to protect against others Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 183/268] libceph: fix ceph_msg_revoke() Kamal Mostafa
` (85 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Takashi Iwai <tiwai@suse.de>
commit 230323dac060123c340cf75997971145a42661ee upstream.
Currently ALSA timer device doesn't take the disconnection into
account very well; it merely unlinks the timer device at disconnection
callback but does nothing else. Because of this, when an application
accessing the timer device is disconnected, it may release the
resource before actually closed. In most cases, it results in a
warning message indicating a leftover timer instance like:
ALSA: timer xxxx is busy?
But basically this is an open race.
This patch tries to address it. The strategy is like other ALSA
devices: namely,
- Manage card's refcount at each open/close
- Wake up the pending tasks at disconnection
- Check the shutdown flag appropriately at each possible call
Note that this patch has one ugly hack to handle the wakeup of pending
tasks. It'd be cleaner to introduce a new disconnect op to
snd_timer_instance ops. But since it would lead to internal ABI
breakage and it eventually increase my own work when backporting to
stable kernels, I took a different path to implement locally in
timer.c. A cleanup patch will follow at next for 4.5 kernel.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=109431
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/core/timer.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 4e8d7bf..0a049c4 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -65,6 +65,7 @@ struct snd_timer_user {
int qtail;
int qused;
int queue_size;
+ bool disconnected;
struct snd_timer_read *queue;
struct snd_timer_tread *tqueue;
spinlock_t qlock;
@@ -290,6 +291,9 @@ int snd_timer_open(struct snd_timer_instance **ti,
mutex_unlock(®ister_mutex);
return -ENOMEM;
}
+ /* take a card refcount for safe disconnection */
+ if (timer->card)
+ get_device(&timer->card->card_dev);
timeri->slave_class = tid->dev_sclass;
timeri->slave_id = slave_id;
if (list_empty(&timer->open_list_head) && timer->hw.open)
@@ -360,6 +364,9 @@ int snd_timer_close(struct snd_timer_instance *timeri)
}
spin_unlock(&timer->lock);
spin_unlock_irq(&slave_active_lock);
+ /* release a card refcount for safe disconnection */
+ if (timer->card)
+ put_device(&timer->card->card_dev);
mutex_unlock(®ister_mutex);
}
out:
@@ -475,6 +482,8 @@ int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks)
timer = timeri->timer;
if (timer == NULL)
return -EINVAL;
+ if (timer->card && timer->card->shutdown)
+ return -ENODEV;
spin_lock_irqsave(&timer->lock, flags);
timeri->ticks = timeri->cticks = ticks;
timeri->pticks = 0;
@@ -509,6 +518,10 @@ static int _snd_timer_stop(struct snd_timer_instance * timeri,
spin_lock_irqsave(&timer->lock, flags);
list_del_init(&timeri->ack_list);
list_del_init(&timeri->active_list);
+ if (timer->card && timer->card->shutdown) {
+ spin_unlock_irqrestore(&timer->lock, flags);
+ return 0;
+ }
if ((timeri->flags & SNDRV_TIMER_IFLG_RUNNING) &&
!(--timer->running)) {
timer->hw.stop(timer);
@@ -571,6 +584,8 @@ int snd_timer_continue(struct snd_timer_instance *timeri)
timer = timeri->timer;
if (! timer)
return -EINVAL;
+ if (timer->card && timer->card->shutdown)
+ return -ENODEV;
spin_lock_irqsave(&timer->lock, flags);
if (!timeri->cticks)
timeri->cticks = 1;
@@ -634,6 +649,9 @@ static void snd_timer_tasklet(unsigned long arg)
unsigned long resolution, ticks;
unsigned long flags;
+ if (timer->card && timer->card->shutdown)
+ return;
+
spin_lock_irqsave(&timer->lock, flags);
/* now process all callbacks */
while (!list_empty(&timer->sack_list_head)) {
@@ -674,6 +692,9 @@ void snd_timer_interrupt(struct snd_timer * timer, unsigned long ticks_left)
if (timer == NULL)
return;
+ if (timer->card && timer->card->shutdown)
+ return;
+
spin_lock_irqsave(&timer->lock, flags);
/* remember the current resolution */
@@ -884,11 +905,28 @@ static int snd_timer_dev_register(struct snd_device *dev)
return 0;
}
+/* just for reference in snd_timer_dev_disconnect() below */
+static void snd_timer_user_ccallback(struct snd_timer_instance *timeri,
+ int event, struct timespec *tstamp,
+ unsigned long resolution);
+
static int snd_timer_dev_disconnect(struct snd_device *device)
{
struct snd_timer *timer = device->device_data;
+ struct snd_timer_instance *ti;
+
mutex_lock(®ister_mutex);
list_del_init(&timer->device_list);
+ /* wake up pending sleepers */
+ list_for_each_entry(ti, &timer->open_list_head, open_list) {
+ /* FIXME: better to have a ti.disconnect() op */
+ if (ti->ccallback == snd_timer_user_ccallback) {
+ struct snd_timer_user *tu = ti->callback_data;
+
+ tu->disconnected = true;
+ wake_up(&tu->qchange_sleep);
+ }
+ }
mutex_unlock(®ister_mutex);
return 0;
}
@@ -899,6 +937,8 @@ void snd_timer_notify(struct snd_timer *timer, int event, struct timespec *tstam
unsigned long resolution = 0;
struct snd_timer_instance *ti, *ts;
+ if (timer->card && timer->card->shutdown)
+ return;
if (! (timer->hw.flags & SNDRV_TIMER_HW_SLAVE))
return;
if (snd_BUG_ON(event < SNDRV_TIMER_EVENT_MSTART ||
@@ -1057,6 +1097,8 @@ static void snd_timer_proc_read(struct snd_info_entry *entry,
mutex_lock(®ister_mutex);
list_for_each_entry(timer, &snd_timer_list, device_list) {
+ if (timer->card && timer->card->shutdown)
+ continue;
switch (timer->tmr_class) {
case SNDRV_TIMER_CLASS_GLOBAL:
snd_iprintf(buffer, "G%i: ", timer->tmr_device);
@@ -1882,6 +1924,10 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer,
remove_wait_queue(&tu->qchange_sleep, &wait);
+ if (tu->disconnected) {
+ err = -ENODEV;
+ break;
+ }
if (signal_pending(current)) {
err = -ERESTARTSYS;
break;
@@ -1931,6 +1977,8 @@ static unsigned int snd_timer_user_poll(struct file *file, poll_table * wait)
mask = 0;
if (tu->qused)
mask |= POLLIN | POLLRDNORM;
+ if (tu->disconnected)
+ mask |= POLLERR;
return mask;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 183/268] libceph: fix ceph_msg_revoke()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (181 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 182/268] ALSA: timer: Handle disconnection more safely Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 184/268] MIPS: Loongson-3: Fix SMP_ASK_C0COUNT IPI handler Kamal Mostafa
` (84 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Ilya Dryomov, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Ilya Dryomov <idryomov@gmail.com>
commit 67645d7619738e51c668ca69f097cb90b5470422 upstream.
There are a number of problems with revoking a "was sending" message:
(1) We never make any attempt to revoke data - only kvecs contibute to
con->out_skip. However, once the header (envelope) is written to the
socket, our peer learns data_len and sets itself to expect at least
data_len bytes to follow front or front+middle. If ceph_msg_revoke()
is called while the messenger is sending message's data portion,
anything we send after that call is counted by the OSD towards the now
revoked message's data portion. The effects vary, the most common one
is the eventual hang - higher layers get stuck waiting for the reply to
the message that was sent out after ceph_msg_revoke() returned and
treated by the OSD as a bunch of data bytes. This is what Matt ran
into.
(2) Flat out zeroing con->out_kvec_bytes worth of bytes to handle kvecs
is wrong. If ceph_msg_revoke() is called before the tag is sent out or
while the messenger is sending the header, we will get a connection
reset, either due to a bad tag (0 is not a valid tag) or a bad header
CRC, which kind of defeats the purpose of revoke. Currently the kernel
client refuses to work with header CRCs disabled, but that will likely
change in the future, making this even worse.
(3) con->out_skip is not reset on connection reset, leading to one or
more spurious connection resets if we happen to get a real one between
con->out_skip is set in ceph_msg_revoke() and before it's cleared in
write_partial_skip().
Fixing (1) and (3) is trivial. The idea behind fixing (2) is to never
zero the tag or the header, i.e. send out tag+header regardless of when
ceph_msg_revoke() is called. That way the header is always correct, no
unnecessary resets are induced and revoke stands ready for disabled
CRCs. Since ceph_msg_revoke() rips out con->out_msg, introduce a new
"message out temp" and copy the header into it before sending.
Reported-by: Matt Conner <matt.conner@keepertech.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Tested-by: Matt Conner <matt.conner@keepertech.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/ceph/messenger.h | 2 +-
net/ceph/messenger.c | 76 ++++++++++++++++++++++++++++++++----------
2 files changed, 59 insertions(+), 19 deletions(-)
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index 3775327..1f043da 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -226,6 +226,7 @@ struct ceph_connection {
struct ceph_entity_addr actual_peer_addr;
/* message out temps */
+ struct ceph_msg_header out_hdr;
struct ceph_msg *out_msg; /* sending message (== tail of
out_sent) */
bool out_msg_done;
@@ -235,7 +236,6 @@ struct ceph_connection {
int out_kvec_left; /* kvec's left in out_kvec */
int out_skip; /* skip this many bytes */
int out_kvec_bytes; /* total bytes left */
- bool out_kvec_is_msg; /* kvec refers to out_msg */
int out_more; /* there is more data after the kvecs */
__le64 out_temp_ack; /* for writing an ack */
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index e3be1d2..ec564c5 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -675,6 +675,8 @@ static void reset_connection(struct ceph_connection *con)
}
con->in_seq = 0;
con->in_seq_acked = 0;
+
+ con->out_skip = 0;
}
/*
@@ -774,6 +776,8 @@ static u32 get_global_seq(struct ceph_messenger *msgr, u32 gt)
static void con_out_kvec_reset(struct ceph_connection *con)
{
+ BUG_ON(con->out_skip);
+
con->out_kvec_left = 0;
con->out_kvec_bytes = 0;
con->out_kvec_cur = &con->out_kvec[0];
@@ -782,9 +786,9 @@ static void con_out_kvec_reset(struct ceph_connection *con)
static void con_out_kvec_add(struct ceph_connection *con,
size_t size, void *data)
{
- int index;
+ int index = con->out_kvec_left;
- index = con->out_kvec_left;
+ BUG_ON(con->out_skip);
BUG_ON(index >= ARRAY_SIZE(con->out_kvec));
con->out_kvec[index].iov_len = size;
@@ -793,6 +797,27 @@ static void con_out_kvec_add(struct ceph_connection *con,
con->out_kvec_bytes += size;
}
+/*
+ * Chop off a kvec from the end. Return residual number of bytes for
+ * that kvec, i.e. how many bytes would have been written if the kvec
+ * hadn't been nuked.
+ */
+static int con_out_kvec_skip(struct ceph_connection *con)
+{
+ int off = con->out_kvec_cur - con->out_kvec;
+ int skip = 0;
+
+ if (con->out_kvec_bytes > 0) {
+ skip = con->out_kvec[off + con->out_kvec_left - 1].iov_len;
+ BUG_ON(con->out_kvec_bytes < skip);
+ BUG_ON(!con->out_kvec_left);
+ con->out_kvec_bytes -= skip;
+ con->out_kvec_left--;
+ }
+
+ return skip;
+}
+
#ifdef CONFIG_BLOCK
/*
@@ -1200,7 +1225,6 @@ static void prepare_write_message_footer(struct ceph_connection *con)
m->footer.flags |= CEPH_MSG_FOOTER_COMPLETE;
dout("prepare_write_message_footer %p\n", con);
- con->out_kvec_is_msg = true;
con->out_kvec[v].iov_base = &m->footer;
if (con->peer_features & CEPH_FEATURE_MSG_AUTH) {
if (con->ops->sign_message)
@@ -1228,7 +1252,6 @@ static void prepare_write_message(struct ceph_connection *con)
u32 crc;
con_out_kvec_reset(con);
- con->out_kvec_is_msg = true;
con->out_msg_done = false;
/* Sneak an ack in there first? If we can get it into the same
@@ -1268,18 +1291,19 @@ static void prepare_write_message(struct ceph_connection *con)
/* tag + hdr + front + middle */
con_out_kvec_add(con, sizeof (tag_msg), &tag_msg);
- con_out_kvec_add(con, sizeof (m->hdr), &m->hdr);
+ con_out_kvec_add(con, sizeof(con->out_hdr), &con->out_hdr);
con_out_kvec_add(con, m->front.iov_len, m->front.iov_base);
if (m->middle)
con_out_kvec_add(con, m->middle->vec.iov_len,
m->middle->vec.iov_base);
- /* fill in crc (except data pages), footer */
+ /* fill in hdr crc and finalize hdr */
crc = crc32c(0, &m->hdr, offsetof(struct ceph_msg_header, crc));
con->out_msg->hdr.crc = cpu_to_le32(crc);
- con->out_msg->footer.flags = 0;
+ memcpy(&con->out_hdr, &con->out_msg->hdr, sizeof(con->out_hdr));
+ /* fill in front and middle crc, footer */
crc = crc32c(0, m->front.iov_base, m->front.iov_len);
con->out_msg->footer.front_crc = cpu_to_le32(crc);
if (m->middle) {
@@ -1291,6 +1315,7 @@ static void prepare_write_message(struct ceph_connection *con)
dout("%s front_crc %u middle_crc %u\n", __func__,
le32_to_cpu(con->out_msg->footer.front_crc),
le32_to_cpu(con->out_msg->footer.middle_crc));
+ con->out_msg->footer.flags = 0;
/* is there a data payload? */
con->out_msg->footer.data_crc = 0;
@@ -1485,7 +1510,6 @@ static int write_partial_kvec(struct ceph_connection *con)
}
}
con->out_kvec_left = 0;
- con->out_kvec_is_msg = false;
ret = 1;
out:
dout("write_partial_kvec %p %d left in %d kvecs ret = %d\n", con,
@@ -1577,6 +1601,7 @@ static int write_partial_skip(struct ceph_connection *con)
{
int ret;
+ dout("%s %p %d left\n", __func__, con, con->out_skip);
while (con->out_skip > 0) {
size_t size = min(con->out_skip, (int) PAGE_CACHE_SIZE);
@@ -2493,13 +2518,13 @@ more:
more_kvec:
/* kvec data queued? */
- if (con->out_skip) {
- ret = write_partial_skip(con);
+ if (con->out_kvec_left) {
+ ret = write_partial_kvec(con);
if (ret <= 0)
goto out;
}
- if (con->out_kvec_left) {
- ret = write_partial_kvec(con);
+ if (con->out_skip) {
+ ret = write_partial_skip(con);
if (ret <= 0)
goto out;
}
@@ -3033,16 +3058,31 @@ void ceph_msg_revoke(struct ceph_msg *msg)
ceph_msg_put(msg);
}
if (con->out_msg == msg) {
- dout("%s %p msg %p - was sending\n", __func__, con, msg);
- con->out_msg = NULL;
- if (con->out_kvec_is_msg) {
- con->out_skip = con->out_kvec_bytes;
- con->out_kvec_is_msg = false;
+ BUG_ON(con->out_skip);
+ /* footer */
+ if (con->out_msg_done) {
+ con->out_skip += con_out_kvec_skip(con);
+ } else {
+ BUG_ON(!msg->data_length);
+ if (con->peer_features & CEPH_FEATURE_MSG_AUTH)
+ con->out_skip += sizeof(msg->footer);
+ else
+ con->out_skip += sizeof(msg->old_footer);
}
+ /* data, middle, front */
+ if (msg->data_length)
+ con->out_skip += msg->cursor.total_resid;
+ if (msg->middle)
+ con->out_skip += con_out_kvec_skip(con);
+ con->out_skip += con_out_kvec_skip(con);
+
+ dout("%s %p msg %p - was sending, will write %d skip %d\n",
+ __func__, con, msg, con->out_kvec_bytes, con->out_skip);
msg->hdr.seq = 0;
-
+ con->out_msg = NULL;
ceph_msg_put(msg);
}
+
mutex_unlock(&con->mutex);
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 184/268] MIPS: Loongson-3: Fix SMP_ASK_C0COUNT IPI handler
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (182 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 183/268] libceph: fix ceph_msg_revoke() Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 185/268] MIPS: hpet: Choose a safe value for the ETIME check Kamal Mostafa
` (83 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Huacai Chen, Aurelien Jarno, Steven J. Hill, Fuxin Zhang,
Zhangjin Wu, linux-mips, Ralf Baechle, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Huacai Chen <chenhc@lemote.com>
commit 5754843225f78ac7cbe142a6899890a9733a5a5d upstream.
When Core-0 handle SMP_ASK_C0COUNT IPI, we should make other cores to
see the result as soon as possible (especially when Store-Fill-Buffer
is enabled). Otherwise, C0_Count syncronization makes no sense.
BTW, array is more suitable than per-cpu variable for syncronization,
and there is a corner case should be avoid: C0_Count of Core-0 can be
really 0.
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/12160/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/mips/loongson64/loongson-3/smp.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/arch/mips/loongson64/loongson-3/smp.c b/arch/mips/loongson64/loongson-3/smp.c
index 1a4738a..509832a9 100644
--- a/arch/mips/loongson64/loongson-3/smp.c
+++ b/arch/mips/loongson64/loongson-3/smp.c
@@ -30,13 +30,13 @@
#include "smp.h"
DEFINE_PER_CPU(int, cpu_state);
-DEFINE_PER_CPU(uint32_t, core0_c0count);
static void *ipi_set0_regs[16];
static void *ipi_clear0_regs[16];
static void *ipi_status0_regs[16];
static void *ipi_en0_regs[16];
static void *ipi_mailbox_buf[16];
+static uint32_t core0_c0count[NR_CPUS];
/* read a 32bit value from ipi register */
#define loongson3_ipi_read32(addr) readl(addr)
@@ -275,12 +275,14 @@ void loongson3_ipi_interrupt(struct pt_regs *regs)
if (action & SMP_ASK_C0COUNT) {
BUG_ON(cpu != 0);
c0count = read_c0_count();
- for (i = 1; i < num_possible_cpus(); i++)
- per_cpu(core0_c0count, i) = c0count;
+ c0count = c0count ? c0count : 1;
+ for (i = 1; i < nr_cpu_ids; i++)
+ core0_c0count[i] = c0count;
+ __wbflush(); /* Let others see the result ASAP */
}
}
-#define MAX_LOOPS 1111
+#define MAX_LOOPS 800
/*
* SMP init and finish on secondary CPUs
*/
@@ -305,16 +307,20 @@ static void loongson3_init_secondary(void)
cpu_logical_map(cpu) / loongson_sysconf.cores_per_package;
i = 0;
- __this_cpu_write(core0_c0count, 0);
+ core0_c0count[cpu] = 0;
loongson3_send_ipi_single(0, SMP_ASK_C0COUNT);
- while (!__this_cpu_read(core0_c0count)) {
+ while (!core0_c0count[cpu]) {
i++;
cpu_relax();
}
if (i > MAX_LOOPS)
i = MAX_LOOPS;
- initcount = __this_cpu_read(core0_c0count) + i;
+ if (cpu_data[cpu].package)
+ initcount = core0_c0count[cpu] + i;
+ else /* Local access is faster for loops */
+ initcount = core0_c0count[cpu] + i/2;
+
write_c0_count(initcount);
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 185/268] MIPS: hpet: Choose a safe value for the ETIME check
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (183 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 184/268] MIPS: Loongson-3: Fix SMP_ASK_C0COUNT IPI handler Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 186/268] ocfs2: NFS hangs in __ocfs2_cluster_lock due to race with ocfs2_unblock_lock Kamal Mostafa
` (82 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Huacai Chen, Aurelien Jarno, Steven J. Hill, Fuxin Zhang,
Zhangjin Wu, linux-mips, Ralf Baechle, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Huacai Chen <chenhc@lemote.com>
commit 5610b1254e3689b6ef8ebe2db260709a74da06c8 upstream.
This patch is borrowed from x86 hpet driver and explaind below:
Due to the overly intelligent design of HPETs, we need to workaround
the problem that the compare value which we write is already behind
the actual counter value at the point where the value hits the real
compare register. This happens for two reasons:
1) We read out the counter, add the delta and write the result to the
compare register. When a NMI hits between the read out and the write
then the counter can be ahead of the event already.
2) The write to the compare register is delayed by up to two HPET
cycles in AMD chipsets.
We can work around this by reading back the compare register to make
sure that the written value has hit the hardware. But that is bad
performance wise for the normal case where the event is far enough in
the future.
As we already know that the write can be delayed by up to two cycles
we can avoid the read back of the compare register completely if we
make the decision whether the delta has elapsed already or not based
on the following calculation:
cmp = event - actual_count;
If cmp is less than 64 HPET clock cycles, then we decide that the event
has happened already and return -ETIME. That covers the above #1 and #2
problems which would cause a wait for HPET wraparound (~306 seconds).
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/12162/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/mips/loongson64/loongson-3/hpet.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/mips/loongson64/loongson-3/hpet.c b/arch/mips/loongson64/loongson-3/hpet.c
index 5c21cd3..b2888d5 100644
--- a/arch/mips/loongson64/loongson-3/hpet.c
+++ b/arch/mips/loongson64/loongson-3/hpet.c
@@ -13,6 +13,9 @@
#define SMBUS_PCI_REG64 0x64
#define SMBUS_PCI_REGB4 0xb4
+#define HPET_MIN_CYCLES 64
+#define HPET_MIN_PROG_DELTA (HPET_MIN_CYCLES + (HPET_MIN_CYCLES >> 1))
+
static DEFINE_SPINLOCK(hpet_lock);
DEFINE_PER_CPU(struct clock_event_device, hpet_clockevent_device);
@@ -139,8 +142,9 @@ static int hpet_next_event(unsigned long delta,
cnt += delta;
hpet_write(HPET_T0_CMP, cnt);
- res = ((int)(hpet_read(HPET_COUNTER) - cnt) > 0) ? -ETIME : 0;
- return res;
+ res = (int)(cnt - hpet_read(HPET_COUNTER));
+
+ return res < HPET_MIN_CYCLES ? -ETIME : 0;
}
static irqreturn_t hpet_irq_handler(int irq, void *data)
@@ -212,7 +216,7 @@ void __init setup_hpet_timer(void)
cd->cpumask = cpumask_of(cpu);
clockevent_set_clock(cd, HPET_FREQ);
cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
- cd->min_delta_ns = 5000;
+ cd->min_delta_ns = clockevent_delta2ns(HPET_MIN_PROG_DELTA, cd);
clockevents_register_device(cd);
setup_irq(HPET_T0_IRQ, &hpet_irq);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 186/268] ocfs2: NFS hangs in __ocfs2_cluster_lock due to race with ocfs2_unblock_lock
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (184 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 185/268] MIPS: hpet: Choose a safe value for the ETIME check Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 187/268] pNFS/flexfiles: Fix an XDR encoding bug in layoutreturn Kamal Mostafa
` (81 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Tariq Saeed, Santosh Shilimkar, Joel Becker, Junxiao Bi,
Eric Ren, Andrew Morton, Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Tariq Saeed <tariq.x.saeed@oracle.com>
commit b1b1e15ef6b80facf76d6757649dfd7295eda29f upstream.
NFS on a 2 node ocfs2 cluster each node exporting dir. The lock causing
the hang is the global bit map inode lock. Node 1 is master, has the
lock granted in PR mode; Node 2 is in the converting list (PR -> EX).
There are no holders of the lock on the master node so it should
downconvert to NL and grant EX to node 2 but that does not happen.
BLOCKED + QUEUED in lock res are set and it is on osb blocked list.
Threads are waiting in __ocfs2_cluster_lock on BLOCKED. One thread
wants EX, rest want PR. So it is as though the downconvert thread needs
to be kicked to complete the conv.
The hang is caused by an EX req coming into __ocfs2_cluster_lock on the
heels of a PR req after it sets BUSY (drops l_lock, releasing EX
thread), forcing the incoming EX to wait on BUSY without doing anything.
PR has called ocfs2_dlm_lock, which sets the node 1 lock from NL -> PR,
queues ast.
At this time, upconvert (PR ->EX) arrives from node 2, finds conflict
with node 1 lock in PR, so the lock res is put on dlm thread's dirty
listt.
After ret from ocf2_dlm_lock, PR thread now waits behind EX on BUSY till
awoken by ast.
Now it is dlm_thread that serially runs dlm_shuffle_lists, ast, bast, in
that order. dlm_shuffle_lists ques a bast on behalf of node 2 (which
will be run by dlm_thread right after the ast). ast does its part, sets
UPCONVERT_FINISHING, clears BUSY and wakes its waiters. Next,
dlm_thread runs bast. It sets BLOCKED and kicks dc thread. dc thread
runs ocfs2_unblock_lock, but since UPCONVERT_FINISHING set, skips doing
anything and reques.
Inside of __ocfs2_cluster_lock, since EX has been waiting on BUSY ahead
of PR, it wakes up first, finds BLOCKED set and skips doing anything but
clearing UPCONVERT_FINISHING (which was actually "meant" for the PR
thread), and this time waits on BLOCKED. Next, the PR thread comes out
of wait but since UPCONVERT_FINISHING is not set, it skips updating the
l_ro_holders and goes straight to wait on BLOCKED. So there, we have a
hang! Threads in __ocfs2_cluster_lock wait on BLOCKED, lock res in osb
blocked list. Only when dc thread is awoken, it will run
ocfs2_unblock_lock and things will unhang.
One way to fix this is to wake the dc thread on the flag after clearing
UPCONVERT_FINISHING
Orabug: 20933419
Signed-off-by: Tariq Saeed <tariq.x.saeed@oracle.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Reviewed-by: Wengang Wang <wen.gang.wang@oracle.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Eric Ren <zren@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/ocfs2/dlmglue.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 23157e4..3623ab6 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -1390,6 +1390,7 @@ static int __ocfs2_cluster_lock(struct ocfs2_super *osb,
unsigned int gen;
int noqueue_attempted = 0;
int dlm_locked = 0;
+ int kick_dc = 0;
if (!(lockres->l_flags & OCFS2_LOCK_INITIALIZED)) {
mlog_errno(-EINVAL);
@@ -1524,7 +1525,12 @@ update_holders:
unlock:
lockres_clear_flags(lockres, OCFS2_LOCK_UPCONVERT_FINISHING);
+ /* ocfs2_unblock_lock reques on seeing OCFS2_LOCK_UPCONVERT_FINISHING */
+ kick_dc = (lockres->l_flags & OCFS2_LOCK_BLOCKED);
+
spin_unlock_irqrestore(&lockres->l_lock, flags);
+ if (kick_dc)
+ ocfs2_wake_downconvert_thread(osb);
out:
/*
* This is helping work around a lock inversion between the page lock
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 187/268] pNFS/flexfiles: Fix an XDR encoding bug in layoutreturn
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (185 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 186/268] ocfs2: NFS hangs in __ocfs2_cluster_lock due to race with ocfs2_unblock_lock Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 188/268] make sure that freeing shmem fast symlinks is RCU-delayed Kamal Mostafa
` (80 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Trond Myklebust, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Trond Myklebust <trond.myklebust@primarydata.com>
commit 082fa37d1351a41afc491d44a1d095cb8d919aa2 upstream.
We must not skip encoding the statistics, or the server will see an
XDR encoding error.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/flexfilelayout/flexfilelayout.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index 14e3b1e..c5f37bb 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -1683,11 +1683,9 @@ ff_layout_encode_layoutreturn(struct pnfs_layout_hdr *lo,
start = xdr_reserve_space(xdr, 4);
BUG_ON(!start);
- if (ff_layout_encode_ioerr(flo, xdr, args))
- goto out;
-
+ ff_layout_encode_ioerr(flo, xdr, args);
ff_layout_encode_iostats(flo, xdr, args);
-out:
+
*start = cpu_to_be32((xdr->p - start - 1) * 4);
dprintk("%s: Return\n", __func__);
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 188/268] make sure that freeing shmem fast symlinks is RCU-delayed
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (186 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 187/268] pNFS/flexfiles: Fix an XDR encoding bug in layoutreturn Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 189/268] MAINTAINERS: return arch/sh to maintained state, with new maintainers Kamal Mostafa
` (79 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Al Viro, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Al Viro <viro@zeniv.linux.org.uk>
commit 3ed47db34f480df7caf44436e3e63e555351ae9a upstream.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/shmem_fs.h | 5 +----
mm/shmem.c | 9 ++++-----
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index 50777b5..92d112a 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -15,10 +15,7 @@ struct shmem_inode_info {
unsigned int seals; /* shmem seals */
unsigned long flags;
unsigned long alloced; /* data pages alloced to file */
- union {
- unsigned long swapped; /* subtotal assigned to swap */
- char *symlink; /* unswappable short symlink */
- };
+ unsigned long swapped; /* subtotal assigned to swap */
struct shared_policy policy; /* NUMA memory alloc policy */
struct list_head swaplist; /* chain of maybes on swap */
struct simple_xattrs xattrs; /* list of xattrs */
diff --git a/mm/shmem.c b/mm/shmem.c
index dbe0c1e..b2890af 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -597,8 +597,7 @@ static void shmem_evict_inode(struct inode *inode)
list_del_init(&info->swaplist);
mutex_unlock(&shmem_swaplist_mutex);
}
- } else
- kfree(info->symlink);
+ }
simple_xattrs_free(&info->xattrs);
WARN_ON(inode->i_blocks);
@@ -2445,13 +2444,12 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
info = SHMEM_I(inode);
inode->i_size = len-1;
if (len <= SHORT_SYMLINK_LEN) {
- info->symlink = kmemdup(symname, len, GFP_KERNEL);
- if (!info->symlink) {
+ inode->i_link = kmemdup(symname, len, GFP_KERNEL);
+ if (!inode->i_link) {
iput(inode);
return -ENOMEM;
}
inode->i_op = &shmem_short_symlink_operations;
- inode->i_link = info->symlink;
} else {
error = shmem_getpage(inode, 0, &page, SGP_WRITE, NULL);
if (error) {
@@ -3066,6 +3064,7 @@ static struct inode *shmem_alloc_inode(struct super_block *sb)
static void shmem_destroy_callback(struct rcu_head *head)
{
struct inode *inode = container_of(head, struct inode, i_rcu);
+ kfree(inode->i_link);
kmem_cache_free(shmem_inode_cachep, SHMEM_I(inode));
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 189/268] MAINTAINERS: return arch/sh to maintained state, with new maintainers
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (187 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 188/268] make sure that freeing shmem fast symlinks is RCU-delayed Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 190/268] MIPS: Fix some missing CONFIG_CPU_MIPSR6 #ifdefs Kamal Mostafa
` (78 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Rich Felker, Yoshinori Sato, Andrew Morton, Linus Torvalds,
Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Rich Felker <dalias@libc.org>
commit 114bf37e04d839b555b3dc460b5e6ce156f49cf0 upstream.
Add Yoshinori Sato and Rich Felker as maintainers for arch/sh
(SUPERH).
Signed-off-by: Rich Felker <dalias@libc.org>
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Acked-by: D. Jeff Dionne <jeff@uClinux.org>
Acked-by: Rob Landley <rob@landley.net>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
MAINTAINERS | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 5ac682d..60f1caa 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9837,9 +9837,11 @@ S: Maintained
F: drivers/net/ethernet/dlink/sundance.c
SUPERH
+M: Yoshinori Sato <ysato@users.sourceforge.jp>
+M: Rich Felker <dalias@libc.org>
L: linux-sh@vger.kernel.org
Q: http://patchwork.kernel.org/project/linux-sh/list/
-S: Orphan
+S: Maintained
F: Documentation/sh/
F: arch/sh/
F: drivers/sh/
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 190/268] MIPS: Fix some missing CONFIG_CPU_MIPSR6 #ifdefs
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (188 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 189/268] MAINTAINERS: return arch/sh to maintained state, with new maintainers Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 191/268] ideapad-laptop: Add Lenovo Yoga 700 to no_hw_rfkill dmi list Kamal Mostafa
` (77 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Huacai Chen, Aurelien Jarno, Steven J. Hill, Fuxin Zhang,
Zhangjin Wu, linux-mips, Ralf Baechle, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Huacai Chen <chenhc@lemote.com>
commit 4f33f6c522948fffc345261896042b58dea23754 upstream.
Commit be0c37c985eddc4 (MIPS: Rearrange PTE bits into fixed positions.)
defines fixed PTE bits for MIPS R2. Then, commit d7b631419b3d230a4d383
(MIPS: pgtable-bits: Fix XPA damage to R6 definitions.) adds the MIPS
R6 definitions in the same way as MIPS R2. But some R6 #ifdefs in the
later commit are missing, so in this patch I fix that.
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/12164/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/mips/include/asm/pgtable.h | 4 ++--
arch/mips/mm/tlbex.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
index ae85694..6bc427f 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -353,7 +353,7 @@ static inline pte_t pte_mkdirty(pte_t pte)
static inline pte_t pte_mkyoung(pte_t pte)
{
pte_val(pte) |= _PAGE_ACCESSED;
-#ifdef CONFIG_CPU_MIPSR2
+#if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)
if (!(pte_val(pte) & _PAGE_NO_READ))
pte_val(pte) |= _PAGE_SILENT_READ;
else
@@ -558,7 +558,7 @@ static inline pmd_t pmd_mkyoung(pmd_t pmd)
{
pmd_val(pmd) |= _PAGE_ACCESSED;
-#ifdef CONFIG_CPU_MIPSR2
+#if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)
if (!(pmd_val(pmd) & _PAGE_NO_READ))
pmd_val(pmd) |= _PAGE_SILENT_READ;
else
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 323d1d3..99e3bd3 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -242,7 +242,7 @@ static void output_pgtable_bits_defines(void)
pr_define("_PAGE_HUGE_SHIFT %d\n", _PAGE_HUGE_SHIFT);
pr_define("_PAGE_SPLITTING_SHIFT %d\n", _PAGE_SPLITTING_SHIFT);
#endif
-#ifdef CONFIG_CPU_MIPSR2
+#if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)
if (cpu_has_rixi) {
#ifdef _PAGE_NO_EXEC_SHIFT
pr_define("_PAGE_NO_EXEC_SHIFT %d\n", _PAGE_NO_EXEC_SHIFT);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 191/268] ideapad-laptop: Add Lenovo Yoga 700 to no_hw_rfkill dmi list
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (189 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 190/268] MIPS: Fix some missing CONFIG_CPU_MIPSR6 #ifdefs Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 192/268] drm/i915: On fb alloc failure, unref gem object where it gets refed Kamal Mostafa
` (76 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Josh Boyer, Darren Hart, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Josh Boyer <jwboyer@fedoraproject.org>
commit 6b31de3e698582fe0b8f7f4bab15831b73204800 upstream.
Like the Yoga 900 models the Lenovo Yoga 700 does not have a
hw rfkill switch, and trying to read the hw rfkill switch through the
ideapad module causes it to always reported blocking breaking wifi.
This commit adds the Lenovo Yoga 700 to the no_hw_rfkill dmi list, fixing
the wifi breakage.
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1295272
Tested-by: <dinyar.rabady+spam@gmail.com>
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/platform/x86/ideapad-laptop.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 468c566..e2b3743 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -874,6 +874,13 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
},
},
{
+ .ident = "Lenovo Yoga 700",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 700"),
+ },
+ },
+ {
.ident = "Lenovo Yoga 900",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 192/268] drm/i915: On fb alloc failure, unref gem object where it gets refed
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (190 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 191/268] ideapad-laptop: Add Lenovo Yoga 700 to no_hw_rfkill dmi list Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 193/268] [media] rc: allow rc modules to be loaded if rc-main is not a module Kamal Mostafa
` (75 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Tvrtko Ursulin, Chris Wilson, Lukas Wunner, Jani Nikula, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Lukas Wunner <lukas@wunner.de>
commit dcb1394e74e32e33856e877bca1a0e88c78323d8 upstream.
Currently when allocating a framebuffer fails, the gem object gets
unrefed at the bottom of the call stack in __intel_framebuffer_create,
not where it gets refed, which is in intel_framebuffer_create_for_mode
(via i915_gem_alloc_object) and in intel_user_framebuffer_create
(via drm_gem_object_lookup).
This invites mistakes: __intel_framebuffer_create is also called from
intelfb_alloc, and as discovered by Tvrtko Ursulin, a double unref
was introduced there with a8bb6818270c ("drm/i915: Fix error path leak
in fbdev fb allocation").
As suggested by Ville Syrjälä, fix the double unref and improve code
clarity by moving the unref away from __intel_framebuffer_create to
where the gem object gets refed.
Based on Tvrtko Ursulin's original v2.
v3: On fb alloc failure, unref gem object where it gets refed,
fix double unref in separate commit (Ville Syrjälä)
v4: Lock struct_mutex on unref (Chris Wilson)
v5: Rebase on drm-intel-nightly 2015y-09m-01d-09h-06m-08s UTC,
rephrase commit message (Jani Nicula)
Tested-by: Pierre Moreau <pierre.morrow@free.fr>
[MBP 5,3 2009 nvidia MCP79 + G96 pre-retina]
Tested-by: Paul Hordiienko <pvt.gord@gmail.com>
[MBP 6,2 2010 intel ILK + nvidia GT216 pre-retina]
Tested-by: William Brown <william@blackhats.net.au>
[MBP 8,2 2011 intel SNB + amd turks pre-retina]
Tested-by: Lukas Wunner <lukas@wunner.de>
[MBP 9,1 2012 intel IVB + nvidia GK107 pre-retina]
Tested-by: Bruno Bierbaumer <bruno@bierbaumer.net>
[MBP 11,3 2013 intel HSW + nvidia GK107 retina]
Fixes: a8bb6818270c ("drm/i915: Fix error path leak in fbdev fb
allocation")
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/2161c5062ef5d6458f8ae14d924a26d4d1dba317.1446892879.git.lukas@wunner.de
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
[ kamal: backport to 4.2-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/intel_display.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 05bf98d..8bd37dd 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9817,20 +9817,17 @@ __intel_framebuffer_create(struct drm_device *dev,
int ret;
intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL);
- if (!intel_fb) {
- drm_gem_object_unreference(&obj->base);
+ if (!intel_fb)
return ERR_PTR(-ENOMEM);
- }
ret = intel_framebuffer_init(dev, intel_fb, mode_cmd, obj);
if (ret)
goto err;
return &intel_fb->base;
+
err:
- drm_gem_object_unreference(&obj->base);
kfree(intel_fb);
-
return ERR_PTR(ret);
}
@@ -9870,6 +9867,7 @@ intel_framebuffer_create_for_mode(struct drm_device *dev,
struct drm_display_mode *mode,
int depth, int bpp)
{
+ struct drm_framebuffer *fb;
struct drm_i915_gem_object *obj;
struct drm_mode_fb_cmd2 mode_cmd = { 0 };
@@ -9884,7 +9882,11 @@ intel_framebuffer_create_for_mode(struct drm_device *dev,
bpp);
mode_cmd.pixel_format = drm_mode_legacy_fb_format(bpp, depth);
- return intel_framebuffer_create(dev, &mode_cmd, obj);
+ fb = intel_framebuffer_create(dev, &mode_cmd, obj);
+ if (IS_ERR(fb))
+ drm_gem_object_unreference_unlocked(&obj->base);
+
+ return fb;
}
static struct drm_framebuffer *
@@ -14267,6 +14269,7 @@ intel_user_framebuffer_create(struct drm_device *dev,
struct drm_file *filp,
struct drm_mode_fb_cmd2 *user_mode_cmd)
{
+ struct drm_framebuffer *fb;
struct drm_i915_gem_object *obj;
struct drm_mode_fb_cmd2 mode_cmd = *user_mode_cmd;
@@ -14275,7 +14278,11 @@ intel_user_framebuffer_create(struct drm_device *dev,
if (&obj->base == NULL)
return ERR_PTR(-ENOENT);
- return intel_framebuffer_create(dev, &mode_cmd, obj);
+ fb = intel_framebuffer_create(dev, &mode_cmd, obj);
+ if (IS_ERR(fb))
+ drm_gem_object_unreference_unlocked(&obj->base);
+
+ return fb;
}
#ifndef CONFIG_DRM_I915_FBDEV
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 193/268] [media] rc: allow rc modules to be loaded if rc-main is not a module
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (191 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 192/268] drm/i915: On fb alloc failure, unref gem object where it gets refed Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 194/268] [media] lirc_imon: do not leave imon_probe() with mutex held Kamal Mostafa
` (74 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Russell King, Mauro Carvalho Chehab, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Russell King <rmk+kernel@arm.linux.org.uk>
commit 2ff56fadd94cdaeeaeccbc0a9b703a0101ada128 upstream.
rc-main mistakenly uses #ifdef MODULE to determine whether it should
load the rc keymap modules. This symbol is only defined if rc-main
is being built as a module itself, and bears no relation to whether
the rc keymaps are modules.
Fix this to use CONFIG_MODULES instead.
Fixes: 631493ecacd8 ("[media] rc-core: merge rc-map.c into rc-main.c")
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/media/rc/rc-main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index f3b6b2c..ddc6fa8 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -60,7 +60,7 @@ struct rc_map *rc_map_get(const char *name)
struct rc_map_list *map;
map = seek_rc_map(name);
-#ifdef MODULE
+#ifdef CONFIG_MODULES
if (!map) {
int rc = request_module("%s", name);
if (rc < 0) {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 194/268] [media] lirc_imon: do not leave imon_probe() with mutex held
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (192 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 193/268] [media] rc: allow rc modules to be loaded if rc-main is not a module Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 195/268] SCSI: initio: remove duplicate module device table Kamal Mostafa
` (73 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Alexey Khoroshilov, Mauro Carvalho Chehab, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Alexey Khoroshilov <khoroshilov@ispras.ru>
commit b833d0df943d70682e288c38c96b8e7bfff4023a upstream.
Commit af8a819a2513 ("[media] lirc_imon: simplify error handling code")
lost mutex_unlock(&context->ctx_lock), so imon_probe() exits with
the context->ctx_lock mutex acquired.
The patch adds mutex_unlock(&context->ctx_lock) back.
Found by Linux Driver Verification project (linuxtesting.org).
Fixes: af8a819a2513 ("[media] lirc_imon: simplify error handling code")
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/staging/media/lirc/lirc_imon.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c
index 62ec9f7..45b6443 100644
--- a/drivers/staging/media/lirc/lirc_imon.c
+++ b/drivers/staging/media/lirc/lirc_imon.c
@@ -885,12 +885,14 @@ static int imon_probe(struct usb_interface *interface,
vendor, product, ifnum, usbdev->bus->busnum, usbdev->devnum);
/* Everything went fine. Just unlock and return retval (with is 0) */
+ mutex_unlock(&context->ctx_lock);
goto driver_unlock;
unregister_lirc:
lirc_unregister_driver(driver->minor);
free_tx_urb:
+ mutex_unlock(&context->ctx_lock);
usb_free_urb(tx_urb);
free_rx_urb:
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 195/268] SCSI: initio: remove duplicate module device table
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (193 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 194/268] [media] lirc_imon: do not leave imon_probe() with mutex held Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 196/268] clk: xgene: Fix divider with non-zero shift value Kamal Mostafa
` (72 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Arnd Bergmann, Martin K. Petersen, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Arnd Bergmann <arnd@arndb.de>
commit d282e2b383e3f41a7758e8cbf3076091ef9d9447 upstream.
The initio driver has for many years had two copies of the
same module device table. One of them is also used for registering
the other driver, the other one is entirely useless after the
large scale cleanup that Alan Cox did back in 2007.
The compiler warns about this whenever the driver is built-in:
drivers/scsi/initio.c:131:29: warning: 'i91u_pci_devices' defined but not used [-Wunused-variable]
This removes the extraneous table and the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 72d39fea901 ("[SCSI] initio: Convert into a real Linux driver and update to modern style")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/scsi/initio.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index 6a926ba..7a91cf3 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -110,11 +110,6 @@
#define i91u_MAXQUEUE 2
#define i91u_REVID "Initio INI-9X00U/UW SCSI device driver; Revision: 1.04a"
-#define I950_DEVICE_ID 0x9500 /* Initio's inic-950 product ID */
-#define I940_DEVICE_ID 0x9400 /* Initio's inic-940 product ID */
-#define I935_DEVICE_ID 0x9401 /* Initio's inic-935 product ID */
-#define I920_DEVICE_ID 0x0002 /* Initio's other product ID */
-
#ifdef DEBUG_i91u
static unsigned int i91u_debug = DEBUG_DEFAULT;
#endif
@@ -127,17 +122,6 @@ static int setup_debug = 0;
static void i91uSCBPost(u8 * pHcb, u8 * pScb);
-/* PCI Devices supported by this driver */
-static struct pci_device_id i91u_pci_devices[] = {
- { PCI_VENDOR_ID_INIT, I950_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
- { PCI_VENDOR_ID_INIT, I940_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
- { PCI_VENDOR_ID_INIT, I935_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
- { PCI_VENDOR_ID_INIT, I920_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
- { PCI_VENDOR_ID_DOMEX, I920_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
- { }
-};
-MODULE_DEVICE_TABLE(pci, i91u_pci_devices);
-
#define DEBUG_INTERRUPT 0
#define DEBUG_QUEUE 0
#define DEBUG_STATE 0
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 196/268] clk: xgene: Fix divider with non-zero shift value
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (194 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 195/268] SCSI: initio: remove duplicate module device table Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 197/268] clk: st: avoid uninitialized variable use Kamal Mostafa
` (71 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Loc Ho, Stephen Boyd, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Loc Ho <lho@apm.com>
commit 1382ea631ddddb634850a3795527db0feeff5aaf upstream.
The X-Gene clock driver missed the divider shift operation when
set the divider value.
Signed-off-by: Loc Ho <lho@apm.com>
Fixes: 308964caeebc ("clk: Add APM X-Gene SoC clock driver")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/clk/clk-xgene.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/clk-xgene.c b/drivers/clk/clk-xgene.c
index f26b3ac..2f9668b 100644
--- a/drivers/clk/clk-xgene.c
+++ b/drivers/clk/clk-xgene.c
@@ -353,7 +353,8 @@ static int xgene_clk_set_rate(struct clk_hw *hw, unsigned long rate,
/* Set new divider */
data = xgene_clk_read(pclk->param.divider_reg +
pclk->param.reg_divider_offset);
- data &= ~((1 << pclk->param.reg_divider_width) - 1);
+ data &= ~((1 << pclk->param.reg_divider_width) - 1)
+ << pclk->param.reg_divider_shift;
data |= divider;
xgene_clk_write(data, pclk->param.divider_reg +
pclk->param.reg_divider_offset);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 197/268] clk: st: avoid uninitialized variable use
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (195 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 196/268] clk: xgene: Fix divider with non-zero shift value Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 198/268] MAINTAINERS: gpio-brcmstb: Remove stray '>' Kamal Mostafa
` (70 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Arnd Bergmann, Stephen Boyd, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Arnd Bergmann <arnd@arndb.de>
commit 2dd52d7f6f9d9d03a82a68040ac3d221dd79af94 upstream.
quadfs_pll_fs660c32_round_rate prints a few structure members
that are never initialized, and also doesn't print the only one
it cares about. We get a gcc warning about the ones that
are printed:
clk/st/clkgen-fsyn.c:560:93: warning: 'params.sdiv' may be used uninitialized in this function
clk/st/clkgen-fsyn.c:560:93: warning: 'params.mdiv' may be used uninitialized in this function
clk/st/clkgen-fsyn.c:560:93: warning: 'params.pe' may be used uninitialized in this function
clk/st/clkgen-fsyn.c:560:93: warning: 'params.nsdiv' may be used uninitialized in this function
This changes the code to no longer print uninitialized data, and
for good measure it also prints the ndiv member that is being
set.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 5f7aa9071e93 ("clk: st: Support for QUADFS inside ClockGenB/C/D/E/F")
Acked-by: Gabriel Fernandez <gabriel.fernandez@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/clk/st/clkgen-fsyn.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/clk/st/clkgen-fsyn.c b/drivers/clk/st/clkgen-fsyn.c
index d9eb2e1..a7a8cdd 100644
--- a/drivers/clk/st/clkgen-fsyn.c
+++ b/drivers/clk/st/clkgen-fsyn.c
@@ -548,19 +548,20 @@ static int clk_fs660c32_vco_get_params(unsigned long input,
return 0;
}
-static long quadfs_pll_fs660c32_round_rate(struct clk_hw *hw, unsigned long rate
- , unsigned long *prate)
+static long quadfs_pll_fs660c32_round_rate(struct clk_hw *hw,
+ unsigned long rate,
+ unsigned long *prate)
{
struct stm_fs params;
- if (!clk_fs660c32_vco_get_params(*prate, rate, ¶ms))
- clk_fs660c32_vco_get_rate(*prate, ¶ms, &rate);
+ if (clk_fs660c32_vco_get_params(*prate, rate, ¶ms))
+ return rate;
- pr_debug("%s: %s new rate %ld [sdiv=0x%x,md=0x%x,pe=0x%x,nsdiv3=%u]\n",
+ clk_fs660c32_vco_get_rate(*prate, ¶ms, &rate);
+
+ pr_debug("%s: %s new rate %ld [ndiv=%u]\n",
__func__, __clk_get_name(hw->clk),
- rate, (unsigned int)params.sdiv,
- (unsigned int)params.mdiv,
- (unsigned int)params.pe, (unsigned int)params.nsdiv);
+ rate, (unsigned int)params.ndiv);
return rate;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 198/268] MAINTAINERS: gpio-brcmstb: Remove stray '>'
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (196 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 197/268] clk: st: avoid uninitialized variable use Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 199/268] ASoC: Intel: pass correct parameter in sst_alloc_stream_mrfld() Kamal Mostafa
` (69 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Florian Fainelli, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Florian Fainelli <f.fainelli@gmail.com>
commit 9c2abe2f7159a6013004b6189a9867e880085e96 upstream.
There is a stray '>' at the end of the mailing-list specified for the
Broadcom STB GPIO driver, remove that.
Fixes: 3b0213d56eb7 ("gpio: Add GPIO support for Broadcom STB SoCs")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
MAINTAINERS | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 60f1caa..66a6649 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2331,7 +2331,7 @@ N: bcm113*
BROADCOM BRCMSTB GPIO DRIVER
M: Gregory Fong <gregory.0xf0@gmail.com>
-L: bcm-kernel-feedback-list@broadcom.com>
+L: bcm-kernel-feedback-list@broadcom.com
S: Supported
F: drivers/gpio/gpio-brcmstb.c
F: Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.txt
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 199/268] ASoC: Intel: pass correct parameter in sst_alloc_stream_mrfld()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (197 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 198/268] MAINTAINERS: gpio-brcmstb: Remove stray '>' Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 200/268] PCI/MSI: Initialize MSI capability for all architectures Kamal Mostafa
` (68 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dan Carpenter, Mark Brown, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Dan Carpenter <dan.carpenter@oracle.com>
commit d16a2b9f2465b5486f830178fbfb7d203e0a17ae upstream.
"data" is always NULL in this function. I think we should be passing
"&data" to sst_prepare_and_post_msg() instead of "data".
Fixes: 3d9ff34622ba ('ASoC: Intel: sst: add stream operations')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Dinesh Mirche <dinesh.mirche@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/intel/atom/sst/sst_stream.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/atom/sst/sst_stream.c b/sound/soc/intel/atom/sst/sst_stream.c
index a74c64c..4ccc80e 100644
--- a/sound/soc/intel/atom/sst/sst_stream.c
+++ b/sound/soc/intel/atom/sst/sst_stream.c
@@ -108,7 +108,7 @@ int sst_alloc_stream_mrfld(struct intel_sst_drv *sst_drv_ctx, void *params)
str_id, pipe_id);
ret = sst_prepare_and_post_msg(sst_drv_ctx, task_id, IPC_CMD,
IPC_IA_ALLOC_STREAM_MRFLD, pipe_id, sizeof(alloc_param),
- &alloc_param, data, true, true, false, true);
+ &alloc_param, &data, true, true, false, true);
if (ret < 0) {
dev_err(sst_drv_ctx->dev, "FW alloc failed ret %d\n", ret);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 200/268] PCI/MSI: Initialize MSI capability for all architectures
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (198 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 199/268] ASoC: Intel: pass correct parameter in sst_alloc_stream_mrfld() Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 201/268] ath9k_htc: check for underflow in ath9k_htc_rx_msg() Kamal Mostafa
` (67 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Guilherme G. Piccoli, Bjorn Helgaas, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com>
commit e80e7edc55ba711f3fe23975061b3f1c336ceb95 upstream.
1851617cd2da ("PCI/MSI: Disable MSI at enumeration even if kernel doesn't
support MSI") moved dev->msi_cap and dev->msix_cap initialization from the
pci_init_capabilities() path (used on all architectures) to the
pci_setup_device() path (not used on Open Firmware architectures).
This broke MSI or MSI-X on Open Firmware machines. 4d9aac397a5d
("powerpc/PCI: Disable MSI/MSI-X interrupts at PCI probe time in OF case")
fixed it for PowerPC but not for SPARC.
Set up MSI and MSI-X (initialize msi_cap and msix_cap and disable MSI and
MSI-X) in pci_init_capabilities() so all architectures do it the same way.
This reverts 4d9aac397a5d since this patch fixes the problem generically
for both PowerPC and SPARC.
[bhelgaas: changelog, make pci_msi_setup_pci_dev() static]
Fixes: 1851617cd2da ("PCI/MSI: Disable MSI at enumeration even if kernel doesn't support MSI")
Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/powerpc/kernel/pci_of_scan.c | 3 ---
drivers/pci/probe.c | 7 ++++---
include/linux/pci.h | 2 --
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index efc3fa5..42e02a2 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -191,9 +191,6 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
pci_device_add(dev, bus);
- /* Setup MSI caps & disable MSI/MSI-X interrupts */
- pci_msi_setup_pci_dev(dev);
-
return dev;
}
EXPORT_SYMBOL(of_create_pci_dev);
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index f6ae0d0..8e4ad97 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1108,7 +1108,7 @@ int pci_cfg_space_size(struct pci_dev *dev)
#define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED)
-void pci_msi_setup_pci_dev(struct pci_dev *dev)
+static void pci_msi_setup_pci_dev(struct pci_dev *dev)
{
/*
* Disable the MSI hardware to avoid screaming interrupts
@@ -1179,8 +1179,6 @@ int pci_setup_device(struct pci_dev *dev)
/* "Unknown power state" */
dev->current_state = PCI_UNKNOWN;
- pci_msi_setup_pci_dev(dev);
-
/* Early fixups, before probing the BARs */
pci_fixup_device(pci_fixup_early, dev);
/* device class may be changed after fixup */
@@ -1530,6 +1528,9 @@ static void pci_init_capabilities(struct pci_dev *dev)
/* MSI/MSI-X list */
pci_msi_init_pci_dev(dev);
+ /* Setup MSI caps & disable MSI/MSI-X interrupts */
+ pci_msi_setup_pci_dev(dev);
+
/* Buffers for saving PCIe and PCI-X capabilities */
pci_allocate_cap_save_buffers(dev);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 1d4eb60..5b098ed 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1204,8 +1204,6 @@ struct msix_entry {
u16 entry; /* driver uses to specify entry, OS writes */
};
-void pci_msi_setup_pci_dev(struct pci_dev *dev);
-
#ifdef CONFIG_PCI_MSI
int pci_msi_vec_count(struct pci_dev *dev);
void pci_msi_shutdown(struct pci_dev *dev);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 201/268] ath9k_htc: check for underflow in ath9k_htc_rx_msg()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (199 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 200/268] PCI/MSI: Initialize MSI capability for all architectures Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 202/268] ASoC: tegra_alc5632: check return value Kamal Mostafa
` (66 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dan Carpenter, Kalle Valo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Dan Carpenter <dan.carpenter@oracle.com>
commit 3a318426e09a9c9266fe6440842e11238f640a20 upstream.
We check for overflow here, but we don't check for underflow so it
causes a static checker warning.
Fixes: fb9987d0f748 ('ath9k_htc: Support for AR9271 chipset.')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/ath/ath9k/htc_hst.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index d2408da..1b41a23 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -411,7 +411,7 @@ void ath9k_htc_rx_msg(struct htc_target *htc_handle,
return;
}
- if (epid >= ENDPOINT_MAX) {
+ if (epid < 0 || epid >= ENDPOINT_MAX) {
if (pipe_id != USB_REG_IN_PIPE)
dev_kfree_skb_any(skb);
else
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 202/268] ASoC: tegra_alc5632: check return value
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (200 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 201/268] ath9k_htc: check for underflow in ath9k_htc_rx_msg() Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 203/268] mtd: nand: fix ONFI parameter page layout Kamal Mostafa
` (65 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sudip Mukherjee, Mark Brown, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
commit 319c32597fc22a58b946a6146f2be1fd208582e0 upstream.
We have been returning success even if snd_soc_card_jack_new() fails.
Lets check the return value and return error if it fails.
Fixes: 12cc6d1dca4d ("ASoC: tegra_alc5632: Register jacks at the card level")
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/tegra/tegra_alc5632.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c
index ba272e2..deb597f 100644
--- a/sound/soc/tegra/tegra_alc5632.c
+++ b/sound/soc/tegra/tegra_alc5632.c
@@ -101,12 +101,16 @@ static const struct snd_kcontrol_new tegra_alc5632_controls[] = {
static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd)
{
+ int ret;
struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(rtd->card);
- snd_soc_card_jack_new(rtd->card, "Headset Jack", SND_JACK_HEADSET,
- &tegra_alc5632_hs_jack,
- tegra_alc5632_hs_jack_pins,
- ARRAY_SIZE(tegra_alc5632_hs_jack_pins));
+ ret = snd_soc_card_jack_new(rtd->card, "Headset Jack",
+ SND_JACK_HEADSET,
+ &tegra_alc5632_hs_jack,
+ tegra_alc5632_hs_jack_pins,
+ ARRAY_SIZE(tegra_alc5632_hs_jack_pins));
+ if (ret)
+ return ret;
if (gpio_is_valid(machine->gpio_hp_det)) {
tegra_alc5632_hp_jack_gpio.gpio = machine->gpio_hp_det;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 203/268] mtd: nand: fix ONFI parameter page layout
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (201 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 202/268] ASoC: tegra_alc5632: check return value Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 204/268] mac80211: fix mgmt-tx abort cookie and leak Kamal Mostafa
` (64 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Boris Brezillon, Brian Norris, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Boris BREZILLON <boris.brezillon@free-electrons.com>
commit de64aa9ec129ba627634088f662a4d09e356ddb6 upstream.
src_ssync_features field is only 1 byte large, and the 4th reserved area
is actually 8 bytes large.
Fixes: d1e1f4e42b5 ("mtd: nand: add support for reading ONFI parameters from NAND device")
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/mtd/nand.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 272f429..bb2fd9a 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -276,7 +276,7 @@ struct nand_onfi_params {
__le16 t_r;
__le16 t_ccs;
__le16 src_sync_timing_mode;
- __le16 src_ssync_features;
+ u8 src_ssync_features;
__le16 clk_pin_capacitance_typ;
__le16 io_pin_capacitance_typ;
__le16 input_pin_capacitance_typ;
@@ -284,7 +284,7 @@ struct nand_onfi_params {
u8 driver_strength_support;
__le16 t_int_r;
__le16 t_ald;
- u8 reserved4[7];
+ u8 reserved4[8];
/* vendor */
__le16 vendor_revision;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 204/268] mac80211: fix mgmt-tx abort cookie and leak
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (202 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 203/268] mtd: nand: fix ONFI parameter page layout Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 205/268] Revert "ACPI / LPSS: allow to use specific PM domain during ->probe()" Kamal Mostafa
` (63 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Johannes Berg, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Johannes Berg <johannes.berg@intel.com>
commit e673a65952b4ab045a3e3eb200fdf408004fb4fd upstream.
If a mgmt-tx operation is aborted before it runs, the wrong
cookie is reported back to userspace, and the ack_skb gets
leaked since the frame is freed directly instead of freeing
it using ieee80211_free_txskb(). Fix that.
Fixes: 3b79af973cf4 ("mac80211: stop using pointers as userspace cookies")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/mac80211/offchannel.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index f2c75cf..0dc4291 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -308,11 +308,10 @@ void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc, bool free)
/* was never transmitted */
if (roc->frame) {
- cfg80211_mgmt_tx_status(&roc->sdata->wdev,
- (unsigned long)roc->frame,
+ cfg80211_mgmt_tx_status(&roc->sdata->wdev, roc->mgmt_tx_cookie,
roc->frame->data, roc->frame->len,
false, GFP_KERNEL);
- kfree_skb(roc->frame);
+ ieee80211_free_txskb(&roc->sdata->local->hw, roc->frame);
}
if (!roc->mgmt_tx_cookie)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 205/268] Revert "ACPI / LPSS: allow to use specific PM domain during ->probe()"
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (203 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 204/268] mac80211: fix mgmt-tx abort cookie and leak Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 206/268] mtd: nand: denali: add missing nand_release() call in denali_remove() Kamal Mostafa
` (62 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andy Shevchenko, Rafael J. Wysocki, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
commit b5f88dd1d6efc472e35ca1b21a44e662c5422088 upstream.
The specific power domain can't be used in a way provided by the commit
01ac170ba29a, i.e. pointer to platform device is a subject to change during
unbound / bind cycle.
This reverts commit 01ac170ba29a9903ee590e1ef2d8e6b27b49a16c.
Fixes: 3df2da968744 (Revert "ACPI / LPSS: introduce a 'proxy' device to power on LPSS for DMA")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/acpi/acpi_lpss.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index 46b58ab..087cb7d 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -680,8 +680,13 @@ static int acpi_lpss_platform_notify(struct notifier_block *nb,
}
switch (action) {
- case BUS_NOTIFY_ADD_DEVICE:
+ case BUS_NOTIFY_BOUND_DRIVER:
pdev->dev.pm_domain = &acpi_lpss_pm_domain;
+ break;
+ case BUS_NOTIFY_UNBOUND_DRIVER:
+ pdev->dev.pm_domain = NULL;
+ break;
+ case BUS_NOTIFY_ADD_DEVICE:
if (pdata->dev_desc->flags & LPSS_LTR)
return sysfs_create_group(&pdev->dev.kobj,
&lpss_attr_group);
@@ -689,7 +694,6 @@ static int acpi_lpss_platform_notify(struct notifier_block *nb,
case BUS_NOTIFY_DEL_DEVICE:
if (pdata->dev_desc->flags & LPSS_LTR)
sysfs_remove_group(&pdev->dev.kobj, &lpss_attr_group);
- pdev->dev.pm_domain = NULL;
break;
default:
break;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 206/268] mtd: nand: denali: add missing nand_release() call in denali_remove()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (204 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 205/268] Revert "ACPI / LPSS: allow to use specific PM domain during ->probe()" Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 207/268] Drivers: hv: util: catch allocation errors Kamal Mostafa
` (61 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Boris Brezillon, Brian Norris, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Boris BREZILLON <boris.brezillon@free-electrons.com>
commit 320092a05dab2f44819c42f33d6b51efb6c474f2 upstream.
Unregister the NAND device from the NAND subsystem when removing a denali
NAND controller, otherwise the MTD attached to the NAND device is still
exposed by the MTD layer, and accesses to this device will likely crash
the system.
Fixes: 2a0a288ec258 ("mtd: denali: split the generic driver and PCI layer")
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mtd/nand/denali.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index 870c7fc..f229554 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1613,9 +1613,16 @@ EXPORT_SYMBOL(denali_init);
/* driver exit point */
void denali_remove(struct denali_nand_info *denali)
{
+ /*
+ * Pre-compute DMA buffer size to avoid any problems in case
+ * nand_release() ever changes in a way that mtd->writesize and
+ * mtd->oobsize are not reliable after this call.
+ */
+ int bufsize = denali->mtd.writesize + denali->mtd.oobsize;
+
+ nand_release(&denali->mtd);
denali_irq_cleanup(denali->irq, denali);
- dma_unmap_single(denali->dev, denali->buf.dma_buf,
- denali->mtd.writesize + denali->mtd.oobsize,
+ dma_unmap_single(denali->dev, denali->buf.dma_buf, bufsize,
DMA_BIDIRECTIONAL);
}
EXPORT_SYMBOL(denali_remove);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 207/268] Drivers: hv: util: catch allocation errors
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (205 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 206/268] mtd: nand: denali: add missing nand_release() call in denali_remove() Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 208/268] Drivers: hv: utils: use memdup_user in hvt_op_write Kamal Mostafa
` (60 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Olaf Hering, K. Y. Srinivasan, Greg Kroah-Hartman, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Olaf Hering <olaf@aepfle.de>
commit cdc0c0c94e4e6dfa371d497a3130f83349b6ead6 upstream.
Catch allocation errors in hvutil_transport_send.
Fixes: 14b50f80c32d ('Drivers: hv: util: introduce hv_utils_transport abstraction')
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/hv/hv_utils_transport.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv/hv_utils_transport.c
index 6a9d80a..1505ee6 100644
--- a/drivers/hv/hv_utils_transport.c
+++ b/drivers/hv/hv_utils_transport.c
@@ -204,9 +204,12 @@ int hvutil_transport_send(struct hvutil_transport *hvt, void *msg, int len)
goto out_unlock;
}
hvt->outmsg = kzalloc(len, GFP_KERNEL);
- memcpy(hvt->outmsg, msg, len);
- hvt->outmsg_len = len;
- wake_up_interruptible(&hvt->outmsg_q);
+ if (hvt->outmsg) {
+ memcpy(hvt->outmsg, msg, len);
+ hvt->outmsg_len = len;
+ wake_up_interruptible(&hvt->outmsg_q);
+ } else
+ ret = -ENOMEM;
out_unlock:
mutex_unlock(&hvt->outmsg_lock);
return ret;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 208/268] Drivers: hv: utils: use memdup_user in hvt_op_write
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (206 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 207/268] Drivers: hv: util: catch allocation errors Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 209/268] tpm_tis: Use devm_free_irq not free_irq Kamal Mostafa
` (59 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Olaf Hering, K. Y. Srinivasan, Greg Kroah-Hartman, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Olaf Hering <olaf@aepfle.de>
commit b00359642c2427da89dc8f77daa2c9e8a84e6d76 upstream.
Use memdup_user to handle OOM.
Fixes: 14b50f80c32d ('Drivers: hv: util: introduce hv_utils_transport abstraction')
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/hv/hv_utils_transport.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv/hv_utils_transport.c
index 1505ee6..24b2766 100644
--- a/drivers/hv/hv_utils_transport.c
+++ b/drivers/hv/hv_utils_transport.c
@@ -80,11 +80,10 @@ static ssize_t hvt_op_write(struct file *file, const char __user *buf,
hvt = container_of(file->f_op, struct hvutil_transport, fops);
- inmsg = kzalloc(count, GFP_KERNEL);
- if (copy_from_user(inmsg, buf, count)) {
- kfree(inmsg);
- return -EFAULT;
- }
+ inmsg = memdup_user(buf, count);
+ if (IS_ERR(inmsg))
+ return PTR_ERR(inmsg);
+
if (hvt->on_msg(inmsg, count))
return -EFAULT;
kfree(inmsg);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 209/268] tpm_tis: Use devm_free_irq not free_irq
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (207 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 208/268] Drivers: hv: utils: use memdup_user in hvt_op_write Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 210/268] ALSA: fm801: explicitly free IRQ line Kamal Mostafa
` (58 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jason Gunthorpe, Jarkko Sakkinen, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
commit 727f28b8ca24a581c7bd868326b8cea1058c720a upstream.
The interrupt is always allocated with devm_request_irq so it
must always be freed with devm_free_irq.
Fixes: 448e9c55c12d ("tpm_tis: verify interrupt during init")
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Acked-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Martin Wilck <Martin.Wilck@ts.fujitsu.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Acked-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/char/tpm/tpm_tis.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 19f9c7dc..60267d7 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -401,7 +401,7 @@ static void disable_interrupts(struct tpm_chip *chip)
iowrite32(intmask,
chip->vendor.iobase +
TPM_INT_ENABLE(chip->vendor.locality));
- free_irq(chip->vendor.irq, chip);
+ devm_free_irq(chip->pdev, chip->vendor.irq, chip);
chip->vendor.irq = 0;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 210/268] ALSA: fm801: explicitly free IRQ line
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (208 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 209/268] tpm_tis: Use devm_free_irq not free_irq Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 211/268] ARM: imx: select SRC for i.MX7 Kamal Mostafa
` (57 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andy Shevchenko, Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
commit e97e98c63b43040732ad5d1f0b38ad4a8371c73a upstream.
Otherwise we will have a warning on ->remove() since device is a PCI one.
WARNING: CPU: 4 PID: 1411 at /home/andy/prj/linux/fs/proc/generic.c:575 remove_proc_entry+0x137/0x160()
remove_proc_entry: removing non-empty directory 'irq/21', leaking at least 'snd_fm801'
Fixes: 5618955c4269 (ALSA: fm801: move to pcim_* and devm_* functions)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/fm801.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index 1fdd92b6..f57847c 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -1165,6 +1165,8 @@ static int snd_fm801_free(struct fm801 *chip)
cmdw |= 0x00c3;
fm801_writew(chip, IRQ_MASK, cmdw);
+ devm_free_irq(&chip->pci->dev, chip->irq, chip);
+
__end_hw:
#ifdef CONFIG_SND_FM801_TEA575X_BOOL
if (!(chip->tea575x_tuner & TUNER_DISABLED)) {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 211/268] ARM: imx: select SRC for i.MX7
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (209 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 210/268] ALSA: fm801: explicitly free IRQ line Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 212/268] ALSA: fm801: propagate TUNER_ONLY bit when autodetected Kamal Mostafa
` (56 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Arnd Bergmann, Shawn Guo, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Arnd Bergmann <arnd@arndb.de>
commit f1858b0e801a45d801dc23bc1ff5be14805022c8 upstream.
The i.MX7 Kconfig option had a couple of missing select lines that
I fixed already, but I missed HAVE_IMX_SRC:
arch/arm/mach-imx/built-in.o: In function `imx7d_init_irq':
platform-spi_imx.c:(.init.text+0x25a8): undefined reference to `imx_src_init'
This adds that one as well.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 0be5da9dc249 ("ARM: imx: imx7d requires anatop")
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/mach-imx/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 573536f..27d084b 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -554,6 +554,7 @@ config SOC_IMX7D
select ARM_GIC
select HAVE_IMX_ANATOP
select HAVE_IMX_MMDC
+ select HAVE_IMX_SRC
help
This enables support for Freescale i.MX7 Dual processor.
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 212/268] ALSA: fm801: propagate TUNER_ONLY bit when autodetected
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (210 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 211/268] ARM: imx: select SRC for i.MX7 Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 213/268] ALSA: fm801: detect FM-only card earlier Kamal Mostafa
` (55 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andy Shevchenko, Ondrej Zary, Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
commit dbec6719ac036f68568d8488805d41346c021eff upstream.
The commit d7ba858a7f7a (ALSA: fm801: implement TEA575x tuner autodetection)
brings autodetection to the driver. However the autodetection algorithm misses
the TUNER_ONLY bit if it is supplied by the user.
Thus, user gets weird messages and no card registered.
snd_fm801 0000:0d:01.0: detected TEA575x radio type SF64-PCR
snd_fm801 0000:0d:01.0: AC'97 interface is busy (1)
snd_fm801 0000:0d:01.0: AC'97 interface is busy (1)
...
snd_fm801 0000:0d:01.0: AC'97 0 does not respond - RESET
snd_fm801 0000:0d:01.0: AC'97 interface is busy (1)
snd_fm801 0000:0d:01.0: AC'97 interface is busy (1)
snd_fm801 0000:0d:01.0: AC'97 0 access is not valid [0x0], removing mixer.
snd_fm801: probe of 0000:0d:01.0 failed with error -5
Do a copy of TUNER_ONLY bit to be applied after autodetection is done.
Fixes: d7ba858a7f7a (ALSA: fm801: implement TEA575x tuner autodetection)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/fm801.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index f57847c..27f97b9 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -1251,6 +1251,8 @@ static int snd_fm801_create(struct snd_card *card,
return -ENODEV;
}
} else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) {
+ unsigned int tuner_only = tea575x_tuner & TUNER_ONLY;
+
/* autodetect tuner connection */
for (tea575x_tuner = 1; tea575x_tuner <= 3; tea575x_tuner++) {
chip->tea575x_tuner = tea575x_tuner;
@@ -1265,6 +1267,8 @@ static int snd_fm801_create(struct snd_card *card,
dev_err(card->dev, "TEA575x radio not found\n");
chip->tea575x_tuner = TUNER_DISABLED;
}
+
+ chip->tea575x_tuner |= tuner_only;
}
if (!(chip->tea575x_tuner & TUNER_DISABLED)) {
strlcpy(chip->tea.card, get_tea575x_gpio(chip)->name,
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 213/268] ALSA: fm801: detect FM-only card earlier
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (211 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 212/268] ALSA: fm801: propagate TUNER_ONLY bit when autodetected Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 214/268] pinctrl: bcm2835: Fix memory leak in error path Kamal Mostafa
` (54 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andy Shevchenko, Takashi Iwai, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
commit b56fa687e02b27f8bd9d282950a88c2ed23d766b upstream.
If user does not supply tea575x_tuner parameter the driver tries to detect the
tuner type. The failed codec initialization is considered as FM-only card
present, however the driver still registers an IRQ handler for it.
Move codec detection earlier to set tea575x_tuner parameter before check.
Here the following functions are introduced
reset_coded() resets AC97 codec
snd_fm801_chip_multichannel_init() initializes cards with multichannel support
Fixes: 5618955c4269 (ALSA: fm801: move to pcim_* and devm_* functions)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/fm801.c | 69 +++++++++++++++++++++++++++++++------------------------
1 file changed, 39 insertions(+), 30 deletions(-)
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index 27f97b9..096fd58 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -1080,26 +1080,20 @@ static int wait_for_codec(struct fm801 *chip, unsigned int codec_id,
return -EIO;
}
-static int snd_fm801_chip_init(struct fm801 *chip, int resume)
+static int reset_codec(struct fm801 *chip)
{
- unsigned short cmdw;
-
- if (chip->tea575x_tuner & TUNER_ONLY)
- goto __ac97_ok;
-
/* codec cold reset + AC'97 warm reset */
fm801_writew(chip, CODEC_CTRL, (1 << 5) | (1 << 6));
fm801_readw(chip, CODEC_CTRL); /* flush posting data */
udelay(100);
fm801_writew(chip, CODEC_CTRL, 0);
- if (wait_for_codec(chip, 0, AC97_RESET, msecs_to_jiffies(750)) < 0)
- if (!resume) {
- dev_info(chip->card->dev,
- "Primary AC'97 codec not found, assume SF64-PCR (tuner-only)\n");
- chip->tea575x_tuner = 3 | TUNER_ONLY;
- goto __ac97_ok;
- }
+ return wait_for_codec(chip, 0, AC97_RESET, msecs_to_jiffies(750));
+}
+
+static void snd_fm801_chip_multichannel_init(struct fm801 *chip)
+{
+ unsigned short cmdw;
if (chip->multichannel) {
if (chip->secondary_addr) {
@@ -1126,8 +1120,11 @@ static int snd_fm801_chip_init(struct fm801 *chip, int resume)
/* cause timeout problems */
wait_for_codec(chip, 0, AC97_VENDOR_ID1, msecs_to_jiffies(750));
}
+}
- __ac97_ok:
+static void snd_fm801_chip_init(struct fm801 *chip)
+{
+ unsigned short cmdw;
/* init volume */
fm801_writew(chip, PCM_VOL, 0x0808);
@@ -1148,11 +1145,8 @@ static int snd_fm801_chip_init(struct fm801 *chip, int resume)
/* interrupt clear */
fm801_writew(chip, IRQ_STATUS,
FM801_IRQ_PLAYBACK | FM801_IRQ_CAPTURE | FM801_IRQ_MPU);
-
- return 0;
}
-
static int snd_fm801_free(struct fm801 *chip)
{
unsigned short cmdw;
@@ -1209,7 +1203,23 @@ static int snd_fm801_create(struct snd_card *card,
if ((err = pci_request_regions(pci, "FM801")) < 0)
return err;
chip->port = pci_resource_start(pci, 0);
- if ((tea575x_tuner & TUNER_ONLY) == 0) {
+
+ if (pci->revision >= 0xb1) /* FM801-AU */
+ chip->multichannel = 1;
+
+ if (!(chip->tea575x_tuner & TUNER_ONLY)) {
+ if (reset_codec(chip) < 0) {
+ dev_info(chip->card->dev,
+ "Primary AC'97 codec not found, assume SF64-PCR (tuner-only)\n");
+ chip->tea575x_tuner = 3 | TUNER_ONLY;
+ } else {
+ snd_fm801_chip_multichannel_init(chip);
+ }
+ }
+
+ snd_fm801_chip_init(chip);
+
+ if ((chip->tea575x_tuner & TUNER_ONLY) == 0) {
if (devm_request_irq(&pci->dev, pci->irq, snd_fm801_interrupt,
IRQF_SHARED, KBUILD_MODNAME, chip)) {
dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
@@ -1220,13 +1230,6 @@ static int snd_fm801_create(struct snd_card *card,
pci_set_master(pci);
}
- if (pci->revision >= 0xb1) /* FM801-AU */
- chip->multichannel = 1;
-
- snd_fm801_chip_init(chip, 0);
- /* init might set tuner access method */
- tea575x_tuner = chip->tea575x_tuner;
-
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
snd_fm801_free(chip);
return err;
@@ -1243,15 +1246,15 @@ static int snd_fm801_create(struct snd_card *card,
chip->tea.private_data = chip;
chip->tea.ops = &snd_fm801_tea_ops;
sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci));
- if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 &&
- (tea575x_tuner & TUNER_TYPE_MASK) < 4) {
+ if ((chip->tea575x_tuner & TUNER_TYPE_MASK) > 0 &&
+ (chip->tea575x_tuner & TUNER_TYPE_MASK) < 4) {
if (snd_tea575x_init(&chip->tea, THIS_MODULE)) {
dev_err(card->dev, "TEA575x radio not found\n");
snd_fm801_free(chip);
return -ENODEV;
}
- } else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) {
- unsigned int tuner_only = tea575x_tuner & TUNER_ONLY;
+ } else if ((chip->tea575x_tuner & TUNER_TYPE_MASK) == 0) {
+ unsigned int tuner_only = chip->tea575x_tuner & TUNER_ONLY;
/* autodetect tuner connection */
for (tea575x_tuner = 1; tea575x_tuner <= 3; tea575x_tuner++) {
@@ -1387,7 +1390,13 @@ static int snd_fm801_resume(struct device *dev)
struct fm801 *chip = card->private_data;
int i;
- snd_fm801_chip_init(chip, 1);
+ if (chip->tea575x_tuner & TUNER_ONLY) {
+ snd_fm801_chip_init(chip);
+ } else {
+ reset_codec(chip);
+ snd_fm801_chip_multichannel_init(chip);
+ snd_fm801_chip_init(chip);
+ }
snd_ac97_resume(chip->ac97);
snd_ac97_resume(chip->ac97_sec);
for (i = 0; i < ARRAY_SIZE(saved_regs); i++)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 214/268] pinctrl: bcm2835: Fix memory leak in error path
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (212 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 213/268] ALSA: fm801: detect FM-only card earlier Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 215/268] mmc: sdhci: restore behavior when setting VDD via external regulator Kamal Mostafa
` (53 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Stefan Wahren, Linus Walleij, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Stefan Wahren <stefan.wahren@i2se.com>
commit 53653c6b91750debba6dc4503003c851257fd340 upstream.
In case of an invalid pin value bcm2835_pctl_dt_node_to_map()
would leak the pull configs of already assigned pins.
So avoid this by calling the free map function in error case.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Fixes: e1b2dc70cd5b ("pinctrl: add bcm2835 driver")
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
index 7a2d53c..8f93ec3 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
@@ -805,7 +805,7 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
return 0;
out:
- kfree(maps);
+ bcm2835_pctl_dt_free_map(pctldev, maps, num_pins * maps_per_pin);
return err;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 215/268] mmc: sdhci: restore behavior when setting VDD via external regulator
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (213 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 214/268] pinctrl: bcm2835: Fix memory leak in error path Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 216/268] x86/LDT: Print the real LDT base address Kamal Mostafa
` (52 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jisheng Zhang, Ulf Hansson, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Jisheng Zhang <jszhang@marvell.com>
commit 918f4cbd4340ddd1eb389cd8efa3b07ac74ec4c0 upstream.
After commit 52221610dd84 ("mmc: sdhci: Improve external VDD regulator
support"), for the VDD is supplied via external regulators, we ignore
the code to convert a VDD voltage request into one of the standard
SDHCI voltage levels, then program it in the SDHCI_POWER_CONTROL. This
brings two issues:
1. SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON quirk isn't handled properly any
more.
2. What's more, once SDHCI_POWER_ON bit is set, some controllers such
as the sdhci-pxav3 used in marvell berlin SoCs require the voltage
levels programming in the SDHCI_POWER_CONTROL register, even the VDD
is supplied by external regulator. So the host in marvell berlin SoCs
still works fine after the commit. However, commit 3cbc6123a93d ("mmc:
sdhci: Set SDHCI_POWER_ON with external vmmc") sets the SDHCI_POWER_ON
bit, this would make the host in marvell berlin SoCs won't work any
more with external vmmc.
This patch restores the behavior when setting VDD through external
regulator by moving the call of mmc_regulator_set_ocr() to the end
of sdhci_set_power() function.
After this patch, the sdcard on Marvell Berlin SoC boards work again.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Fixes: 52221610dd84 ("mmc: sdhci: Improve external VDD ...")
Reviewed-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mmc/host/sdhci.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index cf31efa..939438f 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1262,19 +1262,6 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
struct mmc_host *mmc = host->mmc;
u8 pwr = 0;
- if (!IS_ERR(mmc->supply.vmmc)) {
- spin_unlock_irq(&host->lock);
- mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
- spin_lock_irq(&host->lock);
-
- if (mode != MMC_POWER_OFF)
- sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL);
- else
- sdhci_writeb(host, 0, SDHCI_POWER_CONTROL);
-
- return;
- }
-
if (mode != MMC_POWER_OFF) {
switch (1 << vdd) {
case MMC_VDD_165_195:
@@ -1333,6 +1320,12 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
if (host->quirks & SDHCI_QUIRK_DELAY_AFTER_POWER)
mdelay(10);
}
+
+ if (!IS_ERR(mmc->supply.vmmc)) {
+ spin_unlock_irq(&host->lock);
+ mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
+ spin_lock_irq(&host->lock);
+ }
}
/*****************************************************************************\
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 216/268] x86/LDT: Print the real LDT base address
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (214 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 215/268] mmc: sdhci: restore behavior when setting VDD via external regulator Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 217/268] sysrq: Fix warning in sysrq generated crash Kamal Mostafa
` (51 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jan Beulich, Thomas Gleixner, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Jan Beulich <JBeulich@suse.com>
commit 0d430e3fb3f7cdc13c0d22078b820f682821b45a upstream.
This was meant to print base address and entry count; make it do so
again.
Fixes: 37868fe113ff "x86/ldt: Make modify_ldt synchronous"
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andy Lutomirski <luto@kernel.org>
Link: http://lkml.kernel.org/r/56797D8402000078000C24F0@prv-mh.provo.novell.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kernel/process_64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index a90ac95..adff851 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -124,7 +124,7 @@ void release_thread(struct task_struct *dead_task)
if (dead_task->mm->context.ldt) {
pr_warn("WARNING: dead process %s still has LDT? <%p/%d>\n",
dead_task->comm,
- dead_task->mm->context.ldt,
+ dead_task->mm->context.ldt->entries,
dead_task->mm->context.ldt->size);
BUG();
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 217/268] sysrq: Fix warning in sysrq generated crash.
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (215 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 216/268] x86/LDT: Print the real LDT base address Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 218/268] kconfig: return 'false' instead of 'no' in bool function Kamal Mostafa
` (50 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ani Sinha, Paul E. McKenney, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Ani Sinha <ani@arista.com>
commit 984cf355aeaa8f2eda3861b50d0e8d3e3f77e83b upstream.
Commit 984d74a72076a1 ("sysrq: rcu-ify __handle_sysrq") replaced
spin_lock_irqsave() calls with rcu_read_lock() calls in sysrq. Since
rcu_read_lock() does not disable preemption, faulthandler_disabled() in
__do_page_fault() in x86/fault.c returns false. When the code later calls
might_sleep() in the pagefault handler, we get the following warning:
BUG: sleeping function called from invalid context at ../arch/x86/mm/fault.c:1187
in_atomic(): 0, irqs_disabled(): 0, pid: 4706, name: bash
Preemption disabled at:[<ffffffff81484339>] printk+0x48/0x4a
To fix this, we release the RCU read lock before we crash.
Tested this patch on linux 3.18 by booting off one of our boards.
Fixes: 984d74a72076a1 ("sysrq: rcu-ify __handle_sysrq")
Signed-off-by: Ani Sinha <ani@arista.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/tty/sysrq.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index b5b4278..e54c7c7 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -133,6 +133,12 @@ static void sysrq_handle_crash(int key)
{
char *killer = NULL;
+ /* we need to release the RCU read lock here,
+ * otherwise we get an annoying
+ * 'BUG: sleeping function called from invalid context'
+ * complaint from the kernel before the panic.
+ */
+ rcu_read_unlock();
panic_on_oops = 1; /* force panic */
wmb();
*killer = 1;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 218/268] kconfig: return 'false' instead of 'no' in bool function
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (216 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 217/268] sysrq: Fix warning in sysrq generated crash Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 219/268] perf/x86: Fix filter_events() bug with event mappings Kamal Mostafa
` (49 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Arnaud Lacombe, Mauro Carvalho Chehab, Vegard Nossum,
Michal Marek, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Vegard Nossum <vegard.nossum@oracle.com>
commit aab24a897cfba9dd371f6aac45dbcdae0b23def6 upstream.
menu_is_visible() is a bool function and should use boolean return
values. "no" is a tristate value which happens to also have a value
of 0, but we should nevertheless use the right symbol for it.
This is a very minor cleanup with no semantic change.
Fixes: 86e187ff9 ("kconfig: add an option to determine a menu's visibility")
Cc: Arnaud Lacombe <lacombar@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
| 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index b05cc3d..aed678e 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -477,7 +477,7 @@ bool menu_is_visible(struct menu *menu)
if (menu->visibility) {
if (expr_calc_value(menu->visibility) == no)
- return no;
+ return false;
}
sym = menu->sym;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 219/268] perf/x86: Fix filter_events() bug with event mappings
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (217 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 218/268] kconfig: return 'false' instead of 'no' in bool function Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 220/268] perf/x86: fix PEBS issues on Intel Atom/Core2 Kamal Mostafa
` (48 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Stephane Eranian, Peter Zijlstra (Intel),
Arnaldo Carvalho de Melo, Jiri Olsa, Linus Torvalds,
Thomas Gleixner, Vince Weaver, jolsa, kan.liang, Ingo Molnar,
Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Stephane Eranian <eranian@google.com>
commit 61b87cae6361ea6af161c1ffa549898892707b19 upstream.
This patch fixes a bug in the filter_events() function.
The patch fixes the bug whereby if some mappings did not
exist, e.g., STALLED_CYCLES_FRONTEND, then any event after it
in the attrs array would disappear from the published list of
events in /sys/devices/cpu/events. This could be verified
easily on any system post SNB (which do not publish
STALLED_CYCLES_FRONTEND):
$ ./perf stat -e cycles,ref-cycles true
Performance counter stats for 'true':
1,217,348 cycles
<not supported> ref-cycles
The problem is that in filter_events() there is an assumption
that the argument (attrs) is organized in increasing continuous
event indexes related to the event_map(). But if we remove the
non-supported events by shifing the position in the array, then
the lookup x86_pmu.event_map() needs to compensate for it, otherwise
we are looking up the wrong index. This patch corrects this problem
by compensating for the deleted events and with that ref-cycles
reappears (here shown on Haswell):
$ perf stat -e ref-cycles,cycles true
Performance counter stats for 'true':
4,525,910 ref-cycles
1,064,920 cycles
0.002943888 seconds time elapsed
Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: jolsa@kernel.org
Cc: kan.liang@intel.com
Fixes: 8300daa26755 ("perf/x86: Filter out undefined events from sysfs events attribute")
Link: http://lkml.kernel.org/r/1449516805-6637-1-git-send-email-eranian@google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kernel/cpu/perf_event.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 9469dfa..a27d738 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -1531,6 +1531,7 @@ static void __init filter_events(struct attribute **attrs)
{
struct device_attribute *d;
struct perf_pmu_events_attr *pmu_attr;
+ int offset = 0;
int i, j;
for (i = 0; attrs[i]; i++) {
@@ -1539,7 +1540,7 @@ static void __init filter_events(struct attribute **attrs)
/* str trumps id */
if (pmu_attr->event_str)
continue;
- if (x86_pmu.event_map(i))
+ if (x86_pmu.event_map(i + offset))
continue;
for (j = i; attrs[j]; j++)
@@ -1547,6 +1548,14 @@ static void __init filter_events(struct attribute **attrs)
/* Check the shifted attr. */
i--;
+
+ /*
+ * event_map() is index based, the attrs array is organized
+ * by increasing event index. If we shift the events, then
+ * we need to compensate for the event_map(), otherwise
+ * we are looking up the wrong event in the map
+ */
+ offset++;
}
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 220/268] perf/x86: fix PEBS issues on Intel Atom/Core2
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (218 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 219/268] perf/x86: Fix filter_events() bug with event mappings Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 221/268] power: test_power: correctly handle empty writes Kamal Mostafa
` (47 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Stephane Eranian, Peter Zijlstra (Intel),
Arnaldo Carvalho de Melo, Jiri Olsa, Linus Torvalds,
Thomas Gleixner, Vince Weaver, kan.liang, Ingo Molnar,
Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Stephane Eranian <eranian@google.com>
commit 1424a09a9e1839285e948d4ea9fdfca26c9a2086 upstream.
This patch fixes broken PEBS support on Intel Atom and Core2
due to wrong pointer arithmetic in intel_pmu_drain_pebs_core().
The get_next_pebs_record_by_bit() was called on PEBS format fmt0
which does not use the pebs_record_nhm layout.
Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: kan.liang@intel.com
Fixes: 21509084f999 ("perf/x86/intel: Handle multiple records in the PEBS buffer")
Link: http://lkml.kernel.org/r/1449182000-31524-3-git-send-email-eranian@google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kernel/cpu/perf_event_intel_ds.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
index 71fc402..dbe8d89 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -1027,6 +1027,13 @@ get_next_pebs_record_by_bit(void *base, void *top, int bit)
void *at;
u64 pebs_status;
+ /*
+ * fmt0 does not have a status bitfield (does not use
+ * perf_record_nhm format)
+ */
+ if (x86_pmu.intel_cap.pebs_format < 1)
+ return base;
+
if (base == NULL)
return NULL;
@@ -1112,7 +1119,7 @@ static void intel_pmu_drain_pebs_core(struct pt_regs *iregs)
if (!event->attr.precise_ip)
return;
- n = (top - at) / x86_pmu.pebs_record_size;
+ n = top - at;
if (n <= 0)
return;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 221/268] power: test_power: correctly handle empty writes
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (219 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 220/268] perf/x86: fix PEBS issues on Intel Atom/Core2 Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 222/268] firmware: actually return NULL on failed request_firmware_nowait() Kamal Mostafa
` (46 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sasha Levin, Sebastian Reichel, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Sasha Levin <sasha.levin@oracle.com>
commit 6b9140f39c2aaf76791197fbab0839c0e4af56e8 upstream.
Writing 0 length data into test_power makes it access an invalid array
location and kill the system.
Fixes: f17ef9b2d ("power: Make test_power driver more dynamic.")
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/power/test_power.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/power/test_power.c b/drivers/power/test_power.c
index 83c42ea..57246cd 100644
--- a/drivers/power/test_power.c
+++ b/drivers/power/test_power.c
@@ -301,6 +301,8 @@ static int map_get_value(struct battery_property_map *map, const char *key,
buf[MAX_KEYLENGTH-1] = '\0';
cr = strnlen(buf, MAX_KEYLENGTH) - 1;
+ if (cr < 0)
+ return def_val;
if (buf[cr] == '\n')
buf[cr] = '\0';
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 222/268] firmware: actually return NULL on failed request_firmware_nowait()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (220 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 221/268] power: test_power: correctly handle empty writes Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 223/268] target: Fix a memory leak in target_dev_lba_map_store() Kamal Mostafa
` (45 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Brian Norris, Shuah Khan, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Brian Norris <computersforpeace@gmail.com>
commit 715780ae4bb76d6fd2f20eb78e2a9ba9769a6cdc upstream.
The kerneldoc for request_firmware_nowait() says that it may call the
provided cont() callback with @fw == NULL, if the firmware request
fails. However, this is not the case when called with an empty string
(""). This case is short-circuited by the 'name[0] == '\0'' check
introduced in commit 471b095dfe0d ("firmware_class: make sure fw requests
contain a name"), so _request_firmware() never gets to set the fw to
NULL.
Noticed while using the new 'trigger_async_request' testing hook:
# printf '\x00' > /sys/devices/virtual/misc/test_firmware/trigger_async_request
[10553.726178] test_firmware: loading ''
[10553.729859] test_firmware: loaded: 995209091
# printf '\x00' > /sys/devices/virtual/misc/test_firmware/trigger_async_request
[10733.676184] test_firmware: loading ''
[10733.679855] Unable to handle kernel NULL pointer dereference at virtual address 00000004
[10733.687951] pgd = ec188000
[10733.690655] [00000004] *pgd=00000000
[10733.694240] Internal error: Oops: 5 [#1] SMP ARM
[10733.698847] Modules linked in: btmrvl_sdio btmrvl bluetooth sbs_battery nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables asix usbnet mwifiex_sdio mwifiex cfg80211 jitterentropy_rng drbg joydev snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq snd_seq_device ppp_async ppp_generic slhc tun
[10733.725670] CPU: 0 PID: 6600 Comm: bash Not tainted 4.4.0-rc4-00351-g63d0877 #178
[10733.733137] Hardware name: Rockchip (Device Tree)
[10733.737831] task: ed24f6c0 ti: ee322000 task.ti: ee322000
[10733.743222] PC is at do_raw_spin_lock+0x18/0x1a0
[10733.747831] LR is at _raw_spin_lock+0x18/0x1c
[10733.752180] pc : [<c00653a0>] lr : [<c054c204>] psr: a00d0013
[10733.752180] sp : ee323df8 ip : ee323e20 fp : ee323e1c
[10733.763634] r10: 00000051 r9 : b6f18000 r8 : ee323f80
[10733.768847] r7 : c089cebc r6 : 00000001 r5 : 00000000 r4 : ec0e6000
[10733.775360] r3 : dead4ead r2 : c06bd140 r1 : eef913b4 r0 : 00000000
[10733.781874] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[10733.788995] Control: 10c5387d Table: 2c18806a DAC: 00000051
[10733.794728] Process bash (pid: 6600, stack limit = 0xee322218)
[10733.800549] Stack: (0xee323df8 to 0xee324000)
[10733.804896] 3de0: ec0e6000 00000000
[10733.813059] 3e00: 00000001 c089cebc ee323f80 b6f18000 ee323e2c ee323e20 c054c204 c0065394
[10733.821221] 3e20: ee323e44 ee323e30 c02fec60 c054c1f8 ec0e7ec0 ec3fcfc0 ee323e5c ee323e48
[10733.829384] 3e40: c02fed08 c02fec48 c07dbf74 eeb05a00 ee323e8c ee323e60 c0253828 c02fecac
[10733.837547] 3e60: 00000001 c0116950 ee323eac ee323e78 00000001 ec3fce00 ed2d9700 ed2d970c
[10733.845710] 3e80: ee323e9c ee323e90 c02e873c c02537d4 ee323eac ee323ea0 c017bd40 c02e8720
[10733.853873] 3ea0: ee323ee4 ee323eb0 c017b250 c017bd00 00000000 00000000 f3e47a54 ec128b00
[10733.862035] 3ec0: c017b10c ee323f80 00000001 c000f504 ee322000 00000000 ee323f4c ee323ee8
[10733.870197] 3ee0: c011b71c c017b118 ee323fb0 c011bc90 becfa8d9 00000001 ec128b00 00000001
[10733.878359] 3f00: b6f18000 ee323f80 ee323f4c ee323f18 c011bc90 c0063950 ee323f3c ee323f28
[10733.886522] 3f20: c0063950 c0549138 00000001 ec128b00 00000001 ec128b00 b6f18000 ee323f80
[10733.894684] 3f40: ee323f7c ee323f50 c011bed8 c011b6ec c0135fb8 c0135f24 ec128b00 ec128b00
[10733.902847] 3f60: 00000001 b6f18000 c000f504 ee322000 ee323fa4 ee323f80 c011c664 c011be24
[10733.911009] 3f80: 00000000 00000000 00000001 b6f18000 b6e79be0 00000004 00000000 ee323fa8
[10733.919172] 3fa0: c000f340 c011c618 00000001 b6f18000 00000001 b6f18000 00000001 00000000
[10733.927334] 3fc0: 00000001 b6f18000 b6e79be0 00000004 00000001 00000001 8068a3f1 b6e79c84
[10733.935496] 3fe0: 00000000 becfa7dc b6de194d b6e20246 400d0030 00000001 7a4536e8 49bda390
[10733.943664] [<c00653a0>] (do_raw_spin_lock) from [<c054c204>] (_raw_spin_lock+0x18/0x1c)
[10733.951743] [<c054c204>] (_raw_spin_lock) from [<c02fec60>] (fw_free_buf+0x24/0x64)
[10733.959388] [<c02fec60>] (fw_free_buf) from [<c02fed08>] (release_firmware+0x68/0x74)
[10733.967207] [<c02fed08>] (release_firmware) from [<c0253828>] (trigger_async_request_store+0x60/0x124)
[10733.976501] [<c0253828>] (trigger_async_request_store) from [<c02e873c>] (dev_attr_store+0x28/0x34)
[10733.985533] [<c02e873c>] (dev_attr_store) from [<c017bd40>] (sysfs_kf_write+0x4c/0x58)
[10733.993437] [<c017bd40>] (sysfs_kf_write) from [<c017b250>] (kernfs_fop_write+0x144/0x1a8)
[10734.001689] [<c017b250>] (kernfs_fop_write) from [<c011b71c>] (__vfs_write+0x3c/0xe4)
After this patch:
# printf '\x00' > /sys/devices/virtual/misc/test_firmware/trigger_async_request
[ 32.126322] test_firmware: loading ''
[ 32.129995] test_firmware: failed to async load firmware
-bash: printf: write error: No such device
Fixes: 471b095dfe0d ("firmware_class: make sure fw requests contain a name")
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Ming Lei <ming.lei@canonical.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/base/firmware_class.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 894bda1..fdddf26 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -1118,15 +1118,17 @@ static int
_request_firmware(const struct firmware **firmware_p, const char *name,
struct device *device, unsigned int opt_flags)
{
- struct firmware *fw;
+ struct firmware *fw = NULL;
long timeout;
int ret;
if (!firmware_p)
return -EINVAL;
- if (!name || name[0] == '\0')
- return -EINVAL;
+ if (!name || name[0] == '\0') {
+ ret = -EINVAL;
+ goto out;
+ }
ret = _request_firmware_prepare(&fw, name, device);
if (ret <= 0) /* error or already assigned */
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 223/268] target: Fix a memory leak in target_dev_lba_map_store()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (221 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 222/268] firmware: actually return NULL on failed request_firmware_nowait() Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 224/268] phy: micrel: Fix finding PHY properties in MAC node for KSZ9031 Kamal Mostafa
` (44 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Bart Van Assche, Hannes Reinecke, Christoph Hellwig, Andy Grover,
Sagi Grimberg, Nicholas Bellinger, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Bart Van Assche <bart.vanassche@sandisk.com>
commit f0a8afecb29ad0005e7e946228a0ef5422058b85 upstream.
strsep() modifies its first argument. Make the pointer passed to kfree()
match the return value of kmalloc().
Fixes: 229d4f112fd6 (commit "target_core_alua: Referrals configfs integration")
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Andy Grover <agrover@redhat.com>
Cc: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/target/target_core_configfs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index 860e840..e19da34 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -2137,14 +2137,14 @@ static ssize_t target_core_store_dev_lba_map(
struct se_device *dev = p;
struct t10_alua_lba_map *lba_map = NULL;
struct list_head lba_list;
- char *map_entries, *ptr;
+ char *map_entries, *orig, *ptr;
char state;
int pg_num = -1, pg;
int ret = 0, num = 0, pg_id, alua_state;
unsigned long start_lba = -1, end_lba = -1;
unsigned long segment_size = -1, segment_mult = -1;
- map_entries = kstrdup(page, GFP_KERNEL);
+ orig = map_entries = kstrdup(page, GFP_KERNEL);
if (!map_entries)
return -ENOMEM;
@@ -2242,7 +2242,7 @@ out:
} else
core_alua_set_lba_map(dev, &lba_list,
segment_size, segment_mult);
- kfree(map_entries);
+ kfree(orig);
return count;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 224/268] phy: micrel: Fix finding PHY properties in MAC node for KSZ9031.
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (222 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 223/268] target: Fix a memory leak in target_dev_lba_map_store() Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 225/268] m68k/atari, m68k/sun3: Fix SCSI platform device registration when driver is modular Kamal Mostafa
` (43 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Henri Roosen, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Roosen Henri <Henri.Roosen@ginzinger.com>
commit b4c19f71252e3b6b8c6478fd712c592f00b11438 upstream.
Commit 651df2183543 ("phy: micrel: Fix finding PHY properties in MAC
node.") only fixes finding PHY properties in MAC node for KSZ9021. This
commit applies the same fix for KSZ9031.
Fixes: 8b63ec1837fa ("phylib: Make PHYs children of their MDIO bus, not the bus' parent.")
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Henri Roosen <henri.roosen@ginzinger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/phy/micrel.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 4bb8149..6f719b3 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -470,9 +470,17 @@ static int ksz9031_config_init(struct phy_device *phydev)
"txd2-skew-ps", "txd3-skew-ps"
};
static const char *control_skews[2] = {"txen-skew-ps", "rxdv-skew-ps"};
+ const struct device *dev_walker;
- if (!of_node && dev->parent->of_node)
- of_node = dev->parent->of_node;
+ /* The Micrel driver has a deprecated option to place phy OF
+ * properties in the MAC node. Walk up the tree of devices to
+ * find a device with an OF node.
+ */
+ dev_walker = &phydev->dev;
+ do {
+ of_node = dev_walker->of_node;
+ dev_walker = dev_walker->parent;
+ } while (!of_node && dev_walker);
if (of_node) {
ksz9031_of_load_skew_values(phydev, of_node,
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 225/268] m68k/atari, m68k/sun3: Fix SCSI platform device registration when driver is modular
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (223 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 224/268] phy: micrel: Fix finding PHY properties in MAC node for KSZ9031 Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 226/268] um: Fix build error and kconfig for i386 Kamal Mostafa
` (42 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Finn Thain, Geert Uytterhoeven, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Finn Thain <fthain@telegraphics.com.au>
commit 2d522618c8d13abe87f8203dcb115bfcc555f88b upstream.
Fixes: 3ff228af84b5 ("atari_scsi: Convert to platform device")
Fixes: 0d31f8759109 ("sun3_scsi: Convert to platform device")
Reported-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/m68k/atari/config.c | 4 ++--
arch/m68k/sun3/config.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
index 192b00f..cbd5991 100644
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -858,7 +858,7 @@ static struct platform_device *atari_netusbee_devices[] __initdata = {
};
#endif /* CONFIG_ATARI_ETHERNEC */
-#ifdef CONFIG_ATARI_SCSI
+#if IS_ENABLED(CONFIG_ATARI_SCSI)
static const struct resource atari_scsi_st_rsrc[] __initconst = {
{
.flags = IORESOURCE_IRQ,
@@ -910,7 +910,7 @@ int __init atari_platform_init(void)
}
#endif
-#ifdef CONFIG_ATARI_SCSI
+#if IS_ENABLED(CONFIG_ATARI_SCSI)
if (ATARIHW_PRESENT(ST_SCSI))
platform_device_register_simple("atari_scsi", -1,
atari_scsi_st_rsrc, ARRAY_SIZE(atari_scsi_st_rsrc));
diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index a8b942b..3f06a5d 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -171,7 +171,7 @@ static void __init sun3_sched_init(irq_handler_t timer_routine)
intersil_clear();
}
-#ifdef CONFIG_SUN3_SCSI
+#if IS_ENABLED(CONFIG_SUN3_SCSI)
static const struct resource sun3_scsi_vme_rsrc[] __initconst = {
{
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 226/268] um: Fix build error and kconfig for i386
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (224 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 225/268] m68k/atari, m68k/sun3: Fix SCSI platform device registration when driver is modular Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 227/268] net: sctp: prevent writes to cookie_hmac_alg from accessing invalid memory Kamal Mostafa
` (41 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mickaël Salaün, Jeff Dike, Richard Weinberger,
Josh Triplett, Paul E. McKenney, Michal Marek, Andrew Morton,
Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= <mic@digikod.net>
commit 42d91f612c879627c925d3779c36877cd440f9f9 upstream.
Fix build error by generating elfcore.o only when ELF_CORE (depending on
COREDUMP) is selected:
arch/x86/um/built-in.o: In function `elf_core_write_extra_phdrs':
(.text+0x3e62): undefined reference to `dump_emit'
arch/x86/um/built-in.o: In function `elf_core_write_extra_data':
(.text+0x3eef): undefined reference to `dump_emit'
Fixes: 5d2acfc7b974 ("kconfig: make allnoconfig disable options behind EMBEDDED and EXPERT")
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/um/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile
index a8fecc2..3ee2bb6 100644
--- a/arch/x86/um/Makefile
+++ b/arch/x86/um/Makefile
@@ -17,7 +17,7 @@ obj-y = bug.o bugs_$(BITS).o delay.o fault.o ksyms.o ldt.o \
ifeq ($(CONFIG_X86_32),y)
obj-y += checksum_32.o
-obj-$(CONFIG_BINFMT_ELF) += elfcore.o
+obj-$(CONFIG_ELF_CORE) += elfcore.o
subarch-y = ../lib/string_32.o ../lib/atomic64_32.o ../lib/atomic64_cx8_32.o
subarch-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += ../lib/rwsem.o
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 227/268] net: sctp: prevent writes to cookie_hmac_alg from accessing invalid memory
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (225 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 226/268] um: Fix build error and kconfig for i386 Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 228/268] ipv6: tcp: add rcu locking in tcp_v6_send_synack() Kamal Mostafa
` (40 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sasha Levin, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Sasha Levin <sasha.levin@oracle.com>
commit 320f1a4a175e7cd5d3f006f92b4d4d3e2cbb7bb5 upstream.
proc_dostring() needs an initialized destination string, while the one
provided in proc_sctp_do_hmac_alg() contains stack garbage.
Thus, writing to cookie_hmac_alg would strlen() that garbage and end up
accessing invalid memory.
Fixes: 3c68198e7 ("sctp: Make hmac algorithm selection for cookie generation dynamic")
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/sctp/sysctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index 26d50c5..3e0fc51 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -320,7 +320,7 @@ static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, int write,
struct ctl_table tbl;
bool changed = false;
char *none = "none";
- char tmp[8];
+ char tmp[8] = {0};
int ret;
memset(&tbl, 0, sizeof(struct ctl_table));
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 228/268] ipv6: tcp: add rcu locking in tcp_v6_send_synack()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (226 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 227/268] net: sctp: prevent writes to cookie_hmac_alg from accessing invalid memory Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 229/268] bonding: Prevent IPv6 link local address on enslaved devices Kamal Mostafa
` (39 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Eric Dumazet, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Eric Dumazet <edumazet@google.com>
commit 3e4006f0b86a5ae5eb0e8215f9a9e1db24506977 upstream.
When first SYNACK is sent, we already hold rcu_read_lock(), but this
is not true if a SYNACK is retransmitted, as a timer (soft) interrupt
does not hold rcu_read_lock()
Fixes: 45f6fad84cc30 ("ipv6: add complete rcu protection around np->opt")
Reported-by: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/ipv6/tcp_ipv6.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 682756c..8a51c16 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -462,8 +462,10 @@ static int tcp_v6_send_synack(struct sock *sk, struct dst_entry *dst,
fl6->flowlabel = ip6_flowlabel(ipv6_hdr(ireq->pktopts));
skb_set_queue_mapping(skb, queue_mapping);
+ rcu_read_lock();
err = ip6_xmit(sk, skb, fl6, rcu_dereference(np->opt),
np->tclass);
+ rcu_read_unlock();
err = net_xmit_eval(err);
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 229/268] bonding: Prevent IPv6 link local address on enslaved devices
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (227 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 228/268] ipv6: tcp: add rcu locking in tcp_v6_send_synack() Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 230/268] kbuild: Demote 'sign-compare' warning to W=2 Kamal Mostafa
` (38 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Karl Heiss, Jay Vosburgh, Andy Gospodarek, David S. Miller,
Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Karl Heiss <kheiss@gmail.com>
commit 03d84a5f83a67e692af00a3d3901e7820e3e84d5 upstream.
Commit 1f718f0f4f97 ("bonding: populate neighbour's private on enslave")
undoes the fix provided by commit c2edacf80e15 ("bonding / ipv6: no addrconf
for slaves separately from master") by effectively setting the slave flag
after the slave has been opened. If the slave comes up quickly enough, it
will go through the IPv6 addrconf before the slave flag has been set and
will get a link local IPv6 address.
In order to ensure that addrconf knows to ignore the slave devices on state
change, set IFF_SLAVE before dev_open() during bonding enslavement.
Fixes: 1f718f0f4f97 ("bonding: populate neighbour's private on enslave")
Signed-off-by: Karl Heiss <kheiss@gmail.com>
Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Reviewed-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/bonding/bond_main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index cbbb1c9..593dc28 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1209,7 +1209,6 @@ static int bond_master_upper_dev_link(struct net_device *bond_dev,
err = netdev_master_upper_dev_link_private(slave_dev, bond_dev, slave);
if (err)
return err;
- slave_dev->flags |= IFF_SLAVE;
rtmsg_ifinfo(RTM_NEWLINK, slave_dev, IFF_SLAVE, GFP_KERNEL);
return 0;
}
@@ -1467,6 +1466,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
}
}
+ /* set slave flag before open to prevent IPv6 addrconf */
+ slave_dev->flags |= IFF_SLAVE;
+
/* open the slave since the application closed it */
res = dev_open(slave_dev);
if (res) {
@@ -1727,6 +1729,7 @@ err_close:
dev_close(slave_dev);
err_restore_mac:
+ slave_dev->flags &= ~IFF_SLAVE;
if (!bond->params.fail_over_mac ||
BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) {
/* XXX TODO - fom follow mode needs to change master's
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 230/268] kbuild: Demote 'sign-compare' warning to W=2
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (228 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 229/268] bonding: Prevent IPv6 link local address on enslaved devices Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 231/268] mmc: sd: limit SD card power limit according to cards capabilities Kamal Mostafa
` (37 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Lee Jones, Michal Marek, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Lee Jones <lee.jones@linaro.org>
commit 7599ea8b4e25fd8dea26cb64f100cf265d1e6bf3 upstream.
Ideally, a kernel compile with W=1 enabled should complete cleanly;
however, when we run one currently we are presented with ~25k warnings.
'sign-compare' accounts for ~22k of those ~25k.
In this patch we're demoting 'sign-compare' warnings to W=2, with a view
to fixing the remaining 3k W=1 warnings required for a clean build.
Arnd adds:
"As per our discussion, I'd add that this was inadvertedly introduced
by Behan when he moved the clang specific warnings into an ifdef block
and did not notice that -Wsign-compare was interpreted by both gcc
and clang.
Earlier, it was introduced in just the same way by Jan-Simon as part
of 3d3d6b847420 ("kbuild: LLVMLinux: Adapt warnings for compilation
with clang")."
Acked-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 26ea6bb1fef0 ("kbuild, LLVMLinux: Supress warnings unless W=1-3")
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
| 2 ++
1 file changed, 2 insertions(+)
--git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index f734033..0f8ba77 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -25,6 +25,7 @@ warning-1 += -Wold-style-definition
warning-1 += $(call cc-option, -Wmissing-include-dirs)
warning-1 += $(call cc-option, -Wunused-but-set-variable)
warning-1 += $(call cc-disable-warning, missing-field-initializers)
+warning-1 += $(call cc-disable-warning, sign-compare)
warning-2 := -Waggregate-return
warning-2 += -Wcast-align
@@ -33,6 +34,7 @@ warning-2 += -Wnested-externs
warning-2 += -Wshadow
warning-2 += $(call cc-option, -Wlogical-op)
warning-2 += $(call cc-option, -Wmissing-field-initializers)
+warning-2 += $(call cc-option, -Wsign-compare)
warning-3 := -Wbad-function-cast
warning-3 += -Wcast-qual
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 231/268] mmc: sd: limit SD card power limit according to cards capabilities
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (229 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 230/268] kbuild: Demote 'sign-compare' warning to W=2 Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 232/268] net: tcp_memcontrol: properly detect ancestor socket pressure Kamal Mostafa
` (36 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Russell King, Ulf Hansson, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Russell King <rmk+kernel@arm.linux.org.uk>
commit d9812780a020bcec44565b5950b2a8b31afb5545 upstream.
The SD card specification allows cards to error out a SWITCH command
where the requested function in a group is not supported. The spec
provides for a set of capabilities which indicate which functions are
supported.
In the case of the power limit, requesting an unsupported power level
via the SWITCH command fails, resulting in the power level remaining at
the power-on default of 0.72W, even though the host and card may support
higher powers levels.
This has been seen with SanDisk 8GB cards, which support the default
0.72W and 1.44W (200mA and 400mA) in combination with an iMX6 host,
supporting up to 2.88W (800mA). This currently causes us to try to set
a power limit function value of '3' (2.88W) which the card errors out
on, and thereby causes the power level to remain at 0.72W rather than
the desired 1.44W.
Arrange to limit the selected current limit by the capabilities reported
by the card to avoid the SWITCH command failing. Select the highest
current limit that the host and card combination support.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Fixes: a39ca6ae0a08 ("mmc: core: Simplify and fix for SD switch processing")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mmc/core/sd.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 4e7366a..525de8c 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -329,6 +329,7 @@ static int mmc_read_switch(struct mmc_card *card)
card->sw_caps.sd3_bus_mode = status[13];
/* Driver Strengths supported by the card */
card->sw_caps.sd3_drv_type = status[9];
+ card->sw_caps.sd3_curr_limit = status[7] | status[6] << 8;
}
out:
@@ -547,14 +548,25 @@ static int sd_set_current_limit(struct mmc_card *card, u8 *status)
* when we set current limit to 200ma, the card will draw 200ma, and
* when we set current limit to 400/600/800ma, the card will draw its
* maximum 300ma from the host.
+ *
+ * The above is incorrect: if we try to set a current limit that is
+ * not supported by the card, the card can rightfully error out the
+ * attempt, and remain at the default current limit. This results
+ * in a 300mA card being limited to 200mA even though the host
+ * supports 800mA. Failures seen with SanDisk 8GB UHS cards with
+ * an iMX6 host. --rmk
*/
- if (max_current >= 800)
+ if (max_current >= 800 &&
+ card->sw_caps.sd3_curr_limit & SD_MAX_CURRENT_800)
current_limit = SD_SET_CURRENT_LIMIT_800;
- else if (max_current >= 600)
+ else if (max_current >= 600 &&
+ card->sw_caps.sd3_curr_limit & SD_MAX_CURRENT_600)
current_limit = SD_SET_CURRENT_LIMIT_600;
- else if (max_current >= 400)
+ else if (max_current >= 400 &&
+ card->sw_caps.sd3_curr_limit & SD_MAX_CURRENT_400)
current_limit = SD_SET_CURRENT_LIMIT_400;
- else if (max_current >= 200)
+ else if (max_current >= 200 &&
+ card->sw_caps.sd3_curr_limit & SD_MAX_CURRENT_200)
current_limit = SD_SET_CURRENT_LIMIT_200;
if (current_limit != SD_SET_CURRENT_NO_CHANGE) {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 232/268] net: tcp_memcontrol: properly detect ancestor socket pressure
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (230 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 231/268] mmc: sd: limit SD card power limit according to cards capabilities Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 233/268] vmstat: make vmstat_updater deferrable again and shut down on idle Kamal Mostafa
` (35 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Johannes Weiner, Andrew Morton, Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Johannes Weiner <hannes@cmpxchg.org>
commit 8c2c2358b236530bc2c79b4c2a447cbdbc3d96d7 upstream.
When charging socket memory, the code currently checks only the local
page counter for excess to determine whether the memcg is under socket
pressure. But even if the local counter is fine, one of the ancestors
could have breached its limit, which should also force this child to
enter socket pressure. This currently doesn't happen.
Fix this by using page_counter_try_charge() first. If that fails, it
means that either the local counter or one of the ancestors are in
excess of their limit, and the child should enter socket pressure.
Fixes: 3e32cb2e0a12 ("mm: memcontrol: lockless page counters")
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Vladimir Davydov <vdavydov@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/net/sock.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index 639138b..591d303 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1209,11 +1209,13 @@ static inline void memcg_memory_allocated_add(struct cg_proto *prot,
unsigned long amt,
int *parent_status)
{
- page_counter_charge(&prot->memory_allocated, amt);
+ struct page_counter *counter;
+
+ if (page_counter_try_charge(&prot->memory_allocated, amt, &counter))
+ return;
- if (page_counter_read(&prot->memory_allocated) >
- prot->memory_allocated.limit)
- *parent_status = OVER_LIMIT;
+ page_counter_charge(&prot->memory_allocated, amt);
+ *parent_status = OVER_LIMIT;
}
static inline void memcg_memory_allocated_sub(struct cg_proto *prot,
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 233/268] vmstat: make vmstat_updater deferrable again and shut down on idle
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (231 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 232/268] net: tcp_memcontrol: properly detect ancestor socket pressure Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 234/268] include/linux/memblock.h: fix ordering of 'flags' argument in comments Kamal Mostafa
` (34 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Christoph Lameter, Michal Hocko, Johannes Weiner, Tetsuo Handa,
Andrew Morton, Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Christoph Lameter <cl@linux.com>
commit 0eb77e9880321915322d42913c3b53241739c8aa upstream.
Currently the vmstat updater is not deferrable as a result of commit
ba4877b9ca51 ("vmstat: do not use deferrable delayed work for
vmstat_update"). This in turn can cause multiple interruptions of the
applications because the vmstat updater may run at
Make vmstate_update deferrable again and provide a function that folds
the differentials when the processor is going to idle mode thus
addressing the issue of the above commit in a clean way.
Note that the shepherd thread will continue scanning the differentials
from another processor and will reenable the vmstat workers if it
detects any changes.
Fixes: ba4877b9ca51 ("vmstat: do not use deferrable delayed work for vmstat_update")
Signed-off-by: Christoph Lameter <cl@linux.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ kamal: backport to 4.2-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/vmstat.h | 2 ++
kernel/sched/idle.c | 1 +
mm/vmstat.c | 69 ++++++++++++++++++++++++++++++++------------------
3 files changed, 47 insertions(+), 25 deletions(-)
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 82e7db7..c013b8d 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -211,6 +211,7 @@ extern void __inc_zone_state(struct zone *, enum zone_stat_item);
extern void dec_zone_state(struct zone *, enum zone_stat_item);
extern void __dec_zone_state(struct zone *, enum zone_stat_item);
+void quiet_vmstat(void);
void cpu_vm_stats_fold(int cpu);
void refresh_zone_stat_thresholds(void);
@@ -272,6 +273,7 @@ static inline void __dec_zone_page_state(struct page *page,
static inline void refresh_cpu_vm_stats(int cpu) { }
static inline void refresh_zone_stat_thresholds(void) { }
static inline void cpu_vm_stats_fold(int cpu) { }
+static inline void quiet_vmstat(void) { }
static inline void drain_zonestat(struct zone *zone,
struct per_cpu_pageset *pset) { }
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index 594275e..6d9b4c9 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -221,6 +221,7 @@ static void cpu_idle_loop(void)
*/
__current_set_polling();
+ quiet_vmstat();
tick_nohz_idle_enter();
while (!need_resched()) {
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 705d4a1..2139b23 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -460,7 +460,7 @@ static int fold_diff(int *diff)
*
* The function returns the number of global counters updated.
*/
-static int refresh_cpu_vm_stats(void)
+static int refresh_cpu_vm_stats(bool do_pagesets)
{
struct zone *zone;
int i;
@@ -484,33 +484,35 @@ static int refresh_cpu_vm_stats(void)
#endif
}
}
- cond_resched();
#ifdef CONFIG_NUMA
- /*
- * Deal with draining the remote pageset of this
- * processor
- *
- * Check if there are pages remaining in this pageset
- * if not then there is nothing to expire.
- */
- if (!__this_cpu_read(p->expire) ||
+ if (do_pagesets) {
+ cond_resched();
+ /*
+ * Deal with draining the remote pageset of this
+ * processor
+ *
+ * Check if there are pages remaining in this pageset
+ * if not then there is nothing to expire.
+ */
+ if (!__this_cpu_read(p->expire) ||
!__this_cpu_read(p->pcp.count))
- continue;
+ continue;
- /*
- * We never drain zones local to this processor.
- */
- if (zone_to_nid(zone) == numa_node_id()) {
- __this_cpu_write(p->expire, 0);
- continue;
- }
+ /*
+ * We never drain zones local to this processor.
+ */
+ if (zone_to_nid(zone) == numa_node_id()) {
+ __this_cpu_write(p->expire, 0);
+ continue;
+ }
- if (__this_cpu_dec_return(p->expire))
- continue;
+ if (__this_cpu_dec_return(p->expire))
+ continue;
- if (__this_cpu_read(p->pcp.count)) {
- drain_zone_pages(zone, this_cpu_ptr(&p->pcp));
- changes++;
+ if (__this_cpu_read(p->pcp.count)) {
+ drain_zone_pages(zone, this_cpu_ptr(&p->pcp));
+ changes++;
+ }
}
#endif
}
@@ -1364,7 +1366,7 @@ static cpumask_var_t cpu_stat_off;
static void vmstat_update(struct work_struct *w)
{
- if (refresh_cpu_vm_stats())
+ if (refresh_cpu_vm_stats(true))
/*
* Counters were updated so we expect more updates
* to occur in the future. Keep on running the
@@ -1396,6 +1398,23 @@ static void vmstat_update(struct work_struct *w)
}
/*
+ * Switch off vmstat processing and then fold all the remaining differentials
+ * until the diffs stay at zero. The function is used by NOHZ and can only be
+ * invoked when tick processing is not active.
+ */
+void quiet_vmstat(void)
+{
+ if (system_state != SYSTEM_RUNNING)
+ return;
+
+ do {
+ if (!cpumask_test_and_set_cpu(smp_processor_id(), cpu_stat_off))
+ cancel_delayed_work(this_cpu_ptr(&vmstat_work));
+
+ } while (refresh_cpu_vm_stats(false));
+}
+
+/*
* Check if the diffs for a certain cpu indicate that
* an update is needed.
*/
@@ -1427,7 +1446,7 @@ static bool need_update(int cpu)
*/
static void vmstat_shepherd(struct work_struct *w);
-static DECLARE_DELAYED_WORK(shepherd, vmstat_shepherd);
+static DECLARE_DEFERRABLE_WORK(shepherd, vmstat_shepherd);
static void vmstat_shepherd(struct work_struct *w)
{
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 234/268] include/linux/memblock.h: fix ordering of 'flags' argument in comments
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (232 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 233/268] vmstat: make vmstat_updater deferrable again and shut down on idle Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 235/268] Btrfs: clean up an error code in btrfs_init_space_info() Kamal Mostafa
` (33 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Florian Fainelli, Andrew Morton, Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Florian Fainelli <f.fainelli@gmail.com>
commit d30b5545bdcf802ffc24ec7dbc6dc4036f6e3820 upstream.
for_each_free_mem_range() and for_each_free_mem_range_reverse() both
accept a 'flags' argument, the comment surrounding the macro placed the
'flags' documentation at the very end, while 'flags' is in fact the 3rd
argument to the macro, so let's preserve natural ordering here.
Fixes: fc6daaf931518 ("mm/memblock: add extra "flags" to memblock to allow selection of memory based on attribute")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/memblock.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index cc4b019..f0ccf80 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -211,10 +211,10 @@ void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
* for_each_free_mem_range - iterate through free memblock areas
* @i: u64 used as loop variable
* @nid: node selector, %NUMA_NO_NODE for all nodes
+ * @flags: pick from blocks based on memory attributes
* @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
* @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
* @p_nid: ptr to int for nid of the range, can be %NULL
- * @flags: pick from blocks based on memory attributes
*
* Walks over free (memory && !reserved) areas of memblock. Available as
* soon as memblock is initialized.
@@ -227,10 +227,10 @@ void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
* for_each_free_mem_range_reverse - rev-iterate through free memblock areas
* @i: u64 used as loop variable
* @nid: node selector, %NUMA_NO_NODE for all nodes
+ * @flags: pick from blocks based on memory attributes
* @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
* @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
* @p_nid: ptr to int for nid of the range, can be %NULL
- * @flags: pick from blocks based on memory attributes
*
* Walks over free (memory && !reserved) areas of memblock in reverse
* order. Available as soon as memblock is initialized.
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 235/268] Btrfs: clean up an error code in btrfs_init_space_info()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (233 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 234/268] include/linux/memblock.h: fix ordering of 'flags' argument in comments Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 236/268] btrfs: initialize the seq counter in struct btrfs_device Kamal Mostafa
` (32 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dan Carpenter, David Sterba, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Dan Carpenter <dan.carpenter@oracle.com>
commit 0dc924c5f2a3c4d999e12feaccee5f970cea1315 upstream.
If we return 1 here, then the caller treats it as an error and returns
-EINVAL. It causes a static checker warning to treat positive returns
as an error.
Fixes: 1aba86d67f34 ('Btrfs: fix easily get into ENOSPC in mixed case')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/btrfs/extent-tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index c73c4ce..c96fa08 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -10036,7 +10036,7 @@ int btrfs_init_space_info(struct btrfs_fs_info *fs_info)
disk_super = fs_info->super_copy;
if (!btrfs_super_root(disk_super))
- return 1;
+ return -EINVAL;
features = btrfs_super_incompat_flags(disk_super);
if (features & BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 236/268] btrfs: initialize the seq counter in struct btrfs_device
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (234 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 235/268] Btrfs: clean up an error code in btrfs_init_space_info() Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 237/268] bridge: fix lockdep addr_list_lock false positive splat Kamal Mostafa
` (31 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sebastian Andrzej Siewior, David Sterba, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
commit 546bed631203344611f42b2af1d224d2eedb4e6b upstream.
I managed to trigger this:
| INFO: trying to register non-static key.
| the code is fine but needs lockdep annotation.
| turning off the locking correctness validator.
| CPU: 1 PID: 781 Comm: systemd-gpt-aut Not tainted 4.4.0-rt2+ #14
| Hardware name: ARM-Versatile Express
| [<80307cec>] (dump_stack)
| [<80070e98>] (__lock_acquire)
| [<8007184c>] (lock_acquire)
| [<80287800>] (btrfs_ioctl)
| [<8012a8d4>] (do_vfs_ioctl)
| [<8012ac14>] (SyS_ioctl)
so I think that btrfs_device_data_ordered_init() is not invoked behind
a macro somewhere.
Fixes: 7cc8e58d53cd ("Btrfs: fix unprotected device's variants on 32bits machine")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/btrfs/volumes.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index f5a3c5b..f3f0cff 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -156,6 +156,7 @@ static struct btrfs_device *__alloc_device(void)
spin_lock_init(&dev->reada_lock);
atomic_set(&dev->reada_in_flight, 0);
atomic_set(&dev->dev_stats_ccnt, 0);
+ btrfs_device_data_ordered_init(dev);
INIT_RADIX_TREE(&dev->reada_zones, GFP_NOFS & ~__GFP_WAIT);
INIT_RADIX_TREE(&dev->reada_extents, GFP_NOFS & ~__GFP_WAIT);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 237/268] bridge: fix lockdep addr_list_lock false positive splat
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (235 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 236/268] btrfs: initialize the seq counter in struct btrfs_device Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 238/268] batman-adv: Avoid recursive call_rcu for batadv_bla_claim Kamal Mostafa
` (30 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Vlad Yasevich, Stephen Hemminger, Bridge list, Andy Gospodarek,
Roopa Prabhu, Nikolay Aleksandrov, David S. Miller,
Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
commit c6894dec8ea9ae05747124dce98b3b5c2e69b168 upstream.
After promisc mode management was introduced a bridge device could do
dev_set_promiscuity from its ndo_change_rx_flags() callback which in
turn can be called after the bridge's addr_list_lock has been taken
(e.g. by dev_uc_add). This causes a false positive lockdep splat because
the port interfaces' addr_list_lock is taken when br_manage_promisc()
runs after the bridge's addr list lock was already taken.
To remove the false positive introduce a custom bridge addr_list_lock
class and set it on bridge init.
A simple way to reproduce this is with the following:
$ brctl addbr br0
$ ip l add l br0 br0.100 type vlan id 100
$ ip l set br0 up
$ ip l set br0.100 up
$ echo 1 > /sys/class/net/br0/bridge/vlan_filtering
$ brctl addif br0 eth0
Splat:
[ 43.684325] =============================================
[ 43.684485] [ INFO: possible recursive locking detected ]
[ 43.684636] 4.4.0-rc8+ #54 Not tainted
[ 43.684755] ---------------------------------------------
[ 43.684906] brctl/1187 is trying to acquire lock:
[ 43.685047] (_xmit_ETHER){+.....}, at: [<ffffffff8150169e>] dev_set_rx_mode+0x1e/0x40
[ 43.685460] but task is already holding lock:
[ 43.685618] (_xmit_ETHER){+.....}, at: [<ffffffff815072a7>] dev_uc_add+0x27/0x80
[ 43.686015] other info that might help us debug this:
[ 43.686316] Possible unsafe locking scenario:
[ 43.686743] CPU0
[ 43.686967] ----
[ 43.687197] lock(_xmit_ETHER);
[ 43.687544] lock(_xmit_ETHER);
[ 43.687886] *** DEADLOCK ***
[ 43.688438] May be due to missing lock nesting notation
[ 43.688882] 2 locks held by brctl/1187:
[ 43.689134] #0: (rtnl_mutex){+.+.+.}, at: [<ffffffff81510317>] rtnl_lock+0x17/0x20
[ 43.689852] #1: (_xmit_ETHER){+.....}, at: [<ffffffff815072a7>] dev_uc_add+0x27/0x80
[ 43.690575] stack backtrace:
[ 43.690970] CPU: 0 PID: 1187 Comm: brctl Not tainted 4.4.0-rc8+ #54
[ 43.691270] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.8.1-20150318_183358- 04/01/2014
[ 43.691770] ffffffff826a25c0 ffff8800369fb8e0 ffffffff81360ceb ffffffff826a25c0
[ 43.692425] ffff8800369fb9b8 ffffffff810d0466 ffff8800369fb968 ffffffff81537139
[ 43.693071] ffff88003a08c880 0000000000000000 00000000ffffffff 0000000002080020
[ 43.693709] Call Trace:
[ 43.693931] [<ffffffff81360ceb>] dump_stack+0x4b/0x70
[ 43.694199] [<ffffffff810d0466>] __lock_acquire+0x1e46/0x1e90
[ 43.694483] [<ffffffff81537139>] ? netlink_broadcast_filtered+0x139/0x3e0
[ 43.694789] [<ffffffff8153b5da>] ? nlmsg_notify+0x5a/0xc0
[ 43.695064] [<ffffffff810d10f5>] lock_acquire+0xe5/0x1f0
[ 43.695340] [<ffffffff8150169e>] ? dev_set_rx_mode+0x1e/0x40
[ 43.695623] [<ffffffff815edea5>] _raw_spin_lock_bh+0x45/0x80
[ 43.695901] [<ffffffff8150169e>] ? dev_set_rx_mode+0x1e/0x40
[ 43.696180] [<ffffffff8150169e>] dev_set_rx_mode+0x1e/0x40
[ 43.696460] [<ffffffff8150189c>] dev_set_promiscuity+0x3c/0x50
[ 43.696750] [<ffffffffa0586845>] br_port_set_promisc+0x25/0x50 [bridge]
[ 43.697052] [<ffffffffa05869aa>] br_manage_promisc+0x8a/0xe0 [bridge]
[ 43.697348] [<ffffffffa05826ee>] br_dev_change_rx_flags+0x1e/0x20 [bridge]
[ 43.697655] [<ffffffff81501532>] __dev_set_promiscuity+0x132/0x1f0
[ 43.697943] [<ffffffff81501672>] __dev_set_rx_mode+0x82/0x90
[ 43.698223] [<ffffffff815072de>] dev_uc_add+0x5e/0x80
[ 43.698498] [<ffffffffa05b3c62>] vlan_device_event+0x542/0x650 [8021q]
[ 43.698798] [<ffffffff8109886d>] notifier_call_chain+0x5d/0x80
[ 43.699083] [<ffffffff810988b6>] raw_notifier_call_chain+0x16/0x20
[ 43.699374] [<ffffffff814f456e>] call_netdevice_notifiers_info+0x6e/0x80
[ 43.699678] [<ffffffff814f4596>] call_netdevice_notifiers+0x16/0x20
[ 43.699973] [<ffffffffa05872be>] br_add_if+0x47e/0x4c0 [bridge]
[ 43.700259] [<ffffffffa058801e>] add_del_if+0x6e/0x80 [bridge]
[ 43.700548] [<ffffffffa0588b5f>] br_dev_ioctl+0xaf/0xc0 [bridge]
[ 43.700836] [<ffffffff8151a7ac>] dev_ifsioc+0x30c/0x3c0
[ 43.701106] [<ffffffff8151aac9>] dev_ioctl+0xf9/0x6f0
[ 43.701379] [<ffffffff81254345>] ? mntput_no_expire+0x5/0x450
[ 43.701665] [<ffffffff812543ee>] ? mntput_no_expire+0xae/0x450
[ 43.701947] [<ffffffff814d7b02>] sock_do_ioctl+0x42/0x50
[ 43.702219] [<ffffffff814d8175>] sock_ioctl+0x1e5/0x290
[ 43.702500] [<ffffffff81242d0b>] do_vfs_ioctl+0x2cb/0x5c0
[ 43.702771] [<ffffffff81243079>] SyS_ioctl+0x79/0x90
[ 43.703033] [<ffffffff815eebb6>] entry_SYSCALL_64_fastpath+0x16/0x7a
CC: Vlad Yasevich <vyasevic@redhat.com>
CC: Stephen Hemminger <stephen@networkplumber.org>
CC: Bridge list <bridge@lists.linux-foundation.org>
CC: Andy Gospodarek <gospo@cumulusnetworks.com>
CC: Roopa Prabhu <roopa@cumulusnetworks.com>
Fixes: 2796d0c648c9 ("bridge: Automatically manage port promiscuous mode.")
Reported-by: Andy Gospodarek <gospo@cumulusnetworks.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/bridge/br_device.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 4ff77a1..3d6c8e2 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -28,6 +28,8 @@
const struct nf_br_ops __rcu *nf_br_ops __read_mostly;
EXPORT_SYMBOL_GPL(nf_br_ops);
+static struct lock_class_key bridge_netdev_addr_lock_key;
+
/* net device transmit always called with BH disabled */
netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
{
@@ -87,6 +89,11 @@ out:
return NETDEV_TX_OK;
}
+static void br_set_lockdep_class(struct net_device *dev)
+{
+ lockdep_set_class(&dev->addr_list_lock, &bridge_netdev_addr_lock_key);
+}
+
static int br_dev_init(struct net_device *dev)
{
struct net_bridge *br = netdev_priv(dev);
@@ -99,6 +106,7 @@ static int br_dev_init(struct net_device *dev)
err = br_vlan_init(br);
if (err)
free_percpu(br->stats);
+ br_set_lockdep_class(dev);
return err;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 238/268] batman-adv: Avoid recursive call_rcu for batadv_bla_claim
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (236 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 237/268] bridge: fix lockdep addr_list_lock false positive splat Kamal Mostafa
@ 2016-01-27 20:34 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 239/268] batman-adv: Avoid recursive call_rcu for batadv_nc_node Kamal Mostafa
` (29 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:34 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sven Eckelmann, Marek Lindner, Antonio Quartulli, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Sven Eckelmann <sven@narfation.org>
commit 63b399272294e7a939cde41792dca38c549f0484 upstream.
The batadv_claim_free_ref function uses call_rcu to delay the free of the
batadv_bla_claim object until no (already started) rcu_read_lock is enabled
anymore. This makes sure that no context is still trying to access the
object which should be removed. But batadv_bla_claim also contains a
reference to backbone_gw which must be removed.
The reference drop of backbone_gw was done in the call_rcu function
batadv_claim_free_rcu but should actually be done in the
batadv_claim_release function to avoid nested call_rcus. This is important
because rcu_barrier (e.g. batadv_softif_free or batadv_exit) will not
detect the inner call_rcu as relevant for its execution. Otherwise this
barrier will most likely be inserted in the queue before the callback of
the first call_rcu was executed. The caller of rcu_barrier will therefore
continue to run before the inner call_rcu callback finished.
Fixes: 23721387c409 ("batman-adv: add basic bridge loop avoidance code")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Acked-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/batman-adv/bridge_loop_avoidance.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index ba06092..7b521e7 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -126,21 +126,17 @@ batadv_backbone_gw_free_ref(struct batadv_bla_backbone_gw *backbone_gw)
}
/* finally deinitialize the claim */
-static void batadv_claim_free_rcu(struct rcu_head *rcu)
+static void batadv_claim_release(struct batadv_bla_claim *claim)
{
- struct batadv_bla_claim *claim;
-
- claim = container_of(rcu, struct batadv_bla_claim, rcu);
-
batadv_backbone_gw_free_ref(claim->backbone_gw);
- kfree(claim);
+ kfree_rcu(claim, rcu);
}
/* free a claim, call claim_free_rcu if its the last reference */
static void batadv_claim_free_ref(struct batadv_bla_claim *claim)
{
if (atomic_dec_and_test(&claim->refcount))
- call_rcu(&claim->rcu, batadv_claim_free_rcu);
+ batadv_claim_release(claim);
}
/**
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 239/268] batman-adv: Avoid recursive call_rcu for batadv_nc_node
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (237 preceding siblings ...)
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 238/268] batman-adv: Avoid recursive call_rcu for batadv_bla_claim Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 240/268] batman-adv: Drop immediate batadv_orig_ifinfo free function Kamal Mostafa
` (28 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sven Eckelmann, Marek Lindner, Antonio Quartulli, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Sven Eckelmann <sven@narfation.org>
commit 44e8e7e91d6c7c7ab19688750f7257292640d1a0 upstream.
The batadv_nc_node_free_ref function uses call_rcu to delay the free of the
batadv_nc_node object until no (already started) rcu_read_lock is enabled
anymore. This makes sure that no context is still trying to access the
object which should be removed. But batadv_nc_node also contains a
reference to orig_node which must be removed.
The reference drop of orig_node was done in the call_rcu function
batadv_nc_node_free_rcu but should actually be done in the
batadv_nc_node_release function to avoid nested call_rcus. This is
important because rcu_barrier (e.g. batadv_softif_free or batadv_exit) will
not detect the inner call_rcu as relevant for its execution. Otherwise this
barrier will most likely be inserted in the queue before the callback of
the first call_rcu was executed. The caller of rcu_barrier will therefore
continue to run before the inner call_rcu callback finished.
Fixes: d56b1705e28c ("batman-adv: network coding - detect coding nodes and remove these after timeout")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/batman-adv/network-coding.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c
index 4660401..3e750c5 100644
--- a/net/batman-adv/network-coding.c
+++ b/net/batman-adv/network-coding.c
@@ -204,28 +204,25 @@ void batadv_nc_init_orig(struct batadv_orig_node *orig_node)
}
/**
- * batadv_nc_node_free_rcu - rcu callback to free an nc node and remove
- * its refcount on the orig_node
- * @rcu: rcu pointer of the nc node
+ * batadv_nc_node_release - release nc_node from lists and queue for free after
+ * rcu grace period
+ * @nc_node: the nc node to free
*/
-static void batadv_nc_node_free_rcu(struct rcu_head *rcu)
+static void batadv_nc_node_release(struct batadv_nc_node *nc_node)
{
- struct batadv_nc_node *nc_node;
-
- nc_node = container_of(rcu, struct batadv_nc_node, rcu);
batadv_orig_node_free_ref(nc_node->orig_node);
- kfree(nc_node);
+ kfree_rcu(nc_node, rcu);
}
/**
- * batadv_nc_node_free_ref - decrements the nc node refcounter and possibly
- * frees it
+ * batadv_nc_node_free_ref - decrement the nc node refcounter and possibly
+ * release it
* @nc_node: the nc node to free
*/
static void batadv_nc_node_free_ref(struct batadv_nc_node *nc_node)
{
if (atomic_dec_and_test(&nc_node->refcount))
- call_rcu(&nc_node->rcu, batadv_nc_node_free_rcu);
+ batadv_nc_node_release(nc_node);
}
/**
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 240/268] batman-adv: Drop immediate batadv_orig_ifinfo free function
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (238 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 239/268] batman-adv: Avoid recursive call_rcu for batadv_nc_node Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 241/268] batman-adv: Drop immediate batadv_neigh_node " Kamal Mostafa
` (27 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sven Eckelmann, Marek Lindner, Antonio Quartulli, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Sven Eckelmann <sven@narfation.org>
commit deed96605f5695cb945e0b3d79429581857a2b9d upstream.
It is not allowed to free the memory of an object which is part of a list
which is protected by rcu-read-side-critical sections without making sure
that no other context is accessing the object anymore. This usually happens
by removing the references to this object and then waiting until the rcu
grace period is over and no one (allowedly) accesses it anymore.
But the _now functions ignore this completely. They free the object
directly even when a different context still tries to access it. This has
to be avoided and thus these functions must be removed and all functions
have to use batadv_orig_ifinfo_free_ref.
Fixes: 7351a4822d42 ("batman-adv: split out router from orig_node")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/batman-adv/originator.c | 59 ++++++++++++++++++++++++---------------------
1 file changed, 31 insertions(+), 28 deletions(-)
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 32a0fcf..8200531 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -534,76 +534,79 @@ static void batadv_orig_ifinfo_free_rcu(struct rcu_head *rcu)
}
/**
- * batadv_orig_ifinfo_free_ref - decrement the refcounter and possibly free
- * the orig_ifinfo (without rcu callback)
+ * batadv_orig_ifinfo_free_ref - decrement the refcounter and possibly release
+ * the orig_ifinfo
* @orig_ifinfo: the orig_ifinfo object to release
*/
-static void
-batadv_orig_ifinfo_free_ref_now(struct batadv_orig_ifinfo *orig_ifinfo)
+void batadv_orig_ifinfo_free_ref(struct batadv_orig_ifinfo *orig_ifinfo)
{
if (atomic_dec_and_test(&orig_ifinfo->refcount))
- batadv_orig_ifinfo_free_rcu(&orig_ifinfo->rcu);
+ call_rcu(&orig_ifinfo->rcu, batadv_orig_ifinfo_free_rcu);
}
/**
- * batadv_orig_ifinfo_free_ref - decrement the refcounter and possibly free
- * the orig_ifinfo
- * @orig_ifinfo: the orig_ifinfo object to release
+ * batadv_orig_node_free_rcu - free the orig_node
+ * @rcu: rcu pointer of the orig_node
*/
-void batadv_orig_ifinfo_free_ref(struct batadv_orig_ifinfo *orig_ifinfo)
+static void batadv_orig_node_free_rcu(struct rcu_head *rcu)
{
- if (atomic_dec_and_test(&orig_ifinfo->refcount))
- call_rcu(&orig_ifinfo->rcu, batadv_orig_ifinfo_free_rcu);
+ struct batadv_orig_node *orig_node;
+
+ orig_node = container_of(rcu, struct batadv_orig_node, rcu);
+
+ batadv_mcast_purge_orig(orig_node);
+
+ batadv_frag_purge_orig(orig_node, NULL);
+
+ if (orig_node->bat_priv->bat_algo_ops->bat_orig_free)
+ orig_node->bat_priv->bat_algo_ops->bat_orig_free(orig_node);
+
+ kfree(orig_node->tt_buff);
+ kfree(orig_node);
}
-static void batadv_orig_node_free_rcu(struct rcu_head *rcu)
+/**
+ * batadv_orig_node_release - release orig_node from lists and queue for
+ * free after rcu grace period
+ * @orig_node: the orig node to free
+ */
+static void batadv_orig_node_release(struct batadv_orig_node *orig_node)
{
struct hlist_node *node_tmp;
struct batadv_neigh_node *neigh_node;
- struct batadv_orig_node *orig_node;
struct batadv_orig_ifinfo *orig_ifinfo;
- orig_node = container_of(rcu, struct batadv_orig_node, rcu);
-
spin_lock_bh(&orig_node->neigh_list_lock);
/* for all neighbors towards this originator ... */
hlist_for_each_entry_safe(neigh_node, node_tmp,
&orig_node->neigh_list, list) {
hlist_del_rcu(&neigh_node->list);
- batadv_neigh_node_free_ref_now(neigh_node);
+ batadv_neigh_node_free_ref(neigh_node);
}
hlist_for_each_entry_safe(orig_ifinfo, node_tmp,
&orig_node->ifinfo_list, list) {
hlist_del_rcu(&orig_ifinfo->list);
- batadv_orig_ifinfo_free_ref_now(orig_ifinfo);
+ batadv_orig_ifinfo_free_ref(orig_ifinfo);
}
spin_unlock_bh(&orig_node->neigh_list_lock);
- batadv_mcast_purge_orig(orig_node);
-
/* Free nc_nodes */
batadv_nc_purge_orig(orig_node->bat_priv, orig_node, NULL);
- batadv_frag_purge_orig(orig_node, NULL);
-
- if (orig_node->bat_priv->bat_algo_ops->bat_orig_free)
- orig_node->bat_priv->bat_algo_ops->bat_orig_free(orig_node);
-
- kfree(orig_node->tt_buff);
- kfree(orig_node);
+ call_rcu(&orig_node->rcu, batadv_orig_node_free_rcu);
}
/**
* batadv_orig_node_free_ref - decrement the orig node refcounter and possibly
- * schedule an rcu callback for freeing it
+ * release it
* @orig_node: the orig node to free
*/
void batadv_orig_node_free_ref(struct batadv_orig_node *orig_node)
{
if (atomic_dec_and_test(&orig_node->refcount))
- call_rcu(&orig_node->rcu, batadv_orig_node_free_rcu);
+ batadv_orig_node_release(orig_node);
}
/**
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 241/268] batman-adv: Drop immediate batadv_neigh_node free function
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (239 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 240/268] batman-adv: Drop immediate batadv_orig_ifinfo free function Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 242/268] batman-adv: Drop immediate neigh_ifinfo " Kamal Mostafa
` (26 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sven Eckelmann, Marek Lindner, Antonio Quartulli, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Sven Eckelmann <sven@narfation.org>
commit 2baa753c276f27f8e844637561ad597867aa6fb6 upstream.
It is not allowed to free the memory of an object which is part of a list
which is protected by rcu-read-side-critical sections without making sure
that no other context is accessing the object anymore. This usually happens
by removing the references to this object and then waiting until the rcu
grace period is over and no one (allowedly) accesses it anymore.
But the _now functions ignore this completely. They free the object
directly even when a different context still tries to access it. This has
to be avoided and thus these functions must be removed and all functions
have to use batadv_neigh_node_free_ref.
Fixes: 89652331c00f ("batman-adv: split tq information in neigh_node struct")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/batman-adv/originator.c | 33 ++++++++++-----------------------
1 file changed, 10 insertions(+), 23 deletions(-)
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 8200531..c4dddec 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -228,20 +228,8 @@ static void batadv_neigh_node_free_rcu(struct rcu_head *rcu)
}
/**
- * batadv_neigh_node_free_ref_now - decrement the neighbors refcounter
- * and possibly free it (without rcu callback)
- * @neigh_node: neigh neighbor to free
- */
-static void
-batadv_neigh_node_free_ref_now(struct batadv_neigh_node *neigh_node)
-{
- if (atomic_dec_and_test(&neigh_node->refcount))
- batadv_neigh_node_free_rcu(&neigh_node->rcu);
-}
-
-/**
* batadv_neigh_node_free_ref - decrement the neighbors refcounter
- * and possibly free it
+ * and possibly release it
* @neigh_node: neigh neighbor to free
*/
void batadv_neigh_node_free_ref(struct batadv_neigh_node *neigh_node)
@@ -513,24 +501,23 @@ batadv_neigh_node_get(const struct batadv_orig_node *orig_node,
}
/**
- * batadv_orig_ifinfo_free_rcu - free the orig_ifinfo object
- * @rcu: rcu pointer of the orig_ifinfo object
+ * batadv_orig_ifinfo_release - release orig_ifinfo from lists and queue for
+ * free after rcu grace period
+ * @orig_ifinfo: the orig_ifinfo object to release
*/
-static void batadv_orig_ifinfo_free_rcu(struct rcu_head *rcu)
+static void batadv_orig_ifinfo_release(struct batadv_orig_ifinfo *orig_ifinfo)
{
- struct batadv_orig_ifinfo *orig_ifinfo;
struct batadv_neigh_node *router;
- orig_ifinfo = container_of(rcu, struct batadv_orig_ifinfo, rcu);
-
if (orig_ifinfo->if_outgoing != BATADV_IF_DEFAULT)
- batadv_hardif_free_ref_now(orig_ifinfo->if_outgoing);
+ batadv_hardif_free_ref(orig_ifinfo->if_outgoing);
/* this is the last reference to this object */
router = rcu_dereference_protected(orig_ifinfo->router, true);
if (router)
- batadv_neigh_node_free_ref_now(router);
- kfree(orig_ifinfo);
+ batadv_neigh_node_free_ref(router);
+
+ kfree_rcu(orig_ifinfo, rcu);
}
/**
@@ -541,7 +528,7 @@ static void batadv_orig_ifinfo_free_rcu(struct rcu_head *rcu)
void batadv_orig_ifinfo_free_ref(struct batadv_orig_ifinfo *orig_ifinfo)
{
if (atomic_dec_and_test(&orig_ifinfo->refcount))
- call_rcu(&orig_ifinfo->rcu, batadv_orig_ifinfo_free_rcu);
+ batadv_orig_ifinfo_release(orig_ifinfo);
}
/**
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 242/268] batman-adv: Drop immediate neigh_ifinfo free function
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (240 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 241/268] batman-adv: Drop immediate batadv_neigh_node " Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 243/268] batman-adv: Drop immediate orig_node " Kamal Mostafa
` (25 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sven Eckelmann, Marek Lindner, Antonio Quartulli, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Sven Eckelmann <sven@narfation.org>
commit ae3e1e36e3cb6c686a7a2725af20ca86aa46d62a upstream.
It is not allowed to free the memory of an object which is part of a list
which is protected by rcu-read-side-critical sections without making sure
that no other context is accessing the object anymore. This usually happens
by removing the references to this object and then waiting until the rcu
grace period is over and no one (allowedly) accesses it anymore.
But the _now functions ignore this completely. They free the object
directly even when a different context still tries to access it. This has
to be avoided and thus these functions must be removed and all functions
have to use batadv_neigh_ifinfo_free_ref.
Fixes: 89652331c00f ("batman-adv: split tq information in neigh_node struct")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/batman-adv/originator.c | 34 ++++++++++------------------------
1 file changed, 10 insertions(+), 24 deletions(-)
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index c4dddec..db5eff0 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -162,42 +162,28 @@ err:
}
/**
- * batadv_neigh_ifinfo_free_rcu - free the neigh_ifinfo object
- * @rcu: rcu pointer of the neigh_ifinfo object
- */
-static void batadv_neigh_ifinfo_free_rcu(struct rcu_head *rcu)
-{
- struct batadv_neigh_ifinfo *neigh_ifinfo;
-
- neigh_ifinfo = container_of(rcu, struct batadv_neigh_ifinfo, rcu);
-
- if (neigh_ifinfo->if_outgoing != BATADV_IF_DEFAULT)
- batadv_hardif_free_ref_now(neigh_ifinfo->if_outgoing);
-
- kfree(neigh_ifinfo);
-}
-
-/**
- * batadv_neigh_ifinfo_free_now - decrement the refcounter and possibly free
- * the neigh_ifinfo (without rcu callback)
+ * batadv_neigh_ifinfo_release - release neigh_ifinfo from lists and queue for
+ * free after rcu grace period
* @neigh_ifinfo: the neigh_ifinfo object to release
*/
static void
-batadv_neigh_ifinfo_free_ref_now(struct batadv_neigh_ifinfo *neigh_ifinfo)
+batadv_neigh_ifinfo_release(struct batadv_neigh_ifinfo *neigh_ifinfo)
{
- if (atomic_dec_and_test(&neigh_ifinfo->refcount))
- batadv_neigh_ifinfo_free_rcu(&neigh_ifinfo->rcu);
+ if (neigh_ifinfo->if_outgoing != BATADV_IF_DEFAULT)
+ batadv_hardif_free_ref(neigh_ifinfo->if_outgoing);
+
+ kfree_rcu(neigh_ifinfo, rcu);
}
/**
- * batadv_neigh_ifinfo_free_ref - decrement the refcounter and possibly free
+ * batadv_neigh_ifinfo_free_ref - decrement the refcounter and possibly release
* the neigh_ifinfo
* @neigh_ifinfo: the neigh_ifinfo object to release
*/
void batadv_neigh_ifinfo_free_ref(struct batadv_neigh_ifinfo *neigh_ifinfo)
{
if (atomic_dec_and_test(&neigh_ifinfo->refcount))
- call_rcu(&neigh_ifinfo->rcu, batadv_neigh_ifinfo_free_rcu);
+ batadv_neigh_ifinfo_release(neigh_ifinfo);
}
/**
@@ -216,7 +202,7 @@ static void batadv_neigh_node_free_rcu(struct rcu_head *rcu)
hlist_for_each_entry_safe(neigh_ifinfo, node_tmp,
&neigh_node->ifinfo_list, list) {
- batadv_neigh_ifinfo_free_ref_now(neigh_ifinfo);
+ batadv_neigh_ifinfo_free_ref(neigh_ifinfo);
}
if (bao->bat_neigh_free)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 243/268] batman-adv: Drop immediate orig_node free function
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (241 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 242/268] batman-adv: Drop immediate neigh_ifinfo " Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 244/268] printk: help pr_debug and pr_devel to optimize out arguments Kamal Mostafa
` (24 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sven Eckelmann, Marek Lindner, Antonio Quartulli, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Sven Eckelmann <sven@narfation.org>
commit 42eff6a617e23b691f8e4467f4687ed7245a92db upstream.
It is not allowed to free the memory of an object which is part of a list
which is protected by rcu-read-side-critical sections without making sure
that no other context is accessing the object anymore. This usually happens
by removing the references to this object and then waiting until the rcu
grace period is over and no one (allowedly) accesses it anymore.
But the _now functions ignore this completely. They free the object
directly even when a different context still tries to access it. This has
to be avoided and thus these functions must be removed and all functions
have to use batadv_orig_node_free_ref.
Fixes: 72822225bd41 ("batman-adv: Fix rcu_barrier() miss due to double call_rcu() in TT code")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/batman-adv/originator.c | 11 -----------
net/batman-adv/originator.h | 1 -
net/batman-adv/translation-table.c | 28 +++++++++++++---------------
3 files changed, 13 insertions(+), 27 deletions(-)
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index db5eff0..2a96811 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -582,17 +582,6 @@ void batadv_orig_node_free_ref(struct batadv_orig_node *orig_node)
batadv_orig_node_release(orig_node);
}
-/**
- * batadv_orig_node_free_ref_now - decrement the orig node refcounter and
- * possibly free it (without rcu callback)
- * @orig_node: the orig node to free
- */
-void batadv_orig_node_free_ref_now(struct batadv_orig_node *orig_node)
-{
- if (atomic_dec_and_test(&orig_node->refcount))
- batadv_orig_node_free_rcu(&orig_node->rcu);
-}
-
void batadv_originator_free(struct batadv_priv *bat_priv)
{
struct batadv_hashtable *hash = bat_priv->orig_hash;
diff --git a/net/batman-adv/originator.h b/net/batman-adv/originator.h
index 79734d3..39c9906 100644
--- a/net/batman-adv/originator.h
+++ b/net/batman-adv/originator.h
@@ -38,7 +38,6 @@ int batadv_originator_init(struct batadv_priv *bat_priv);
void batadv_originator_free(struct batadv_priv *bat_priv);
void batadv_purge_orig_ref(struct batadv_priv *bat_priv);
void batadv_orig_node_free_ref(struct batadv_orig_node *orig_node);
-void batadv_orig_node_free_ref_now(struct batadv_orig_node *orig_node);
struct batadv_orig_node *batadv_orig_node_new(struct batadv_priv *bat_priv,
const uint8_t *addr);
struct batadv_neigh_node *
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index c9b2629..5d4644a 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -238,20 +238,6 @@ int batadv_tt_global_hash_count(struct batadv_priv *bat_priv,
return count;
}
-static void batadv_tt_orig_list_entry_free_rcu(struct rcu_head *rcu)
-{
- struct batadv_tt_orig_list_entry *orig_entry;
-
- orig_entry = container_of(rcu, struct batadv_tt_orig_list_entry, rcu);
-
- /* We are in an rcu callback here, therefore we cannot use
- * batadv_orig_node_free_ref() and its call_rcu():
- * An rcu_barrier() wouldn't wait for that to finish
- */
- batadv_orig_node_free_ref_now(orig_entry->orig_node);
- kfree(orig_entry);
-}
-
/**
* batadv_tt_local_size_mod - change the size by v of the local table identified
* by vid
@@ -347,13 +333,25 @@ static void batadv_tt_global_size_dec(struct batadv_orig_node *orig_node,
batadv_tt_global_size_mod(orig_node, vid, -1);
}
+/**
+ * batadv_tt_orig_list_entry_release - release tt orig entry from lists and
+ * queue for free after rcu grace period
+ * @orig_entry: tt orig entry to be free'd
+ */
+static void
+batadv_tt_orig_list_entry_release(struct batadv_tt_orig_list_entry *orig_entry)
+{
+ batadv_orig_node_free_ref(orig_entry->orig_node);
+ kfree_rcu(orig_entry, rcu);
+}
+
static void
batadv_tt_orig_list_entry_free_ref(struct batadv_tt_orig_list_entry *orig_entry)
{
if (!atomic_dec_and_test(&orig_entry->refcount))
return;
- call_rcu(&orig_entry->rcu, batadv_tt_orig_list_entry_free_rcu);
+ batadv_tt_orig_list_entry_release(orig_entry);
}
/**
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 244/268] printk: help pr_debug and pr_devel to optimize out arguments
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (242 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 243/268] batman-adv: Drop immediate orig_node " Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 245/268] ARM: dts: armadillo800eva Correct extal1 frequency to 24 MHz Kamal Mostafa
` (23 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Aaron Conole, Joe Perches, Jason Baron, Andrew Morton,
Linus Torvalds, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Aaron Conole <aconole@redhat.com>
commit fe22cd9b7c980b8b948ec85f034a8668c57ec867 upstream.
Currently, pr_debug and pr_devel will not elide function call arguments
appearing in calls to the no_printk for these macros. This is because
all side effects must be honored before proceeding to the 0-value
assignment in no_printk.
The behavior is contrary to documentation found in the CodingStyle and
the header file where these functions are declared.
This patch corrects that behavior by shunting out the call to no_printk
completely. The format string is still checked by gcc for correctness,
but no code seems to be emitted in common cases.
[akpm@linux-foundation.org: remove braces, per Joe]
Fixes: 5264f2f75d86 ("include/linux/printk.h: use and neaten no_printk")
Signed-off-by: Aaron Conole <aconole@redhat.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Joe Perches <joe@perches.com>
Cc: Jason Baron <jbaron@akamai.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/printk.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/linux/printk.h b/include/linux/printk.h
index a6298b2..acbcd43 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -106,13 +106,13 @@ struct va_format {
/*
* Dummy printk for disabled debugging statements to use whilst maintaining
- * gcc's format and side-effect checking.
+ * gcc's format checking.
*/
-static inline __printf(1, 2)
-int no_printk(const char *fmt, ...)
-{
- return 0;
-}
+#define no_printk(fmt, ...) \
+do { \
+ if (0) \
+ printk(fmt, ##__VA_ARGS__); \
+} while (0)
#ifdef CONFIG_EARLY_PRINTK
extern asmlinkage __printf(1, 2)
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 245/268] ARM: dts: armadillo800eva Correct extal1 frequency to 24 MHz
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (243 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 244/268] printk: help pr_debug and pr_devel to optimize out arguments Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 246/268] team: Replace rcu_read_lock with a mutex in team_vlan_rx_kill_vid Kamal Mostafa
` (22 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Geert Uytterhoeven, Simon Horman, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Geert Uytterhoeven <geert+renesas@glider.be>
commit c61f30a255550bbfc6b83c1ca720661489cac4c0 upstream.
On r8a7740/armadillo, actual clock rates are ca. 4% lower than reported
by /sys/kernel/debug/clk/clk_summary. Correct the extal1 frequency from
25 MHz to 24 MHz to fix this.
This matches the Armadillo-800 EVA Product Manual, which claims the main
crystal runs at 24 MHz, and the old legacy/reference board code.
Fixes: 25aa7ba3fdfb ("ARM: shmobile: armadillo800eva: Sync DTS")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/dts/r8a7740-armadillo800eva.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/r8a7740-armadillo800eva.dts b/arch/arm/boot/dts/r8a7740-armadillo800eva.dts
index 2e31d8c..8595b0d 100644
--- a/arch/arm/boot/dts/r8a7740-armadillo800eva.dts
+++ b/arch/arm/boot/dts/r8a7740-armadillo800eva.dts
@@ -180,7 +180,7 @@
};
&extal1_clk {
- clock-frequency = <25000000>;
+ clock-frequency = <24000000>;
};
&extal2_clk {
clock-frequency = <48000000>;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 246/268] team: Replace rcu_read_lock with a mutex in team_vlan_rx_kill_vid
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (244 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 245/268] ARM: dts: armadillo800eva Correct extal1 frequency to 24 MHz Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 247/268] mmc: debugfs: correct wrong voltage value Kamal Mostafa
` (21 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ido Schimmel, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Ido Schimmel <idosch@mellanox.com>
commit 60a6531bfe49555581ccd65f66a350cc5693fcde upstream.
We can't be within an RCU read-side critical section when deleting
VLANs, as underlying drivers might sleep during the hardware operation.
Therefore, replace the RCU critical section with a mutex. This is
consistent with team_vlan_rx_add_vid.
Fixes: 3d249d4ca7d0 ("net: introduce ethernet teaming device")
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/team/team.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index daa054b..88058480 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1845,10 +1845,10 @@ static int team_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
struct team *team = netdev_priv(dev);
struct team_port *port;
- rcu_read_lock();
- list_for_each_entry_rcu(port, &team->port_list, list)
+ mutex_lock(&team->lock);
+ list_for_each_entry(port, &team->port_list, list)
vlan_vid_del(port->dev, proto, vid);
- rcu_read_unlock();
+ mutex_unlock(&team->lock);
return 0;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 247/268] mmc: debugfs: correct wrong voltage value
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (245 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 246/268] team: Replace rcu_read_lock with a mutex in team_vlan_rx_kill_vid Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 248/268] IB/mlx4: Initialize hop_limit when creating address handle Kamal Mostafa
` (20 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Chuanxiao Dong, Pawel Wodkowski, Ulf Hansson, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Chuanxiao Dong <chuanxiao.dong@intel.com>
commit 0036e74686344f1051afc3107740140abfd03616 upstream.
Correct the wrong voltage value shown in debugfs for mmc/sd/sdio.
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Fixes: 42cd95a0603e ("mmc: core: debugfs: Add signal_voltage to ios dump")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mmc/core/debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
index e914210..7115489 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -164,7 +164,7 @@ static int mmc_ios_show(struct seq_file *s, void *data)
str = "invalid";
break;
}
- seq_printf(s, "signal voltage:\t%u (%s)\n", ios->chip_select, str);
+ seq_printf(s, "signal voltage:\t%u (%s)\n", ios->signal_voltage, str);
return 0;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 248/268] IB/mlx4: Initialize hop_limit when creating address handle
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (246 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 247/268] mmc: debugfs: correct wrong voltage value Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 249/268] net/mlx4: Remove unused macro Kamal Mostafa
` (19 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Matan Barak, Doug Ledford, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Matan Barak <matanb@mellanox.com>
commit 4e4081673445485aa6bc90383bdb83e7a96cc48a upstream.
Hop limit value wasn't copied from attributes when ah was created.
This may influence packets for unconnected services to get dropped in
routers when endpoints are not in the same subnet.
Fixes: fa417f7b520e ("IB/mlx4: Add support for IBoE")
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/infiniband/hw/mlx4/ah.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/hw/mlx4/ah.c b/drivers/infiniband/hw/mlx4/ah.c
index 33fdd50..de1a28d 100644
--- a/drivers/infiniband/hw/mlx4/ah.c
+++ b/drivers/infiniband/hw/mlx4/ah.c
@@ -91,6 +91,7 @@ static struct ib_ah *create_iboe_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr
ah->av.eth.port_pd = cpu_to_be32(to_mpd(pd)->pdn | (ah_attr->port_num << 24));
ah->av.eth.gid_index = ah_attr->grh.sgid_index;
ah->av.eth.vlan = cpu_to_be16(vlan_tag);
+ ah->av.eth.hop_limit = ah_attr->grh.hop_limit;
if (ah_attr->static_rate) {
ah->av.eth.stat_rate = ah_attr->static_rate + MLX4_STAT_RATE_OFFSET;
while (ah->av.eth.stat_rate > IB_RATE_2_5_GBPS + MLX4_STAT_RATE_OFFSET &&
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 249/268] net/mlx4: Remove unused macro
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (247 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 248/268] IB/mlx4: Initialize hop_limit when creating address handle Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 250/268] NFSv4: Don't perform cached access checks before we've OPENed the file Kamal Mostafa
` (18 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Moni Shoua, Doug Ledford, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Moni Shoua <monis@mellanox.com>
commit f25bf1977f7a968e85fe8ab99252b8132c6cf8c4 upstream.
The macro mlx4_foreach_non_ib_transport_port() is not used anywhere. Remove it.
Fixes: aa9a2d51a3e7 ("mlx4: Activate RoCE/SRIOV")
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/mlx4/device.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index fd13c1c..24a877f 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -961,10 +961,6 @@ struct mlx4_mad_ifc {
for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
if ((type) == (dev)->caps.port_mask[(port)])
-#define mlx4_foreach_non_ib_transport_port(port, dev) \
- for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
- if (((dev)->caps.port_mask[port] != MLX4_PORT_TYPE_IB))
-
#define mlx4_foreach_ib_transport_port(port, dev) \
for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 250/268] NFSv4: Don't perform cached access checks before we've OPENed the file
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (248 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 249/268] net/mlx4: Remove unused macro Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 251/268] NFS: Ensure we revalidate attributes before using execute_ok() Kamal Mostafa
` (17 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Al Viro, Trond Myklebust, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Trond Myklebust <trond.myklebust@primarydata.com>
commit 762674f86d0328d5dc923c966e209e1ee59663f2 upstream.
Donald Buczek reports that a nfs4 client incorrectly denies
execute access based on outdated file mode (missing 'x' bit).
After the mode on the server is 'fixed' (chmod +x) further execution
attempts continue to fail, because the nfs ACCESS call updates
the access parameter but not the mode parameter or the mode in
the inode.
The root cause is ultimately that the VFS is calling may_open()
before the NFS client has a chance to OPEN the file and hence revalidate
the access and attribute caches.
Al Viro suggests:
>>> Make nfs_permission() relax the checks when it sees MAY_OPEN, if you know
>>> that things will be caught by server anyway?
>>
>> That can work as long as we're guaranteed that everything that calls
>> inode_permission() with MAY_OPEN on a regular file will also follow up
>> with a vfs_open() or dentry_open() on success. Is this always the
>> case?
>
> 1) in do_tmpfile(), followed by do_dentry_open() (not reachable by NFS since
> it doesn't have ->tmpfile() instance anyway)
>
> 2) in atomic_open(), after the call of ->atomic_open() has succeeded.
>
> 3) in do_last(), followed on success by vfs_open()
>
> That's all. All calls of inode_permission() that get MAY_OPEN come from
> may_open(), and there's no other callers of that puppy.
Reported-by: Donald Buczek <buczek@molgen.mpg.de>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=109771
Link: http://lkml.kernel.org/r/1451046656-26319-1-git-send-email-buczek@molgen.mpg.de
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/dir.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 547308a..40d0dc6 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2460,6 +2460,9 @@ int nfs_permission(struct inode *inode, int mask)
case S_IFLNK:
goto out;
case S_IFREG:
+ if ((mask & MAY_OPEN) &&
+ nfs_server_capable(inode, NFS_CAP_ATOMIC_OPEN))
+ return 0;
break;
case S_IFDIR:
/*
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 251/268] NFS: Ensure we revalidate attributes before using execute_ok()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (249 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 250/268] NFSv4: Don't perform cached access checks before we've OPENed the file Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 252/268] veth: don’t modify ip_summed; doing so treats packets with bad checksums as good Kamal Mostafa
` (16 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Trond Myklebust, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Trond Myklebust <trond.myklebust@primarydata.com>
commit 5c5fc09a1157a11dbe84e6421c3e0b37d05238cb upstream.
Donald Buczek reports that NFS clients can also report incorrect
results for access() due to lack of revalidation of attributes
before calling execute_ok().
Looking closely, it seems chdir() is afflicted with the same problem.
Fix is to ensure we call nfs_revalidate_inode_rcu() or
nfs_revalidate_inode() as appropriate before deciding to trust
execute_ok().
Reported-by: Donald Buczek <buczek@molgen.mpg.de>
Link: http://lkml.kernel.org/r/1451331530-3748-1-git-send-email-buczek@molgen.mpg.de
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/dir.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 40d0dc6..fccbda7 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2443,6 +2443,20 @@ int nfs_may_open(struct inode *inode, struct rpc_cred *cred, int openflags)
}
EXPORT_SYMBOL_GPL(nfs_may_open);
+static int nfs_execute_ok(struct inode *inode, int mask)
+{
+ struct nfs_server *server = NFS_SERVER(inode);
+ int ret;
+
+ if (mask & MAY_NOT_BLOCK)
+ ret = nfs_revalidate_inode_rcu(server, inode);
+ else
+ ret = nfs_revalidate_inode(server, inode);
+ if (ret == 0 && !execute_ok(inode))
+ ret = -EACCES;
+ return ret;
+}
+
int nfs_permission(struct inode *inode, int mask)
{
struct rpc_cred *cred;
@@ -2495,8 +2509,8 @@ force_lookup:
res = PTR_ERR(cred);
}
out:
- if (!res && (mask & MAY_EXEC) && !execute_ok(inode))
- res = -EACCES;
+ if (!res && (mask & MAY_EXEC))
+ res = nfs_execute_ok(inode, mask);
dfprintk(VFS, "NFS: permission(%s/%lu), mask=0x%x, res=%d\n",
inode->i_sb->s_id, inode->i_ino, mask, res);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 252/268] veth: don’t modify ip_summed; doing so treats packets with bad checksums as good.
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (250 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 251/268] NFS: Ensure we revalidate attributes before using execute_ok() Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 253/268] net: cdc_ncm: avoid changing RX/TX buffers on MTU changes Kamal Mostafa
` (15 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Evan Jones, Nicolas Dichtel, Phil Sutter, Toshiaki Makita,
netdev, Vijay Pandurangan, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Vijay Pandurangan <vijayp@vijayp.ca>
[ Upstream commit ce8c839b74e3017996fad4e1b7ba2e2625ede82f ]
Packets that arrive from real hardware devices have ip_summed ==
CHECKSUM_UNNECESSARY if the hardware verified the checksums, or
CHECKSUM_NONE if the packet is bad or it was unable to verify it. The
current version of veth will replace CHECKSUM_NONE with
CHECKSUM_UNNECESSARY, which causes corrupt packets routed from hardware to
a veth device to be delivered to the application. This caused applications
at Twitter to receive corrupt data when network hardware was corrupting
packets.
We believe this was added as an optimization to skip computing and
verifying checksums for communication between containers. However, locally
generated packets have ip_summed == CHECKSUM_PARTIAL, so the code as
written does nothing for them. As far as we can tell, after removing this
code, these packets are transmitted from one stack to another unmodified
(tcpdump shows invalid checksums on both sides, as expected), and they are
delivered correctly to applications. We didn’t test every possible network
configuration, but we tried a few common ones such as bridging containers,
using NAT between the host and a container, and routing from hardware
devices to containers. We have effectively deployed this in production at
Twitter (by disabling RX checksum offloading on veth devices).
This code dates back to the first version of the driver, commit
<e314dbdc1c0dc6a548ecf> ("[NET]: Virtual ethernet device driver"), so I
suspect this bug occurred mostly because the driver API has evolved
significantly since then. Commit <0b7967503dc97864f283a> ("net/veth: Fix
packet checksumming") (in December 2010) fixed this for packets that get
created locally and sent to hardware devices, by not changing
CHECKSUM_PARTIAL. However, the same issue still occurs for packets coming
in from hardware devices.
Co-authored-by: Evan Jones <ej@evanjones.ca>
Signed-off-by: Evan Jones <ej@evanjones.ca>
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: Phil Sutter <phil@nwl.cc>
Cc: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Vijay Pandurangan <vijayp@vijayp.ca>
Acked-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/veth.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index c8186ff..2e61a79 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -117,12 +117,6 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
kfree_skb(skb);
goto drop;
}
- /* don't change ip_summed == CHECKSUM_PARTIAL, as that
- * will cause bad checksum on forwarded packets
- */
- if (skb->ip_summed == CHECKSUM_NONE &&
- rcv->features & NETIF_F_RXCSUM)
- skb->ip_summed = CHECKSUM_UNNECESSARY;
if (likely(dev_forward_skb(rcv, skb) == NET_RX_SUCCESS)) {
struct pcpu_vstats *stats = this_cpu_ptr(dev->vstats);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 253/268] net: cdc_ncm: avoid changing RX/TX buffers on MTU changes
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (251 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 252/268] veth: don’t modify ip_summed; doing so treats packets with bad checksums as good Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 254/268] sctp: sctp should release assoc when sctp_make_abort_user return NULL in sctp_close Kamal Mostafa
` (14 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Bjørn Mork, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>
[ Upstream commit 1dfddff5fcd869fcab0c52fafae099dfa435a935 ]
NCM buffer sizes are negotiated with the device independently of
the network device MTU. The RX buffers are allocated by the
usbnet framework based on the rx_urb_size value set by cdc_ncm. A
single RX buffer can hold a number of MTU sized packets.
The default usbnet change_mtu ndo only modifies rx_urb_size if it
is equal to hard_mtu. And the cdc_ncm driver will set rx_urb_size
and hard_mtu independently of each other, based on dwNtbInMaxSize
and dwNtbOutMaxSize respectively. It was therefore assumed that
usbnet_change_mtu() would never touch rx_urb_size. This failed to
consider the case where dwNtbInMaxSize and dwNtbOutMaxSize happens
to be equal.
Fix by implementing an NCM specific change_mtu ndo, modifying the
netdev MTU without touching the buffer size settings.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/usb/cdc_mbim.c | 2 +-
drivers/net/usb/cdc_ncm.c | 31 +++++++++++++++++++++++++++++++
include/linux/usb/cdc_ncm.h | 1 +
3 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/drivers/net/usb/cdc_mbim.c b/drivers/net/usb/cdc_mbim.c
index b6ea6ff..d87b4ac 100644
--- a/drivers/net/usb/cdc_mbim.c
+++ b/drivers/net/usb/cdc_mbim.c
@@ -100,7 +100,7 @@ static const struct net_device_ops cdc_mbim_netdev_ops = {
.ndo_stop = usbnet_stop,
.ndo_start_xmit = usbnet_start_xmit,
.ndo_tx_timeout = usbnet_tx_timeout,
- .ndo_change_mtu = usbnet_change_mtu,
+ .ndo_change_mtu = cdc_ncm_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
.ndo_vlan_rx_add_vid = cdc_mbim_rx_add_vid,
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index fa41a6d..e278a7a 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -41,6 +41,7 @@
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/ctype.h>
+#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/workqueue.h>
#include <linux/mii.h>
@@ -689,6 +690,33 @@ static void cdc_ncm_free(struct cdc_ncm_ctx *ctx)
kfree(ctx);
}
+/* we need to override the usbnet change_mtu ndo for two reasons:
+ * - respect the negotiated maximum datagram size
+ * - avoid unwanted changes to rx and tx buffers
+ */
+int cdc_ncm_change_mtu(struct net_device *net, int new_mtu)
+{
+ struct usbnet *dev = netdev_priv(net);
+ struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0];
+ int maxmtu = ctx->max_datagram_size - cdc_ncm_eth_hlen(dev);
+
+ if (new_mtu <= 0 || new_mtu > maxmtu)
+ return -EINVAL;
+ net->mtu = new_mtu;
+ return 0;
+}
+EXPORT_SYMBOL_GPL(cdc_ncm_change_mtu);
+
+static const struct net_device_ops cdc_ncm_netdev_ops = {
+ .ndo_open = usbnet_open,
+ .ndo_stop = usbnet_stop,
+ .ndo_start_xmit = usbnet_start_xmit,
+ .ndo_tx_timeout = usbnet_tx_timeout,
+ .ndo_change_mtu = cdc_ncm_change_mtu,
+ .ndo_set_mac_address = eth_mac_addr,
+ .ndo_validate_addr = eth_validate_addr,
+};
+
int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting, int drvflags)
{
const struct usb_cdc_union_desc *union_desc = NULL;
@@ -874,6 +902,9 @@ advance:
/* add our sysfs attrs */
dev->net->sysfs_groups[0] = &cdc_ncm_sysfs_attr_group;
+ /* must handle MTU changes */
+ dev->net->netdev_ops = &cdc_ncm_netdev_ops;
+
return 0;
error2:
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h
index 1f6526c..3a375d0 100644
--- a/include/linux/usb/cdc_ncm.h
+++ b/include/linux/usb/cdc_ncm.h
@@ -138,6 +138,7 @@ struct cdc_ncm_ctx {
};
u8 cdc_ncm_select_altsetting(struct usb_interface *intf);
+int cdc_ncm_change_mtu(struct net_device *net, int new_mtu);
int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting, int drvflags);
void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf);
struct sk_buff *cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 254/268] sctp: sctp should release assoc when sctp_make_abort_user return NULL in sctp_close
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (252 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 253/268] net: cdc_ncm: avoid changing RX/TX buffers on MTU changes Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 255/268] connector: bump skb->users before callback invocation Kamal Mostafa
` (13 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Xin Long, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Xin Long <lucien.xin@gmail.com>
[ Upstream commit 068d8bd338e855286aea54e70d1c101569284b21 ]
In sctp_close, sctp_make_abort_user may return NULL because of memory
allocation failure. If this happens, it will bypass any state change
and never free the assoc. The assoc has no chance to be freed and it
will be kept in memory with the state it had even after the socket is
closed by sctp_close().
So if sctp_make_abort_user fails to allocate memory, we should abort
the asoc via sctp_primitive_ABORT as well. Just like the annotation in
sctp_sf_cookie_wait_prm_abort and sctp_sf_do_9_1_prm_abort said,
"Even if we can't send the ABORT due to low memory delete the TCB.
This is a departure from our typical NOMEM handling".
But then the chunk is NULL (low memory) and the SCTP_CMD_REPLY cmd would
dereference the chunk pointer, and system crash. So we should add
SCTP_CMD_REPLY cmd only when the chunk is not NULL, just like other
places where it adds SCTP_CMD_REPLY cmd.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/sctp/sm_statefuns.c | 6 ++++--
net/sctp/socket.c | 3 +--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 3809a74..68056f8 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -4829,7 +4829,8 @@ sctp_disposition_t sctp_sf_do_9_1_prm_abort(
retval = SCTP_DISPOSITION_CONSUME;
- sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort));
+ if (abort)
+ sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort));
/* Even if we can't send the ABORT due to low memory delete the
* TCB. This is a departure from our typical NOMEM handling.
@@ -4966,7 +4967,8 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_abort(
SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT));
retval = SCTP_DISPOSITION_CONSUME;
- sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort));
+ if (abort)
+ sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort));
sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
SCTP_STATE(SCTP_STATE_CLOSED));
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 84b1b50..9dee804 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1513,8 +1513,7 @@ static void sctp_close(struct sock *sk, long timeout)
struct sctp_chunk *chunk;
chunk = sctp_make_abort_user(asoc, NULL, 0);
- if (chunk)
- sctp_primitive_ABORT(net, asoc, chunk);
+ sctp_primitive_ABORT(net, asoc, chunk);
} else
sctp_primitive_SHUTDOWN(net, asoc, NULL);
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 255/268] connector: bump skb->users before callback invocation
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (253 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 254/268] sctp: sctp should release assoc when sctp_make_abort_user return NULL in sctp_close Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 256/268] af_unix: Fix splice-bind deadlock Kamal Mostafa
` (12 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Florian Westphal, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Florian Westphal <fw@strlen.de>
[ Upstream commit 55285bf09427c5abf43ee1d54e892f352092b1f1 ]
Dmitry reports memleak with syskaller program.
Problem is that connector bumps skb usecount but might not invoke callback.
So move skb_get to where we invoke the callback.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/connector/connector.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index 30f5228..c19e7fc 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -178,26 +178,21 @@ static int cn_call_callback(struct sk_buff *skb)
*
* It checks skb, netlink header and msg sizes, and calls callback helper.
*/
-static void cn_rx_skb(struct sk_buff *__skb)
+static void cn_rx_skb(struct sk_buff *skb)
{
struct nlmsghdr *nlh;
- struct sk_buff *skb;
int len, err;
- skb = skb_get(__skb);
-
if (skb->len >= NLMSG_HDRLEN) {
nlh = nlmsg_hdr(skb);
len = nlmsg_len(nlh);
if (len < (int)sizeof(struct cn_msg) ||
skb->len < nlh->nlmsg_len ||
- len > CONNECTOR_MAX_MSG_SIZE) {
- kfree_skb(skb);
+ len > CONNECTOR_MAX_MSG_SIZE)
return;
- }
- err = cn_call_callback(skb);
+ err = cn_call_callback(skb_get(skb));
if (err < 0)
kfree_skb(skb);
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 256/268] af_unix: Fix splice-bind deadlock
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (254 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 255/268] connector: bump skb->users before callback invocation Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 257/268] unix: properly account for FDs passed over unix sockets Kamal Mostafa
` (11 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Rainer Weikusat, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
[ Upstream commit c845acb324aa85a39650a14e7696982ceea75dc1 ]
On 2015/11/06, Dmitry Vyukov reported a deadlock involving the splice
system call and AF_UNIX sockets,
http://lists.openwall.net/netdev/2015/11/06/24
The situation was analyzed as
(a while ago) A: socketpair()
B: splice() from a pipe to /mnt/regular_file
does sb_start_write() on /mnt
C: try to freeze /mnt
wait for B to finish with /mnt
A: bind() try to bind our socket to /mnt/new_socket_name
lock our socket, see it not bound yet
decide that it needs to create something in /mnt
try to do sb_start_write() on /mnt, block (it's
waiting for C).
D: splice() from the same pipe to our socket
lock the pipe, see that socket is connected
try to lock the socket, block waiting for A
B: get around to actually feeding a chunk from
pipe to file, try to lock the pipe. Deadlock.
on 2015/11/10 by Al Viro,
http://lists.openwall.net/netdev/2015/11/10/4
The patch fixes this by removing the kern_path_create related code from
unix_mknod and executing it as part of unix_bind prior acquiring the
readlock of the socket in question. This means that A (as used above)
will sb_start_write on /mnt before it acquires the readlock, hence, it
won't indirectly block B which first did a sb_start_write and then
waited for a thread trying to acquire the readlock. Consequently, A
being blocked by C waiting for B won't cause a deadlock anymore
(effectively, both A and B acquire two locks in opposite order in the
situation described above).
Dmitry Vyukov(<dvyukov@google.com>) tested the original patch.
Signed-off-by: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/unix/af_unix.c | 66 +++++++++++++++++++++++++++++++++---------------------
1 file changed, 40 insertions(+), 26 deletions(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 0fc6dba..0e7bf2b 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -952,32 +952,20 @@ fail:
return NULL;
}
-static int unix_mknod(const char *sun_path, umode_t mode, struct path *res)
+static int unix_mknod(struct dentry *dentry, struct path *path, umode_t mode,
+ struct path *res)
{
- struct dentry *dentry;
- struct path path;
- int err = 0;
- /*
- * Get the parent directory, calculate the hash for last
- * component.
- */
- dentry = kern_path_create(AT_FDCWD, sun_path, &path, 0);
- err = PTR_ERR(dentry);
- if (IS_ERR(dentry))
- return err;
+ int err;
- /*
- * All right, let's create it.
- */
- err = security_path_mknod(&path, dentry, mode, 0);
+ err = security_path_mknod(path, dentry, mode, 0);
if (!err) {
- err = vfs_mknod(d_inode(path.dentry), dentry, mode, 0);
+ err = vfs_mknod(d_inode(path->dentry), dentry, mode, 0);
if (!err) {
- res->mnt = mntget(path.mnt);
+ res->mnt = mntget(path->mnt);
res->dentry = dget(dentry);
}
}
- done_path_create(&path, dentry);
+
return err;
}
@@ -988,10 +976,12 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
struct unix_sock *u = unix_sk(sk);
struct sockaddr_un *sunaddr = (struct sockaddr_un *)uaddr;
char *sun_path = sunaddr->sun_path;
- int err;
+ int err, name_err;
unsigned int hash;
struct unix_address *addr;
struct hlist_head *list;
+ struct path path;
+ struct dentry *dentry;
err = -EINVAL;
if (sunaddr->sun_family != AF_UNIX)
@@ -1007,14 +997,34 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
goto out;
addr_len = err;
+ name_err = 0;
+ dentry = NULL;
+ if (sun_path[0]) {
+ /* Get the parent directory, calculate the hash for last
+ * component.
+ */
+ dentry = kern_path_create(AT_FDCWD, sun_path, &path, 0);
+
+ if (IS_ERR(dentry)) {
+ /* delay report until after 'already bound' check */
+ name_err = PTR_ERR(dentry);
+ dentry = NULL;
+ }
+ }
+
err = mutex_lock_interruptible(&u->readlock);
if (err)
- goto out;
+ goto out_path;
err = -EINVAL;
if (u->addr)
goto out_up;
+ if (name_err) {
+ err = name_err == -EEXIST ? -EADDRINUSE : name_err;
+ goto out_up;
+ }
+
err = -ENOMEM;
addr = kmalloc(sizeof(*addr)+addr_len, GFP_KERNEL);
if (!addr)
@@ -1025,11 +1035,11 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
addr->hash = hash ^ sk->sk_type;
atomic_set(&addr->refcnt, 1);
- if (sun_path[0]) {
- struct path path;
+ if (dentry) {
+ struct path u_path;
umode_t mode = S_IFSOCK |
(SOCK_INODE(sock)->i_mode & ~current_umask());
- err = unix_mknod(sun_path, mode, &path);
+ err = unix_mknod(dentry, &path, mode, &u_path);
if (err) {
if (err == -EEXIST)
err = -EADDRINUSE;
@@ -1037,9 +1047,9 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
goto out_up;
}
addr->hash = UNIX_HASH_SIZE;
- hash = d_backing_inode(path.dentry)->i_ino & (UNIX_HASH_SIZE-1);
+ hash = d_backing_inode(dentry)->i_ino & (UNIX_HASH_SIZE - 1);
spin_lock(&unix_table_lock);
- u->path = path;
+ u->path = u_path;
list = &unix_socket_table[hash];
} else {
spin_lock(&unix_table_lock);
@@ -1062,6 +1072,10 @@ out_unlock:
spin_unlock(&unix_table_lock);
out_up:
mutex_unlock(&u->readlock);
+out_path:
+ if (dentry)
+ done_path_create(&path, dentry);
+
out:
return err;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 257/268] unix: properly account for FDs passed over unix sockets
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (255 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 256/268] af_unix: Fix splice-bind deadlock Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 258/268] bridge: Only call /sbin/bridge-stp for the initial network namespace Kamal Mostafa
` (10 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Willy Tarreau, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: willy tarreau <w@1wt.eu>
[ Upstream commit 712f4aad406bb1ed67f3f98d04c044191f0ff593 ]
It is possible for a process to allocate and accumulate far more FDs than
the process' limit by sending them over a unix socket then closing them
to keep the process' fd count low.
This change addresses this problem by keeping track of the number of FDs
in flight per user and preventing non-privileged processes from having
more FDs in flight than their configured FD limit.
Reported-by: socketpair@gmail.com
Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Mitigates: CVE-2013-4312 (Linux 2.0+)
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/sched.h | 1 +
net/unix/af_unix.c | 24 ++++++++++++++++++++----
net/unix/garbage.c | 13 ++++++++-----
3 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index bfca8aa..8097d58 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -822,6 +822,7 @@ struct user_struct {
unsigned long mq_bytes; /* How many bytes can be allocated to mqueue? */
#endif
unsigned long locked_shm; /* How many pages of mlocked shm ? */
+ unsigned long unix_inflight; /* How many files in flight in unix sockets */
#ifdef CONFIG_KEYS
struct key *uid_keyring; /* UID specific keyring */
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 0e7bf2b..7926de1 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1512,6 +1512,21 @@ static void unix_destruct_scm(struct sk_buff *skb)
sock_wfree(skb);
}
+/*
+ * The "user->unix_inflight" variable is protected by the garbage
+ * collection lock, and we just read it locklessly here. If you go
+ * over the limit, there might be a tiny race in actually noticing
+ * it across threads. Tough.
+ */
+static inline bool too_many_unix_fds(struct task_struct *p)
+{
+ struct user_struct *user = current_user();
+
+ if (unlikely(user->unix_inflight > task_rlimit(p, RLIMIT_NOFILE)))
+ return !capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN);
+ return false;
+}
+
#define MAX_RECURSION_LEVEL 4
static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb)
@@ -1520,6 +1535,9 @@ static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb)
unsigned char max_level = 0;
int unix_sock_count = 0;
+ if (too_many_unix_fds(current))
+ return -ETOOMANYREFS;
+
for (i = scm->fp->count - 1; i >= 0; i--) {
struct sock *sk = unix_get_socket(scm->fp->fp[i]);
@@ -1541,10 +1559,8 @@ static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb)
if (!UNIXCB(skb).fp)
return -ENOMEM;
- if (unix_sock_count) {
- for (i = scm->fp->count - 1; i >= 0; i--)
- unix_inflight(scm->fp->fp[i]);
- }
+ for (i = scm->fp->count - 1; i >= 0; i--)
+ unix_inflight(scm->fp->fp[i]);
return max_level;
}
diff --git a/net/unix/garbage.c b/net/unix/garbage.c
index a73a226..8fcdc22 100644
--- a/net/unix/garbage.c
+++ b/net/unix/garbage.c
@@ -120,11 +120,11 @@ void unix_inflight(struct file *fp)
{
struct sock *s = unix_get_socket(fp);
+ spin_lock(&unix_gc_lock);
+
if (s) {
struct unix_sock *u = unix_sk(s);
- spin_lock(&unix_gc_lock);
-
if (atomic_long_inc_return(&u->inflight) == 1) {
BUG_ON(!list_empty(&u->link));
list_add_tail(&u->link, &gc_inflight_list);
@@ -132,25 +132,28 @@ void unix_inflight(struct file *fp)
BUG_ON(list_empty(&u->link));
}
unix_tot_inflight++;
- spin_unlock(&unix_gc_lock);
}
+ fp->f_cred->user->unix_inflight++;
+ spin_unlock(&unix_gc_lock);
}
void unix_notinflight(struct file *fp)
{
struct sock *s = unix_get_socket(fp);
+ spin_lock(&unix_gc_lock);
+
if (s) {
struct unix_sock *u = unix_sk(s);
- spin_lock(&unix_gc_lock);
BUG_ON(list_empty(&u->link));
if (atomic_long_dec_and_test(&u->inflight))
list_del_init(&u->link);
unix_tot_inflight--;
- spin_unlock(&unix_gc_lock);
}
+ fp->f_cred->user->unix_inflight--;
+ spin_unlock(&unix_gc_lock);
}
static void scan_inflight(struct sock *x, void (*func)(struct unix_sock *),
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 258/268] bridge: Only call /sbin/bridge-stp for the initial network namespace
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (256 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 257/268] unix: properly account for FDs passed over unix sockets Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 259/268] tcp_yeah: don't set ssthresh below 2 Kamal Mostafa
` (9 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Eric W. Biederman, Hannes Frederic Sowa, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
[ Upstream commit ff62198553e43cdffa9d539f6165d3e83f8a42bc ]
[I stole this patch from Eric Biederman. He wrote:]
> There is no defined mechanism to pass network namespace information
> into /sbin/bridge-stp therefore don't even try to invoke it except
> for bridge devices in the initial network namespace.
>
> It is possible for unprivileged users to cause /sbin/bridge-stp to be
> invoked for any network device name which if /sbin/bridge-stp does not
> guard against unreasonable arguments or being invoked twice on the
> same network device could cause problems.
[Hannes: changed patch using netns_eq]
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/bridge/br_stp_if.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 4ca449a..49d8d28 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -130,7 +130,10 @@ static void br_stp_start(struct net_bridge *br)
char *envp[] = { NULL };
struct net_bridge_port *p;
- r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC);
+ if (net_eq(dev_net(br->dev), &init_net))
+ r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC);
+ else
+ r = -ENOENT;
spin_lock_bh(&br->lock);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 259/268] tcp_yeah: don't set ssthresh below 2
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (257 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 258/268] bridge: Only call /sbin/bridge-stp for the initial network namespace Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 260/268] sched,cls_flower: set key address type when present Kamal Mostafa
` (8 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Neal Cardwell, Yuchung Cheng, Eric Dumazet, David S. Miller,
Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Neal Cardwell <ncardwell@google.com>
[ Upstream commit 83d15e70c4d8909d722c0d64747d8fb42e38a48f ]
For tcp_yeah, use an ssthresh floor of 2, the same floor used by Reno
and CUBIC, per RFC 5681 (equation 4).
tcp_yeah_ssthresh() was sometimes returning a 0 or negative ssthresh
value if the intended reduction is as big or bigger than the current
cwnd. Congestion control modules should never return a zero or
negative ssthresh. A zero ssthresh generally results in a zero cwnd,
causing the connection to stall. A negative ssthresh value will be
interpreted as a u32 and will set a target cwnd for PRR near 4
billion.
Oleksandr Natalenko reported that a system using tcp_yeah with ECN
could see a warning about a prior_cwnd of 0 in
tcp_cwnd_reduction(). Testing verified that this was due to
tcp_yeah_ssthresh() misbehaving in this way.
Reported-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/ipv4/tcp_yeah.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_yeah.c b/net/ipv4/tcp_yeah.c
index 17d3566..3e6a472 100644
--- a/net/ipv4/tcp_yeah.c
+++ b/net/ipv4/tcp_yeah.c
@@ -219,7 +219,7 @@ static u32 tcp_yeah_ssthresh(struct sock *sk)
yeah->fast_count = 0;
yeah->reno_count = max(yeah->reno_count>>1, 2U);
- return tp->snd_cwnd - reduction;
+ return max_t(int, tp->snd_cwnd - reduction, 2);
}
static struct tcp_congestion_ops tcp_yeah __read_mostly = {
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 260/268] sched,cls_flower: set key address type when present
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (258 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 259/268] tcp_yeah: don't set ssthresh below 2 Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 261/268] udp: disallow UFO for sockets with SO_NO_CHECK option Kamal Mostafa
` (7 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jamal Hadi Salim, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Jamal Hadi Salim <jhs@mojatatu.com>
[ Upstream commit 66530bdf85eb1d72a0c399665e09a2c2298501c6 ]
only when user space passes the addresses should we consider their
presence
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/sched/cls_flower.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 2f3d03f..ec9b8ee 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -252,23 +252,28 @@ static int fl_set_key(struct net *net, struct nlattr **tb,
fl_set_key_val(tb, key->eth.src, TCA_FLOWER_KEY_ETH_SRC,
mask->eth.src, TCA_FLOWER_KEY_ETH_SRC_MASK,
sizeof(key->eth.src));
+
fl_set_key_val(tb, &key->basic.n_proto, TCA_FLOWER_KEY_ETH_TYPE,
&mask->basic.n_proto, TCA_FLOWER_UNSPEC,
sizeof(key->basic.n_proto));
+
if (key->basic.n_proto == htons(ETH_P_IP) ||
key->basic.n_proto == htons(ETH_P_IPV6)) {
fl_set_key_val(tb, &key->basic.ip_proto, TCA_FLOWER_KEY_IP_PROTO,
&mask->basic.ip_proto, TCA_FLOWER_UNSPEC,
sizeof(key->basic.ip_proto));
}
- if (key->control.addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS) {
+
+ if (tb[TCA_FLOWER_KEY_IPV4_SRC] || tb[TCA_FLOWER_KEY_IPV4_DST]) {
+ key->control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
fl_set_key_val(tb, &key->ipv4.src, TCA_FLOWER_KEY_IPV4_SRC,
&mask->ipv4.src, TCA_FLOWER_KEY_IPV4_SRC_MASK,
sizeof(key->ipv4.src));
fl_set_key_val(tb, &key->ipv4.dst, TCA_FLOWER_KEY_IPV4_DST,
&mask->ipv4.dst, TCA_FLOWER_KEY_IPV4_DST_MASK,
sizeof(key->ipv4.dst));
- } else if (key->control.addr_type == FLOW_DISSECTOR_KEY_IPV6_ADDRS) {
+ } else if (tb[TCA_FLOWER_KEY_IPV6_SRC] || tb[TCA_FLOWER_KEY_IPV6_DST]) {
+ key->control.addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS;
fl_set_key_val(tb, &key->ipv6.src, TCA_FLOWER_KEY_IPV6_SRC,
&mask->ipv6.src, TCA_FLOWER_KEY_IPV6_SRC_MASK,
sizeof(key->ipv6.src));
@@ -276,6 +281,7 @@ static int fl_set_key(struct net *net, struct nlattr **tb,
&mask->ipv6.dst, TCA_FLOWER_KEY_IPV6_DST_MASK,
sizeof(key->ipv6.dst));
}
+
if (key->basic.ip_proto == IPPROTO_TCP) {
fl_set_key_val(tb, &key->tp.src, TCA_FLOWER_KEY_TCP_SRC,
&mask->tp.src, TCA_FLOWER_UNSPEC,
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 261/268] udp: disallow UFO for sockets with SO_NO_CHECK option
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (259 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 260/268] sched,cls_flower: set key address type when present Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 262/268] net: preserve IP control block during GSO segmentation Kamal Mostafa
` (6 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Michal Kubecek, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: =?UTF-8?q?Michal=20Kube=C4=8Dek?= <mkubecek@suse.cz>
[ Upstream commit 40ba330227ad00b8c0cdf2f425736ff9549cc423 ]
Commit acf8dd0a9d0b ("udp: only allow UFO for packets from SOCK_DGRAM
sockets") disallows UFO for packets sent from raw sockets. We need to do
the same also for SOCK_DGRAM sockets with SO_NO_CHECK options, even if
for a bit different reason: while such socket would override the
CHECKSUM_PARTIAL set by ip_ufo_append_data(), gso_size is still set and
bad offloading flags warning is triggered in __skb_gso_segment().
In the IPv6 case, SO_NO_CHECK option is ignored but we need to disallow
UFO for packets sent by sockets with UDP_NO_CHECK6_TX option.
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Tested-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/ipv4/ip_output.c | 2 +-
net/ipv6/ip6_output.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 23fcc82..de76e1f 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -918,7 +918,7 @@ static int __ip_append_data(struct sock *sk,
if (((length > mtu) || (skb && skb_is_gso(skb))) &&
(sk->sk_protocol == IPPROTO_UDP) &&
(rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len &&
- (sk->sk_type == SOCK_DGRAM)) {
+ (sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx) {
err = ip_ufo_append_data(sk, queue, getfrag, from, length,
hh_len, fragheaderlen, transhdrlen,
maxfraglen, flags);
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index ba1a9ac..18382b0 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1331,7 +1331,7 @@ emsgsize:
(skb && skb_is_gso(skb))) &&
(sk->sk_protocol == IPPROTO_UDP) &&
(rt->dst.dev->features & NETIF_F_UFO) &&
- (sk->sk_type == SOCK_DGRAM)) {
+ (sk->sk_type == SOCK_DGRAM) && !udp_get_no_check6_tx(sk)) {
err = ip6_ufo_append_data(sk, queue, getfrag, from, length,
hh_len, fragheaderlen,
transhdrlen, mtu, flags, fl6);
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 262/268] net: preserve IP control block during GSO segmentation
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (260 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 261/268] udp: disallow UFO for sockets with SO_NO_CHECK option Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 263/268] phonet: properly unshare skbs in phonet_rcv() Kamal Mostafa
` (5 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Konstantin Khlebnikov, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Konstantin Khlebnikov <koct9i@gmail.com>
[ Upstream commit 9207f9d45b0ad071baa128e846d7e7ed85016df3 ]
Skb_gso_segment() uses skb control block during segmentation.
This patch adds 32-bytes room for previous control block which
will be copied into all resulting segments.
This patch fixes kernel crash during fragmenting forwarded packets.
Fragmentation requires valid IP CB in skb for clearing ip options.
Also patch removes custom save/restore in ovs code, now it's redundant.
Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Link: http://lkml.kernel.org/r/CALYGNiP-0MZ-FExV2HutTvE9U-QQtkKSoE--KN=JQE5STYsjAA@mail.gmail.com
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/skbuff.h | 3 ++-
net/core/dev.c | 5 +++++
net/ipv4/ip_output.c | 1 +
net/openvswitch/datapath.c | 5 +----
net/xfrm/xfrm_output.c | 2 ++
5 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 2751588..8b2a698 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3337,7 +3337,8 @@ struct skb_gso_cb {
int encap_level;
__u16 csum_start;
};
-#define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb)
+#define SKB_SGO_CB_OFFSET 32
+#define SKB_GSO_CB(skb) ((struct skb_gso_cb *)((skb)->cb + SKB_SGO_CB_OFFSET))
static inline int skb_tnl_header_len(const struct sk_buff *inner_skb)
{
diff --git a/net/core/dev.c b/net/core/dev.c
index a8e4dd4..f1f1dd8 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2512,6 +2512,8 @@ static inline bool skb_needs_check(struct sk_buff *skb, bool tx_path)
*
* It may return NULL if the skb requires no segmentation. This is
* only possible when GSO is used for verifying header integrity.
+ *
+ * Segmentation preserves SKB_SGO_CB_OFFSET bytes of previous skb cb.
*/
struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
netdev_features_t features, bool tx_path)
@@ -2526,6 +2528,9 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
return ERR_PTR(err);
}
+ BUILD_BUG_ON(SKB_SGO_CB_OFFSET +
+ sizeof(*SKB_GSO_CB(skb)) > sizeof(skb->cb));
+
SKB_GSO_CB(skb)->mac_offset = skb_headroom(skb);
SKB_GSO_CB(skb)->encap_level = 0;
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index de76e1f..56b5daa 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -240,6 +240,7 @@ static int ip_finish_output_gso(struct sock *sk, struct sk_buff *skb,
* from host network stack.
*/
features = netif_skb_features(skb);
+ BUILD_BUG_ON(sizeof(*IPCB(skb)) > SKB_SGO_CB_OFFSET);
segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);
if (IS_ERR_OR_NULL(segs)) {
kfree_skb(skb);
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index ff332d1..1964ce5 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -336,12 +336,10 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
unsigned short gso_type = skb_shinfo(skb)->gso_type;
struct sw_flow_key later_key;
struct sk_buff *segs, *nskb;
- struct ovs_skb_cb ovs_cb;
int err;
- ovs_cb = *OVS_CB(skb);
+ BUILD_BUG_ON(sizeof(*OVS_CB(skb)) > SKB_SGO_CB_OFFSET);
segs = __skb_gso_segment(skb, NETIF_F_SG, false);
- *OVS_CB(skb) = ovs_cb;
if (IS_ERR(segs))
return PTR_ERR(segs);
if (segs == NULL)
@@ -359,7 +357,6 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
/* Queue all of the segments. */
skb = segs;
do {
- *OVS_CB(skb) = ovs_cb;
if (gso_type & SKB_GSO_UDP && skb != segs)
key = &later_key;
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 68ada2c..443f78c 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -165,6 +165,8 @@ static int xfrm_output_gso(struct sock *sk, struct sk_buff *skb)
{
struct sk_buff *segs;
+ BUILD_BUG_ON(sizeof(*IPCB(skb)) > SKB_SGO_CB_OFFSET);
+ BUILD_BUG_ON(sizeof(*IP6CB(skb)) > SKB_SGO_CB_OFFSET);
segs = skb_gso_segment(skb, 0);
kfree_skb(skb);
if (IS_ERR(segs))
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 263/268] phonet: properly unshare skbs in phonet_rcv()
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (261 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 262/268] net: preserve IP control block during GSO segmentation Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 264/268] net: bpf: reject invalid shifts Kamal Mostafa
` (4 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Eric Dumazet, Remi Denis-Courmont, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 7aaed57c5c2890634cfadf725173c7c68ea4cb4f ]
Ivaylo Dimitrov reported a regression caused by commit 7866a621043f
("dev: add per net_device packet type chains").
skb->dev becomes NULL and we crash in __netif_receive_skb_core().
Before above commit, different kind of bugs or corruptions could happen
without major crash.
But the root cause is that phonet_rcv() can queue skb without checking
if skb is shared or not.
Many thanks to Ivaylo Dimitrov for his help, diagnosis and tests.
Reported-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Tested-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Remi Denis-Courmont <courmisch@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/phonet/af_phonet.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index 10d42f3..f925753 100644
--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -377,6 +377,10 @@ static int phonet_rcv(struct sk_buff *skb, struct net_device *dev,
struct sockaddr_pn sa;
u16 len;
+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (!skb)
+ return NET_RX_DROP;
+
/* check we have at least a full Phonet header */
if (!pskb_pull(skb, sizeof(struct phonethdr)))
goto out;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 264/268] net: bpf: reject invalid shifts
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (262 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 263/268] phonet: properly unshare skbs in phonet_rcv() Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 265/268] batman-adv: Drop immediate batadv_hard_iface free function Kamal Mostafa
` (3 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Rabin Vincent, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Rabin Vincent <rabin@rab.in>
[ Upstream commit 229394e8e62a4191d592842cf67e80c62a492937 ]
On ARM64, a BUG() is triggered in the eBPF JIT if a filter with a
constant shift that can't be encoded in the immediate field of the
UBFM/SBFM instructions is passed to the JIT. Since these shifts
amounts, which are negative or >= regsize, are invalid, reject them in
the eBPF verifier and the classic BPF filter checker, for all
architectures.
Signed-off-by: Rabin Vincent <rabin@rab.in>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/bpf/verifier.c | 10 ++++++++++
net/core/filter.c | 5 +++++
2 files changed, 15 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 039d866..4d19a8c 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -1036,6 +1036,16 @@ static int check_alu_op(struct reg_state *regs, struct bpf_insn *insn)
return -EINVAL;
}
+ if ((opcode == BPF_LSH || opcode == BPF_RSH ||
+ opcode == BPF_ARSH) && BPF_SRC(insn->code) == BPF_K) {
+ int size = BPF_CLASS(insn->code) == BPF_ALU64 ? 64 : 32;
+
+ if (insn->imm < 0 || insn->imm >= size) {
+ verbose("invalid shift %d\n", insn->imm);
+ return -EINVAL;
+ }
+ }
+
/* pattern match 'bpf_add Rx, imm' instruction */
if (opcode == BPF_ADD && BPF_CLASS(insn->code) == BPF_ALU64 &&
regs[insn->dst_reg].type == FRAME_PTR &&
diff --git a/net/core/filter.c b/net/core/filter.c
index 8dcdd86..515b50b 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -779,6 +779,11 @@ static int bpf_check_classic(const struct sock_filter *filter,
if (ftest->k == 0)
return -EINVAL;
break;
+ case BPF_ALU | BPF_LSH | BPF_K:
+ case BPF_ALU | BPF_RSH | BPF_K:
+ if (ftest->k >= 32)
+ return -EINVAL;
+ break;
case BPF_LD | BPF_MEM:
case BPF_LDX | BPF_MEM:
case BPF_ST:
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 265/268] batman-adv: Drop immediate batadv_hard_iface free function
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (263 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 264/268] net: bpf: reject invalid shifts Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 266/268] xfrm: dst_entries_init() per-net dst_ops Kamal Mostafa
` (2 subsequent siblings)
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sven Eckelmann, Marek Lindner, Antonio Quartulli, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Sven Eckelmann <sven@narfation.org>
[ Upstream commit b4d922cfc9c08318eeb77d53b7633740e6b0efb0 ]
It is not allowed to free the memory of an object which is part of a list
which is protected by rcu-read-side-critical sections without making sure
that no other context is accessing the object anymore. This usually happens
by removing the references to this object and then waiting until the rcu
grace period is over and no one (allowedly) accesses it anymore.
But the _now functions ignore this completely. They free the object
directly even when a different context still tries to access it. This has
to be avoided and thus these functions must be removed and all functions
have to use batadv_hardif_free_ref.
Fixes: 89652331c00f ("batman-adv: split tq information in neigh_node struct")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/batman-adv/hard-interface.h | 12 ------------
net/batman-adv/originator.c | 14 +++++++-------
2 files changed, 7 insertions(+), 19 deletions(-)
diff --git a/net/batman-adv/hard-interface.h b/net/batman-adv/hard-interface.h
index 5a31420..7b12ea8 100644
--- a/net/batman-adv/hard-interface.h
+++ b/net/batman-adv/hard-interface.h
@@ -75,18 +75,6 @@ batadv_hardif_free_ref(struct batadv_hard_iface *hard_iface)
call_rcu(&hard_iface->rcu, batadv_hardif_free_rcu);
}
-/**
- * batadv_hardif_free_ref_now - decrement the hard interface refcounter and
- * possibly free it (without rcu callback)
- * @hard_iface: the hard interface to free
- */
-static inline void
-batadv_hardif_free_ref_now(struct batadv_hard_iface *hard_iface)
-{
- if (atomic_dec_and_test(&hard_iface->refcount))
- batadv_hardif_free_rcu(&hard_iface->rcu);
-}
-
static inline struct batadv_hard_iface *
batadv_primary_if_get_selected(struct batadv_priv *bat_priv)
{
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 2a96811..ae69e32 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -188,16 +188,16 @@ void batadv_neigh_ifinfo_free_ref(struct batadv_neigh_ifinfo *neigh_ifinfo)
/**
* batadv_neigh_node_free_rcu - free the neigh_node
- * @rcu: rcu pointer of the neigh_node
+ * batadv_neigh_node_release - release neigh_node from lists and queue for
+ * free after rcu grace period
+ * @neigh_node: neigh neighbor to free
*/
-static void batadv_neigh_node_free_rcu(struct rcu_head *rcu)
+static void batadv_neigh_node_release(struct batadv_neigh_node *neigh_node)
{
struct hlist_node *node_tmp;
- struct batadv_neigh_node *neigh_node;
struct batadv_neigh_ifinfo *neigh_ifinfo;
struct batadv_algo_ops *bao;
- neigh_node = container_of(rcu, struct batadv_neigh_node, rcu);
bao = neigh_node->orig_node->bat_priv->bat_algo_ops;
hlist_for_each_entry_safe(neigh_ifinfo, node_tmp,
@@ -208,9 +208,9 @@ static void batadv_neigh_node_free_rcu(struct rcu_head *rcu)
if (bao->bat_neigh_free)
bao->bat_neigh_free(neigh_node);
- batadv_hardif_free_ref_now(neigh_node->if_incoming);
+ batadv_hardif_free_ref(neigh_node->if_incoming);
- kfree(neigh_node);
+ kfree_rcu(neigh_node, rcu);
}
/**
@@ -221,7 +221,7 @@ static void batadv_neigh_node_free_rcu(struct rcu_head *rcu)
void batadv_neigh_node_free_ref(struct batadv_neigh_node *neigh_node)
{
if (atomic_dec_and_test(&neigh_node->refcount))
- call_rcu(&neigh_node->rcu, batadv_neigh_node_free_rcu);
+ batadv_neigh_node_release(neigh_node);
}
/**
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 266/268] xfrm: dst_entries_init() per-net dst_ops
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (264 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 265/268] batman-adv: Drop immediate batadv_hard_iface free function Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 267/268] vxlan: fix test which detect duplicate vxlan iface Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 268/268] ipv6: update skb->csum when CE mark is propagated Kamal Mostafa
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dan Streetman, Dan Streetman, Steffen Klassert, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Dan Streetman <dan.streetman@canonical.com>
[ Upstream commit a8a572a6b5f2a79280d6e302cb3c1cb1fbaeb3e8 ]
Remove the dst_entries_init/destroy calls for xfrm4 and xfrm6 dst_ops
templates; their dst_entries counters will never be used. Move the
xfrm dst_ops initialization from the common xfrm/xfrm_policy.c to
xfrm4/xfrm4_policy.c and xfrm6/xfrm6_policy.c, and call dst_entries_init
and dst_entries_destroy for each net namespace.
The ipv4 and ipv6 xfrms each create dst_ops template, and perform
dst_entries_init on the templates. The template values are copied to each
net namespace's xfrm.xfrm*_dst_ops. The problem there is the dst_ops
pcpuc_entries field is a percpu counter and cannot be used correctly by
simply copying it to another object.
The result of this is a very subtle bug; changes to the dst entries
counter from one net namespace may sometimes get applied to a different
net namespace dst entries counter. This is because of how the percpu
counter works; it has a main count field as well as a pointer to the
percpu variables. Each net namespace maintains its own main count
variable, but all point to one set of percpu variables. When any net
namespace happens to change one of the percpu variables to outside its
small batch range, its count is moved to the net namespace's main count
variable. So with multiple net namespaces operating concurrently, the
dst_ops entries counter can stray from the actual value that it should
be; if counts are consistently moved from one net namespace to another
(which my testing showed is likely), then one net namespace winds up
with a negative dst_ops count while another winds up with a continually
increasing count, eventually reaching its gc_thresh limit, which causes
all new traffic on the net namespace to fail with -ENOBUFS.
Signed-off-by: Dan Streetman <dan.streetman@canonical.com>
Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/ipv4/xfrm4_policy.c | 46 +++++++++++++++++++++++++++++++++---------
net/ipv6/xfrm6_policy.c | 53 +++++++++++++++++++++++++++++++++++--------------
net/xfrm/xfrm_policy.c | 38 -----------------------------------
3 files changed, 75 insertions(+), 62 deletions(-)
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index bff6974..7852608 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -230,7 +230,7 @@ static void xfrm4_dst_ifdown(struct dst_entry *dst, struct net_device *dev,
xfrm_dst_ifdown(dst, dev);
}
-static struct dst_ops xfrm4_dst_ops = {
+static struct dst_ops xfrm4_dst_ops_template = {
.family = AF_INET,
.gc = xfrm4_garbage_collect,
.update_pmtu = xfrm4_update_pmtu,
@@ -244,7 +244,7 @@ static struct dst_ops xfrm4_dst_ops = {
static struct xfrm_policy_afinfo xfrm4_policy_afinfo = {
.family = AF_INET,
- .dst_ops = &xfrm4_dst_ops,
+ .dst_ops = &xfrm4_dst_ops_template,
.dst_lookup = xfrm4_dst_lookup,
.get_saddr = xfrm4_get_saddr,
.decode_session = _decode_session4,
@@ -266,7 +266,7 @@ static struct ctl_table xfrm4_policy_table[] = {
{ }
};
-static int __net_init xfrm4_net_init(struct net *net)
+static int __net_init xfrm4_net_sysctl_init(struct net *net)
{
struct ctl_table *table;
struct ctl_table_header *hdr;
@@ -294,7 +294,7 @@ err_alloc:
return -ENOMEM;
}
-static void __net_exit xfrm4_net_exit(struct net *net)
+static void __net_exit xfrm4_net_sysctl_exit(struct net *net)
{
struct ctl_table *table;
@@ -306,12 +306,44 @@ static void __net_exit xfrm4_net_exit(struct net *net)
if (!net_eq(net, &init_net))
kfree(table);
}
+#else /* CONFIG_SYSCTL */
+static int inline xfrm4_net_sysctl_init(struct net *net)
+{
+ return 0;
+}
+
+static void inline xfrm4_net_sysctl_exit(struct net *net)
+{
+}
+#endif
+
+static int __net_init xfrm4_net_init(struct net *net)
+{
+ int ret;
+
+ memcpy(&net->xfrm.xfrm4_dst_ops, &xfrm4_dst_ops_template,
+ sizeof(xfrm4_dst_ops_template));
+ ret = dst_entries_init(&net->xfrm.xfrm4_dst_ops);
+ if (ret)
+ return ret;
+
+ ret = xfrm4_net_sysctl_init(net);
+ if (ret)
+ dst_entries_destroy(&net->xfrm.xfrm4_dst_ops);
+
+ return ret;
+}
+
+static void __net_exit xfrm4_net_exit(struct net *net)
+{
+ xfrm4_net_sysctl_exit(net);
+ dst_entries_destroy(&net->xfrm.xfrm4_dst_ops);
+}
static struct pernet_operations __net_initdata xfrm4_net_ops = {
.init = xfrm4_net_init,
.exit = xfrm4_net_exit,
};
-#endif
static void __init xfrm4_policy_init(void)
{
@@ -320,13 +352,9 @@ static void __init xfrm4_policy_init(void)
void __init xfrm4_init(void)
{
- dst_entries_init(&xfrm4_dst_ops);
-
xfrm4_state_init();
xfrm4_policy_init();
xfrm4_protocol_init();
-#ifdef CONFIG_SYSCTL
register_pernet_subsys(&xfrm4_net_ops);
-#endif
}
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index ed0583c..f4ae5dc 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -274,7 +274,7 @@ static void xfrm6_dst_ifdown(struct dst_entry *dst, struct net_device *dev,
xfrm_dst_ifdown(dst, dev);
}
-static struct dst_ops xfrm6_dst_ops = {
+static struct dst_ops xfrm6_dst_ops_template = {
.family = AF_INET6,
.gc = xfrm6_garbage_collect,
.update_pmtu = xfrm6_update_pmtu,
@@ -288,7 +288,7 @@ static struct dst_ops xfrm6_dst_ops = {
static struct xfrm_policy_afinfo xfrm6_policy_afinfo = {
.family = AF_INET6,
- .dst_ops = &xfrm6_dst_ops,
+ .dst_ops = &xfrm6_dst_ops_template,
.dst_lookup = xfrm6_dst_lookup,
.get_saddr = xfrm6_get_saddr,
.decode_session = _decode_session6,
@@ -320,7 +320,7 @@ static struct ctl_table xfrm6_policy_table[] = {
{ }
};
-static int __net_init xfrm6_net_init(struct net *net)
+static int __net_init xfrm6_net_sysctl_init(struct net *net)
{
struct ctl_table *table;
struct ctl_table_header *hdr;
@@ -348,7 +348,7 @@ err_alloc:
return -ENOMEM;
}
-static void __net_exit xfrm6_net_exit(struct net *net)
+static void __net_exit xfrm6_net_sysctl_exit(struct net *net)
{
struct ctl_table *table;
@@ -360,24 +360,52 @@ static void __net_exit xfrm6_net_exit(struct net *net)
if (!net_eq(net, &init_net))
kfree(table);
}
+#else /* CONFIG_SYSCTL */
+static int inline xfrm6_net_sysctl_init(struct net *net)
+{
+ return 0;
+}
+
+static void inline xfrm6_net_sysctl_exit(struct net *net)
+{
+}
+#endif
+
+static int __net_init xfrm6_net_init(struct net *net)
+{
+ int ret;
+
+ memcpy(&net->xfrm.xfrm6_dst_ops, &xfrm6_dst_ops_template,
+ sizeof(xfrm6_dst_ops_template));
+ ret = dst_entries_init(&net->xfrm.xfrm6_dst_ops);
+ if (ret)
+ return ret;
+
+ ret = xfrm6_net_sysctl_init(net);
+ if (ret)
+ dst_entries_destroy(&net->xfrm.xfrm6_dst_ops);
+
+ return ret;
+}
+
+static void __net_exit xfrm6_net_exit(struct net *net)
+{
+ xfrm6_net_sysctl_exit(net);
+ dst_entries_destroy(&net->xfrm.xfrm6_dst_ops);
+}
static struct pernet_operations xfrm6_net_ops = {
.init = xfrm6_net_init,
.exit = xfrm6_net_exit,
};
-#endif
int __init xfrm6_init(void)
{
int ret;
- dst_entries_init(&xfrm6_dst_ops);
-
ret = xfrm6_policy_init();
- if (ret) {
- dst_entries_destroy(&xfrm6_dst_ops);
+ if (ret)
goto out;
- }
ret = xfrm6_state_init();
if (ret)
goto out_policy;
@@ -386,9 +414,7 @@ int __init xfrm6_init(void)
if (ret)
goto out_state;
-#ifdef CONFIG_SYSCTL
register_pernet_subsys(&xfrm6_net_ops);
-#endif
out:
return ret;
out_state:
@@ -400,11 +426,8 @@ out_policy:
void xfrm6_fini(void)
{
-#ifdef CONFIG_SYSCTL
unregister_pernet_subsys(&xfrm6_net_ops);
-#endif
xfrm6_protocol_fini();
xfrm6_policy_fini();
xfrm6_state_fini();
- dst_entries_destroy(&xfrm6_dst_ops);
}
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 2718184..b5680ad 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2816,7 +2816,6 @@ static struct neighbour *xfrm_neigh_lookup(const struct dst_entry *dst,
int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo)
{
- struct net *net;
int err = 0;
if (unlikely(afinfo == NULL))
return -EINVAL;
@@ -2847,26 +2846,6 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo)
}
spin_unlock(&xfrm_policy_afinfo_lock);
- rtnl_lock();
- for_each_net(net) {
- struct dst_ops *xfrm_dst_ops;
-
- switch (afinfo->family) {
- case AF_INET:
- xfrm_dst_ops = &net->xfrm.xfrm4_dst_ops;
- break;
-#if IS_ENABLED(CONFIG_IPV6)
- case AF_INET6:
- xfrm_dst_ops = &net->xfrm.xfrm6_dst_ops;
- break;
-#endif
- default:
- BUG();
- }
- *xfrm_dst_ops = *afinfo->dst_ops;
- }
- rtnl_unlock();
-
return err;
}
EXPORT_SYMBOL(xfrm_policy_register_afinfo);
@@ -2902,22 +2881,6 @@ int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo)
}
EXPORT_SYMBOL(xfrm_policy_unregister_afinfo);
-static void __net_init xfrm_dst_ops_init(struct net *net)
-{
- struct xfrm_policy_afinfo *afinfo;
-
- rcu_read_lock();
- afinfo = rcu_dereference(xfrm_policy_afinfo[AF_INET]);
- if (afinfo)
- net->xfrm.xfrm4_dst_ops = *afinfo->dst_ops;
-#if IS_ENABLED(CONFIG_IPV6)
- afinfo = rcu_dereference(xfrm_policy_afinfo[AF_INET6]);
- if (afinfo)
- net->xfrm.xfrm6_dst_ops = *afinfo->dst_ops;
-#endif
- rcu_read_unlock();
-}
-
static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
@@ -3066,7 +3029,6 @@ static int __net_init xfrm_net_init(struct net *net)
rv = xfrm_policy_init(net);
if (rv < 0)
goto out_policy;
- xfrm_dst_ops_init(net);
rv = xfrm_sysctl_init(net);
if (rv < 0)
goto out_sysctl;
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 267/268] vxlan: fix test which detect duplicate vxlan iface
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (265 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 266/268] xfrm: dst_entries_init() per-net dst_ops Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 268/268] ipv6: update skb->csum when CE mark is propagated Kamal Mostafa
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Nicolas Dichtel, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
[ Upstream commit 07b9b37c227cb8d88d478b4a9c5634fee514ede1 ]
When a vxlan interface is created, the driver checks that there is not
another vxlan interface with the same properties. To do this, it checks
the existing vxlan udp socket. Since commit 1c51a9159dde, the creation of
the vxlan socket is done only when the interface is set up, thus it breaks
that test.
Example:
$ ip l a vxlan10 type vxlan id 10 group 239.0.0.10 dev eth0 dstport 0
$ ip l a vxlan11 type vxlan id 10 group 239.0.0.10 dev eth0 dstport 0
$ ip -br l | grep vxlan
vxlan10 DOWN f2:55:1c:6a:fb:00 <BROADCAST,MULTICAST>
vxlan11 DOWN 7a:cb:b9:38:59:0d <BROADCAST,MULTICAST>
Instead of checking sockets, let's loop over the vxlan iface list.
Fixes: 1c51a9159dde ("vxlan: fix race caused by dropping rtnl_unlock")
Reported-by: Thomas Faivre <thomas.faivre@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/vxlan.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 025250b..f819d51 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2581,7 +2581,7 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev,
struct nlattr *tb[], struct nlattr *data[])
{
struct vxlan_net *vn = net_generic(src_net, vxlan_net_id);
- struct vxlan_dev *vxlan = netdev_priv(dev);
+ struct vxlan_dev *vxlan = netdev_priv(dev), *tmp;
struct vxlan_rdst *dst = &vxlan->default_dst;
__u32 vni;
int err;
@@ -2718,9 +2718,13 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev,
if (data[IFLA_VXLAN_REMCSUM_NOPARTIAL])
vxlan->flags |= VXLAN_F_REMCSUM_NOPARTIAL;
- if (vxlan_find_vni(src_net, vni, use_ipv6 ? AF_INET6 : AF_INET,
- vxlan->dst_port, vxlan->flags)) {
- pr_info("duplicate VNI %u\n", vni);
+ list_for_each_entry(tmp, &vn->vxlan_list, next) {
+ if (tmp->default_dst.remote_vni == vni &&
+ (tmp->default_dst.remote_ip.sa.sa_family == AF_INET6 ||
+ tmp->saddr.sa.sa_family == AF_INET6) == use_ipv6 &&
+ tmp->dst_port == vxlan->dst_port &&
+ (tmp->flags & VXLAN_F_RCV_FLAGS) ==
+ (vxlan->flags & VXLAN_F_RCV_FLAGS))
return -EEXIST;
}
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
* [PATCH 4.2.y-ckt 268/268] ipv6: update skb->csum when CE mark is propagated
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
` (266 preceding siblings ...)
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 267/268] vxlan: fix test which detect duplicate vxlan iface Kamal Mostafa
@ 2016-01-27 20:35 ` Kamal Mostafa
267 siblings, 0 replies; 269+ messages in thread
From: Kamal Mostafa @ 2016-01-27 20:35 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Eric Dumazet, David S. Miller, Kamal Mostafa
4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 34ae6a1aa0540f0f781dd265366036355fdc8930 ]
When a tunnel decapsulates the outer header, it has to comply
with RFC 6080 and eventually propagate CE mark into inner header.
It turns out IP6_ECN_set_ce() does not correctly update skb->csum
for CHECKSUM_COMPLETE packets, triggering infamous "hw csum failure"
messages and stack traces.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/net/inet_ecn.h | 19 ++++++++++++++++---
net/ipv6/xfrm6_mode_tunnel.c | 2 +-
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index 84b2083..0dc0a51 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -111,11 +111,24 @@ static inline void ipv4_copy_dscp(unsigned int dscp, struct iphdr *inner)
struct ipv6hdr;
-static inline int IP6_ECN_set_ce(struct ipv6hdr *iph)
+/* Note:
+ * IP_ECN_set_ce() has to tweak IPV4 checksum when setting CE,
+ * meaning both changes have no effect on skb->csum if/when CHECKSUM_COMPLETE
+ * In IPv6 case, no checksum compensates the change in IPv6 header,
+ * so we have to update skb->csum.
+ */
+static inline int IP6_ECN_set_ce(struct sk_buff *skb, struct ipv6hdr *iph)
{
+ __be32 from, to;
+
if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph)))
return 0;
- *(__be32*)iph |= htonl(INET_ECN_CE << 20);
+
+ from = *(__be32 *)iph;
+ to = from | htonl(INET_ECN_CE << 20);
+ *(__be32 *)iph = to;
+ if (skb->ip_summed == CHECKSUM_COMPLETE)
+ skb->csum = csum_add(csum_sub(skb->csum, from), to);
return 1;
}
@@ -142,7 +155,7 @@ static inline int INET_ECN_set_ce(struct sk_buff *skb)
case cpu_to_be16(ETH_P_IPV6):
if (skb_network_header(skb) + sizeof(struct ipv6hdr) <=
skb_tail_pointer(skb))
- return IP6_ECN_set_ce(ipv6_hdr(skb));
+ return IP6_ECN_set_ce(skb, ipv6_hdr(skb));
break;
}
diff --git a/net/ipv6/xfrm6_mode_tunnel.c b/net/ipv6/xfrm6_mode_tunnel.c
index 901ef6f..5266ad2 100644
--- a/net/ipv6/xfrm6_mode_tunnel.c
+++ b/net/ipv6/xfrm6_mode_tunnel.c
@@ -24,7 +24,7 @@ static inline void ipip6_ecn_decapsulate(struct sk_buff *skb)
struct ipv6hdr *inner_iph = ipipv6_hdr(skb);
if (INET_ECN_is_ce(ipv6_get_dsfield(outer_iph)))
- IP6_ECN_set_ce(inner_iph);
+ IP6_ECN_set_ce(skb, inner_iph);
}
/* Add encapsulation header.
--
1.9.1
^ permalink raw reply [flat|nested] 269+ messages in thread
end of thread, other threads:[~2016-01-27 22:05 UTC | newest]
Thread overview: 269+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-27 20:31 [4.2.y-ckt stable] Linux 4.2.8-ckt3 stable review Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 001/268] drm/nouveau/nv46: Change mc subdev oclass from nv44 to nv4c Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 002/268] ovl: allow zero size xattr Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 003/268] ovl: use a minimal buffer in ovl_copy_xattr Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 004/268] [media] vb2: fix a regression in poll() behavior for output,streams Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 005/268] [media] gspca: ov534/topro: prevent a division by 0 Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 006/268] [media] media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 007/268] [media] si2157: return -EINVAL if firmware blob is too big Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 008/268] tools lib traceevent: Fix output of %llu for 64 bit values read on 32 bit machines Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 009/268] cxl: use correct operator when writing pcie config space values Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 010/268] KVM: x86: expose MSR_TSC_AUX to userspace Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 011/268] KVM: x86: correctly print #AC in traces Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 012/268] drm/amdgpu: call hpd_irq_event on resume Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 013/268] drm/radeon: " Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 014/268] xhci: refuse loading if nousb is used Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 015/268] ARM: mvebu: remove duplicated regulator definition in Armada 388 GP Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 016/268] arm64: Clear out any singlestep state on a ptrace detach operation Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 017/268] time: Avoid signed overflow in timekeeping_get_ns() Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 018/268] ovl: root: copy attr Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 019/268] Bluetooth: Add support of Toshiba Broadcom based devices Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 020/268] ext4 crypto: exit cleanly if ext4_derive_key_aes() fails Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 021/268] ext4 crypto: add missing locking for keyring_key access Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 022/268] rtlwifi: fix memory leak for USB device Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 023/268] wlcore/wl12xx: spi: fix oops on firmware load Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 024/268] ovl: setattr: check permissions before copy-up Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 025/268] ovl: check dentry positiveness in ovl_cleanup_whiteouts() Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 026/268] EDAC, mc_sysfs: Fix freeing bus' name Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 027/268] EDAC: Robustify workqueues destruction Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 028/268] arm64: mm: ensure that the zero page is visible to the page table walker Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 029/268] powerpc: Make value-returning atomics fully ordered Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 030/268] powerpc: Make {cmp}xchg* and their atomic_ versions " Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 031/268] dm space map metadata: remove unused variable in brb_pop() Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 032/268] Drivers: hv: vmbus: Fix a Host signaling bug Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 033/268] tools: hv: vss: fix the write()'s argument: error -> vss_msg Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 034/268] clk: exynos: use irqsave version of spin_lock to avoid deadlock with irqs Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 035/268] iommu/io-pgtable-arm: Ensure we free the final level on teardown Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 036/268] dm thin: fix race condition when destroying thin pool workqueue Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 037/268] drm/radeon: Fix "slow" audio over DP on DCE8+ Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 038/268] futex: Drop refcount if requeue_pi() acquired the rtmutex Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 039/268] arm64: mdscr_el1: avoid exposing DCC to userspace Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 040/268] arm64: kernel: enforce pmuserenr_el0 initialization and restore Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 041/268] coresight: checking for NULL string in coresight_name_match() Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 042/268] drm/radeon: Fix off-by-one errors in radeon_vm_bo_set_addr Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 043/268] drm/amdgpu: Fix off-by-one errors in amdgpu_vm_bo_map Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 044/268] drm/radeon: clean up fujitsu quirks Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 045/268] mmc: mmc: Fix incorrect use of driver strength switching HS200 and HS400 Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 046/268] mmc: sdhci-pci: Do not default to 33 Ohm driver strength for Intel SPT Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 047/268] mmc: sdio: Fix invalid vdd in voltage switch power cycle Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 048/268] mmc: sdhci: Fix DMA descriptor with zero data length Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 049/268] mmc: sdhci: Fix sdhci_runtime_pm_bus_on/off() Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 050/268] regulator: axp20x: Fix GPIO LDO enable value for AXP22x Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 051/268] udf: limit the maximum number of indirect extents in a row Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 052/268] [media] rc: sunxi-cir: Initialize the spinlock properly Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 053/268] nfs: Fix race in __update_open_stateid() Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 054/268] USB: cp210x: add ID for ELV Marble Sound Board 1 Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 055/268] Thermal: initialize thermal zone device correctly Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 056/268] Thermal: handle thermal zone device properly during system sleep Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 057/268] Thermal: do thermal zone update after a cooling device registered Kamal Mostafa
2016-01-27 20:31 ` [PATCH 4.2.y-ckt 058/268] posix-clock: Fix return code on the poll method's error path Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 059/268] rtlwifi: rtl8723be: Fix module parameter initialization Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 060/268] rtlwifi: rtl8723ae: Fix initialization of module parameters Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 061/268] rtlwifi: rtl8821ae: Fix errors in parameter initialization Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 062/268] rtlwifi: rtl8188ee: Fix module " Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 063/268] rtlwifi: rtl8192de: Fix incorrect module parameter descriptions Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 064/268] rtlwifi: rtl8192se: Fix module parameter initialization Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 065/268] rtlwifi: rtl8192ce: Fix handling of module parameters Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 066/268] rtlwifi: rtl8192cu: Add missing parameter setup Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 067/268] NFS: Fix attribute cache revalidation Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 068/268] rtlwifi: rtl_pci: Fix kernel panic Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 069/268] bcache: fix a livelock when we cause a huge number of cache misses Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 070/268] bcache: Add a cond_resched() call to gc Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 071/268] bcache: clear BCACHE_DEV_UNLINK_DONE flag when attaching a backing device Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 072/268] bcache: fix a leak in bch_cached_dev_run() Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 073/268] bcache: unregister reboot notifier if bcache fails to unregister device Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 074/268] bcache: allows use of register in udev to avoid "device_busy" error Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 075/268] bcache: prevent crash on changing writeback_running Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 076/268] bcache: Change refill_dirty() to always scan entire disk if necessary Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 077/268] wlcore/wl12xx: spi: fix NULL pointer dereference (Oops) Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 078/268] Input: i8042 - add Fujitsu Lifebook U745 to the nomux list Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 079/268] libxfs: pack the agfl header structure so XFS_AGFL_SIZE is correct Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 080/268] x86/xen: don't reset vcpu_info on a cancelled suspend Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 081/268] udf: Prevent buffer overrun with multi-byte characters Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 082/268] udf: Check output buffer length when converting name to CS0 Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 083/268] drm/dp/mst: process broadcast messages correctly Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 084/268] drm/dp/mst: always send reply for UP request Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 085/268] drm/dp/mst: fix in MSTB RAD initialization Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 086/268] drm/dp/mst: fix in RAD element access Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 087/268] PCI: Fix minimum allocation address overwrite Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 088/268] PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 089/268] btrfs: handle invalid num_stripes in sys_array Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 090/268] iwlwifi: update and fix 7265 series PCI IDs Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 091/268] iwlwifi: pcie: properly configure the debug buffer size for 8000 Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 092/268] locks: fix unlock when fcntl_setlk races with a close Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 093/268] scsi: add Synology to 1024 sector blacklist Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 094/268] ASoC: compress: Fix compress device direction check Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 095/268] dm snapshot: fix hung bios when copy error occurs Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 096/268] uml: fix hostfs mknod() Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 097/268] uml: flush stdout before forking Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 098/268] drm/nouveau/kms: take mode_config mutex in connector hotplug path Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 099/268] ALSA: usb: Add native DSD support for Oppo HA-1 Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 100/268] ALSA: hda - Fixup inverted internal mic for Lenovo E50-80 Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 101/268] x86/mm: Add barriers and document switch_mm()-vs-flush synchronization Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 102/268] x86/boot: Double BOOT_HEAP_SIZE to 64KB Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 103/268] s390: fix normalization bug in exception table sorting Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 104/268] xfs: inode recovery readahead can race with inode buffer creation Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 105/268] xfs: handle dquot buffer readahead in log recovery correctly Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 106/268] clocksource/drivers/vt8500: Increase the minimum delta Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 107/268] Input: elantech - mark protocols v2 and v3 as semi-mt Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 108/268] x86/reboot/quirks: Add iMac10,1 to pci_reboot_dmi_table[] Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 109/268] ALSA: seq: Fix missing NULL check at remove_events ioctl Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 110/268] ALSA: seq: Fix race at timer setup and close Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 111/268] virtio_balloon: fix race by fill and leak Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 112/268] virtio_balloon: fix race between migration and ballooning Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 113/268] ALSA: hda - Fix white noise on Dell Latitude E5550 Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 114/268] parisc: Fix __ARCH_SI_PREAMBLE_SIZE Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 115/268] scripts/recordmcount.pl: support data in text section on powerpc Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 116/268] powerpc/module: Handle R_PPC64_ENTRY relocations Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 117/268] ALSA: hda - fix the headset mic detection problem for a Dell laptop Kamal Mostafa
2016-01-27 20:32 ` [PATCH 4.2.y-ckt 118/268] ALSA: usb-audio: Fix mixer ctl regression of Native Instrument devices Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 119/268] drm/i915: Restore inhibiting the load of the default context Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 120/268] drm/i915: intel_hpd_init(): Fix suspend/resume reprobing Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 121/268] x86/mm: Improve switch_mm() barrier comments Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 122/268] ALSA: timer: Fix double unlink of active_list Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 123/268] dmaengine: dw: fix cyclic transfer setup Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 124/268] dmaengine: dw: fix cyclic transfer callbacks Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 125/268] mmc: mmci: fix an ages old detection error Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 126/268] ALSA: timer: Fix race among timer ioctls Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 127/268] sparc64: fix incorrect sign extension in sys_sparc64_personality Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 128/268] cifs: Ratelimit kernel log messages Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 129/268] cifs: fix race between call_async() and reconnect() Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 130/268] cifs_dbg() outputs an uninitialized buffer in cifs_readdir() Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 131/268] m32r: fix m32104ut_defconfig build fail Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 132/268] dma-debug: switch check from _text to _stext Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 133/268] scripts/bloat-o-meter: fix python3 syntax error Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 134/268] ocfs2/dlm: ignore cleaning the migration mle that is inuse Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 135/268] ALSA: hda - Add fixup for Dell Latitidue E6540 Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 136/268] ALSA: timer: Harden slave timer list handling Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 137/268] zram/zcomp: use GFP_NOIO to allocate streams Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 138/268] zram: try vmalloc() after kmalloc() Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 139/268] ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Portege R700 Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 140/268] ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Satellite R830 Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 141/268] mm: soft-offline: check return value in second __get_any_page() call Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 142/268] zram: don't call idr_remove() from zram_remove() Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 143/268] memcg: only free spare array when readers are done Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 144/268] panic: release stale console lock to always get the logbuf printed out Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 145/268] kernel/panic.c: turn off locks debug before releasing console lock Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 146/268] printk: do cond_resched() between lines while outputting to consoles Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 147/268] ALSA: hda - Fix bass pin fixup for ASUS N550JX Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 148/268] crypto: algif_skcipher - Require setkey before accept(2) Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 149/268] crypto: af_alg - Disallow bind/setkey/... after accept(2) Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 150/268] crypto: af_alg - Fix socket double-free when accept fails Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 151/268] crypto: af_alg - Add nokey compatibility path Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 152/268] crypto: algif_skcipher " Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 153/268] crypto: hash - Add crypto_ahash_has_setkey Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 154/268] crypto: algif_hash - Require setkey before accept(2) Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 155/268] crypto: af_alg - Allow af_af_alg_release_parent to be called on nokey path Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 156/268] crypto: algif_hash - Remove custom release parent function Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 157/268] crypto: algif_skcipher " Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 158/268] crypto: af_alg - Forbid bind(2) when nokey child sockets are present Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 159/268] lib: sw842: select crc32 Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 160/268] crypto: algif_hash - Fix race condition in hash_check_key Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 161/268] crypto: algif_skcipher - Fix race condition in skcipher_check_key Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 162/268] ALSA: hrtimer: Fix stall by hrtimer_cancel() Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 163/268] dmaengine: at_xdmac: fix resume for cyclic transfers Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 164/268] ALSA: pcm: Fix snd_pcm_hw_params struct copy in compat mode Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 165/268] ALSA: seq: Fix snd_seq_call_port_info_ioctl " Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 166/268] ALSA: control: Avoid kernel warnings from tlv ioctl with numid 0 Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 167/268] ARM: debug-ll: fix BCM63xx entry for multiplatform Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 168/268] xfs: log mount failures don't wait for buffers to be released Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 169/268] crypto: algif_skcipher - Load TX SG list after waiting Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 170/268] crypto: crc32c - Fix crc32c soft dependency Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 171/268] IB/qib: fix mcast detach when qp not attached Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 172/268] IB/qib: Support creating qps with GFP_NOIO flag Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 173/268] IB/mlx5: Expose correct maximum number of CQE capacity Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 174/268] IB/cm: Fix a recently introduced deadlock Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 175/268] ideapad-laptop: Add Lenovo ideapad Y700-17ISK to no_hw_rfkill dmi list Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 176/268] Btrfs: fix deadlock running delayed iputs at transaction commit time Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 177/268] iscsi-target: Fix potential dead-lock during node acl delete Kamal Mostafa
2016-01-27 20:33 ` [PATCH 4.2.y-ckt 178/268] crypto: algif_skcipher - sendmsg SG marking is off by one Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 179/268] ALSA: hda - Flush the pending probe work at remove Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 180/268] zsmalloc: fix migrate_zspage-zs_free race condition Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 181/268] prctl: take mmap sem for writing to protect against others Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 182/268] ALSA: timer: Handle disconnection more safely Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 183/268] libceph: fix ceph_msg_revoke() Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 184/268] MIPS: Loongson-3: Fix SMP_ASK_C0COUNT IPI handler Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 185/268] MIPS: hpet: Choose a safe value for the ETIME check Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 186/268] ocfs2: NFS hangs in __ocfs2_cluster_lock due to race with ocfs2_unblock_lock Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 187/268] pNFS/flexfiles: Fix an XDR encoding bug in layoutreturn Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 188/268] make sure that freeing shmem fast symlinks is RCU-delayed Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 189/268] MAINTAINERS: return arch/sh to maintained state, with new maintainers Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 190/268] MIPS: Fix some missing CONFIG_CPU_MIPSR6 #ifdefs Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 191/268] ideapad-laptop: Add Lenovo Yoga 700 to no_hw_rfkill dmi list Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 192/268] drm/i915: On fb alloc failure, unref gem object where it gets refed Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 193/268] [media] rc: allow rc modules to be loaded if rc-main is not a module Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 194/268] [media] lirc_imon: do not leave imon_probe() with mutex held Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 195/268] SCSI: initio: remove duplicate module device table Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 196/268] clk: xgene: Fix divider with non-zero shift value Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 197/268] clk: st: avoid uninitialized variable use Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 198/268] MAINTAINERS: gpio-brcmstb: Remove stray '>' Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 199/268] ASoC: Intel: pass correct parameter in sst_alloc_stream_mrfld() Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 200/268] PCI/MSI: Initialize MSI capability for all architectures Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 201/268] ath9k_htc: check for underflow in ath9k_htc_rx_msg() Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 202/268] ASoC: tegra_alc5632: check return value Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 203/268] mtd: nand: fix ONFI parameter page layout Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 204/268] mac80211: fix mgmt-tx abort cookie and leak Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 205/268] Revert "ACPI / LPSS: allow to use specific PM domain during ->probe()" Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 206/268] mtd: nand: denali: add missing nand_release() call in denali_remove() Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 207/268] Drivers: hv: util: catch allocation errors Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 208/268] Drivers: hv: utils: use memdup_user in hvt_op_write Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 209/268] tpm_tis: Use devm_free_irq not free_irq Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 210/268] ALSA: fm801: explicitly free IRQ line Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 211/268] ARM: imx: select SRC for i.MX7 Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 212/268] ALSA: fm801: propagate TUNER_ONLY bit when autodetected Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 213/268] ALSA: fm801: detect FM-only card earlier Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 214/268] pinctrl: bcm2835: Fix memory leak in error path Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 215/268] mmc: sdhci: restore behavior when setting VDD via external regulator Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 216/268] x86/LDT: Print the real LDT base address Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 217/268] sysrq: Fix warning in sysrq generated crash Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 218/268] kconfig: return 'false' instead of 'no' in bool function Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 219/268] perf/x86: Fix filter_events() bug with event mappings Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 220/268] perf/x86: fix PEBS issues on Intel Atom/Core2 Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 221/268] power: test_power: correctly handle empty writes Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 222/268] firmware: actually return NULL on failed request_firmware_nowait() Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 223/268] target: Fix a memory leak in target_dev_lba_map_store() Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 224/268] phy: micrel: Fix finding PHY properties in MAC node for KSZ9031 Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 225/268] m68k/atari, m68k/sun3: Fix SCSI platform device registration when driver is modular Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 226/268] um: Fix build error and kconfig for i386 Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 227/268] net: sctp: prevent writes to cookie_hmac_alg from accessing invalid memory Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 228/268] ipv6: tcp: add rcu locking in tcp_v6_send_synack() Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 229/268] bonding: Prevent IPv6 link local address on enslaved devices Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 230/268] kbuild: Demote 'sign-compare' warning to W=2 Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 231/268] mmc: sd: limit SD card power limit according to cards capabilities Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 232/268] net: tcp_memcontrol: properly detect ancestor socket pressure Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 233/268] vmstat: make vmstat_updater deferrable again and shut down on idle Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 234/268] include/linux/memblock.h: fix ordering of 'flags' argument in comments Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 235/268] Btrfs: clean up an error code in btrfs_init_space_info() Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 236/268] btrfs: initialize the seq counter in struct btrfs_device Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 237/268] bridge: fix lockdep addr_list_lock false positive splat Kamal Mostafa
2016-01-27 20:34 ` [PATCH 4.2.y-ckt 238/268] batman-adv: Avoid recursive call_rcu for batadv_bla_claim Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 239/268] batman-adv: Avoid recursive call_rcu for batadv_nc_node Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 240/268] batman-adv: Drop immediate batadv_orig_ifinfo free function Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 241/268] batman-adv: Drop immediate batadv_neigh_node " Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 242/268] batman-adv: Drop immediate neigh_ifinfo " Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 243/268] batman-adv: Drop immediate orig_node " Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 244/268] printk: help pr_debug and pr_devel to optimize out arguments Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 245/268] ARM: dts: armadillo800eva Correct extal1 frequency to 24 MHz Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 246/268] team: Replace rcu_read_lock with a mutex in team_vlan_rx_kill_vid Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 247/268] mmc: debugfs: correct wrong voltage value Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 248/268] IB/mlx4: Initialize hop_limit when creating address handle Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 249/268] net/mlx4: Remove unused macro Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 250/268] NFSv4: Don't perform cached access checks before we've OPENed the file Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 251/268] NFS: Ensure we revalidate attributes before using execute_ok() Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 252/268] veth: don’t modify ip_summed; doing so treats packets with bad checksums as good Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 253/268] net: cdc_ncm: avoid changing RX/TX buffers on MTU changes Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 254/268] sctp: sctp should release assoc when sctp_make_abort_user return NULL in sctp_close Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 255/268] connector: bump skb->users before callback invocation Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 256/268] af_unix: Fix splice-bind deadlock Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 257/268] unix: properly account for FDs passed over unix sockets Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 258/268] bridge: Only call /sbin/bridge-stp for the initial network namespace Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 259/268] tcp_yeah: don't set ssthresh below 2 Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 260/268] sched,cls_flower: set key address type when present Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 261/268] udp: disallow UFO for sockets with SO_NO_CHECK option Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 262/268] net: preserve IP control block during GSO segmentation Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 263/268] phonet: properly unshare skbs in phonet_rcv() Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 264/268] net: bpf: reject invalid shifts Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 265/268] batman-adv: Drop immediate batadv_hard_iface free function Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 266/268] xfrm: dst_entries_init() per-net dst_ops Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 267/268] vxlan: fix test which detect duplicate vxlan iface Kamal Mostafa
2016-01-27 20:35 ` [PATCH 4.2.y-ckt 268/268] ipv6: update skb->csum when CE mark is propagated Kamal Mostafa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®