* [3.8.y.z extended stable] Linux 3.8.13.16 stable review
@ 2014-01-15 21:50 Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 001/166] selinux: handle TCP SYN-ACK packets correctly in selinux_ip_postroute() Kamal Mostafa
` (165 more replies)
0 siblings, 166 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Kamal Mostafa
This is the start of the review cycle for the Linux 3.8.13.16 stable kernel.
This version contains 166 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?p=ubuntu/linux.git;h=linux-3.8.y-review;a=shortlog
git://kernel.ubuntu.com/ubuntu/linux.git linux-3.8.y-review
The review period for version 3.8.13.16 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 3.8.y.z extended stable kernel version,
see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable .
-Kamal
--
Documentation/networking/packet_mmap.txt | 10 ++
arch/arm/kernel/process.c | 7 +-
arch/arm/kernel/stacktrace.c | 2 +-
arch/arm/kernel/traps.c | 8 +-
arch/arm/mach-footbridge/dc21285-timer.c | 9 +-
arch/arm/mach-pxa/reset.c | 8 +-
arch/arm/mach-pxa/tosa.c | 102 ++++++-------
arch/arm64/kernel/ptrace.c | 38 +++--
arch/powerpc/include/asm/exception-64s.h | 2 +-
arch/powerpc/kvm/book3s_64_mmu_hv.c | 6 +-
arch/powerpc/kvm/book3s_hv_rm_mmu.c | 4 +
arch/sparc/include/asm/pgtable_64.h | 4 +-
arch/x86/Makefile | 8 +-
arch/x86/boot/Makefile | 6 +-
arch/x86/boot/compressed/Makefile | 1 +
arch/x86/include/asm/fpu-internal.h | 13 +-
arch/x86/include/asm/pgtable.h | 11 +-
arch/x86/kvm/lapic.c | 43 +++---
arch/x86/kvm/lapic.h | 4 +-
arch/x86/kvm/x86.c | 40 +-----
arch/x86/mm/gup.c | 13 ++
arch/x86/platform/efi/efi.c | 7 -
arch/x86/realmode/rm/Makefile | 3 +-
drivers/acpi/battery.c | 23 ++-
drivers/ata/ahci.c | 3 +
drivers/ata/libata-core.c | 3 +
drivers/ata/libata-scsi.c | 21 +++
drivers/char/i8k.c | 7 +
drivers/char/tpm/tpm_ppi.c | 15 +-
drivers/clk/clk-divider.c | 2 +-
drivers/dma/Kconfig | 1 +
drivers/firewire/sbp2.c | 1 -
drivers/gpio/gpio-msm-v2.c | 4 +-
drivers/gpu/drm/drm_edid.c | 8 ++
drivers/gpu/drm/i915/i915_dma.c | 10 ++
drivers/gpu/drm/i915/i915_drv.c | 1 +
drivers/gpu/drm/i915/i915_gem_context.c | 2 -
drivers/gpu/drm/i915/intel_display.c | 8 +-
drivers/gpu/drm/nouveau/core/subdev/bios/init.c | 6 +-
drivers/gpu/drm/radeon/atombios_i2c.c | 14 +-
drivers/gpu/drm/radeon/ni.c | 20 ++-
drivers/gpu/drm/radeon/radeon.h | 2 +-
drivers/gpu/drm/radeon/radeon_kms.c | 7 +
drivers/gpu/drm/radeon/rs690.c | 11 ++
drivers/gpu/drm/radeon/si.c | 23 ++-
drivers/hwmon/lm78.c | 2 +
drivers/hwmon/sis5595.c | 2 +
drivers/hwmon/vt8231.c | 2 +-
drivers/hwmon/w83l786ng.c | 13 +-
drivers/iio/adc/ad7887.c | 16 ++-
drivers/md/dm-bufio.c | 5 +
drivers/md/dm-delay.c | 23 ++-
drivers/md/dm-snap.c | 71 ++++++++-
drivers/md/dm-table.c | 5 +
drivers/md/dm-thin-metadata.c | 9 ++
drivers/md/dm-thin-metadata.h | 1 +
drivers/md/dm-thin.c | 66 +++++----
drivers/md/persistent-data/dm-block-manager.c | 6 +
drivers/md/persistent-data/dm-block-manager.h | 1 +
drivers/media/pci/saa7164/saa7164-core.c | 4 +-
drivers/media/usb/dvb-usb-v2/af9035.c | 46 +++++-
drivers/mfd/rtsx_pcr.c | 10 +-
drivers/net/ethernet/broadcom/tg3.c | 5 +-
drivers/net/ethernet/ibm/ehea/ehea_main.c | 2 +-
drivers/net/ethernet/tehuti/tehuti.c | 1 -
drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +-
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
drivers/net/hamradio/hdlcdrv.c | 2 +
drivers/net/hamradio/yam.c | 1 +
drivers/net/hyperv/netvsc_drv.c | 1 -
drivers/net/macvtap.c | 20 ++-
drivers/net/tun.c | 2 +
drivers/net/usb/dm9601.c | 34 +++--
drivers/net/virtio_net.c | 119 +++++++++++-----
drivers/net/wireless/ath/ath9k/ar9002_mac.c | 52 +++++--
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 22 +--
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 25 ++--
drivers/net/wireless/ath/ath9k/main.c | 5 +-
drivers/net/wireless/rtlwifi/pci.c | 4 +-
drivers/of/address.c | 8 --
drivers/pci/pci-driver.c | 13 +-
drivers/power/power_supply_core.c | 10 +-
drivers/rtc/rtc-at91rm9200.c | 2 +
drivers/scsi/aacraid/commctrl.c | 3 +-
drivers/scsi/qla2xxx/qla_target.c | 9 +-
drivers/target/iscsi/iscsi_target.c | 26 ++--
drivers/target/target_core_device.c | 5 +
drivers/target/target_core_file.c | 8 +-
drivers/target/target_core_file.h | 5 +-
drivers/usb/class/cdc-acm.c | 2 +
drivers/usb/class/cdc-wdm.c | 8 +-
drivers/usb/core/hub.c | 4 +-
drivers/usb/dwc3/ep0.c | 2 +
drivers/usb/dwc3/gadget.c | 5 +-
drivers/usb/gadget/composite.c | 1 +
drivers/usb/host/xhci-pci.c | 7 +-
drivers/usb/musb/musb_core.c | 9 +-
drivers/usb/serial/ftdi_sio.c | 37 +++--
drivers/usb/serial/mos7840.c | 32 ++---
drivers/usb/serial/option.c | 29 ++++
drivers/usb/serial/pl2303.c | 31 ++--
drivers/usb/serial/spcp8x5.c | 30 ++--
drivers/usb/serial/zte_ev.c | 3 +-
fs/btrfs/send.c | 4 +-
fs/ext2/super.c | 1 +
fs/ext4/ext4_jbd2.c | 5 +
fs/ext4/extents.c | 19 ++-
fs/ext4/inode.c | 6 -
fs/ext4/mballoc.c | 11 +-
fs/ext4/super.c | 4 +-
fs/xfs/xfs_qm.c | 58 ++++++--
include/asm-generic/pgtable.h | 2 +-
include/drm/drm_pciids.h | 2 +-
include/linux/auxvec.h | 2 +-
include/linux/compiler-intel.h | 2 -
include/linux/kexec.h | 3 +
include/linux/migrate.h | 9 ++
include/linux/mm_types.h | 44 ++++++
include/linux/net.h | 2 +-
include/linux/netdevice.h | 9 ++
include/sound/memalloc.h | 2 +-
include/target/target_core_base.h | 1 +
include/uapi/drm/radeon_drm.h | 2 +
include/uapi/sound/compress_offload.h | 6 +-
kernel/fork.c | 1 +
kernel/freezer.c | 6 +
kernel/futex.c | 2 +-
kernel/kexec.c | 4 +
kernel/sched/fair.c | 7 +
kernel/sched/rt.c | 14 ++
kernel/trace/ftrace.c | 2 +-
mm/compaction.c | 4 +
mm/huge_memory.c | 45 ++++--
mm/memcontrol.c | 36 +++++
mm/migrate.c | 69 +++++++--
mm/mprotect.c | 13 +-
mm/pgtable-generic.c | 8 +-
net/8021q/vlan_dev.c | 19 ++-
net/bridge/br_multicast.c | 4 +-
net/core/drop_monitor.c | 1 -
net/core/neighbour.c | 2 +-
net/core/netpoll.c | 11 +-
net/core/sock.c | 2 +-
net/ipv4/inet_diag.c | 16 +++
net/ipv6/route.c | 33 ++---
net/llc/af_llc.c | 5 +-
net/mac80211/main.c | 1 +
net/mac80211/rx.c | 3 +-
net/mac80211/scan.c | 2 +-
net/mac80211/tx.c | 23 +--
net/packet/af_packet.c | 65 +++++----
net/rds/ib.c | 3 +-
net/rds/ib_send.c | 5 +-
net/rose/af_rose.c | 16 +--
net/unix/af_unix.c | 16 ++-
net/wireless/radiotap.c | 4 +
scripts/link-vmlinux.sh | 4 +-
security/selinux/hooks.c | 166 ++++++++++++++++++----
security/selinux/include/objsec.h | 5 +-
security/selinux/include/xfrm.h | 9 +-
security/selinux/xfrm.c | 53 +++++--
sound/core/pcm_lib.c | 2 +
sound/pci/hda/hda_intel.c | 4 +
sound/pci/hda/patch_hdmi.c | 6 +-
sound/soc/codecs/wm5110.c | 2 +-
sound/soc/codecs/wm8904.c | 2 +-
sound/soc/codecs/wm_adsp.c | 10 +-
sound/soc/tegra/tegra20_i2s.c | 6 +-
sound/soc/tegra/tegra20_spdif.c | 10 +-
sound/soc/tegra/tegra30_i2s.c | 6 +-
tools/power/cpupower/utils/cpupower-set.c | 6 +-
virt/kvm/kvm_main.c | 3 +
172 files changed, 1651 insertions(+), 690 deletions(-)
Al Viro (1):
ext4: fix del_timer() misuse for ->s_err_report
Alan Cox (1):
drivers/char/i8k.c: add Dell XPLS L421X
Alan Stern (1):
usb: dwc3: fix implementation of endpoint wedge
Alex Deucher (5):
drm/radeon: fixup bad vram size on SI
drm/radeon/atom: fix bus probes when hw_i2c is set (v2)
drm/radeon: Fix sideport problems on certain RS690 boards
drm/radeon: fix asic gfx values for scrapper asics
drm/radeon: 0x9649 is SUMO2 not SUMO
Andrey Vagin (1):
virtio: delete napi structures from netdev before releasing memory
Andy Honig (3):
KVM: Improve create VCPU parameter (CVE-2013-4587)
KVM: x86: Fix potential divide by 0 in lapic (CVE-2013-6367)
KVM: x86: Convert vapic synchronization to _cached functions (CVE-2013-6368)
Anssi Hannula (1):
ALSA: hda - hdmi: Fix IEC958 ctl indexes for some simple HDMI devices
Antti Palosaari (2):
[media] af9035: [0ccd:0099] TerraTec Cinergy T Stick Dual RC (rev. 2)
[media] af9035: add [0413:6a05] Leadtek WinFast DTV Dongle Dual
Ard Biesheuvel (1):
auxvec.h: account for AT_HWCAP2 in AT_VECTOR_SIZE_BASE
Bjørn Mork (1):
usb: cdc-wdm: manage_power should always set needs_remote_wakeup
Bo Shen (1):
ASoC: wm8904: fix DSP mode B configuration
Brian Carnes (1):
hwmon: (w83l786ng) Fix fan speed control mode setting and reporting
Chad Hanson (1):
selinux: fix broken peer recv check
Changli Gao (1):
net: drop_monitor: fix the value of maxattr
Charles Keepax (2):
ASoC: wm5110: Correct HPOUT3 DAPM route typo
ASoC: wm_adsp: Add small delay while polling DSP RAM start
Chris Wilson (3):
drm/i915: Do not clobber config status after a forced restore of hw state
drm/i915: Hold mutex across i915_gem_release
drm/i915: Use the correct GMCH_CTRL register for Sandybridge+
Colin Leitner (4):
USB: spcp8x5: correct handling of CS5 setting
USB: mos7840: correct handling of CS5 setting
USB: ftdi_sio: fixed handling of unsupported CSIZE setting
USB: pl2303: fixed handling of CS5 setting
Curt Brune (1):
bridge: use spin_lock_bh() in br_multicast_set_hash_max
Dan Carpenter (2):
hwmon: Prevent some divide by zeros in FAN_TO_REG()
Btrfs: fix access_ok() check in btrfs_ioctl_send()
Dan Williams (1):
net_dma: mark broken
Daniel Borkmann (3):
packet: fix send path when running with proto == 0
net: inet_diag: zero out uninitialized idiag_{src,dst} fields
net: llc: fix use after free in llc_ui_recvmsg
Daniel Vetter (1):
drm/i915: don't update the dri1 breadcrumb with modesetting
David Cluytens (1):
USB: cdc-acm: Added support for the Lenovo RD02-D400 USB Modem
David Henningsson (1):
ALSA: hda - Add enable_msi=0 workaround for four HP machines
David S. Miller (2):
vlan: Fix header ops passthru when doing TX VLAN offload.
netpoll: Fix missing TXQ unlock and and OOPS.
Dmitry Eremin-Solenikov (1):
ARM: pxa: tosa: fix keys mapping
Dmitry Kunilov (1):
usb: serial: zte_ev: move support for ZTE AC2726 from zte_ev back to option
Eric Dumazet (1):
net: do not pretend FRAGLIST support
Eryu Guan (1):
ext4: check for overlapping extents in ext4_valid_extent_entries()
Fabrizio Gazzato (1):
[media] af9035: add ID [0ccd:00aa] TerraTec Cinergy T Stick (rev. 2)
Fangxiaozhi (Franko) (1):
USB: option: support new huawei devices
Felix Fietkau (1):
mac80211: move "bufferable MMPDU" check to fix AP mode scan
Florian Westphal (1):
net: rose: restore old recvmsg behavior
Gleb Natapov (1):
KVM: x86: fix guest-initiated crash with x2apic (CVE-2013-6376)
Gustavo Zacarias (1):
USB: serial: option: blacklist interface 1 for Huawei E173s-6
H. Peter Anvin (2):
x86, build: Pass in additional -mno-mmx, -mno-sse options
x86, build, icc: Remove uninitialized_var() from compiler-intel.h
Hannes Frederic Sowa (1):
ipv6: don't count addrconf generated routes against gc limit
Ilia Mirkin (1):
drm/nouveau/bios: make jump conditional
James Hogan (1):
clk: clk-divider: fix divisor > 255 bug
Jan Kara (2):
ext2: Fix oops in ext2_get_block() called from ext2_quota_write()
ext4: fix deadlock when writing in ENOSPC conditions
Jan Kiszka (1):
KVM: x86: Fix APIC map calculation after re-enabling
Jason Wang (3):
macvtap: signal truncated packets
netvsc: don't flush peers notifying work during setting mtu
virtio-net: fix refill races during restore
Jean Delvare (1):
hwmon: (w83l768ng) Fix fan speed control range
Jiang Liu (1):
ACPI / TPM: fix memory leak when walking ACPI namespace
Jie Liu (1):
xfs: fix infinite loop by detaching the group/project hints from user dquot
Joe Thornber (4):
dm thin: switch to read only mode if a mapping insert fails
dm thin: always fallback the pool mode if commit fails
dm thin: re-establish read-only state when switching to fail mode
dm thin: allow pool in read-only mode to transition to read-write mode
Johannes Berg (3):
mac80211: fix scheduled scan rtnl deadlock
mac80211: don't attempt to reorder multicast frames
radiotap: fix bitmap-end-finding buffer overrun
Johannes Weiner (1):
mm: memcg: fix race condition between memcg teardown and swapin
Jonathan Cameron (1):
iio:adc:ad7887 Fix channel reported endianness from cpu to big endian
JongHo Kim (1):
ALSA: Add SNDRV_PCM_STATE_PAUSED case in wait_for_avail function
Joonsoo Kim (1):
mm/compaction: respect ignore_skip_hint in update_pageblock_skip
Josh Boyer (1):
cpupower: Fix segfault due to incorrect getopt_long arugments
Julius Werner (1):
usb: hub: Use correct reset for wedged USB3 devices that are NOTATTACHED
Junho Ryu (1):
ext4: fix use-after-free in ext4_mb_new_blocks
Kamala R (1):
IPv6: Fixed support for blackhole and prohibit routes
Khalid Aziz (1):
PCI: Disable Bus Master only on kexec reboot
Kirill Tkhai (1):
sched/rt: Fix rq's cpupri leak while enqueue/dequeue child RT entities
Konstantin Khlebnikov (2):
ARM: 7912/1: check stack pointer in get_wchan
ARM: 7913/1: fix framepointer check in unwind_frame
Lan Tianyu (1):
ACPI / Battery: Add a _BIX quirk for NEC LZ750/LS
Larry Finger (1):
rtlwifi: pci: Fix oops on driver unload
Li RongQing (1):
ipv6: always set the new created dst's from in ip6_rt_copy
Linus Pizunski (1):
drivers/rtc/rtc-at91rm9200.c: correct alarm over day/month wrap
Linus Torvalds (2):
futex: fix handling of read-only-mapped hugepages
x86, fpu, amd: Clear exceptions in AMD FXSAVE workaround
Mahesh Rajashekhara (1):
aacraid: prevent invalid pointer dereference
Marek Olšák (2):
drm/radeon: fix render backend setup for SI and CIK
drm/radeon: expose render backend mask to the userspace
Mathy Vanhoef (1):
ath9k_htc: properly set MAC address and BSSID mask
Matthew Garrett (1):
x86, efi: Don't use (U)EFI time services on 32 bit
Mel Gorman (11):
mm: numa: serialise parallel get_user_page against THP migration
mm: numa: call MMU notifiers on THP migration
mm: clear pmd_numa before invalidating
mm: numa: do not clear PMD during PTE update scan
mm: numa: do not clear PTE for pte_numa update
mm: numa: ensure anon_vma is locked to prevent parallel THP splits
mm: numa: avoid unnecessary work on the failure path
sched: numa: skip inaccessible VMAs
mm: numa: clear numa hinting information on mprotect
mm: numa: avoid unnecessary disruption of NUMA hinting during migration
mm: numa: defer TLB flush for THP migration as long as possible
Miao Xie (1):
ftrace: Initialize the ftrace profiler for each possible cpu
Michael Grzeschik (1):
usb: gadget: composite: reset delayed_status on reset_config
Michael Neuling (1):
powerpc: Fix bad stack check in exception entry
Michael S. Tsirkin (3):
virtio_net: fix error handling for mergeable buffers
virtio-net: make all RX paths handle errors consistently
virtio_net: don't leak memory or block when too many frags
Michele Baldessari (1):
libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8
Mike Snitzer (1):
dm thin: switch to read-only mode if metadata space is exhausted
Mikulas Patocka (4):
dm delay: fix a possible deadlock due to shared workqueue
dm snapshot: avoid snapshot space leak on crash
dm table: fail dm_table_create on dm_round_up overflow
dm bufio: initialize read-only module parameters
Ming Lei (1):
scripts/link-vmlinux.sh: only filter kernel symbols for arm
Nat Gurumoorthy (1):
tg3: Initialize REG_BASE_ADDR at PCI config offset 120 to 0
Nicholas Bellinger (2):
iscsi-target: Fix-up all zero data-length CDBs with R/W_BIT set
target/file: Update hw_max_sectors based on current block_size
Nithin Sujir (1):
tg3: Expand 4g_overflow_test workaround to skb fragments of any size.
Oleg Nesterov (1):
selinux: selinux_setprocattr()->ptrace_parent() needs rcu_read_lock()
Paul Moore (4):
selinux: handle TCP SYN-ACK packets correctly in selinux_ip_postroute()
selinux: look for IPsec labels on both inbound and outbound packets
selinux: process labeled IPsec TCP SYN-ACK packets properly in selinux_ip_postroute()
selinux: handle TCP SYN-ACK packets correctly in selinux_ip_output()
Peter Korsgaard (2):
dm9601: fix reception of full size ethernet frames on dm9620/dm9621a
dm9601: work around tx fifo sync issue on dm962x
Rafał Miłecki (1):
drm/edid: add quirk for BPC in Samsung NP700G7A-S01PL notebook
Rik van Riel (1):
mm: fix TLB flush race between migration, and change_protection_range
Rob Herring (1):
Revert "of/address: Handle #address-cells > 2 specially"
Russell King (2):
ARM: fix footbridge clockevent device
ARM: fix "bad mode in ... handler" message for undefined instructions
Salva Peiró (1):
hamradio/yam: fix info leak in ioctl
Sasha Levin (3):
net: unix: allow set_peek_off to fail
net: unix: allow bind to fail on mutex lock
rds: prevent dereference of a NULL device
Sebastian Andrzej Siewior (1):
usb: musb: only cancel work if it is initialized
Sergei Ianovich (1):
ARM: pxa: prevent PXA270 occasional reboot freezes
Shivaram Upadhyayula (1):
qla2xxx: Fix schedule_delayed_work() for target timeout calculations
Shuah Khan (1):
power_supply: Fix Oops from NULL pointer dereference from wakeup_source_activate
Simon Guinot (1):
ahci: add PCI ID for Marvell 88SE9170 SATA controller
Stefan Richter (1):
firewire: sbp2: bring back WRITE SAME support
Stefano Panella (1):
ALSA: memalloc.h - fix wrong truncation of dma_addr_t
Stephen Boyd (1):
gpio: msm: Fix irq mask/unmask by writing bits instead of numbers
Stephen Warren (1):
ASoC: tegra: fix uninitialized variables in set_fmt
Steven Rostedt (1):
SELinux: Fix possible NULL pointer dereference in selinux_inode_permission()
Sujith Manoharan (3):
ath9k: Fix QuickDrop usage
ath9k: Fix XLNA bias strength
ath9k: Fix interrupt handling for the AR9002 family
Takashi Iwai (2):
ALSA: compress: Fix 64bit ABI incompatibility
xhci: Limit the spurious wakeup fix only to HP machines
Tejun Heo (1):
libata, freezer: avoid block device removal while system is frozen
Theodore Ts'o (1):
ext4: call ext4_error_inode() if jbd2_journal_dirty_metadata() fails
Thomas Gleixner (1):
mfd: rtsx_pcr: Disable interrupts before cancelling delayed works
Venkat Venkatsubra (1):
rds: prevent BUG_ON triggered on congestion update to loopback
Vlad Yasevich (1):
macvtap: Do not double-count received packets
Wei Yongjun (1):
[media] saa7164: fix return value check in saa7164_initdev()
Wenliang Fan (1):
drivers/net/hamradio: Integer overflow in hdlcdrv_ioctl()
Will Deacon (1):
arm64: ptrace: avoid using HW_BREAKPOINT_EMPTY for disabled events
Zhi Yong Wu (2):
macvtap: update file current position
tun: update file current position
pingfan liu (1):
powerpc: kvm: fix rare but potential deadlock scene
^ permalink raw reply [flat|nested] 168+ messages in thread
* [PATCH 3.8 001/166] selinux: handle TCP SYN-ACK packets correctly in selinux_ip_postroute()
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 002/166] selinux: look for IPsec labels on both inbound and outbound packets Kamal Mostafa
` (164 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Paul Moore, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Moore <pmoore@redhat.com>
commit 446b802437f285de68ffb8d6fac3c44c3cab5b04 upstream.
In selinux_ip_postroute() we perform access checks based on the
packet's security label. For locally generated traffic we get the
packet's security label from the associated socket; this works in all
cases except for TCP SYN-ACK packets. In the case of SYN-ACK packet's
the correct security label is stored in the connection's request_sock,
not the server's socket. Unfortunately, at the point in time when
selinux_ip_postroute() is called we can't query the request_sock
directly, we need to recreate the label using the same logic that
originally labeled the associated request_sock.
See the inline comments for more explanation.
Reported-by: Janak Desai <Janak.Desai@gtri.gatech.edu>
Tested-by: Janak Desai <Janak.Desai@gtri.gatech.edu>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
security/selinux/hooks.c | 68 +++++++++++++++++++++++++++++++++++++-----------
1 file changed, 53 insertions(+), 15 deletions(-)
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index ef26e96..a3d77ec 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3713,6 +3713,30 @@ static int selinux_skb_peerlbl_sid(struct sk_buff *skb, u16 family, u32 *sid)
return 0;
}
+/**
+ * selinux_conn_sid - Determine the child socket label for a connection
+ * @sk_sid: the parent socket's SID
+ * @skb_sid: the packet's SID
+ * @conn_sid: the resulting connection SID
+ *
+ * If @skb_sid is valid then the user:role:type information from @sk_sid is
+ * combined with the MLS information from @skb_sid in order to create
+ * @conn_sid. If @skb_sid is not valid then then @conn_sid is simply a copy
+ * of @sk_sid. Returns zero on success, negative values on failure.
+ *
+ */
+static int selinux_conn_sid(u32 sk_sid, u32 skb_sid, u32 *conn_sid)
+{
+ int err = 0;
+
+ if (skb_sid != SECSID_NULL)
+ err = security_sid_mls_copy(sk_sid, skb_sid, conn_sid);
+ else
+ *conn_sid = sk_sid;
+
+ return err;
+}
+
/* socket security operations */
static int socket_sockcreate_sid(const struct task_security_struct *tsec,
@@ -4319,7 +4343,7 @@ static int selinux_inet_conn_request(struct sock *sk, struct sk_buff *skb,
struct sk_security_struct *sksec = sk->sk_security;
int err;
u16 family = sk->sk_family;
- u32 newsid;
+ u32 connsid;
u32 peersid;
/* handle mapped IPv4 packets arriving via IPv6 sockets */
@@ -4329,16 +4353,11 @@ static int selinux_inet_conn_request(struct sock *sk, struct sk_buff *skb,
err = selinux_skb_peerlbl_sid(skb, family, &peersid);
if (err)
return err;
- if (peersid == SECSID_NULL) {
- req->secid = sksec->sid;
- req->peer_secid = SECSID_NULL;
- } else {
- err = security_sid_mls_copy(sksec->sid, peersid, &newsid);
- if (err)
- return err;
- req->secid = newsid;
- req->peer_secid = peersid;
- }
+ err = selinux_conn_sid(sksec->sid, peersid, &connsid);
+ if (err)
+ return err;
+ req->secid = connsid;
+ req->peer_secid = peersid;
return selinux_netlbl_inet_conn_request(req, family);
}
@@ -4687,12 +4706,12 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb, int ifindex,
if (!secmark_active && !peerlbl_active)
return NF_ACCEPT;
- /* if the packet is being forwarded then get the peer label from the
- * packet itself; otherwise check to see if it is from a local
- * application or the kernel, if from an application get the peer label
- * from the sending socket, otherwise use the kernel's sid */
sk = skb->sk;
if (sk == NULL) {
+ /* Without an associated socket the packet is either coming
+ * from the kernel or it is being forwarded; check the packet
+ * to determine which and if the packet is being forwarded
+ * query the packet directly to determine the security label. */
if (skb->skb_iif) {
secmark_perm = PACKET__FORWARD_OUT;
if (selinux_skb_peerlbl_sid(skb, family, &peer_sid))
@@ -4701,7 +4720,26 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb, int ifindex,
secmark_perm = PACKET__SEND;
peer_sid = SECINITSID_KERNEL;
}
+ } else if (sk->sk_state == TCP_LISTEN) {
+ /* Locally generated packet but the associated socket is in the
+ * listening state which means this is a SYN-ACK packet. In
+ * this particular case the correct security label is assigned
+ * to the connection/request_sock but unfortunately we can't
+ * query the request_sock as it isn't queued on the parent
+ * socket until after the SYN-ACK packet is sent; the only
+ * viable choice is to regenerate the label like we do in
+ * selinux_inet_conn_request(). See also selinux_ip_output()
+ * for similar problems. */
+ u32 skb_sid;
+ struct sk_security_struct *sksec = sk->sk_security;
+ if (selinux_skb_peerlbl_sid(skb, family, &skb_sid))
+ return NF_DROP;
+ if (selinux_conn_sid(sksec->sid, skb_sid, &peer_sid))
+ return NF_DROP;
+ secmark_perm = PACKET__SEND;
} else {
+ /* Locally generated packet, fetch the security label from the
+ * associated socket. */
struct sk_security_struct *sksec = sk->sk_security;
peer_sid = sksec->sid;
secmark_perm = PACKET__SEND;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 002/166] selinux: look for IPsec labels on both inbound and outbound packets
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 001/166] selinux: handle TCP SYN-ACK packets correctly in selinux_ip_postroute() Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 003/166] selinux: process labeled IPsec TCP SYN-ACK packets properly in selinux_ip_postroute() Kamal Mostafa
` (163 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Paul Moore, Luis Henriques, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Moore <pmoore@redhat.com>
commit 817eff718dca4e54d5721211ddde0914428fbb7c upstream.
Previously selinux_skb_peerlbl_sid() would only check for labeled
IPsec security labels on inbound packets, this patch enables it to
check both inbound and outbound traffic for labeled IPsec security
labels.
Reported-by: Janak Desai <Janak.Desai@gtri.gatech.edu>
[ Paul: backported to 3.4 kernel ]
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
security/selinux/hooks.c | 2 +-
security/selinux/include/xfrm.h | 9 +++----
security/selinux/xfrm.c | 53 ++++++++++++++++++++++++++++++++---------
3 files changed, 48 insertions(+), 16 deletions(-)
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index a3d77ec..1fd031b 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3699,7 +3699,7 @@ static int selinux_skb_peerlbl_sid(struct sk_buff *skb, u16 family, u32 *sid)
u32 nlbl_sid;
u32 nlbl_type;
- selinux_skb_xfrm_sid(skb, &xfrm_sid);
+ selinux_xfrm_skb_sid(skb, &xfrm_sid);
selinux_netlbl_skbuff_getsid(skb, family, &nlbl_type, &nlbl_sid);
err = security_net_peersid_resolve(nlbl_sid, nlbl_type, xfrm_sid, sid);
diff --git a/security/selinux/include/xfrm.h b/security/selinux/include/xfrm.h
index 65f67cb..3ffdadc 100644
--- a/security/selinux/include/xfrm.h
+++ b/security/selinux/include/xfrm.h
@@ -47,6 +47,7 @@ int selinux_xfrm_sock_rcv_skb(u32 sid, struct sk_buff *skb,
int selinux_xfrm_postroute_last(u32 isec_sid, struct sk_buff *skb,
struct common_audit_data *ad, u8 proto);
int selinux_xfrm_decode_session(struct sk_buff *skb, u32 *sid, int ckall);
+int selinux_xfrm_skb_sid(struct sk_buff *skb, u32 *sid);
static inline void selinux_xfrm_notify_policyload(void)
{
@@ -80,12 +81,12 @@ static inline int selinux_xfrm_decode_session(struct sk_buff *skb, u32 *sid, int
static inline void selinux_xfrm_notify_policyload(void)
{
}
-#endif
-static inline void selinux_skb_xfrm_sid(struct sk_buff *skb, u32 *sid)
+static inline int selinux_xfrm_skb_sid(struct sk_buff *skb, u32 *sid)
{
- int err = selinux_xfrm_decode_session(skb, sid, 0);
- BUG_ON(err);
+ *sid = SECSID_NULL;
+ return 0;
}
+#endif
#endif /* _SELINUX_XFRM_H_ */
diff --git a/security/selinux/xfrm.c b/security/selinux/xfrm.c
index 8ab2951..1552b91 100644
--- a/security/selinux/xfrm.c
+++ b/security/selinux/xfrm.c
@@ -152,21 +152,13 @@ int selinux_xfrm_state_pol_flow_match(struct xfrm_state *x, struct xfrm_policy *
return rc;
}
-/*
- * LSM hook implementation that checks and/or returns the xfrm sid for the
- * incoming packet.
- */
-
-int selinux_xfrm_decode_session(struct sk_buff *skb, u32 *sid, int ckall)
+static int selinux_xfrm_skb_sid_ingress(struct sk_buff *skb,
+ u32 *sid, int ckall)
{
- struct sec_path *sp;
+ struct sec_path *sp = skb->sp;
*sid = SECSID_NULL;
- if (skb == NULL)
- return 0;
-
- sp = skb->sp;
if (sp) {
int i, sid_set = 0;
@@ -190,6 +182,45 @@ int selinux_xfrm_decode_session(struct sk_buff *skb, u32 *sid, int ckall)
return 0;
}
+static u32 selinux_xfrm_skb_sid_egress(struct sk_buff *skb)
+{
+ struct dst_entry *dst = skb_dst(skb);
+ struct xfrm_state *x;
+
+ if (dst == NULL)
+ return SECSID_NULL;
+ x = dst->xfrm;
+ if (x == NULL || !selinux_authorizable_xfrm(x))
+ return SECSID_NULL;
+
+ return x->security->ctx_sid;
+}
+
+/*
+ * LSM hook implementation that checks and/or returns the xfrm sid for the
+ * incoming packet.
+ */
+
+int selinux_xfrm_decode_session(struct sk_buff *skb, u32 *sid, int ckall)
+{
+ if (skb == NULL) {
+ *sid = SECSID_NULL;
+ return 0;
+ }
+ return selinux_xfrm_skb_sid_ingress(skb, sid, ckall);
+}
+
+int selinux_xfrm_skb_sid(struct sk_buff *skb, u32 *sid)
+{
+ int rc;
+
+ rc = selinux_xfrm_skb_sid_ingress(skb, sid, 0);
+ if (rc == 0 && *sid == SECSID_NULL)
+ *sid = selinux_xfrm_skb_sid_egress(skb);
+
+ return rc;
+}
+
/*
* Security blob allocation for xfrm_policy and xfrm_state
* CTX does not have a meaningful value on input
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 003/166] selinux: process labeled IPsec TCP SYN-ACK packets properly in selinux_ip_postroute()
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 001/166] selinux: handle TCP SYN-ACK packets correctly in selinux_ip_postroute() Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 002/166] selinux: look for IPsec labels on both inbound and outbound packets Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 004/166] dm delay: fix a possible deadlock due to shared workqueue Kamal Mostafa
` (162 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Paul Moore, Luis Henriques, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Moore <pmoore@redhat.com>
commit c0828e50485932b7e019df377a6b0a8d1ebd3080 upstream.
Due to difficulty in arriving at the proper security label for
TCP SYN-ACK packets in selinux_ip_postroute(), we need to check packets
while/before they are undergoing XFRM transforms instead of waiting
until afterwards so that we can determine the correct security label.
Reported-by: Janak Desai <Janak.Desai@gtri.gatech.edu>
[ Paul: backported to 3.4 kernel ]
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
security/selinux/hooks.c | 43 ++++++++++++++++++++++++++++++++++++-------
1 file changed, 36 insertions(+), 7 deletions(-)
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 1fd031b..9e8bcf3 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -4691,22 +4691,32 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb, int ifindex,
* as fast and as clean as possible. */
if (!selinux_policycap_netpeer)
return selinux_ip_postroute_compat(skb, ifindex, family);
+
+ secmark_active = selinux_secmark_enabled();
+ peerlbl_active = netlbl_enabled() || selinux_xfrm_enabled();
+ if (!secmark_active && !peerlbl_active)
+ return NF_ACCEPT;
+
+ sk = skb->sk;
+
#ifdef CONFIG_XFRM
/* If skb->dst->xfrm is non-NULL then the packet is undergoing an IPsec
* packet transformation so allow the packet to pass without any checks
* since we'll have another chance to perform access control checks
* when the packet is on it's final way out.
* NOTE: there appear to be some IPv6 multicast cases where skb->dst
- * is NULL, in this case go ahead and apply access control. */
- if (skb_dst(skb) != NULL && skb_dst(skb)->xfrm != NULL)
+ * is NULL, in this case go ahead and apply access control.
+ * is NULL, in this case go ahead and apply access control.
+ * NOTE: if this is a local socket (skb->sk != NULL) that is in the
+ * TCP listening state we cannot wait until the XFRM processing
+ * is done as we will miss out on the SA label if we do;
+ * unfortunately, this means more work, but it is only once per
+ * connection. */
+ if (skb_dst(skb) != NULL && skb_dst(skb)->xfrm != NULL &&
+ !(sk != NULL && sk->sk_state == TCP_LISTEN))
return NF_ACCEPT;
#endif
- secmark_active = selinux_secmark_enabled();
- peerlbl_active = netlbl_enabled() || selinux_xfrm_enabled();
- if (!secmark_active && !peerlbl_active)
- return NF_ACCEPT;
- sk = skb->sk;
if (sk == NULL) {
/* Without an associated socket the packet is either coming
* from the kernel or it is being forwarded; check the packet
@@ -4734,6 +4744,25 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb, int ifindex,
struct sk_security_struct *sksec = sk->sk_security;
if (selinux_skb_peerlbl_sid(skb, family, &skb_sid))
return NF_DROP;
+ /* At this point, if the returned skb peerlbl is SECSID_NULL
+ * and the packet has been through at least one XFRM
+ * transformation then we must be dealing with the "final"
+ * form of labeled IPsec packet; since we've already applied
+ * all of our access controls on this packet we can safely
+ * pass the packet. */
+ if (skb_sid == SECSID_NULL) {
+ switch (family) {
+ case PF_INET:
+ if (IPCB(skb)->flags & IPSKB_XFRM_TRANSFORMED)
+ return NF_ACCEPT;
+ break;
+ case PF_INET6:
+ if (IP6CB(skb)->flags & IP6SKB_XFRM_TRANSFORMED)
+ return NF_ACCEPT;
+ default:
+ return NF_DROP_ERR(-ECONNREFUSED);
+ }
+ }
if (selinux_conn_sid(sksec->sid, skb_sid, &peer_sid))
return NF_DROP;
secmark_perm = PACKET__SEND;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 004/166] dm delay: fix a possible deadlock due to shared workqueue
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (2 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 003/166] selinux: process labeled IPsec TCP SYN-ACK packets properly in selinux_ip_postroute() Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 005/166] mac80211: fix scheduled scan rtnl deadlock Kamal Mostafa
` (161 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mikulas Patocka, Mike Snitzer, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 718822c1c112dc99e0c72c8968ee1db9d9d910f0 upstream.
The dm-delay target uses a shared workqueue for multiple instances. This
can cause deadlock if two or more dm-delay targets are stacked on the top
of each other.
This patch changes dm-delay to use a per-instance workqueue.
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-delay.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c
index c0d03b0..7c4c725 100644
--- a/drivers/md/dm-delay.c
+++ b/drivers/md/dm-delay.c
@@ -20,6 +20,7 @@
struct delay_c {
struct timer_list delay_timer;
struct mutex timer_lock;
+ struct workqueue_struct *kdelayd_wq;
struct work_struct flush_expired_bios;
struct list_head delayed_bios;
atomic_t may_delay;
@@ -45,14 +46,13 @@ struct dm_delay_info {
static DEFINE_MUTEX(delayed_bios_lock);
-static struct workqueue_struct *kdelayd_wq;
static struct kmem_cache *delayed_cache;
static void handle_delayed_timer(unsigned long data)
{
struct delay_c *dc = (struct delay_c *)data;
- queue_work(kdelayd_wq, &dc->flush_expired_bios);
+ queue_work(dc->kdelayd_wq, &dc->flush_expired_bios);
}
static void queue_timeout(struct delay_c *dc, unsigned long expires)
@@ -191,6 +191,12 @@ out:
goto bad_dev_write;
}
+ dc->kdelayd_wq = alloc_workqueue("kdelayd", WQ_MEM_RECLAIM, 0);
+ if (!dc->kdelayd_wq) {
+ DMERR("Couldn't start kdelayd");
+ goto bad_queue;
+ }
+
setup_timer(&dc->delay_timer, handle_delayed_timer, (unsigned long)dc);
INIT_WORK(&dc->flush_expired_bios, flush_expired_bios);
@@ -203,6 +209,8 @@ out:
ti->private = dc;
return 0;
+bad_queue:
+ mempool_destroy(dc->delayed_pool);
bad_dev_write:
if (dc->dev_write)
dm_put_device(ti, dc->dev_write);
@@ -217,7 +225,7 @@ static void delay_dtr(struct dm_target *ti)
{
struct delay_c *dc = ti->private;
- flush_workqueue(kdelayd_wq);
+ destroy_workqueue(dc->kdelayd_wq);
dm_put_device(ti, dc->dev_read);
@@ -350,12 +358,6 @@ static int __init dm_delay_init(void)
{
int r = -ENOMEM;
- kdelayd_wq = alloc_workqueue("kdelayd", WQ_MEM_RECLAIM, 0);
- if (!kdelayd_wq) {
- DMERR("Couldn't start kdelayd");
- goto bad_queue;
- }
-
delayed_cache = KMEM_CACHE(dm_delay_info, 0);
if (!delayed_cache) {
DMERR("Couldn't create delayed bio cache.");
@@ -373,8 +375,6 @@ static int __init dm_delay_init(void)
bad_register:
kmem_cache_destroy(delayed_cache);
bad_memcache:
- destroy_workqueue(kdelayd_wq);
-bad_queue:
return r;
}
@@ -382,7 +382,6 @@ static void __exit dm_delay_exit(void)
{
dm_unregister_target(&delay_target);
kmem_cache_destroy(delayed_cache);
- destroy_workqueue(kdelayd_wq);
}
/* Module hooks */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 005/166] mac80211: fix scheduled scan rtnl deadlock
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (3 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 004/166] dm delay: fix a possible deadlock due to shared workqueue Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 006/166] mac80211: don't attempt to reorder multicast frames Kamal Mostafa
` (160 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Johannes Berg, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
commit 18db594a1005d908d995a2fc8f5a7bf4286fdca0 upstream.
When changing cfg80211 to use RTNL locking, this caused a
deadlock in mac80211 as it calls cfg80211_sched_scan_stopped()
from a work item that's on a workqueue that is flushed with
the RTNL held.
Fix this by simply using schedule_work(), the work only needs
to finish running before the wiphy is unregistered, no other
synchronisation (e.g. with suspend) is really required since
for suspend userspace is already blocked anyway when we flush
the workqueue so will only pick up the event after resume.
Fixes: 5fe231e87372 ("cfg80211: vastly simplify locking")
Reported-and-tested-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/mac80211/main.c | 1 +
net/mac80211/scan.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 1b087ff..e93d39d 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1104,6 +1104,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
cancel_work_sync(&local->restart_work);
cancel_work_sync(&local->reconfig_filter);
+ flush_work(&local->sched_scan_stopped_work);
ieee80211_clear_tx_pending(local);
rate_control_deinitialize(local);
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 8d6ba43..49b5681 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -1049,6 +1049,6 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw)
trace_api_sched_scan_stopped(local);
- ieee80211_queue_work(&local->hw, &local->sched_scan_stopped_work);
+ schedule_work(&local->sched_scan_stopped_work);
}
EXPORT_SYMBOL(ieee80211_sched_scan_stopped);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 006/166] mac80211: don't attempt to reorder multicast frames
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (4 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 005/166] mac80211: fix scheduled scan rtnl deadlock Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 007/166] usb: gadget: composite: reset delayed_status on reset_config Kamal Mostafa
` (159 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Johannes Berg, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
commit 051a41fa4ee14f5c39668f0980973b9a195de560 upstream.
Multicast frames can't be transmitted as part of an aggregation
session (such a session couldn't even be set up) so don't try to
reorder them. Trying to do so would cause the reorder to stop
working correctly since multicast QoS frames (as transmitted by
the Aruba APs this was found with) would cause sequence number
confusion in the buffer.
Reported-by: Blaise Gassend <blaise@suitabletech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/mac80211/rx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index b1e5e03..dc97ae5 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -868,7 +868,8 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx)
u16 sc;
u8 tid, ack_policy;
- if (!ieee80211_is_data_qos(hdr->frame_control))
+ if (!ieee80211_is_data_qos(hdr->frame_control) ||
+ is_multicast_ether_addr(hdr->addr1))
goto dont_reorder;
/*
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 007/166] usb: gadget: composite: reset delayed_status on reset_config
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (5 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 006/166] mac80211: don't attempt to reorder multicast frames Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 008/166] usb: musb: only cancel work if it is initialized Kamal Mostafa
` (158 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Michael Grzeschik, Felipe Balbi, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
commit 2bac51a1827a18821150ed8c9f9752c02f9c2b02 upstream.
The delayed_status value is used to keep track of status response
packets on ep0. It needs to be reset or the set_config function would
still delay the answer, if the usb device got unplugged while waiting
for setup_continue to be called.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/gadget/composite.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 2a6bfe7..44fef44 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -556,6 +556,7 @@ static void reset_config(struct usb_composite_dev *cdev)
bitmap_zero(f->endpoints, 32);
}
cdev->config = NULL;
+ cdev->delayed_status = 0;
}
static int set_config(struct usb_composite_dev *cdev,
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 008/166] usb: musb: only cancel work if it is initialized
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (6 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 007/166] usb: gadget: composite: reset delayed_status on reset_config Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 009/166] usb: dwc3: fix implementation of endpoint wedge Kamal Mostafa
` (157 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sebastian Andrzej Siewior, Felipe Balbi, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
commit 66fadea5b79c07154126bb0db375be915f611246 upstream.
Since commit c5340bd14 ("usb: musb: cancel work on removal") the workqueue
is cancelled but then if we bail out before the workqueue is setup we
get this:
|INFO: trying to register non-static key.
|the code is fine but needs lockdep annotation.
|turning off the locking correctness validator.
|CPU: 0 PID: 708 Comm: modprobe Not tainted 3.12.0+ #435
|[<c00867bc>] (lock_acquire+0xf0/0x108) from [<c00529d0>] (flush_work+0x38/0x2ec)
|[<c00529d0>] (flush_work+0x38/0x2ec) from [<c0052d24>] (__cancel_work_timer+0xa0/0x134)
|[<c0052d24>] (__cancel_work_timer+0xa0/0x134) from [<bf0e4ae4>] (musb_free+0x40/0x60 [musb_hdrc])
|[<bf0e4ae4>] (musb_free+0x40/0x60 [musb_hdrc]) from [<bf0e5364>] (musb_probe+0x678/0xb78 [musb_hdrc])
|[<bf0e5364>] (musb_probe+0x678/0xb78 [musb_hdrc]) from [<c0294bf0>] (platform_drv_probe+0x1c/0x24)
|[<c0294bf0>] (platform_drv_probe+0x1c/0x24) from [<c0293970>] (driver_probe_device+0x90/0x224)
|[<c0293970>] (driver_probe_device+0x90/0x224) from [<c0291ef0>] (bus_for_each_drv+0x60/0x8c)
|[<c0291ef0>] (bus_for_each_drv+0x60/0x8c) from [<c02938bc>] (device_attach+0x80/0xa4)
|[<c02938bc>] (device_attach+0x80/0xa4) from [<c0292b24>] (bus_probe_device+0x88/0xac)
|[<c0292b24>] (bus_probe_device+0x88/0xac) from [<c0291490>] (device_add+0x388/0x6c8)
|[<c0291490>] (device_add+0x388/0x6c8) from [<c02952a0>] (platform_device_add+0x188/0x22c)
|[<c02952a0>] (platform_device_add+0x188/0x22c) from [<bf11ea30>] (dsps_probe+0x294/0x394 [musb_dsps])
|[<bf11ea30>] (dsps_probe+0x294/0x394 [musb_dsps]) from [<c0294bf0>] (platform_drv_probe+0x1c/0x24)
|platform musb-hdrc.1.auto: Driver musb-hdrc requests probe deferral
|musb-hdrc musb-hdrc.1.auto: musb_init_controller failed with status -517
This patch moves the init part to earlier part so it can be cleaned as
part of the fail3 label because now it is surrounded by the fail4 label.
Step two is to remove it from musb_free() and add it to the two cleanup
paths (error path and device removal) separately.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/musb/musb_core.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 85b7a91..dd4fe41 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1816,7 +1816,6 @@ static void musb_free(struct musb *musb)
disable_irq_wake(musb->nIrq);
free_irq(musb->nIrq, musb);
}
- cancel_work_sync(&musb->irq_work);
if (is_dma_capable() && musb->dma_controller) {
struct dma_controller *c = musb->dma_controller;
@@ -1915,6 +1914,9 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
musb_platform_disable(musb);
musb_generic_disable(musb);
+ /* Init IRQ workqueue before request_irq */
+ INIT_WORK(&musb->irq_work, musb_irq_work);
+
/* setup musb parts of the core (especially endpoints) */
status = musb_core_init(plat->config->multipoint
? MUSB_CONTROLLER_MHDRC
@@ -1924,9 +1926,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
setup_timer(&musb->otg_timer, musb_otg_timer_func, (unsigned long) musb);
- /* Init IRQ workqueue before request_irq */
- INIT_WORK(&musb->irq_work, musb_irq_work);
-
/* attach to the IRQ */
if (request_irq(nIrq, musb->isr, 0, dev_name(dev), musb)) {
dev_err(dev, "request_irq %d failed!\n", nIrq);
@@ -1986,6 +1985,7 @@ fail4:
musb_gadget_cleanup(musb);
fail3:
+ cancel_work_sync(&musb->irq_work);
pm_runtime_put_sync(musb->controller);
fail2:
@@ -2050,6 +2050,7 @@ static int musb_remove(struct platform_device *pdev)
musb_exit_debugfs(musb);
musb_shutdown(pdev);
+ cancel_work_sync(&musb->irq_work);
musb_free(musb);
iounmap(ctrl_base);
device_init_wakeup(dev, 0);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 009/166] usb: dwc3: fix implementation of endpoint wedge
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (7 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 008/166] usb: musb: only cancel work if it is initialized Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 010/166] [media] af9035: add ID [0ccd:00aa] TerraTec Cinergy T Stick (rev. 2) Kamal Mostafa
` (156 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alan Stern, Felipe Balbi, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <stern@rowland.harvard.edu>
commit a535d81c92615b8ffb99b7e1fd1fb01effaed1af upstream.
The dwc3 UDC driver doesn't implement endpoint wedging correctly.
When an endpoint is wedged, the gadget driver should be allowed to
clear the wedge by calling usb_ep_clear_halt(). Only the host is
prevented from resetting the endpoint.
This patch fixes the implementation.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Pratyush Anand <pratyush.anand@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/dwc3/ep0.c | 2 ++
drivers/usb/dwc3/gadget.c | 5 +----
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index d7da073..7b87b81 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -475,6 +475,8 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
dep = dwc3_wIndex_to_dep(dwc, wIndex);
if (!dep)
return -EINVAL;
+ if (set == 0 && (dep->flags & DWC3_EP_WEDGE))
+ break;
ret = __dwc3_gadget_ep_set_halt(dep, set);
if (ret)
return -EINVAL;
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 1656800..418288e 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1211,9 +1211,6 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value)
else
dep->flags |= DWC3_EP_STALL;
} else {
- if (dep->flags & DWC3_EP_WEDGE)
- return 0;
-
ret = dwc3_send_gadget_ep_cmd(dwc, dep->number,
DWC3_DEPCMD_CLEARSTALL, ¶ms);
if (ret)
@@ -1221,7 +1218,7 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value)
value ? "set" : "clear",
dep->name);
else
- dep->flags &= ~DWC3_EP_STALL;
+ dep->flags &= ~(DWC3_EP_STALL | DWC3_EP_WEDGE);
}
return ret;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 010/166] [media] af9035: add ID [0ccd:00aa] TerraTec Cinergy T Stick (rev. 2)
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (8 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 009/166] usb: dwc3: fix implementation of endpoint wedge Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 011/166] [media] af9035: [0ccd:0099] TerraTec Cinergy T Stick Dual RC " Kamal Mostafa
` (155 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Fabrizio Gazzato, Mauro Carvalho Chehab, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabrizio Gazzato <fabrizio.gazzato@gmail.com>
commit d9b7595bed61930987308be946563ce084148c14 upstream.
This patch adds USB ID for alternative "Terratec Cinergy T Stick".
Tested by a friend: works similarly to 0ccd:0093 version (af9035+tua9001)
Signed-off-by: Fabrizio Gazzato <fabrizio.gazzato@gmail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/media/usb/dvb-usb-v2/af9035.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
index 61ae7f9..c3cd6be 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -1133,6 +1133,8 @@ static const struct usb_device_id af9035_id_table[] = {
&af9035_props, "AVerMedia Twinstar (A825)", NULL) },
{ DVB_USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3100MINI_PLUS,
&af9035_props, "Asus U3100Mini Plus", NULL) },
+ { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00aa,
+ &af9035_props, "TerraTec Cinergy T Stick (rev. 2)", NULL) },
{ }
};
MODULE_DEVICE_TABLE(usb, af9035_id_table);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 011/166] [media] af9035: [0ccd:0099] TerraTec Cinergy T Stick Dual RC (rev. 2)
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (9 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 010/166] [media] af9035: add ID [0ccd:00aa] TerraTec Cinergy T Stick (rev. 2) Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 012/166] [media] af9035: add [0413:6a05] Leadtek WinFast DTV Dongle Dual Kamal Mostafa
` (154 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Antti Palosaari, Mauro Carvalho Chehab, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Antti Palosaari <crope@iki.fi>
commit b799b8102baa8e63139f0eadef00d75701328775 upstream.
That same USB ID is used both AF9015 and AF9035 driver.
iManufacturer is only thing we can select correct driver without a I/O.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/media/usb/dvb-usb-v2/af9035.c | 42 ++++++++++++++++++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
index c3cd6be..cbe1373 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -1046,6 +1046,43 @@ err:
return ret;
}
+static int af9035_probe(struct usb_interface *intf,
+ const struct usb_device_id *id)
+{
+ struct usb_device *udev = interface_to_usbdev(intf);
+ char manufacturer[sizeof("Afatech")];
+
+ memset(manufacturer, 0, sizeof(manufacturer));
+ usb_string(udev, udev->descriptor.iManufacturer,
+ manufacturer, sizeof(manufacturer));
+ /*
+ * There is two devices having same ID but different chipset. One uses
+ * AF9015 and the other IT9135 chipset. Only difference seen on lsusb
+ * is iManufacturer string.
+ *
+ * idVendor 0x0ccd TerraTec Electronic GmbH
+ * idProduct 0x0099
+ * bcdDevice 2.00
+ * iManufacturer 1 Afatech
+ * iProduct 2 DVB-T 2
+ *
+ * idVendor 0x0ccd TerraTec Electronic GmbH
+ * idProduct 0x0099
+ * bcdDevice 2.00
+ * iManufacturer 1 ITE Technologies, Inc.
+ * iProduct 2 DVB-T TV Stick
+ */
+ if ((le16_to_cpu(udev->descriptor.idVendor) == USB_VID_TERRATEC) &&
+ (le16_to_cpu(udev->descriptor.idProduct) == 0x0099)) {
+ if (!strcmp("Afatech", manufacturer)) {
+ dev_dbg(&udev->dev, "%s: rejecting device\n", __func__);
+ return -ENODEV;
+ }
+ }
+
+ return dvb_usbv2_probe(intf, id);
+}
+
/* interface 0 is used by DVB-T receiver and
interface 1 is for remote controller (HID) */
static const struct dvb_usb_device_properties af9035_props = {
@@ -1135,6 +1172,9 @@ static const struct usb_device_id af9035_id_table[] = {
&af9035_props, "Asus U3100Mini Plus", NULL) },
{ DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00aa,
&af9035_props, "TerraTec Cinergy T Stick (rev. 2)", NULL) },
+ /* XXX: that same ID [0ccd:0099] is used by af9015 driver too */
+ { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x0099,
+ &af9035_props, "TerraTec Cinergy T Stick Dual RC (rev. 2)", NULL) },
{ }
};
MODULE_DEVICE_TABLE(usb, af9035_id_table);
@@ -1142,7 +1182,7 @@ MODULE_DEVICE_TABLE(usb, af9035_id_table);
static struct usb_driver af9035_usb_driver = {
.name = KBUILD_MODNAME,
.id_table = af9035_id_table,
- .probe = dvb_usbv2_probe,
+ .probe = af9035_probe,
.disconnect = dvb_usbv2_disconnect,
.suspend = dvb_usbv2_suspend,
.resume = dvb_usbv2_resume,
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 012/166] [media] af9035: add [0413:6a05] Leadtek WinFast DTV Dongle Dual
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (10 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 011/166] [media] af9035: [0ccd:0099] TerraTec Cinergy T Stick Dual RC " Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 013/166] [media] saa7164: fix return value check in saa7164_initdev() Kamal Mostafa
` (153 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Antti Palosaari, Mauro Carvalho Chehab, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Antti Palosaari <crope@iki.fi>
commit 0c413d10515feae02cee967b31bb8afea8aa0d29 upstream.
It is IT9135 dual design.
Thanks to Michael Piko for reporting that!
Reported-by: Michael Piko <michael@piko.com.au>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/media/usb/dvb-usb-v2/af9035.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
index cbe1373..3b41d7c 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -1175,6 +1175,8 @@ static const struct usb_device_id af9035_id_table[] = {
/* XXX: that same ID [0ccd:0099] is used by af9015 driver too */
{ DVB_USB_DEVICE(USB_VID_TERRATEC, 0x0099,
&af9035_props, "TerraTec Cinergy T Stick Dual RC (rev. 2)", NULL) },
+ { DVB_USB_DEVICE(USB_VID_LEADTEK, 0x6a05,
+ &af9035_props, "Leadtek WinFast DTV Dongle Dual", NULL) },
{ }
};
MODULE_DEVICE_TABLE(usb, af9035_id_table);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 013/166] [media] saa7164: fix return value check in saa7164_initdev()
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (11 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 012/166] [media] af9035: add [0413:6a05] Leadtek WinFast DTV Dongle Dual Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 014/166] ath9k: Fix QuickDrop usage Kamal Mostafa
` (152 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Wei Yongjun, Hans Verkuil, Mauro Carvalho Chehab, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
commit 89f4d45b2752df5d222b5f63919ce59e2d8afaf4 upstream.
In case of error, the function kthread_run() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/media/pci/saa7164/saa7164-core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c
index 63502e7..bb394e0 100644
--- a/drivers/media/pci/saa7164/saa7164-core.c
+++ b/drivers/media/pci/saa7164/saa7164-core.c
@@ -1348,9 +1348,11 @@ static int saa7164_initdev(struct pci_dev *pci_dev,
if (fw_debug) {
dev->kthread = kthread_run(saa7164_thread_function, dev,
"saa7164 debug");
- if (!dev->kthread)
+ if (IS_ERR(dev->kthread)) {
+ dev->kthread = NULL;
printk(KERN_ERR "%s() Failed to create "
"debug kernel thread\n", __func__);
+ }
}
} /* != BOARD_UNKNOWN */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 014/166] ath9k: Fix QuickDrop usage
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (12 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 013/166] [media] saa7164: fix return value check in saa7164_initdev() Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 015/166] ath9k: Fix XLNA bias strength Kamal Mostafa
` (151 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sujith Manoharan, John W. Linville, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
commit 93c1cfbe598f72cfa7be49e4a7d2a1d482e15119 upstream.
Bit 5 in the miscConfiguration field of the base EEPROM
header denotes whether QuickDrop is enabled or not. Fix
the incorrect usage of BIT(1) and also make sure that
this is done only for the required chips.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 92e761a..5fcc943e 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -3920,18 +3920,20 @@ static void ar9003_hw_quick_drop_apply(struct ath_hw *ah, u16 freq)
int quick_drop;
s32 t[3], f[3] = {5180, 5500, 5785};
- if (!(pBase->miscConfiguration & BIT(1)))
+ if (!(pBase->miscConfiguration & BIT(4)))
return;
- if (freq < 4000)
- quick_drop = eep->modalHeader2G.quick_drop;
- else {
- t[0] = eep->base_ext1.quick_drop_low;
- t[1] = eep->modalHeader5G.quick_drop;
- t[2] = eep->base_ext1.quick_drop_high;
- quick_drop = ar9003_hw_power_interpolate(freq, f, t, 3);
+ if (AR_SREV_9300(ah) || AR_SREV_9580(ah) || AR_SREV_9340(ah)) {
+ if (freq < 4000) {
+ quick_drop = eep->modalHeader2G.quick_drop;
+ } else {
+ t[0] = eep->base_ext1.quick_drop_low;
+ t[1] = eep->modalHeader5G.quick_drop;
+ t[2] = eep->base_ext1.quick_drop_high;
+ quick_drop = ar9003_hw_power_interpolate(freq, f, t, 3);
+ }
+ REG_RMW_FIELD(ah, AR_PHY_AGC, AR_PHY_AGC_QUICK_DROP, quick_drop);
}
- REG_RMW_FIELD(ah, AR_PHY_AGC, AR_PHY_AGC_QUICK_DROP, quick_drop);
}
static void ar9003_hw_txend_to_xpa_off_apply(struct ath_hw *ah, bool is2ghz)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 015/166] ath9k: Fix XLNA bias strength
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (13 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 014/166] ath9k: Fix QuickDrop usage Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 016/166] USB: serial: option: blacklist interface 1 for Huawei E173s-6 Kamal Mostafa
` (150 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sujith Manoharan, John W. Linville, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
commit a1783a7b0846fc6414483e6caf646db72023fffd upstream.
The EEPROM parameter to determine whether the bias
strength values for XLNA have to be applied is part
of the miscConfiguration field and not featureEnable.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 5fcc943e..cdb1651 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -3973,7 +3973,7 @@ static void ar9003_hw_xlna_bias_strength_apply(struct ath_hw *ah, bool is2ghz)
struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
u8 bias;
- if (!(eep->baseEepHeader.featureEnable & 0x40))
+ if (!(eep->baseEepHeader.miscConfiguration & 0x40))
return;
if (!AR_SREV_9300(ah))
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 016/166] USB: serial: option: blacklist interface 1 for Huawei E173s-6
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (14 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 015/166] ath9k: Fix XLNA bias strength Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 017/166] USB: option: support new huawei devices Kamal Mostafa
` (149 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Gustavo Zacarias, Greg Kroah-Hartman, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Gustavo Zacarias <gustavo@zacarias.com.ar>
commit 8f173e22abf2258ddfa73f46eadbb6a6c29f1631 upstream.
Interface 1 on this device isn't for option to bind to otherwise an oops
on usb_wwan with log flooding will happen when accessing the port:
tty_release: ttyUSB1: read/write wait queue active!
It doesn't seem to respond to QMI if it's added to qmi_wwan so don't add
it there - it's likely used by the card reader.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/option.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 4da1743..0ec2147 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -85,6 +85,7 @@ static void option_instat_callback(struct urb *urb);
#define HUAWEI_PRODUCT_K4505 0x1464
#define HUAWEI_PRODUCT_K3765 0x1465
#define HUAWEI_PRODUCT_K4605 0x14C6
+#define HUAWEI_PRODUCT_E173S6 0x1C07
#define QUANTA_VENDOR_ID 0x0408
#define QUANTA_PRODUCT_Q101 0xEA02
@@ -572,6 +573,8 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c23, USB_CLASS_COMM, 0x02, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t) &net_intf1_blacklist },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173S6, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t) &net_intf1_blacklist },
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1750, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t) &net_intf2_blacklist },
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1441, USB_CLASS_COMM, 0x02, 0xff) },
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 017/166] USB: option: support new huawei devices
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (15 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 016/166] USB: serial: option: blacklist interface 1 for Huawei E173s-6 Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 018/166] USB: spcp8x5: correct handling of CS5 setting Kamal Mostafa
` (148 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: fangxiaozhi, Greg Kroah-Hartman, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: "Fangxiaozhi (Franko)" <fangxiaozhi@huawei.com>
commit 2bf308d7bc5e8cdd69672199f59532f35339133c upstream.
Add new supporting declarations to option.c, to support Huawei new
devices with new bInterfaceProtocol value.
Signed-off-by: fangxiaozhi <huananhu@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/option.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 0ec2147..a03c30e 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -637,6 +637,10 @@ static const struct usb_device_id option_ids[] = {
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x6D) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x6E) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x6F) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x72) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x73) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x74) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x75) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x78) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x79) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x7A) },
@@ -691,6 +695,10 @@ static const struct usb_device_id option_ids[] = {
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x6D) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x6E) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x6F) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x72) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x73) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x74) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x75) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x78) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x79) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x7A) },
@@ -745,6 +753,10 @@ static const struct usb_device_id option_ids[] = {
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6D) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6E) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6F) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x72) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x73) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x74) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x75) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x78) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x79) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x7A) },
@@ -799,6 +811,10 @@ static const struct usb_device_id option_ids[] = {
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x6D) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x6E) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x6F) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x72) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x73) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x74) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x75) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x78) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x79) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x7A) },
@@ -853,6 +869,10 @@ static const struct usb_device_id option_ids[] = {
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x6D) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x6E) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x6F) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x72) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x73) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x74) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x75) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x78) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x79) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x7A) },
@@ -907,6 +927,10 @@ static const struct usb_device_id option_ids[] = {
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x6D) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x6E) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x6F) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x72) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x73) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x74) },
+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x75) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x78) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x79) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x7A) },
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 018/166] USB: spcp8x5: correct handling of CS5 setting
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (16 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 017/166] USB: option: support new huawei devices Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 019/166] USB: mos7840: " Kamal Mostafa
` (147 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Colin Leitner, Johan Hovold, Greg Kroah-Hartman, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Colin Leitner <colin.leitner@googlemail.com>
commit 711fbdfbf2bc4827214a650afe3f64767a1aba16 upstream.
This patch removes an erroneous check of CSIZE, which made it impossible to set
CS5.
Compiles clean, but couldn't test against hardware.
Signed-off-by: Colin Leitner <colin.leitner@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/spcp8x5.c | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c
index 76f11d0..ef07c95a 100644
--- a/drivers/usb/serial/spcp8x5.c
+++ b/drivers/usb/serial/spcp8x5.c
@@ -370,22 +370,20 @@ static void spcp8x5_set_termios(struct tty_struct *tty,
}
/* Set Data Length : 00:5bit, 01:6bit, 10:7bit, 11:8bit */
- if (cflag & CSIZE) {
- switch (cflag & CSIZE) {
- case CS5:
- buf[1] |= SET_UART_FORMAT_SIZE_5;
- break;
- case CS6:
- buf[1] |= SET_UART_FORMAT_SIZE_6;
- break;
- case CS7:
- buf[1] |= SET_UART_FORMAT_SIZE_7;
- break;
- default:
- case CS8:
- buf[1] |= SET_UART_FORMAT_SIZE_8;
- break;
- }
+ switch (cflag & CSIZE) {
+ case CS5:
+ buf[1] |= SET_UART_FORMAT_SIZE_5;
+ break;
+ case CS6:
+ buf[1] |= SET_UART_FORMAT_SIZE_6;
+ break;
+ case CS7:
+ buf[1] |= SET_UART_FORMAT_SIZE_7;
+ break;
+ default:
+ case CS8:
+ buf[1] |= SET_UART_FORMAT_SIZE_8;
+ break;
}
/* Set Stop bit2 : 0:1bit 1:2bit */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 019/166] USB: mos7840: correct handling of CS5 setting
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (17 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 018/166] USB: spcp8x5: correct handling of CS5 setting Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 020/166] USB: ftdi_sio: fixed handling of unsupported CSIZE setting Kamal Mostafa
` (146 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Colin Leitner, Johan Hovold, Greg Kroah-Hartman, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Colin Leitner <colin.leitner@googlemail.com>
commit 78692cc3382e0603a47e1f2aaeffe0d99891994d upstream.
This patch removes an erroneous check of CSIZE, which made it impossible to set
CS5.
Compiles clean, but couldn't test against hardware.
Signed-off-by: Colin Leitner <colin.leitner@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/mos7840.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 84502ea..716669e 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -1926,25 +1926,25 @@ static void mos7840_change_port_settings(struct tty_struct *tty,
iflag = tty->termios.c_iflag;
/* Change the number of bits */
- if (cflag & CSIZE) {
- switch (cflag & CSIZE) {
- case CS5:
- lData = LCR_BITS_5;
- break;
+ switch (cflag & CSIZE) {
+ case CS5:
+ lData = LCR_BITS_5;
+ break;
- case CS6:
- lData = LCR_BITS_6;
- break;
+ case CS6:
+ lData = LCR_BITS_6;
+ break;
- case CS7:
- lData = LCR_BITS_7;
- break;
- default:
- case CS8:
- lData = LCR_BITS_8;
- break;
- }
+ case CS7:
+ lData = LCR_BITS_7;
+ break;
+
+ default:
+ case CS8:
+ lData = LCR_BITS_8;
+ break;
}
+
/* Change the Parity bit */
if (cflag & PARENB) {
if (cflag & PARODD) {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 020/166] USB: ftdi_sio: fixed handling of unsupported CSIZE setting
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (18 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 019/166] USB: mos7840: " Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 021/166] USB: pl2303: fixed handling of CS5 setting Kamal Mostafa
` (145 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Colin Leitner, Johan Hovold, Greg Kroah-Hartman, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Colin Leitner <colin.leitner@googlemail.com>
commit 8704211f65a2106ba01b6ac9727cdaf9ca11594c upstream.
FTDI UARTs support only 7 or 8 data bits. Until now the ftdi_sio driver would
only report this limitation for CS6 to dmesg and fail to reflect this fact to
tcgetattr.
This patch reverts the unsupported CSIZE setting and reports the fact with less
severance to dmesg for both CS5 and CS6.
To test the patch it's sufficient to call
stty -F /dev/ttyUSB0 cs5
which will succeed without the patch and report an error with the patch
applied.
As an additional fix this patch ensures that the control request will always
include a data bit size.
Signed-off-by: Colin Leitner <colin.leitner@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/ftdi_sio.c | 37 ++++++++++++++++++++++++-------------
1 file changed, 24 insertions(+), 13 deletions(-)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 2bc1966..ede7f9f 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -2180,6 +2180,20 @@ static void ftdi_set_termios(struct tty_struct *tty,
termios->c_cflag |= CRTSCTS;
}
+ /*
+ * All FTDI UART chips are limited to CS7/8. We won't pretend to
+ * support CS5/6 and revert the CSIZE setting instead.
+ */
+ if ((C_CSIZE(tty) != CS8) && (C_CSIZE(tty) != CS7)) {
+ dev_warn(ddev, "requested CSIZE setting not supported\n");
+
+ termios->c_cflag &= ~CSIZE;
+ if (old_termios)
+ termios->c_cflag |= old_termios->c_cflag & CSIZE;
+ else
+ termios->c_cflag |= CS8;
+ }
+
cflag = termios->c_cflag;
if (!old_termios)
@@ -2216,19 +2230,16 @@ no_skip:
} else {
urb_value |= FTDI_SIO_SET_DATA_PARITY_NONE;
}
- if (cflag & CSIZE) {
- switch (cflag & CSIZE) {
- case CS7:
- urb_value |= 7;
- dev_dbg(ddev, "Setting CS7\n");
- break;
- case CS8:
- urb_value |= 8;
- dev_dbg(ddev, "Setting CS8\n");
- break;
- default:
- dev_err(ddev, "CSIZE was set but not CS7-CS8\n");
- }
+ switch (cflag & CSIZE) {
+ case CS7:
+ urb_value |= 7;
+ dev_dbg(ddev, "Setting CS7\n");
+ break;
+ default:
+ case CS8:
+ urb_value |= 8;
+ dev_dbg(ddev, "Setting CS8\n");
+ break;
}
/* This is needed by the break command since it uses the same command
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 021/166] USB: pl2303: fixed handling of CS5 setting
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (19 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 020/166] USB: ftdi_sio: fixed handling of unsupported CSIZE setting Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 022/166] USB: cdc-acm: Added support for the Lenovo RD02-D400 USB Modem Kamal Mostafa
` (144 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Colin Leitner, Johan Hovold, Greg Kroah-Hartman, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Colin Leitner <colin.leitner@googlemail.com>
commit a313249937820f8b1996133fc285efbd6aad2c5b upstream.
This patch fixes the CS5 setting on the PL2303 USB-to-serial devices. CS5 has a
value of 0 and the CSIZE setting has been skipped altogether by the enclosing
if. Tested on 3.11.6 and the scope shows the correct output after the fix has
been applied.
Tagged to be added to stable, because it fixes a user visible driver bug and is
simple enough to backport easily.
Signed-off-by: Colin Leitner <colin.leitner@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/pl2303.c | 31 ++++++++++++++-----------------
1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index a16d378..037fd68 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -303,24 +303,21 @@ static void pl2303_set_termios(struct tty_struct *tty,
dev_dbg(&port->dev, "0xa1:0x21:0:0 %d - %x %x %x %x %x %x %x\n", i,
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
- if (cflag & CSIZE) {
- switch (cflag & CSIZE) {
- case CS5:
- buf[6] = 5;
- break;
- case CS6:
- buf[6] = 6;
- break;
- case CS7:
- buf[6] = 7;
- break;
- default:
- case CS8:
- buf[6] = 8;
- break;
- }
- dev_dbg(&port->dev, "data bits = %d\n", buf[6]);
+ switch (C_CSIZE(tty)) {
+ case CS5:
+ buf[6] = 5;
+ break;
+ case CS6:
+ buf[6] = 6;
+ break;
+ case CS7:
+ buf[6] = 7;
+ break;
+ default:
+ case CS8:
+ buf[6] = 8;
}
+ dev_dbg(&port->dev, "data bits = %d\n", buf[6]);
/* For reference buf[0]:buf[3] baud rate value */
/* NOTE: Only the values defined in baud_sup are supported !
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 022/166] USB: cdc-acm: Added support for the Lenovo RD02-D400 USB Modem
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (20 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 021/166] USB: pl2303: fixed handling of CS5 setting Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 023/166] drm/radeon: fixup bad vram size on SI Kamal Mostafa
` (143 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: David Cluytens, Greg Kroah-Hartman, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: David Cluytens <david.cluytens@gmail.com>
commit 3b59d16c513da258ec8f6a0b4db85f257a0380d6 upstream.
Signed-off-by: David Cluytens <david.cluytens@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/class/cdc-acm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 35d2cf1..c4564e3 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1542,6 +1542,8 @@ static int acm_reset_resume(struct usb_interface *intf)
static const struct usb_device_id acm_ids[] = {
/* quirky and broken devices */
+ { USB_DEVICE(0x17ef, 0x7000), /* Lenovo USB modem */
+ .driver_info = NO_UNION_NORMAL, },/* has no union descriptor */
{ USB_DEVICE(0x0870, 0x0001), /* Metricom GS Modem */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 023/166] drm/radeon: fixup bad vram size on SI
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (21 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 022/166] USB: cdc-acm: Added support for the Lenovo RD02-D400 USB Modem Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 024/166] drm/radeon/atom: fix bus probes when hw_i2c is set (v2) Kamal Mostafa
` (142 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit 0ca223b029a261e82fb2f50c52eb85d510f4260e upstream.
Some boards seem to have garbage in the upper
16 bits of the vram size register. Check for
this and clamp the size properly. Fixes
boards reporting bogus amounts of vram.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/si.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 966b5e6..ff9a680 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -2426,8 +2426,15 @@ static int si_mc_init(struct radeon_device *rdev)
rdev->mc.aper_base = pci_resource_start(rdev->pdev, 0);
rdev->mc.aper_size = pci_resource_len(rdev->pdev, 0);
/* size in MB on si */
- rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024ULL * 1024ULL;
- rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024ULL * 1024ULL;
+ tmp = RREG32(CONFIG_MEMSIZE);
+ /* some boards may have garbage in the upper 16 bits */
+ if (tmp & 0xffff0000) {
+ DRM_INFO("Probable bad vram size: 0x%08x\n", tmp);
+ if (tmp & 0xffff)
+ tmp &= 0xffff;
+ }
+ rdev->mc.mc_vram_size = tmp * 1024ULL * 1024ULL;
+ rdev->mc.real_vram_size = rdev->mc.mc_vram_size;
rdev->mc.visible_vram_size = rdev->mc.aper_size;
si_vram_gtt_location(rdev, &rdev->mc);
radeon_update_bandwidth_info(rdev);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 024/166] drm/radeon/atom: fix bus probes when hw_i2c is set (v2)
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (22 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 023/166] drm/radeon: fixup bad vram size on SI Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 025/166] usb: hub: Use correct reset for wedged USB3 devices that are NOTATTACHED Kamal Mostafa
` (141 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit ffd3d3361d583cb73fa65a5fed3a196ba6f261bb upstream.
When probing the bus, we need to set the byte count
to 0 rather than 1.
v2: Don't count the first byte.
bug:
https://bugzilla.kernel.org/show_bug.cgi?id=66241
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/atombios_i2c.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/radeon/atombios_i2c.c b/drivers/gpu/drm/radeon/atombios_i2c.c
index 4bb4b7a..1dfafb1 100644
--- a/drivers/gpu/drm/radeon/atombios_i2c.c
+++ b/drivers/gpu/drm/radeon/atombios_i2c.c
@@ -44,7 +44,7 @@ static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan,
PROCESS_I2C_CHANNEL_TRANSACTION_PS_ALLOCATION args;
int index = GetIndexIntoMasterTable(COMMAND, ProcessI2cChannelTransaction);
unsigned char *base;
- u16 out;
+ u16 out = cpu_to_le16(0);
memset(&args, 0, sizeof(args));
@@ -55,10 +55,14 @@ static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan,
DRM_ERROR("hw i2c: tried to write too many bytes (%d vs 2)\n", num);
return -EINVAL;
}
- if (num > 1) {
+ if (buf == NULL)
+ args.ucRegIndex = 0;
+ else
+ args.ucRegIndex = buf[0];
+ if (num)
num--;
+ if (num)
memcpy(&out, &buf[1], num);
- }
args.lpI2CDataOut = cpu_to_le16(out);
} else {
if (num > ATOM_MAX_HW_I2C_READ) {
@@ -93,14 +97,14 @@ int radeon_atom_hw_i2c_xfer(struct i2c_adapter *i2c_adap,
struct radeon_i2c_chan *i2c = i2c_get_adapdata(i2c_adap);
struct i2c_msg *p;
int i, remaining, current_count, buffer_offset, max_bytes, ret;
- u8 buf = 0, flags;
+ u8 flags;
/* check for bus probe */
p = &msgs[0];
if ((num == 1) && (p->len == 0)) {
ret = radeon_process_i2c_ch(i2c,
p->addr, HW_I2C_WRITE,
- &buf, 1);
+ NULL, 0);
if (ret)
return ret;
else
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 025/166] usb: hub: Use correct reset for wedged USB3 devices that are NOTATTACHED
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (23 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 024/166] drm/radeon/atom: fix bus probes when hw_i2c is set (v2) Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 026/166] drivers/char/i8k.c: add Dell XPLS L421X Kamal Mostafa
` (140 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Julius Werner, Greg Kroah-Hartman, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Julius Werner <jwerner@chromium.org>
commit 2d51f3cd11f414c56a87dc018196b85fd50b04a4 upstream.
This patch adds a check for USB_STATE_NOTATTACHED to the
hub_port_warm_reset_required() workaround for ports that end up in
Compliance Mode in hub_events() when trying to decide which reset
function to use. Trying to call usb_reset_device() with a NOTATTACHED
device will just fail and leave the port broken.
Signed-off-by: Julius Werner <jwerner@chromium.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/core/hub.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 1ac190b..edbf39f 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4764,7 +4764,9 @@ static void hub_events(void)
hub->ports[i - 1]->child;
dev_dbg(hub_dev, "warm reset port %d\n", i);
- if (!udev) {
+ if (!udev ||
+ !(portstatus & USB_PORT_STAT_CONNECTION) ||
+ udev->state == USB_STATE_NOTATTACHED) {
status = hub_port_reset(hub, i,
NULL, HUB_BH_RESET_TIME,
true);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 026/166] drivers/char/i8k.c: add Dell XPLS L421X
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (24 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 025/166] usb: hub: Use correct reset for wedged USB3 devices that are NOTATTACHED Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 027/166] PCI: Disable Bus Master only on kexec reboot Kamal Mostafa
` (139 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Alan Cox, Andrew Morton, Greg Kroah-Hartman, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Cox <alan@linux.intel.com>
commit 9aa5b0181bdf335f0b731d8502e128a862884bcd upstream.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=60772
Signed-off-by: Alan Cox <alan@linux.intel.com>
Reported-by: Leho Kraav <leho@kraav.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/char/i8k.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
index 40cc0cf2..e6939e1 100644
--- a/drivers/char/i8k.c
+++ b/drivers/char/i8k.c
@@ -664,6 +664,13 @@ static struct dmi_system_id __initdata i8k_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Vostro"),
},
},
+ {
+ .ident = "Dell XPS421",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "XPS L421X"),
+ },
+ },
{ }
};
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 027/166] PCI: Disable Bus Master only on kexec reboot
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (25 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 026/166] drivers/char/i8k.c: add Dell XPLS L421X Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 028/166] ARM: 7912/1: check stack pointer in get_wchan Kamal Mostafa
` (138 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Khalid Aziz, Bjorn Helgaas, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Khalid Aziz <khalid.aziz@oracle.com>
commit 4fc9bbf98fd66f879e628d8537ba7c240be2b58e upstream.
Add a flag to tell the PCI subsystem that kernel is shutting down in
preparation to kexec a kernel. Add code in PCI subsystem to use this flag
to clear Bus Master bit on PCI devices only in case of kexec reboot.
This fixes a power-off problem on Acer Aspire V5-573G and likely other
machines and avoids any other issues caused by clearing Bus Master bit on
PCI devices in normal shutdown path. The problem was introduced by
b566a22c2332 ("PCI: disable Bus Master on PCI device shutdown").
This patch is based on discussion at
http://marc.info/?l=linux-pci&m=138425645204355&w=2
Link: https://bugzilla.kernel.org/show_bug.cgi?id=63861
Reported-by: Chang Liu <cl91tp@gmail.com>
Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Konstantin Khlebnikov <koct9i@gmail.com>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/pci/pci-driver.c | 13 ++++++++++---
include/linux/kexec.h | 3 +++
kernel/kexec.c | 4 ++++
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 8c1ecc5..66e919c 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -19,6 +19,7 @@
#include <linux/cpu.h>
#include <linux/pm_runtime.h>
#include <linux/suspend.h>
+#include <linux/kexec.h>
#include "pci.h"
struct pci_dynid {
@@ -388,11 +389,17 @@ static void pci_device_shutdown(struct device *dev)
pci_msi_shutdown(pci_dev);
pci_msix_shutdown(pci_dev);
+#ifdef CONFIG_KEXEC
/*
- * Turn off Bus Master bit on the device to tell it to not
- * continue to do DMA
+ * If this is a kexec reboot, turn off Bus Master bit on the
+ * device to tell it to not continue to do DMA. Don't touch
+ * devices in D3cold or unknown states.
+ * If it is not a kexec reboot, firmware will hit the PCI
+ * devices with big hammer and stop their DMA any way.
*/
- pci_disable_device(pci_dev);
+ if (kexec_in_progress && (pci_dev->current_state <= PCI_D3hot))
+ pci_clear_master(pci_dev);
+#endif
}
#ifdef CONFIG_PM
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index d0b8458..9140056 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -197,6 +197,9 @@ extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
extern size_t vmcoreinfo_size;
extern size_t vmcoreinfo_max_size;
+/* flag to track if kexec reboot is in progress */
+extern bool kexec_in_progress;
+
int __init parse_crashkernel(char *cmdline, unsigned long long system_ram,
unsigned long long *crash_size, unsigned long long *crash_base);
int crash_shrink_memory(unsigned long new_size);
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 5e4bd78..9533498 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -47,6 +47,9 @@ u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
size_t vmcoreinfo_size;
size_t vmcoreinfo_max_size = sizeof(vmcoreinfo_data);
+/* Flag to indicate we are going to kexec a new kernel */
+bool kexec_in_progress = false;
+
/* Location of the reserved area for the crash kernel */
struct resource crashk_res = {
.name = "Crash kernel",
@@ -1569,6 +1572,7 @@ int kernel_kexec(void)
} else
#endif
{
+ kexec_in_progress = true;
kernel_restart_prepare(NULL);
printk(KERN_EMERG "Starting new kernel\n");
machine_shutdown();
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 028/166] ARM: 7912/1: check stack pointer in get_wchan
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (26 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 027/166] PCI: Disable Bus Master only on kexec reboot Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 029/166] ARM: 7913/1: fix framepointer check in unwind_frame Kamal Mostafa
` (137 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Konstantin Khlebnikov, Russell King, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
commit 1b15ec7a7427d4188ba91b9bbac696250a059d22 upstream.
get_wchan() is lockless. Task may wakeup at any time and change its own stack,
thus each next stack frame may be overwritten and filled with random stuff.
/proc/$pid/stack interface had been disabled for non-current tasks, see [1]
But 'wchan' still allows to trigger stack frame unwinding on volatile stack.
This patch fixes oops in unwind_frame() by adding stack pointer validation on
each step (as x86 code do), unwind_frame() already checks frame pointer.
Also I've found another report of this oops on stackoverflow (irony).
Link: http://www.spinics.net/lists/arm-kernel/msg110589.html [1]
Link: http://stackoverflow.com/questions/18479894/unwind-frame-cause-a-kernel-paging-error
Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/kernel/process.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index c6dec5f..31c92b8 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -434,6 +434,7 @@ EXPORT_SYMBOL(dump_fpu);
unsigned long get_wchan(struct task_struct *p)
{
struct stackframe frame;
+ unsigned long stack_page;
int count = 0;
if (!p || p == current || p->state == TASK_RUNNING)
return 0;
@@ -442,9 +443,11 @@ unsigned long get_wchan(struct task_struct *p)
frame.sp = thread_saved_sp(p);
frame.lr = 0; /* recovered from the stack */
frame.pc = thread_saved_pc(p);
+ stack_page = (unsigned long)task_stack_page(p);
do {
- int ret = unwind_frame(&frame);
- if (ret < 0)
+ if (frame.sp < stack_page ||
+ frame.sp >= stack_page + THREAD_SIZE ||
+ unwind_frame(&frame) < 0)
return 0;
if (!in_sched_functions(frame.pc))
return frame.pc;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 029/166] ARM: 7913/1: fix framepointer check in unwind_frame
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (27 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 028/166] ARM: 7912/1: check stack pointer in get_wchan Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 030/166] x86, build: Pass in additional -mno-mmx, -mno-sse options Kamal Mostafa
` (136 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Konstantin Khlebnikov, Russell King, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
commit 3abb6671a9c04479c4bd026798a05f857393b7e2 upstream.
This patch fixes corner case when (fp + 4) overflows unsigned long,
for example: fp = 0xFFFFFFFF -> fp + 4 == 3.
Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/kernel/stacktrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c
index 00f79e5..af4e8c8 100644
--- a/arch/arm/kernel/stacktrace.c
+++ b/arch/arm/kernel/stacktrace.c
@@ -31,7 +31,7 @@ int notrace unwind_frame(struct stackframe *frame)
high = ALIGN(low, THREAD_SIZE);
/* check current frame pointer is within bounds */
- if (fp < (low + 12) || fp + 4 >= high)
+ if (fp < low + 12 || fp > high - 4)
return -EINVAL;
/* restore the registers from the stack frame */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 030/166] x86, build: Pass in additional -mno-mmx, -mno-sse options
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (28 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 029/166] ARM: 7913/1: fix framepointer check in unwind_frame Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 031/166] ALSA: memalloc.h - fix wrong truncation of dma_addr_t Kamal Mostafa
` (135 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sunil K. Pandey, H. Peter Anvin, H. J. Lu, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: "H. Peter Anvin" <hpa@linux.intel.com>
commit 8b3b005d675726e38bc504d2e35a991e55819155 upstream.
In checkin
5551a34e5aea x86-64, build: Always pass in -mno-sse
we unconditionally added -mno-sse to the main build, to keep newer
compilers from generating SSE instructions from autovectorization.
However, this did not extend to the special environments
(arch/x86/boot, arch/x86/boot/compressed, and arch/x86/realmode/rm).
Add -mno-sse to the compiler command line for these environments, and
add -mno-mmx to all the environments as well, as we don't want a
compiler to generate MMX code either.
This patch also removes a $(cc-option) call for -m32, since we have
long since stopped supporting compilers too old for the -m32 option,
and in fact hardcode it in other places in the Makefiles.
Reported-by: Kevin B. Smith <kevin.b.smith@intel.com>
Cc: Sunil K. Pandey <sunil.k.pandey@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: H. J. Lu <hjl.tools@gmail.com>
Link: http://lkml.kernel.org/n/tip-j21wzqv790q834n7yc6g80j1@git.kernel.org
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/Makefile | 8 ++++----
arch/x86/boot/Makefile | 6 +++---
arch/x86/boot/compressed/Makefile | 1 +
arch/x86/realmode/rm/Makefile | 3 ++-
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 8c2ad4e..48e80e0 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -27,8 +27,8 @@ ifeq ($(CONFIG_X86_32),y)
KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
- # Don't autogenerate SSE instructions
- KBUILD_CFLAGS += -mno-sse
+ # Don't autogenerate MMX or SSE instructions
+ KBUILD_CFLAGS += -mno-mmx -mno-sse
# Never want PIC in a 32-bit kernel, prevent breakage with GCC built
# with nonstandard options
@@ -56,8 +56,8 @@ else
KBUILD_AFLAGS += -m64
KBUILD_CFLAGS += -m64
- # Don't autogenerate SSE instructions
- KBUILD_CFLAGS += -mno-sse
+ # Don't autogenerate MMX or SSE instructions
+ KBUILD_CFLAGS += -mno-mmx -mno-sse
# Use -mpreferred-stack-boundary=3 if supported.
KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index 379814b..6cf0111 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -53,18 +53,18 @@ $(obj)/cpustr.h: $(obj)/mkcpustr FORCE
# How to compile the 16-bit code. Note we always compile for -march=i386,
# that way we can complain to the user if the CPU is insufficient.
-KBUILD_CFLAGS := $(USERINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
+KBUILD_CFLAGS := $(USERINCLUDE) -m32 -g -Os -D_SETUP -D__KERNEL__ \
-DDISABLE_BRANCH_PROFILING \
-Wall -Wstrict-prototypes \
-march=i386 -mregparm=3 \
-include $(srctree)/$(src)/code16gcc.h \
-fno-strict-aliasing -fomit-frame-pointer -fno-pic \
+ -mno-mmx -mno-sse \
$(call cc-option, -ffreestanding) \
$(call cc-option, -fno-toplevel-reorder,\
- $(call cc-option, -fno-unit-at-a-time)) \
+ $(call cc-option, -fno-unit-at-a-time)) \
$(call cc-option, -fno-stack-protector) \
$(call cc-option, -mpreferred-stack-boundary=2)
-KBUILD_CFLAGS += $(call cc-option, -m32)
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 5ef205c..7194d9f 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -12,6 +12,7 @@ KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
cflags-$(CONFIG_X86_32) := -march=i386
cflags-$(CONFIG_X86_64) := -mcmodel=small
KBUILD_CFLAGS += $(cflags-y)
+KBUILD_CFLAGS += -mno-mmx -mno-sse
KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
diff --git a/arch/x86/realmode/rm/Makefile b/arch/x86/realmode/rm/Makefile
index 8869287..9cac825 100644
--- a/arch/x86/realmode/rm/Makefile
+++ b/arch/x86/realmode/rm/Makefile
@@ -73,9 +73,10 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -m32 -g -Os -D_SETUP -D__KERNEL__ -D_WAKEUP \
-march=i386 -mregparm=3 \
-include $(srctree)/$(src)/../../boot/code16gcc.h \
-fno-strict-aliasing -fomit-frame-pointer -fno-pic \
+ -mno-mmx -mno-sse \
$(call cc-option, -ffreestanding) \
$(call cc-option, -fno-toplevel-reorder,\
- $(call cc-option, -fno-unit-at-a-time)) \
+ $(call cc-option, -fno-unit-at-a-time)) \
$(call cc-option, -fno-stack-protector) \
$(call cc-option, -mpreferred-stack-boundary=2)
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 031/166] ALSA: memalloc.h - fix wrong truncation of dma_addr_t
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (29 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 030/166] x86, build: Pass in additional -mno-mmx, -mno-sse options Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 032/166] ALSA: compress: Fix 64bit ABI incompatibility Kamal Mostafa
` (134 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Stefano Panella, Takashi Iwai, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefano Panella <stefano.panella@citrix.com>
commit 932e9dec380c67ec15ac3eb073bb55797d8b4801 upstream.
When running a 32bit kernel the hda_intel driver is still reporting
a 64bit dma_mask if the HW supports it.
>From sound/pci/hda/hda_intel.c:
/* allow 64bit DMA address if supported by H/W */
if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64)))
pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64));
else {
pci_set_dma_mask(pci, DMA_BIT_MASK(32));
pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32));
}
which means when there is a call to dma_alloc_coherent from
snd_malloc_dev_pages a machine address bigger than 32bit can be returned.
This can be true in particular if running the 32bit kernel as a pv dom0
under the Xen Hypervisor or PAE on bare metal.
The problem is that when calling setup_bdle to program the BLE the
dma_addr_t returned from the dma_alloc_coherent is wrongly truncated
from snd_sgbuf_get_addr if running a 32bit kernel:
static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab,
size_t offset)
{
struct snd_sg_buf *sgbuf = dmab->private_data;
dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr;
addr &= PAGE_MASK;
return addr + offset % PAGE_SIZE;
}
where PAGE_MASK in a 32bit kernel is zeroing the upper 32bit af addr.
Without this patch the HW will fetch the 32bit truncated address,
which is not the one obtained from dma_alloc_coherent and will result
to a non working audio but can corrupt host memory at a random location.
The current patch apply to v3.13-rc3-74-g6c843f5
Signed-off-by: Stefano Panella <stefano.panella@citrix.com>
Reviewed-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/sound/memalloc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h
index 844af65..d12356b 100644
--- a/include/sound/memalloc.h
+++ b/include/sound/memalloc.h
@@ -103,7 +103,7 @@ static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab,
{
struct snd_sg_buf *sgbuf = dmab->private_data;
dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr;
- addr &= PAGE_MASK;
+ addr &= ~((dma_addr_t)PAGE_SIZE - 1);
return addr + offset % PAGE_SIZE;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 032/166] ALSA: compress: Fix 64bit ABI incompatibility
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (30 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 031/166] ALSA: memalloc.h - fix wrong truncation of dma_addr_t Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 033/166] dm snapshot: avoid snapshot space leak on crash Kamal Mostafa
` (133 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 6733cf572a9e20db2b7580a5dd39d5782d571eec upstream.
snd_pcm_uframes_t is defined as unsigned long so it would take
different sizes depending on 32 or 64bit architectures. As we don't
want this ABI incompatibility, and there is no real 64bit user yet,
let's make it the fixed size with __u32.
Also bump the protocol version number to 0.1.2.
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/uapi/sound/compress_offload.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/uapi/sound/compress_offload.h b/include/uapi/sound/compress_offload.h
index 05341a4..9aa8624 100644
--- a/include/uapi/sound/compress_offload.h
+++ b/include/uapi/sound/compress_offload.h
@@ -30,7 +30,7 @@
#include <sound/compress_params.h>
-#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 0)
+#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 2)
/**
* struct snd_compressed_buffer: compressed buffer
* @fragment_size: size of buffer fragment in bytes
@@ -67,8 +67,8 @@ struct snd_compr_params {
struct snd_compr_tstamp {
__u32 byte_offset;
__u32 copied_total;
- snd_pcm_uframes_t pcm_frames;
- snd_pcm_uframes_t pcm_io_frames;
+ __u32 pcm_frames;
+ __u32 pcm_io_frames;
__u32 sampling_rate;
};
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 033/166] dm snapshot: avoid snapshot space leak on crash
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (31 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 032/166] ALSA: compress: Fix 64bit ABI incompatibility Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 034/166] dm table: fail dm_table_create on dm_round_up overflow Kamal Mostafa
` (132 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mikulas Patocka, Mike Snitzer, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 230c83afdd9cd384348475bea1e14b80b3b6b1b8 upstream.
There is a possible leak of snapshot space in case of crash.
The reason for space leaking is that chunks in the snapshot device are
allocated sequentially, but they are finished (and stored in the metadata)
out of order, depending on the order in which copying finished.
For example, supposed that the metadata contains the following records
SUPERBLOCK
METADATA (blocks 0 ... 250)
DATA 0
DATA 1
DATA 2
...
DATA 250
Now suppose that you allocate 10 new data blocks 251-260. Suppose that
copying of these blocks finish out of order (block 260 finished first
and the block 251 finished last). Now, the snapshot device looks like
this:
SUPERBLOCK
METADATA (blocks 0 ... 250, 260, 259, 258, 257, 256)
DATA 0
DATA 1
DATA 2
...
DATA 250
DATA 251
DATA 252
DATA 253
DATA 254
DATA 255
METADATA (blocks 255, 254, 253, 252, 251)
DATA 256
DATA 257
DATA 258
DATA 259
DATA 260
Now, if the machine crashes after writing the first metadata block but
before writing the second metadata block, the space for areas DATA 250-255
is leaked, it contains no valid data and it will never be used in the
future.
This patch makes dm-snapshot complete exceptions in the same order they
were allocated, thus fixing this bug.
Note: when backporting this patch to the stable kernel, change the version
field in the following way:
* if version in the stable kernel is {1, 11, 1}, change it to {1, 12, 0}
* if version in the stable kernel is {1, 10, 0} or {1, 10, 1}, change it
to {1, 10, 2}
Userspace reads the version to determine if the bug was fixed, so the
version change is needed.
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-snap.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 64 insertions(+), 7 deletions(-)
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 8b36c52..b06482b 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -66,6 +66,18 @@ struct dm_snapshot {
atomic_t pending_exceptions_count;
+ /* Protected by "lock" */
+ sector_t exception_start_sequence;
+
+ /* Protected by kcopyd single-threaded callback */
+ sector_t exception_complete_sequence;
+
+ /*
+ * A list of pending exceptions that completed out of order.
+ * Protected by kcopyd single-threaded callback.
+ */
+ struct list_head out_of_order_list;
+
mempool_t *pending_pool;
struct dm_exception_table pending;
@@ -170,6 +182,14 @@ struct dm_snap_pending_exception {
*/
int started;
+ /* There was copying error. */
+ int copy_error;
+
+ /* A sequence number, it is used for in-order completion. */
+ sector_t exception_sequence;
+
+ struct list_head out_of_order_entry;
+
/*
* For writing a complete chunk, bypassing the copy.
*/
@@ -1092,6 +1112,9 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
s->valid = 1;
s->active = 0;
atomic_set(&s->pending_exceptions_count, 0);
+ s->exception_start_sequence = 0;
+ s->exception_complete_sequence = 0;
+ INIT_LIST_HEAD(&s->out_of_order_list);
init_rwsem(&s->lock);
INIT_LIST_HEAD(&s->list);
spin_lock_init(&s->pe_lock);
@@ -1441,6 +1464,19 @@ static void commit_callback(void *context, int success)
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);
+}
+
/*
* Called when the copy I/O has finished. kcopyd actually runs
* this code so don't block.
@@ -1450,13 +1486,32 @@ static void copy_callback(int read_err, unsigned long write_err, void *context)
struct dm_snap_pending_exception *pe = context;
struct dm_snapshot *s = pe->snap;
- if (read_err || write_err)
- pending_complete(pe, 0);
+ pe->copy_error = read_err || write_err;
- else
- /* Update the metadata if we are persistent */
- s->store->type->commit_exception(s->store, &pe->e,
- commit_callback, pe);
+ if (pe->exception_sequence == s->exception_complete_sequence) {
+ s->exception_complete_sequence++;
+ complete_exception(pe);
+
+ while (!list_empty(&s->out_of_order_list)) {
+ pe = list_entry(s->out_of_order_list.next,
+ struct dm_snap_pending_exception, out_of_order_entry);
+ if (pe->exception_sequence != s->exception_complete_sequence)
+ break;
+ s->exception_complete_sequence++;
+ list_del(&pe->out_of_order_entry);
+ complete_exception(pe);
+ }
+ } else {
+ struct list_head *lh;
+ struct dm_snap_pending_exception *pe2;
+
+ list_for_each_prev(lh, &s->out_of_order_list) {
+ pe2 = list_entry(lh, struct dm_snap_pending_exception, out_of_order_entry);
+ if (pe2->exception_sequence < pe->exception_sequence)
+ break;
+ }
+ list_add(&pe->out_of_order_entry, lh);
+ }
}
/*
@@ -1551,6 +1606,8 @@ __find_pending_exception(struct dm_snapshot *s,
return NULL;
}
+ pe->exception_sequence = s->exception_start_sequence++;
+
dm_insert_exception(&s->pending, &pe->e);
return pe;
@@ -2190,7 +2247,7 @@ static struct target_type origin_target = {
static struct target_type snapshot_target = {
.name = "snapshot",
- .version = {1, 11, 1},
+ .version = {1, 12, 0},
.module = THIS_MODULE,
.ctr = snapshot_ctr,
.dtr = snapshot_dtr,
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 034/166] dm table: fail dm_table_create on dm_round_up overflow
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (32 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 033/166] dm snapshot: avoid snapshot space leak on crash Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 035/166] dm thin: switch to read only mode if a mapping insert fails Kamal Mostafa
` (131 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mikulas Patocka, Mike Snitzer, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 5b2d06576c5410c10d95adfd5c4d8b24de861d87 upstream.
The dm_round_up function may overflow to zero. In this case,
dm_table_create() must fail rather than go on to allocate an empty array
with alloc_targets().
This fixes a possible memory corruption that could be caused by passing
too large a number in "param->target_count".
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-table.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index ee51e08..f5e5ed5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -215,6 +215,11 @@ int dm_table_create(struct dm_table **result, fmode_t mode,
num_targets = dm_round_up(num_targets, KEYS_PER_NODE);
+ if (!num_targets) {
+ kfree(t);
+ return -ENOMEM;
+ }
+
if (alloc_targets(t, num_targets)) {
kfree(t);
t = NULL;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 035/166] dm thin: switch to read only mode if a mapping insert fails
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (33 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 034/166] dm table: fail dm_table_create on dm_round_up overflow Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 036/166] dm thin: switch to read-only mode if metadata space is exhausted Kamal Mostafa
` (130 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Joe Thornber, Mike Snitzer, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Thornber <ejt@redhat.com>
commit fafc7a815e40255d24e80a1cb7365892362fa398 upstream.
Switch the thin pool to read-only mode when dm_thin_insert_block() fails
since there is little reason to expect the cause of the failure to be
resolved without further action by user space.
This issue was noticed with the device-mapper-test-suite using:
dmtest run --suite thin-provisioning -n /exhausting_metadata_space_causes_fail_mode/
The quantity of errors logged in this case must be reduced.
before patch:
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map metadata: unable to allocate new metadata block
<snip ... these repeat for a long while ... >
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map common: dm_tm_shadow_block() failed
device-mapper: thin: 253:4: no free metadata space available.
device-mapper: thin: 253:4: switching pool to read-only mode
after patch:
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: 253:4: dm_thin_insert_block() failed: error = -28
device-mapper: thin: 253:4: switching pool to read-only mode
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/dm-thin.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 2d3a2af..a3d00dd 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -547,6 +547,7 @@ static void process_prepared_mapping_fail(struct dm_thin_new_mapping *m)
static void process_prepared_mapping(struct dm_thin_new_mapping *m)
{
struct thin_c *tc = m->tc;
+ struct pool *pool = tc->pool;
struct bio *bio;
int r;
@@ -566,7 +567,9 @@ static void process_prepared_mapping(struct dm_thin_new_mapping *m)
*/
r = dm_thin_insert_block(tc->td, m->virt_block, m->data_block);
if (r) {
- DMERR_LIMIT("dm_thin_insert_block() failed");
+ DMERR_LIMIT("%s: dm_thin_insert_block() failed: error = %d",
+ dm_device_name(pool->pool_md), r);
+ set_pool_mode(pool, PM_READ_ONLY);
dm_cell_error(m->cell);
goto out;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 036/166] dm thin: switch to read-only mode if metadata space is exhausted
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (34 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 035/166] dm thin: switch to read only mode if a mapping insert fails Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 037/166] dm thin: always fallback the pool mode if commit fails Kamal Mostafa
` (129 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Mike Snitzer, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <snitzer@redhat.com>
commit 4a02b34e0cf1d0d0dd3737702841da4bf615a50a upstream.
Switch the thin pool to read-only mode in alloc_data_block() if
dm_pool_alloc_data_block() fails because the pool's metadata space is
exhausted.
Differentiate between data and metadata space in messages about no
free space available.
This issue was noticed with the device-mapper-test-suite using:
dmtest run --suite thin-provisioning -n /exhausting_metadata_space_causes_fail_mode/
The quantity of errors logged in this case must be reduced.
before patch:
device-mapper: thin: 253:4: reached low water mark for metadata device: sending event.
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map common: dm_tm_shadow_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map common: dm_tm_shadow_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map common: dm_tm_shadow_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map common: dm_tm_shadow_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map common: dm_tm_shadow_block() failed
<snip ... these repeat for a _very_ long while ... >
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: 253:4: commit failed: error = -28
device-mapper: thin: 253:4: switching pool to read-only mode
after patch:
device-mapper: thin: 253:4: reached low water mark for metadata device: sending event.
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: 253:4: no free metadata space available.
device-mapper: thin: 253:4: switching pool to read-only mode
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/dm-thin.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index a3d00dd..c29e967 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -878,7 +878,7 @@ static int alloc_data_block(struct thin_c *tc, dm_block_t *result)
* doing all this checking and return -ENOSPC.
*/
if (!free_blocks) {
- DMWARN("%s: no free space available.",
+ DMWARN("%s: no free data space available.",
dm_device_name(pool->pool_md));
spin_lock_irqsave(&pool->lock, flags);
pool->no_free_space = 1;
@@ -889,8 +889,16 @@ static int alloc_data_block(struct thin_c *tc, dm_block_t *result)
}
r = dm_pool_alloc_data_block(pool->pmd, result);
- if (r)
+ if (r) {
+ if (r == -ENOSPC &&
+ !dm_pool_get_free_metadata_block_count(pool->pmd, &free_blocks) &&
+ !free_blocks) {
+ DMWARN("%s: no free metadata space available.",
+ dm_device_name(pool->pool_md));
+ set_pool_mode(pool, PM_READ_ONLY);
+ }
return r;
+ }
return 0;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 037/166] dm thin: always fallback the pool mode if commit fails
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (35 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 036/166] dm thin: switch to read-only mode if metadata space is exhausted Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 038/166] dm thin: re-establish read-only state when switching to fail mode Kamal Mostafa
` (128 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Joe Thornber, Mike Snitzer, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Thornber <ejt@redhat.com>
commit 020cc3b5e28c2e24f59f53a9154faf08564f308e upstream.
Rename commit_or_fallback() to commit(). Now all previous calls to
commit() will trigger the pool mode to fallback if the commit fails.
Also, check the error returned from commit() in alloc_data_block().
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/dm-thin.c | 36 +++++++++++++++---------------------
1 file changed, 15 insertions(+), 21 deletions(-)
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index c29e967..7ac3dd4 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -810,31 +810,23 @@ static void schedule_zero(struct thin_c *tc, dm_block_t virt_block,
}
}
-static int commit(struct pool *pool)
-{
- int r;
-
- r = dm_pool_commit_metadata(pool->pmd);
- if (r)
- DMERR_LIMIT("commit failed: error = %d", r);
-
- return r;
-}
-
/*
* A non-zero return indicates read_only or fail_io mode.
* Many callers don't care about the return value.
*/
-static int commit_or_fallback(struct pool *pool)
+static int commit(struct pool *pool)
{
int r;
if (get_pool_mode(pool) != PM_WRITE)
return -EINVAL;
- r = commit(pool);
- if (r)
+ r = dm_pool_commit_metadata(pool->pmd);
+ if (r) {
+ DMERR_LIMIT("%s: dm_pool_commit_metadata failed: error = %d",
+ dm_device_name(pool->pool_md), r);
set_pool_mode(pool, PM_READ_ONLY);
+ }
return r;
}
@@ -867,7 +859,9 @@ static int alloc_data_block(struct thin_c *tc, dm_block_t *result)
* Try to commit to see if that will free up some
* more space.
*/
- (void) commit_or_fallback(pool);
+ r = commit(pool);
+ if (r)
+ return r;
r = dm_pool_get_free_block_count(pool->pmd, &free_blocks);
if (r)
@@ -1271,7 +1265,7 @@ static void process_deferred_bios(struct pool *pool)
if (bio_list_empty(&bios) && !need_commit_due_to_time(pool))
return;
- if (commit_or_fallback(pool)) {
+ if (commit(pool)) {
while ((bio = bio_list_pop(&bios)))
bio_io_error(bio);
return;
@@ -2056,7 +2050,7 @@ static int pool_preresume(struct dm_target *ti)
return r;
}
- (void) commit_or_fallback(pool);
+ (void) commit(pool);
}
return 0;
@@ -2084,7 +2078,7 @@ static void pool_postsuspend(struct dm_target *ti)
cancel_delayed_work(&pool->waker);
flush_workqueue(pool->wq);
- (void) commit_or_fallback(pool);
+ (void) commit(pool);
}
static int check_arg_count(unsigned argc, unsigned args_required)
@@ -2218,7 +2212,7 @@ static int process_reserve_metadata_snap_mesg(unsigned argc, char **argv, struct
if (r)
return r;
- (void) commit_or_fallback(pool);
+ (void) commit(pool);
r = dm_pool_reserve_metadata_snap(pool->pmd);
if (r)
@@ -2280,7 +2274,7 @@ static int pool_message(struct dm_target *ti, unsigned argc, char **argv)
DMWARN("Unrecognised thin pool target message received: %s", argv[0]);
if (!r)
- (void) commit_or_fallback(pool);
+ (void) commit(pool);
return r;
}
@@ -2335,7 +2329,7 @@ static void pool_status(struct dm_target *ti, status_type_t type,
/* Commit to ensure statistics aren't out-of-date */
if (!(status_flags & DM_STATUS_NOFLUSH_FLAG) && !dm_suspended(ti))
- (void) commit_or_fallback(pool);
+ (void) commit(pool);
r = dm_pool_get_metadata_transaction_id(pool->pmd, &transaction_id);
if (r) {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 038/166] dm thin: re-establish read-only state when switching to fail mode
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (36 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 037/166] dm thin: always fallback the pool mode if commit fails Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 039/166] dm thin: allow pool in read-only mode to transition to read-write mode Kamal Mostafa
` (127 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Joe Thornber, Mike Snitzer, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Thornber <ejt@redhat.com>
commit 5383ef3a929a1366e2ced45cd6d74be7aa2a2281 upstream.
If the thin-pool transitioned to fail mode and the thin-pool's table
were reloaded for some reason: the new table's default pool mode would
be read-write, though it will transition to fail mode during resume.
When the pool mode transitions directly from PM_WRITE to PM_FAIL we need
to re-establish the intermediate read-only state in both the metadata
and persistent-data block manager (as is usually done with the normal
pool mode transition sequence: PM_WRITE -> PM_READ_ONLY -> PM_FAIL).
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/dm-thin.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 7ac3dd4..bc7d4a3 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -1312,6 +1312,7 @@ static void set_pool_mode(struct pool *pool, enum pool_mode mode)
switch (mode) {
case PM_FAIL:
DMERR("switching pool to failure mode");
+ dm_pool_metadata_read_only(pool->pmd);
pool->process_bio = process_bio_fail;
pool->process_discard = process_bio_fail;
pool->process_prepared_mapping = process_prepared_mapping_fail;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 039/166] dm thin: allow pool in read-only mode to transition to read-write mode
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (37 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 038/166] dm thin: re-establish read-only state when switching to fail mode Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 040/166] x86, build, icc: Remove uninitialized_var() from compiler-intel.h Kamal Mostafa
` (126 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Joe Thornber, Mike Snitzer, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Thornber <ejt@redhat.com>
commit 9b7aaa64f96f7ca280d75326fca42f42017b89ef upstream.
A thin-pool may be in read-only mode because the pool's data or metadata
space was exhausted. To allow for recovery, by adding more space to the
pool, we must allow a pool to transition from PM_READ_ONLY to PM_WRITE
mode. Otherwise, running out of space will render the pool permanently
read-only.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/dm-thin-metadata.c | 9 +++++++++
drivers/md/dm-thin-metadata.h | 1 +
drivers/md/dm-thin.c | 12 ++++++++++--
drivers/md/persistent-data/dm-block-manager.c | 6 ++++++
drivers/md/persistent-data/dm-block-manager.h | 1 +
5 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c
index 4d6e853..0368a69 100644
--- a/drivers/md/dm-thin-metadata.c
+++ b/drivers/md/dm-thin-metadata.c
@@ -1684,3 +1684,12 @@ void dm_pool_metadata_read_only(struct dm_pool_metadata *pmd)
dm_bm_set_read_only(pmd->bm);
up_write(&pmd->root_lock);
}
+
+void dm_pool_metadata_read_write(struct dm_pool_metadata *pmd)
+{
+ down_write(&pmd->root_lock);
+ pmd->read_only = false;
+ dm_bm_set_read_write(pmd->bm);
+ up_write(&pmd->root_lock);
+}
+
diff --git a/drivers/md/dm-thin-metadata.h b/drivers/md/dm-thin-metadata.h
index 0cecc37..050a9ad 100644
--- a/drivers/md/dm-thin-metadata.h
+++ b/drivers/md/dm-thin-metadata.h
@@ -191,6 +191,7 @@ int dm_pool_resize_data_dev(struct dm_pool_metadata *pmd, dm_block_t new_size);
* that nothing is changing.
*/
void dm_pool_metadata_read_only(struct dm_pool_metadata *pmd);
+void dm_pool_metadata_read_write(struct dm_pool_metadata *pmd);
/*----------------------------------------------------------------*/
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index bc7d4a3..44a715f 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -1335,6 +1335,7 @@ static void set_pool_mode(struct pool *pool, enum pool_mode mode)
break;
case PM_WRITE:
+ dm_pool_metadata_read_write(pool->pmd);
pool->process_bio = process_bio;
pool->process_discard = process_discard;
pool->process_prepared_mapping = process_prepared_mapping;
@@ -1545,12 +1546,19 @@ static int bind_control_target(struct pool *pool, struct dm_target *ti)
struct pool_c *pt = ti->private;
/*
- * We want to make sure that degraded pools are never upgraded.
+ * We want to make sure that a pool in PM_FAIL mode is never upgraded.
*/
enum pool_mode old_mode = pool->pf.mode;
enum pool_mode new_mode = pt->adjusted_pf.mode;
- if (old_mode > new_mode)
+ /*
+ * If we were in PM_FAIL mode, rollback of metadata failed. We're
+ * not going to recover without a thin_repair. So we never let the
+ * pool move out of the old mode. On the other hand a PM_READ_ONLY
+ * may have been due to a lack of metadata or data space, and may
+ * now work (ie. if the underlying devices have been resized).
+ */
+ if (old_mode == PM_FAIL)
new_mode = old_mode;
pool->ti = ti;
diff --git a/drivers/md/persistent-data/dm-block-manager.c b/drivers/md/persistent-data/dm-block-manager.c
index 28c3ed0..53281f4 100644
--- a/drivers/md/persistent-data/dm-block-manager.c
+++ b/drivers/md/persistent-data/dm-block-manager.c
@@ -620,6 +620,12 @@ void dm_bm_set_read_only(struct dm_block_manager *bm)
}
EXPORT_SYMBOL_GPL(dm_bm_set_read_only);
+void dm_bm_set_read_write(struct dm_block_manager *bm)
+{
+ bm->read_only = false;
+}
+EXPORT_SYMBOL_GPL(dm_bm_set_read_write);
+
u32 dm_bm_checksum(const void *data, size_t len, u32 init_xor)
{
return crc32c(~(u32) 0, data, len) ^ init_xor;
diff --git a/drivers/md/persistent-data/dm-block-manager.h b/drivers/md/persistent-data/dm-block-manager.h
index be5bff6..84dbab5 100644
--- a/drivers/md/persistent-data/dm-block-manager.h
+++ b/drivers/md/persistent-data/dm-block-manager.h
@@ -120,6 +120,7 @@ int dm_bm_flush_and_unlock(struct dm_block_manager *bm,
* be returned if you do.
*/
void dm_bm_set_read_only(struct dm_block_manager *bm);
+void dm_bm_set_read_write(struct dm_block_manager *bm);
u32 dm_bm_checksum(const void *data, size_t len, u32 init_xor);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 040/166] x86, build, icc: Remove uninitialized_var() from compiler-intel.h
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (38 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 039/166] dm thin: allow pool in read-only mode to transition to read-write mode Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 041/166] x86, efi: Don't use (U)EFI time services on 32 bit Kamal Mostafa
` (125 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Kevin B. Smith, H. Peter Anvin, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: "H. Peter Anvin" <hpa@linux.intel.com>
commit 503cf95c061a0551eb684da364509297efbe55d9 upstream.
When compiling with icc, <linux/compiler-gcc.h> ends up included
because the icc environment defines __GNUC__. Thus, we neither need
nor want to have this macro defined in both compiler-gcc.h and
compiler-intel.h, and the fact that they are inconsistent just makes
the compiler spew warnings.
Reported-by: Sunil K. Pandey <sunil.k.pandey@intel.com>
Cc: Kevin B. Smith <kevin.b.smith@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Link: http://lkml.kernel.org/n/tip-0mbwou1zt7pafij09b897lg3@git.kernel.org
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/compiler-intel.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h
index 973ce10..dc1bd3d 100644
--- a/include/linux/compiler-intel.h
+++ b/include/linux/compiler-intel.h
@@ -28,8 +28,6 @@
#endif
-#define uninitialized_var(x) x
-
#ifndef __HAVE_BUILTIN_BSWAP16__
/* icc has this, but it's called _bswap16 */
#define __HAVE_BUILTIN_BSWAP16__
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 041/166] x86, efi: Don't use (U)EFI time services on 32 bit
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (39 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 040/166] x86, build, icc: Remove uninitialized_var() from compiler-intel.h Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 042/166] dm bufio: initialize read-only module parameters Kamal Mostafa
` (124 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Matthew Garrett, Matt Fleming, H. Peter Anvin, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Garrett <matthew.garrett@nebula.com>
commit 04bf9ba720fcc4fa313fa122b799ae0989b6cd50 upstream.
UEFI time services are often broken once we're in virtual mode. We were
already refusing to use them on 64-bit systems, but it turns out that
they're also broken on some 32-bit firmware, including the Dell Venue.
Disable them for now, we can revisit once we have the 1:1 mappings code
incorporated.
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Link: http://lkml.kernel.org/r/1385754283-2464-1-git-send-email-matthew.garrett@nebula.com
Cc: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/platform/efi/efi.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index cc657c8..2a5d329 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -756,13 +756,6 @@ void __init efi_init(void)
set_bit(EFI_MEMMAP, &x86_efi_facility);
-#ifdef CONFIG_X86_32
- if (efi_is_native()) {
- x86_platform.get_wallclock = efi_get_time;
- x86_platform.set_wallclock = efi_set_rtc_mmss;
- }
-#endif
-
#if EFI_DEBUG
print_efi_memmap();
#endif
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 042/166] dm bufio: initialize read-only module parameters
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (40 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 041/166] x86, efi: Don't use (U)EFI time services on 32 bit Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 043/166] ALSA: hda - hdmi: Fix IEC958 ctl indexes for some simple HDMI devices Kamal Mostafa
` (123 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mikulas Patocka, Mike Snitzer, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 4cb57ab4a2e61978f3a9b7d4f53988f30d61c27f upstream.
Some module parameters in dm-bufio are read-only. These parameters
inform the user about memory consumption. They are not supposed to be
changed by the user.
However, despite being read-only, these parameters can be set on
modprobe or insmod command line, for example:
modprobe dm-bufio current_allocated_bytes=12345
The kernel doesn't expect that these variables can be non-zero at module
initialization and if the user sets them, it results in BUG.
This patch initializes the variables in the module init routine, so that
user-supplied values are ignored.
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-bufio.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index 5d2c26e..6ef007b 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -1661,6 +1661,11 @@ static int __init dm_bufio_init(void)
{
__u64 mem;
+ dm_bufio_allocated_kmem_cache = 0;
+ dm_bufio_allocated_get_free_pages = 0;
+ dm_bufio_allocated_vmalloc = 0;
+ dm_bufio_current_allocated = 0;
+
memset(&dm_bufio_caches, 0, sizeof dm_bufio_caches);
memset(&dm_bufio_cache_names, 0, sizeof dm_bufio_cache_names);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 043/166] ALSA: hda - hdmi: Fix IEC958 ctl indexes for some simple HDMI devices
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (41 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 042/166] dm bufio: initialize read-only module parameters Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 044/166] ARM: pxa: tosa: fix keys mapping Kamal Mostafa
` (122 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Anssi Hannula, Takashi Iwai, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Anssi Hannula <anssi.hannula@iki.fi>
commit c9a6338aecdb92f9d015ecc26d203e54250bebbb upstream.
In case a single HDA card has both HDMI and S/PDIF outputs, the S/PDIF
outputs will have their IEC958 controls created starting from index 16
and the HDMI controls will be created starting from index 0.
However, HDMI simple_playback_build_controls() as used by old VIA and
NVIDIA codecs incorrectly requests the IEC958 controls to be created
with an S/PDIF type instead of HDMI.
In case the card has other codecs that have HDMI outputs, the controls
will be created with wrong index=16, causing them to e.g. be unreachable
by the ALSA "hdmi" alias.
Fix that by making simple_playback_build_controls() request controls
with HDMI indexes.
Not many cards have an affected configuration, but e.g. ASUS M3N78-VM
contains an integrated NVIDIA HDA "card" with:
- a VIA codec that has, among others, an S/PDIF pin incorrectly
labelled as an HDMI pin, and
- an NVIDIA MCP7x HDMI codec.
Reported-by: MysterX on #openelec
Tested-by: MysterX on #openelec
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/patch_hdmi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 01b98b0..027e4f0 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1800,9 +1800,9 @@ static int simple_playback_build_controls(struct hda_codec *codec)
struct hdmi_spec *spec = codec->spec;
int err;
- err = snd_hda_create_spdif_out_ctls(codec,
- spec->cvts[0].cvt_nid,
- spec->cvts[0].cvt_nid);
+ err = snd_hda_create_dig_out_ctls(codec, spec->cvts[0].cvt_nid,
+ spec->cvts[0].cvt_nid,
+ HDA_PCM_TYPE_HDMI);
if (err < 0)
return err;
return simple_hdmi_build_jack(codec, 0);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 044/166] ARM: pxa: tosa: fix keys mapping
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (42 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 043/166] ALSA: hda - hdmi: Fix IEC958 ctl indexes for some simple HDMI devices Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 045/166] ARM: pxa: prevent PXA270 occasional reboot freezes Kamal Mostafa
` (121 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dmitry Eremin-Solenikov, Haojian Zhuang, Olof Johansson,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
commit 506cac15ac86f204b83e3cfccde73eeb4e7c5f34 upstream.
When converting from tosa-keyboard driver to matrix keyboard, tosa keys
received extra 1 column shift. Replace that with correct values to make
keyboard work again.
Fixes: f69a6548c9d5 ('[ARM] pxa/tosa: make use of the matrix keypad driver')
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/mach-pxa/tosa.c | 102 +++++++++++++++++++++++------------------------
1 file changed, 51 insertions(+), 51 deletions(-)
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 233629e..c7ff6d4 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -424,57 +424,57 @@ static struct platform_device tosa_power_device = {
* Tosa Keyboard
*/
static const uint32_t tosakbd_keymap[] = {
- KEY(0, 2, KEY_W),
- KEY(0, 6, KEY_K),
- KEY(0, 7, KEY_BACKSPACE),
- KEY(0, 8, KEY_P),
- KEY(1, 1, KEY_Q),
- KEY(1, 2, KEY_E),
- KEY(1, 3, KEY_T),
- KEY(1, 4, KEY_Y),
- KEY(1, 6, KEY_O),
- KEY(1, 7, KEY_I),
- KEY(1, 8, KEY_COMMA),
- KEY(2, 1, KEY_A),
- KEY(2, 2, KEY_D),
- KEY(2, 3, KEY_G),
- KEY(2, 4, KEY_U),
- KEY(2, 6, KEY_L),
- KEY(2, 7, KEY_ENTER),
- KEY(2, 8, KEY_DOT),
- KEY(3, 1, KEY_Z),
- KEY(3, 2, KEY_C),
- KEY(3, 3, KEY_V),
- KEY(3, 4, KEY_J),
- KEY(3, 5, TOSA_KEY_ADDRESSBOOK),
- KEY(3, 6, TOSA_KEY_CANCEL),
- KEY(3, 7, TOSA_KEY_CENTER),
- KEY(3, 8, TOSA_KEY_OK),
- KEY(3, 9, KEY_LEFTSHIFT),
- KEY(4, 1, KEY_S),
- KEY(4, 2, KEY_R),
- KEY(4, 3, KEY_B),
- KEY(4, 4, KEY_N),
- KEY(4, 5, TOSA_KEY_CALENDAR),
- KEY(4, 6, TOSA_KEY_HOMEPAGE),
- KEY(4, 7, KEY_LEFTCTRL),
- KEY(4, 8, TOSA_KEY_LIGHT),
- KEY(4, 10, KEY_RIGHTSHIFT),
- KEY(5, 1, KEY_TAB),
- KEY(5, 2, KEY_SLASH),
- KEY(5, 3, KEY_H),
- KEY(5, 4, KEY_M),
- KEY(5, 5, TOSA_KEY_MENU),
- KEY(5, 7, KEY_UP),
- KEY(5, 11, TOSA_KEY_FN),
- KEY(6, 1, KEY_X),
- KEY(6, 2, KEY_F),
- KEY(6, 3, KEY_SPACE),
- KEY(6, 4, KEY_APOSTROPHE),
- KEY(6, 5, TOSA_KEY_MAIL),
- KEY(6, 6, KEY_LEFT),
- KEY(6, 7, KEY_DOWN),
- KEY(6, 8, KEY_RIGHT),
+ KEY(0, 1, KEY_W),
+ KEY(0, 5, KEY_K),
+ KEY(0, 6, KEY_BACKSPACE),
+ KEY(0, 7, KEY_P),
+ KEY(1, 0, KEY_Q),
+ KEY(1, 1, KEY_E),
+ KEY(1, 2, KEY_T),
+ KEY(1, 3, KEY_Y),
+ KEY(1, 5, KEY_O),
+ KEY(1, 6, KEY_I),
+ KEY(1, 7, KEY_COMMA),
+ KEY(2, 0, KEY_A),
+ KEY(2, 1, KEY_D),
+ KEY(2, 2, KEY_G),
+ KEY(2, 3, KEY_U),
+ KEY(2, 5, KEY_L),
+ KEY(2, 6, KEY_ENTER),
+ KEY(2, 7, KEY_DOT),
+ KEY(3, 0, KEY_Z),
+ KEY(3, 1, KEY_C),
+ KEY(3, 2, KEY_V),
+ KEY(3, 3, KEY_J),
+ KEY(3, 4, TOSA_KEY_ADDRESSBOOK),
+ KEY(3, 5, TOSA_KEY_CANCEL),
+ KEY(3, 6, TOSA_KEY_CENTER),
+ KEY(3, 7, TOSA_KEY_OK),
+ KEY(3, 8, KEY_LEFTSHIFT),
+ KEY(4, 0, KEY_S),
+ KEY(4, 1, KEY_R),
+ KEY(4, 2, KEY_B),
+ KEY(4, 3, KEY_N),
+ KEY(4, 4, TOSA_KEY_CALENDAR),
+ KEY(4, 5, TOSA_KEY_HOMEPAGE),
+ KEY(4, 6, KEY_LEFTCTRL),
+ KEY(4, 7, TOSA_KEY_LIGHT),
+ KEY(4, 9, KEY_RIGHTSHIFT),
+ KEY(5, 0, KEY_TAB),
+ KEY(5, 1, KEY_SLASH),
+ KEY(5, 2, KEY_H),
+ KEY(5, 3, KEY_M),
+ KEY(5, 4, TOSA_KEY_MENU),
+ KEY(5, 6, KEY_UP),
+ KEY(5, 10, TOSA_KEY_FN),
+ KEY(6, 0, KEY_X),
+ KEY(6, 1, KEY_F),
+ KEY(6, 2, KEY_SPACE),
+ KEY(6, 3, KEY_APOSTROPHE),
+ KEY(6, 4, TOSA_KEY_MAIL),
+ KEY(6, 5, KEY_LEFT),
+ KEY(6, 6, KEY_DOWN),
+ KEY(6, 7, KEY_RIGHT),
};
static struct matrix_keymap_data tosakbd_keymap_data = {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 045/166] ARM: pxa: prevent PXA270 occasional reboot freezes
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (43 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 044/166] ARM: pxa: tosa: fix keys mapping Kamal Mostafa
@ 2014-01-15 21:50 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 046/166] hwmon: (w83l786ng) Fix fan speed control mode setting and reporting Kamal Mostafa
` (120 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:50 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sergei Ianovich, Haojian Zhuang, Olof Johansson, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergei Ianovich <ynvich@gmail.com>
commit ff88b4724fde18056a4c539f7327389aec0f4c2d upstream.
Erratum 71 of PXA270M Processor Family Specification Update
(April 19, 2010) explains that watchdog reset time is just
8us insead of 10ms in EMTS.
If SDRAM is not reset, it causes memory bus congestion and
the device hangs. We put SDRAM in selfresh mode before watchdog
reset, removing potential freezes.
Without this patch PXA270-based ICP DAS LP-8x4x hangs after up to 40
reboots. With this patch it has successfully rebooted 500 times.
Signed-off-by: Sergei Ianovich <ynvich@gmail.com>
Tested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/mach-pxa/reset.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-pxa/reset.c b/arch/arm/mach-pxa/reset.c
index 3fab583..0616390 100644
--- a/arch/arm/mach-pxa/reset.c
+++ b/arch/arm/mach-pxa/reset.c
@@ -13,6 +13,7 @@
#include <mach/regs-ost.h>
#include <mach/reset.h>
+#include <mach/smemc.h>
unsigned int reset_status;
EXPORT_SYMBOL(reset_status);
@@ -81,6 +82,12 @@ static void do_hw_reset(void)
writel_relaxed(OSSR_M3, OSSR);
/* ... in 100 ms */
writel_relaxed(readl_relaxed(OSCR) + 368640, OSMR3);
+ /*
+ * SDRAM hangs on watchdog reset on Marvell PXA270 (erratum 71)
+ * we put SDRAM into self-refresh to prevent that
+ */
+ while (1)
+ writel_relaxed(MDREFR_SLFRSH, MDREFR);
}
void pxa_restart(char mode, const char *cmd)
@@ -104,4 +111,3 @@ void pxa_restart(char mode, const char *cmd)
break;
}
}
-
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 046/166] hwmon: (w83l786ng) Fix fan speed control mode setting and reporting
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (44 preceding siblings ...)
2014-01-15 21:50 ` [PATCH 3.8 045/166] ARM: pxa: prevent PXA270 occasional reboot freezes Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 047/166] hwmon: (w83l768ng) Fix fan speed control range Kamal Mostafa
` (119 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Brian Carnes, Jean Delvare, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Brian Carnes <bmcarnes@gmail.com>
commit cf7559bc053471f32373d71d04a9aa19e0b48d59 upstream.
The wrong mask is used, which causes some fan speed control modes
(pwmX_enable) to be incorrectly reported, and some modes to be
impossible to set.
[JD: add subject and description.]
Signed-off-by: Brian Carnes <bmcarnes@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/hwmon/w83l786ng.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hwmon/w83l786ng.c b/drivers/hwmon/w83l786ng.c
index 79710bc..c7514e0 100644
--- a/drivers/hwmon/w83l786ng.c
+++ b/drivers/hwmon/w83l786ng.c
@@ -511,7 +511,7 @@ store_pwm_enable(struct device *dev, struct device_attribute *attr,
mutex_lock(&data->update_lock);
reg = w83l786ng_read_value(client, W83L786NG_REG_FAN_CFG);
data->pwm_enable[nr] = val;
- reg &= ~(0x02 << W83L786NG_PWM_ENABLE_SHIFT[nr]);
+ reg &= ~(0x03 << W83L786NG_PWM_ENABLE_SHIFT[nr]);
reg |= (val - 1) << W83L786NG_PWM_ENABLE_SHIFT[nr];
w83l786ng_write_value(client, W83L786NG_REG_FAN_CFG, reg);
mutex_unlock(&data->update_lock);
@@ -777,7 +777,7 @@ static struct w83l786ng_data *w83l786ng_update_device(struct device *dev)
((pwmcfg >> W83L786NG_PWM_MODE_SHIFT[i]) & 1)
? 0 : 1;
data->pwm_enable[i] =
- ((pwmcfg >> W83L786NG_PWM_ENABLE_SHIFT[i]) & 2) + 1;
+ ((pwmcfg >> W83L786NG_PWM_ENABLE_SHIFT[i]) & 3) + 1;
data->pwm[i] = w83l786ng_read_value(client,
W83L786NG_REG_PWM[i]);
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 047/166] hwmon: (w83l768ng) Fix fan speed control range
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (45 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 046/166] hwmon: (w83l786ng) Fix fan speed control mode setting and reporting Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 048/166] hwmon: Prevent some divide by zeros in FAN_TO_REG() Kamal Mostafa
` (118 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Jean Delvare, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean Delvare <khali@linux-fr.org>
commit 33a7ab91d509fa33b4bcd3ce0038cc80298050da upstream.
The W83L786NG stores the fan speed on 4 bits while the sysfs interface
uses a 0-255 range. Thus the driver should scale the user input down
to map it to the device range, and scale up the value read from the
device before presenting it to the user. The reserved register nibble
should be left unchanged.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/hwmon/w83l786ng.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/hwmon/w83l786ng.c b/drivers/hwmon/w83l786ng.c
index c7514e0..0cce70c 100644
--- a/drivers/hwmon/w83l786ng.c
+++ b/drivers/hwmon/w83l786ng.c
@@ -482,9 +482,11 @@ store_pwm(struct device *dev, struct device_attribute *attr,
if (err)
return err;
val = SENSORS_LIMIT(val, 0, 255);
+ val = DIV_ROUND_CLOSEST(val, 0x11);
mutex_lock(&data->update_lock);
- data->pwm[nr] = val;
+ data->pwm[nr] = val * 0x11;
+ val |= w83l786ng_read_value(client, W83L786NG_REG_PWM[nr]) & 0xf0;
w83l786ng_write_value(client, W83L786NG_REG_PWM[nr], val);
mutex_unlock(&data->update_lock);
return count;
@@ -778,8 +780,9 @@ static struct w83l786ng_data *w83l786ng_update_device(struct device *dev)
? 0 : 1;
data->pwm_enable[i] =
((pwmcfg >> W83L786NG_PWM_ENABLE_SHIFT[i]) & 3) + 1;
- data->pwm[i] = w83l786ng_read_value(client,
- W83L786NG_REG_PWM[i]);
+ data->pwm[i] =
+ (w83l786ng_read_value(client, W83L786NG_REG_PWM[i])
+ & 0x0f) * 0x11;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 048/166] hwmon: Prevent some divide by zeros in FAN_TO_REG()
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (46 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 047/166] hwmon: (w83l768ng) Fix fan speed control range Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 049/166] Btrfs: fix access_ok() check in btrfs_ioctl_send() Kamal Mostafa
` (117 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dan Carpenter, Jean Delvare, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <dan.carpenter@oracle.com>
commit 3806b45ba4655147a011df03242cc197ab986c43 upstream.
The "rpm * div" operations can overflow here, so this patch adds an
upper limit to rpm to prevent that. Jean Delvare helped me with this
patch.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Roger Lucas <vt8231@hiddenengine.co.uk>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/hwmon/lm78.c | 2 ++
drivers/hwmon/sis5595.c | 2 ++
drivers/hwmon/vt8231.c | 2 +-
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c
index 53d6ee8..e6b2897 100644
--- a/drivers/hwmon/lm78.c
+++ b/drivers/hwmon/lm78.c
@@ -94,6 +94,8 @@ static inline u8 FAN_TO_REG(long rpm, int div)
{
if (rpm <= 0)
return 255;
+ if (rpm > 1350000)
+ return 1;
return SENSORS_LIMIT((1350000 + rpm * div / 2) / (rpm * div), 1, 254);
}
diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c
index 06ce3c9..9fcffa9 100644
--- a/drivers/hwmon/sis5595.c
+++ b/drivers/hwmon/sis5595.c
@@ -141,6 +141,8 @@ static inline u8 FAN_TO_REG(long rpm, int div)
{
if (rpm <= 0)
return 255;
+ if (rpm > 1350000)
+ return 1;
return SENSORS_LIMIT((1350000 + rpm * div / 2) / (rpm * div), 1, 254);
}
diff --git a/drivers/hwmon/vt8231.c b/drivers/hwmon/vt8231.c
index a56355c..2aaa5ec 100644
--- a/drivers/hwmon/vt8231.c
+++ b/drivers/hwmon/vt8231.c
@@ -145,7 +145,7 @@ static const u8 regtempmin[] = { 0x3a, 0x3e, 0x2c, 0x2e, 0x30, 0x32 };
*/
static inline u8 FAN_TO_REG(long rpm, int div)
{
- if (rpm == 0)
+ if (rpm <= 0 || rpm > 1310720)
return 0;
return SENSORS_LIMIT(1310720 / (rpm * div), 1, 255);
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 049/166] Btrfs: fix access_ok() check in btrfs_ioctl_send()
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (47 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 048/166] hwmon: Prevent some divide by zeros in FAN_TO_REG() Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 050/166] futex: fix handling of read-only-mapped hugepages Kamal Mostafa
` (116 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dan Carpenter, Chris Mason, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <dan.carpenter@oracle.com>
commit 700ff4f095d78af0998953e922e041d75254518b upstream.
The closing parenthesis is in the wrong place. We want to check
"sizeof(*arg->clone_sources) * arg->clone_sources_count" instead of
"sizeof(*arg->clone_sources * arg->clone_sources_count)".
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/btrfs/send.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 321b7fb..a89d788 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -4555,8 +4555,8 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
}
if (!access_ok(VERIFY_READ, arg->clone_sources,
- sizeof(*arg->clone_sources *
- arg->clone_sources_count))) {
+ sizeof(*arg->clone_sources) *
+ arg->clone_sources_count)) {
ret = -EFAULT;
goto out;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 050/166] futex: fix handling of read-only-mapped hugepages
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (48 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 049/166] Btrfs: fix access_ok() check in btrfs_ioctl_send() Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 051/166] KVM: Improve create VCPU parameter (CVE-2013-4587) Kamal Mostafa
` (115 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mel Gorman, Darren Hart, Andrea Arcangeli, Oleg Nesterov,
Linus Torvalds, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <torvalds@linux-foundation.org>
commit f12d5bfceb7e1f9051563381ec047f7f13956c3c upstream.
The hugepage code had the exact same bug that regular pages had in
commit 7485d0d3758e ("futexes: Remove rw parameter from
get_futex_key()").
The regular page case was fixed by commit 9ea71503a8ed ("futex: Fix
regression with read only mappings"), but the transparent hugepage case
(added in a5b338f2b0b1: "thp: update futex compound knowledge") case
remained broken.
Found by Dave Jones and his trinity tool.
Reported-and-tested-by: Dave Jones <davej@fedoraproject.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Darren Hart <dvhart@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/futex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/futex.c b/kernel/futex.c
index f0ee318..e564a9a 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -285,7 +285,7 @@ again:
put_page(page);
/* serialize against __split_huge_page_splitting() */
local_irq_disable();
- if (likely(__get_user_pages_fast(address, 1, 1, &page) == 1)) {
+ if (likely(__get_user_pages_fast(address, 1, !ro, &page) == 1)) {
page_head = compound_head(page);
/*
* page_head is valid pointer but we must pin
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 051/166] KVM: Improve create VCPU parameter (CVE-2013-4587)
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (49 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 050/166] futex: fix handling of read-only-mapped hugepages Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 052/166] KVM: x86: Fix potential divide by 0 in lapic (CVE-2013-6367) Kamal Mostafa
` (114 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andrew Honig, Paolo Bonzini, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Honig <ahonig@google.com>
commit 338c7dbadd2671189cec7faf64c84d01071b3f96 upstream.
In multiple functions the vcpu_id is used as an offset into a bitfield. Ag
malicious user could specify a vcpu_id greater than 255 in order to set or
clear bits in kernel memory. This could be used to elevate priveges in the
kernel. This patch verifies that the vcpu_id provided is less than 255.
The api documentation already specifies that the vcpu_id must be less than
max_vcpus, but this is currently not checked.
Reported-by: Andrew Honig <ahonig@google.com>
Signed-off-by: Andrew Honig <ahonig@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
virt/kvm/kvm_main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 4dc41654..4884600 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1839,6 +1839,9 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, u32 id)
int r;
struct kvm_vcpu *vcpu, *v;
+ if (id >= KVM_MAX_VCPUS)
+ return -EINVAL;
+
vcpu = kvm_arch_vcpu_create(kvm, id);
if (IS_ERR(vcpu))
return PTR_ERR(vcpu);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 052/166] KVM: x86: Fix potential divide by 0 in lapic (CVE-2013-6367)
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (50 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 051/166] KVM: Improve create VCPU parameter (CVE-2013-4587) Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 053/166] KVM: x86: Convert vapic synchronization to _cached functions (CVE-2013-6368) Kamal Mostafa
` (113 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andrew Honig, Paolo Bonzini, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Honig <ahonig@google.com>
commit b963a22e6d1a266a67e9eecc88134713fd54775c upstream.
Under guest controllable circumstances apic_get_tmcct will execute a
divide by zero and cause a crash. If the guest cpuid support
tsc deadline timers and performs the following sequence of requests
the host will crash.
- Set the mode to periodic
- Set the TMICT to 0
- Set the mode bits to 11 (neither periodic, nor one shot, nor tsc deadline)
- Set the TMICT to non-zero.
Then the lapic_timer.period will be 0, but the TMICT will not be. If the
guest then reads from the TMCCT then the host will perform a divide by 0.
This patch ensures that if the lapic_timer.period is 0, then the division
does not occur.
Reported-by: Andrew Honig <ahonig@google.com>
Signed-off-by: Andrew Honig <ahonig@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kvm/lapic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index a2f492c..8d11f7735 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -807,7 +807,8 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic)
ASSERT(apic != NULL);
/* if initial count is 0, current count should also be 0 */
- if (kvm_apic_get_reg(apic, APIC_TMICT) == 0)
+ if (kvm_apic_get_reg(apic, APIC_TMICT) == 0 ||
+ apic->lapic_timer.period == 0)
return 0;
remaining = hrtimer_get_remaining(&apic->lapic_timer.timer);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 053/166] KVM: x86: Convert vapic synchronization to _cached functions (CVE-2013-6368)
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (51 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 052/166] KVM: x86: Fix potential divide by 0 in lapic (CVE-2013-6367) Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 054/166] KVM: x86: fix guest-initiated crash with x2apic (CVE-2013-6376) Kamal Mostafa
` (112 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andrew Honig, Paolo Bonzini, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Honig <ahonig@google.com>
commit fda4e2e85589191b123d31cdc21fd33ee70f50fd upstream.
In kvm_lapic_sync_from_vapic and kvm_lapic_sync_to_vapic there is the
potential to corrupt kernel memory if userspace provides an address that
is at the end of a page. This patches concerts those functions to use
kvm_write_guest_cached and kvm_read_guest_cached. It also checks the
vapic_address specified by userspace during ioctl processing and returns
an error to userspace if the address is not a valid GPA.
This is generally not guest triggerable, because the required write is
done by firmware that runs before the guest. Also, it only affects AMD
processors and oldish Intel that do not have the FlexPriority feature
(unless you disable FlexPriority, of course; then newer processors are
also affected).
Fixes: b93463aa59d6 ('KVM: Accelerated apic support')
Reported-by: Andrew Honig <ahonig@google.com>
Signed-off-by: Andrew Honig <ahonig@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kvm/lapic.c | 27 +++++++++++++++------------
arch/x86/kvm/lapic.h | 4 ++--
arch/x86/kvm/x86.c | 40 +---------------------------------------
3 files changed, 18 insertions(+), 53 deletions(-)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 8d11f7735..b8a559b 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1633,7 +1633,6 @@ static void apic_sync_pv_eoi_from_guest(struct kvm_vcpu *vcpu,
void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu)
{
u32 data;
- void *vapic;
if (test_bit(KVM_APIC_PV_EOI_PENDING, &vcpu->arch.apic_attention))
apic_sync_pv_eoi_from_guest(vcpu, vcpu->arch.apic);
@@ -1641,9 +1640,8 @@ void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu)
if (!test_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention))
return;
- vapic = kmap_atomic(vcpu->arch.apic->vapic_page);
- data = *(u32 *)(vapic + offset_in_page(vcpu->arch.apic->vapic_addr));
- kunmap_atomic(vapic);
+ kvm_read_guest_cached(vcpu->kvm, &vcpu->arch.apic->vapic_cache, &data,
+ sizeof(u32));
apic_set_tpr(vcpu->arch.apic, data & 0xff);
}
@@ -1679,7 +1677,6 @@ void kvm_lapic_sync_to_vapic(struct kvm_vcpu *vcpu)
u32 data, tpr;
int max_irr, max_isr;
struct kvm_lapic *apic = vcpu->arch.apic;
- void *vapic;
apic_sync_pv_eoi_to_guest(vcpu, apic);
@@ -1695,18 +1692,24 @@ void kvm_lapic_sync_to_vapic(struct kvm_vcpu *vcpu)
max_isr = 0;
data = (tpr & 0xff) | ((max_isr & 0xf0) << 8) | (max_irr << 24);
- vapic = kmap_atomic(vcpu->arch.apic->vapic_page);
- *(u32 *)(vapic + offset_in_page(vcpu->arch.apic->vapic_addr)) = data;
- kunmap_atomic(vapic);
+ kvm_write_guest_cached(vcpu->kvm, &vcpu->arch.apic->vapic_cache, &data,
+ sizeof(u32));
}
-void kvm_lapic_set_vapic_addr(struct kvm_vcpu *vcpu, gpa_t vapic_addr)
+int kvm_lapic_set_vapic_addr(struct kvm_vcpu *vcpu, gpa_t vapic_addr)
{
- vcpu->arch.apic->vapic_addr = vapic_addr;
- if (vapic_addr)
+ if (vapic_addr) {
+ if (kvm_gfn_to_hva_cache_init(vcpu->kvm,
+ &vcpu->arch.apic->vapic_cache,
+ vapic_addr, sizeof(u32)))
+ return -EINVAL;
__set_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention);
- else
+ } else {
__clear_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention);
+ }
+
+ vcpu->arch.apic->vapic_addr = vapic_addr;
+ return 0;
}
int kvm_x2apic_msr_write(struct kvm_vcpu *vcpu, u32 msr, u64 data)
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h
index e5ebf9f..de61f21 100644
--- a/arch/x86/kvm/lapic.h
+++ b/arch/x86/kvm/lapic.h
@@ -31,7 +31,7 @@ struct kvm_lapic {
*/
void *regs;
gpa_t vapic_addr;
- struct page *vapic_page;
+ struct gfn_to_hva_cache vapic_cache;
};
int kvm_create_lapic(struct kvm_vcpu *vcpu);
void kvm_free_lapic(struct kvm_vcpu *vcpu);
@@ -64,7 +64,7 @@ int kvm_lapic_find_highest_irr(struct kvm_vcpu *vcpu);
u64 kvm_get_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu);
void kvm_set_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu, u64 data);
-void kvm_lapic_set_vapic_addr(struct kvm_vcpu *vcpu, gpa_t vapic_addr);
+int kvm_lapic_set_vapic_addr(struct kvm_vcpu *vcpu, gpa_t vapic_addr);
void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu);
void kvm_lapic_sync_to_vapic(struct kvm_vcpu *vcpu);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 6e2af7b..c22ab85 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3094,8 +3094,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
r = -EFAULT;
if (copy_from_user(&va, argp, sizeof va))
goto out;
- r = 0;
- kvm_lapic_set_vapic_addr(vcpu, va.vapic_addr);
+ r = kvm_lapic_set_vapic_addr(vcpu, va.vapic_addr);
break;
}
case KVM_X86_SETUP_MCE: {
@@ -5450,36 +5449,6 @@ static void post_kvm_run_save(struct kvm_vcpu *vcpu)
!kvm_event_needs_reinjection(vcpu);
}
-static int vapic_enter(struct kvm_vcpu *vcpu)
-{
- struct kvm_lapic *apic = vcpu->arch.apic;
- struct page *page;
-
- if (!apic || !apic->vapic_addr)
- return 0;
-
- page = gfn_to_page(vcpu->kvm, apic->vapic_addr >> PAGE_SHIFT);
- if (is_error_page(page))
- return -EFAULT;
-
- vcpu->arch.apic->vapic_page = page;
- return 0;
-}
-
-static void vapic_exit(struct kvm_vcpu *vcpu)
-{
- struct kvm_lapic *apic = vcpu->arch.apic;
- int idx;
-
- if (!apic || !apic->vapic_addr)
- return;
-
- idx = srcu_read_lock(&vcpu->kvm->srcu);
- kvm_release_page_dirty(apic->vapic_page);
- mark_page_dirty(vcpu->kvm, apic->vapic_addr >> PAGE_SHIFT);
- srcu_read_unlock(&vcpu->kvm->srcu, idx);
-}
-
static void update_cr8_intercept(struct kvm_vcpu *vcpu)
{
int max_irr, tpr;
@@ -5796,11 +5765,6 @@ static int __vcpu_run(struct kvm_vcpu *vcpu)
}
vcpu->srcu_idx = srcu_read_lock(&kvm->srcu);
- r = vapic_enter(vcpu);
- if (r) {
- srcu_read_unlock(&kvm->srcu, vcpu->srcu_idx);
- return r;
- }
r = 1;
while (r > 0) {
@@ -5857,8 +5821,6 @@ static int __vcpu_run(struct kvm_vcpu *vcpu)
srcu_read_unlock(&kvm->srcu, vcpu->srcu_idx);
- vapic_exit(vcpu);
-
return r;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 054/166] KVM: x86: fix guest-initiated crash with x2apic (CVE-2013-6376)
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (52 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 053/166] KVM: x86: Convert vapic synchronization to _cached functions (CVE-2013-6368) Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 055/166] selinux: handle TCP SYN-ACK packets correctly in selinux_ip_output() Kamal Mostafa
` (111 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Gleb Natapov, Paolo Bonzini, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Gleb Natapov <gleb@redhat.com>
commit 17d68b763f09a9ce824ae23eb62c9efc57b69271 upstream.
A guest can cause a BUG_ON() leading to a host kernel crash.
When the guest writes to the ICR to request an IPI, while in x2apic
mode the following things happen, the destination is read from
ICR2, which is a register that the guest can control.
kvm_irq_delivery_to_apic_fast uses the high 16 bits of ICR2 as the
cluster id. A BUG_ON is triggered, which is a protection against
accessing map->logical_map with an out-of-bounds access and manages
to avoid that anything really unsafe occurs.
The logic in the code is correct from real HW point of view. The problem
is that KVM supports only one cluster with ID 0 in clustered mode, but
the code that has the bug does not take this into account.
Reported-by: Lars Bull <larsbull@google.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kvm/lapic.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index b8a559b..360aed5 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -167,6 +167,8 @@ static inline u16 apic_logical_id(struct kvm_apic_map *map, u32 ldr)
return ldr & map->lid_mask;
}
+#define KVM_X2APIC_CID_BITS 0
+
static void recalculate_apic_map(struct kvm *kvm)
{
struct kvm_apic_map *new, *old = NULL;
@@ -204,7 +206,8 @@ static void recalculate_apic_map(struct kvm *kvm)
if (apic_x2apic_mode(apic)) {
new->ldr_bits = 32;
new->cid_shift = 16;
- new->cid_mask = new->lid_mask = 0xffff;
+ new->cid_mask = (1 << KVM_X2APIC_CID_BITS) - 1;
+ new->lid_mask = 0xffff;
} else if (kvm_apic_sw_enabled(apic) &&
!new->cid_mask /* flat mode */ &&
kvm_apic_get_reg(apic, APIC_DFR) == APIC_DFR_CLUSTER) {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 055/166] selinux: handle TCP SYN-ACK packets correctly in selinux_ip_output()
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (53 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 054/166] KVM: x86: fix guest-initiated crash with x2apic (CVE-2013-6376) Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 056/166] drivers/rtc/rtc-at91rm9200.c: correct alarm over day/month wrap Kamal Mostafa
` (110 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Paul Moore, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Moore <pmoore@redhat.com>
commit 47180068276a04ed31d24fe04c673138208b07a9 upstream.
In selinux_ip_output() we always label packets based on the parent
socket. While this approach works in almost all cases, it doesn't
work in the case of TCP SYN-ACK packets when the correct label is not
the label of the parent socket, but rather the label of the larval
socket represented by the request_sock struct.
Unfortunately, since the request_sock isn't queued on the parent
socket until *after* the SYN-ACK packet is sent, we can't lookup the
request_sock to determine the correct label for the packet; at this
point in time the best we can do is simply pass/NF_ACCEPT the packet.
It must be said that simply passing the packet without any explicit
labeling action, while far from ideal, is not terrible as the SYN-ACK
packet will inherit any IP option based labeling from the initial
connection request so the label *should* be correct and all our
access controls remain in place so we shouldn't have to worry about
information leaks.
Reported-by: Janak Desai <Janak.Desai@gtri.gatech.edu>
Tested-by: Janak Desai <Janak.Desai@gtri.gatech.edu>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
security/selinux/hooks.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 9e8bcf3..1ce432d 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -52,6 +52,7 @@
#include <net/icmp.h>
#include <net/ip.h> /* for local_port_range[] */
#include <net/tcp.h> /* struct or_callable used in sock_rcv_skb */
+#include <net/inet_connection_sock.h>
#include <net/net_namespace.h>
#include <net/netlabel.h>
#include <linux/uaccess.h>
@@ -4612,6 +4613,7 @@ static unsigned int selinux_ipv6_forward(unsigned int hooknum,
static unsigned int selinux_ip_output(struct sk_buff *skb,
u16 family)
{
+ struct sock *sk;
u32 sid;
if (!netlbl_enabled())
@@ -4620,8 +4622,27 @@ static unsigned int selinux_ip_output(struct sk_buff *skb,
/* we do this in the LOCAL_OUT path and not the POST_ROUTING path
* because we want to make sure we apply the necessary labeling
* before IPsec is applied so we can leverage AH protection */
- if (skb->sk) {
- struct sk_security_struct *sksec = skb->sk->sk_security;
+ sk = skb->sk;
+ if (sk) {
+ struct sk_security_struct *sksec;
+
+ if (sk->sk_state == TCP_LISTEN)
+ /* if the socket is the listening state then this
+ * packet is a SYN-ACK packet which means it needs to
+ * be labeled based on the connection/request_sock and
+ * not the parent socket. unfortunately, we can't
+ * lookup the request_sock yet as it isn't queued on
+ * the parent socket until after the SYN-ACK is sent.
+ * the "solution" is to simply pass the packet as-is
+ * as any IP option based labeling should be copied
+ * from the initial connection request (in the IP
+ * layer). it is far from ideal, but until we get a
+ * security label in the packet itself this is the
+ * best we can do. */
+ return NF_ACCEPT;
+
+ /* standard practice, label using the parent socket */
+ sksec = sk->sk_security;
sid = sksec->sid;
} else
sid = SECINITSID_KERNEL;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 056/166] drivers/rtc/rtc-at91rm9200.c: correct alarm over day/month wrap
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (54 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 055/166] selinux: handle TCP SYN-ACK packets correctly in selinux_ip_output() Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 057/166] mm: memcg: fix race condition between memcg teardown and swapin Kamal Mostafa
` (109 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Linus Pizunski, Nicolas Ferre, Andrew Morton, Linus Torvalds,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Pizunski <linus@narrativeteam.com>
commit eb3c227289840eed95ddfb0516046f08d8993940 upstream.
Update month and day of month to the alarm month/day instead of current
day/month when setting the RTC alarm mask.
Signed-off-by: Linus Pizunski <linus@narrativeteam.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.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/rtc/rtc-at91rm9200.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c
index 086fb35..357da6b 100644
--- a/drivers/rtc/rtc-at91rm9200.c
+++ b/drivers/rtc/rtc-at91rm9200.c
@@ -163,6 +163,8 @@ static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
at91_alarm_year = tm.tm_year;
+ tm.tm_mon = alrm->time.tm_mon;
+ tm.tm_mday = alrm->time.tm_mday;
tm.tm_hour = alrm->time.tm_hour;
tm.tm_min = alrm->time.tm_min;
tm.tm_sec = alrm->time.tm_sec;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 057/166] mm: memcg: fix race condition between memcg teardown and swapin
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (55 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 056/166] drivers/rtc/rtc-at91rm9200.c: correct alarm over day/month wrap Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 058/166] powerpc: kvm: fix rare but potential deadlock scene Kamal Mostafa
` (108 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Johannes Weiner, David Rientjes, Andrew Morton, Linus Torvalds,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Weiner <hannes@cmpxchg.org>
commit 96f1c58d853497a757463e0b57fed140d6858f3a upstream.
There is a race condition between a memcg being torn down and a swapin
triggered from a different memcg of a page that was recorded to belong
to the exiting memcg on swapout (with CONFIG_MEMCG_SWAP extension). The
result is unreclaimable pages pointing to dead memcgs, which can lead to
anything from endless loops in later memcg teardown (the page is charged
to all hierarchical parents but is not on any LRU list) or crashes from
following the dangling memcg pointer.
Memcgs with tasks in them can not be torn down and usually charges don't
show up in memcgs without tasks. Swapin with the CONFIG_MEMCG_SWAP
extension is the notable exception because it charges the cgroup that
was recorded as owner during swapout, which may be empty and in the
process of being torn down when a task in another memcg triggers the
swapin:
teardown: swapin:
lookup_swap_cgroup_id()
rcu_read_lock()
mem_cgroup_lookup()
css_tryget()
rcu_read_unlock()
disable css_tryget()
call_rcu()
offline_css()
reparent_charges()
res_counter_charge() (hierarchical!)
css_put()
css_free()
pc->mem_cgroup = dead memcg
add page to dead lru
Add a final reparenting step into css_free() to make sure any such raced
charges are moved out of the memcg before it's finally freed.
In the longer term it would be cleaner to have the css_tryget() and the
res_counter charge under the same RCU lock section so that the charge
reparenting is deferred until the last charge whose tryget succeeded is
visible. But this will require more invasive changes that will be
harder to evaluate and backport into stable, so better defer them to a
separate change set.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
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/memcontrol.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 6b7ff19..3e6bb9f 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6175,6 +6175,42 @@ static void mem_cgroup_css_offline(struct cgroup *cont)
static void mem_cgroup_css_free(struct cgroup *cont)
{
struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
+ /*
+ * XXX: css_offline() would be where we should reparent all
+ * memory to prepare the cgroup for destruction. However,
+ * memcg does not do css_tryget() and res_counter charging
+ * under the same RCU lock region, which means that charging
+ * could race with offlining. Offlining only happens to
+ * cgroups with no tasks in them but charges can show up
+ * without any tasks from the swapin path when the target
+ * memcg is looked up from the swapout record and not from the
+ * current task as it usually is. A race like this can leak
+ * charges and put pages with stale cgroup pointers into
+ * circulation:
+ *
+ * #0 #1
+ * lookup_swap_cgroup_id()
+ * rcu_read_lock()
+ * mem_cgroup_lookup()
+ * css_tryget()
+ * rcu_read_unlock()
+ * disable css_tryget()
+ * call_rcu()
+ * offline_css()
+ * reparent_charges()
+ * res_counter_charge()
+ * css_put()
+ * css_free()
+ * pc->mem_cgroup = dead memcg
+ * add page to lru
+ *
+ * The bulk of the charges are still moved in offline_css() to
+ * avoid pinning a lot of pages in case a long-term reference
+ * like a swapout record is deferring the css_free() to long
+ * after offlining. But this makes sure we catch any charges
+ * made after offlining:
+ */
+ mem_cgroup_reparent_charges(memcg);
kmem_cgroup_destroy(memcg);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 058/166] powerpc: kvm: fix rare but potential deadlock scene
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (56 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 057/166] mm: memcg: fix race condition between memcg teardown and swapin Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 059/166] drm/i915: Do not clobber config status after a forced restore of hw state Kamal Mostafa
` (107 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Liu Ping Fan, Alexander Graf, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: pingfan liu <qemulist@gmail.com>
commit 91648ec09c1ef69c4d840ab6dab391bfb452d554 upstream.
Since kvmppc_hv_find_lock_hpte() is called from both virtmode and
realmode, so it can trigger the deadlock.
Suppose the following scene:
Two physical cpuM, cpuN, two VM instances A, B, each VM has a group of
vcpus.
If on cpuM, vcpu_A_1 holds bitlock X (HPTE_V_HVLOCK), then is switched
out, and on cpuN, vcpu_A_2 try to lock X in realmode, then cpuN will be
caught in realmode for a long time.
What makes things even worse if the following happens,
On cpuM, bitlockX is hold, on cpuN, Y is hold.
vcpu_B_2 try to lock Y on cpuM in realmode
vcpu_A_2 try to lock X on cpuN in realmode
Oops! deadlock happens
Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
Reviewed-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/powerpc/kvm/book3s_64_mmu_hv.c | 6 +++++-
arch/powerpc/kvm/book3s_hv_rm_mmu.c | 4 ++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
index 8cc18ab..61a1dbf 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
@@ -473,11 +473,14 @@ static int kvmppc_mmu_book3s_64_hv_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
slb_v = vcpu->kvm->arch.vrma_slb_v;
}
+ preempt_disable();
/* Find the HPTE in the hash table */
index = kvmppc_hv_find_lock_hpte(kvm, eaddr, slb_v,
HPTE_V_VALID | HPTE_V_ABSENT);
- if (index < 0)
+ if (index < 0) {
+ preempt_enable();
return -ENOENT;
+ }
hptep = (unsigned long *)(kvm->arch.hpt_virt + (index << 4));
v = hptep[0] & ~HPTE_V_HVLOCK;
gr = kvm->arch.revmap[index].guest_rpte;
@@ -485,6 +488,7 @@ static int kvmppc_mmu_book3s_64_hv_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
/* Unlock the HPTE */
asm volatile("lwsync" : : : "memory");
hptep[0] = v;
+ preempt_enable();
gpte->eaddr = eaddr;
gpte->vpage = ((v & HPTE_V_AVPN) << 4) | ((eaddr >> 12) & 0xfff);
diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
index 19c93ba..9a1f990 100644
--- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c
+++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
@@ -735,6 +735,10 @@ static int slb_base_page_shift[4] = {
20, /* 1M, unsupported */
};
+/* When called from virtmode, this func should be protected by
+ * preempt_disable(), otherwise, the holding of HPTE_V_HVLOCK
+ * can trigger deadlock issue.
+ */
long kvmppc_hv_find_lock_hpte(struct kvm *kvm, gva_t eaddr, unsigned long slb_v,
unsigned long valid)
{
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 059/166] drm/i915: Do not clobber config status after a forced restore of hw state
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (57 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 058/166] powerpc: kvm: fix rare but potential deadlock scene Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 060/166] drm/i915: Hold mutex across i915_gem_release Kamal Mostafa
` (106 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Chris Wilson, Daniel Vetter, Paulo Zanoni, Daniel Vetter,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <chris@chris-wilson.co.uk>
commit edd5b13313551d6b04acfb90d3db58ed3cf3c814 upstream.
We call intel_modeset_setup_hw_state() along two paths, driver
load/resume and after a lid event notification. During initialisation of
the driver, it is imperative that we reset the config state. This
correctly sets up the initial connector statuses and prepares the
hardware for a thorough probing. However, during a lid event, we only
want to undo the damage caused by the bios by resetting our last known
mode. In this cirumstance, we do not want to clobber our desired state.
In order to try and keep sanity between the config state and our own
tracking, do the drm_mode_config_reset() first along the load/resume
paths before reading out the hw state and apply any definite known
corrections.
v2: "As discussed on irc I don't think we should force the connector
state to anything here: Imo connector->status should reflect what we
believe to be the true output connection state, whereas connector->encoder
reflects whether this connector is wired up to a pipe. And since we no
longer reject modeset on disconnected connectors and never nuked the pipe
if the connector gets disconnected there's no reason for that - such policy
is userspace's job.
This regression has been introduced in
commit 2e9388923e83bc4e2726f170a984621f1d582e77
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Thu Oct 11 20:08:24 2012 +0200
drm/i915/crt: explicitly set up HOTPLUG_BITS on resume"
so sayeth Daniel.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/i915_drv.c | 1 +
drivers/gpu/drm/i915/intel_display.c | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index a749aca..bfa8910 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -590,6 +590,7 @@ static int __i915_drm_thaw(struct drm_device *dev)
mutex_unlock(&dev->struct_mutex);
intel_modeset_init_hw(dev);
+ drm_mode_config_reset(dev);
intel_modeset_setup_hw_state(dev, false);
drm_irq_install(dev);
}
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 82fcb37..5b769a7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9357,8 +9357,6 @@ void intel_modeset_setup_hw_state(struct drm_device *dev,
}
intel_modeset_check_state(dev);
-
- drm_mode_config_reset(dev);
}
void intel_modeset_gem_init(struct drm_device *dev)
@@ -9367,6 +9365,7 @@ void intel_modeset_gem_init(struct drm_device *dev)
intel_setup_overlay(dev);
+ drm_mode_config_reset(dev);
intel_modeset_setup_hw_state(dev, false);
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 060/166] drm/i915: Hold mutex across i915_gem_release
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (58 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 059/166] drm/i915: Do not clobber config status after a forced restore of hw state Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 061/166] ASoC: tegra: fix uninitialized variables in set_fmt Kamal Mostafa
` (105 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Chris Wilson, Daniel Vetter, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <chris@chris-wilson.co.uk>
commit 0d1430a3f4b7cfd8779b78740a4182321f3ca7f3 upstream.
Inorder to serialise the closing of the file descriptor and its
subsequent release of client requests with i915_gem_free_request(), we
need to hold the struct_mutex in i915_gem_release(). Failing to do so
has the potential to trigger an OOPS, later with a use-after-free.
Testcase: igt/gem_close_race
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70874
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71029
Reported-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/i915_dma.c | 2 ++
drivers/gpu/drm/i915/i915_gem_context.c | 2 --
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index ef781e7..92896bf 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1794,8 +1794,10 @@ void i915_driver_lastclose(struct drm_device * dev)
void i915_driver_preclose(struct drm_device * dev, struct drm_file *file_priv)
{
+ mutex_lock(&dev->struct_mutex);
i915_gem_context_close(dev, file_priv);
i915_gem_release(dev, file_priv);
+ mutex_unlock(&dev->struct_mutex);
}
void i915_driver_postclose(struct drm_device *dev, struct drm_file *file)
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index a80bba9..e75cac6 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -310,10 +310,8 @@ void i915_gem_context_close(struct drm_device *dev, struct drm_file *file)
{
struct drm_i915_file_private *file_priv = file->driver_priv;
- mutex_lock(&dev->struct_mutex);
idr_for_each(&file_priv->context_idr, context_idr_cleanup, NULL);
idr_destroy(&file_priv->context_idr);
- mutex_unlock(&dev->struct_mutex);
}
static struct i915_hw_context *
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 061/166] ASoC: tegra: fix uninitialized variables in set_fmt
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (59 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 060/166] drm/i915: Hold mutex across i915_gem_release Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 062/166] usb: cdc-wdm: manage_power should always set needs_remote_wakeup Kamal Mostafa
` (104 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Stephen Warren, Mark Brown, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Warren <swarren@nvidia.com>
commit 241bf43321a10815225f477bba96a42285a2da73 upstream.
In tegra*_i2s_set_fmt(), in the (fmt == SND_SOC_DAIFMT_CBM_CFM) case,
"val" is never assigned to, but left uninitialized. The other case does
initialized it. Fix this by initializing val at the start of the
function, and only ever ORing into it.
Update the handling of "mask" so it works the same way for consistency.
Update tegra20_spdif.c to use the same code-style for consistency, even
though it doesn't happen to suffer from the same problem at present.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Fixes: 0f163546a772 ("ASoC: tegra: use regmap more directly")
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/tegra/tegra20_i2s.c | 6 +++---
sound/soc/tegra/tegra20_spdif.c | 10 +++++-----
sound/soc/tegra/tegra30_i2s.c | 6 +++---
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/sound/soc/tegra/tegra20_i2s.c b/sound/soc/tegra/tegra20_i2s.c
index caa772d..57227e0 100644
--- a/sound/soc/tegra/tegra20_i2s.c
+++ b/sound/soc/tegra/tegra20_i2s.c
@@ -73,7 +73,7 @@ static int tegra20_i2s_set_fmt(struct snd_soc_dai *dai,
unsigned int fmt)
{
struct tegra20_i2s *i2s = snd_soc_dai_get_drvdata(dai);
- unsigned int mask, val;
+ unsigned int mask = 0, val = 0;
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
case SND_SOC_DAIFMT_NB_NF:
@@ -82,10 +82,10 @@ static int tegra20_i2s_set_fmt(struct snd_soc_dai *dai,
return -EINVAL;
}
- mask = TEGRA20_I2S_CTRL_MASTER_ENABLE;
+ mask |= TEGRA20_I2S_CTRL_MASTER_ENABLE;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS:
- val = TEGRA20_I2S_CTRL_MASTER_ENABLE;
+ val |= TEGRA20_I2S_CTRL_MASTER_ENABLE;
break;
case SND_SOC_DAIFMT_CBM_CFM:
break;
diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c
index 04771d1..0f751e1 100644
--- a/sound/soc/tegra/tegra20_spdif.c
+++ b/sound/soc/tegra/tegra20_spdif.c
@@ -66,15 +66,15 @@ static int tegra20_spdif_hw_params(struct snd_pcm_substream *substream,
{
struct device *dev = dai->dev;
struct tegra20_spdif *spdif = snd_soc_dai_get_drvdata(dai);
- unsigned int mask, val;
+ unsigned int mask = 0, val = 0;
int ret, spdifclock;
- mask = TEGRA20_SPDIF_CTRL_PACK |
- TEGRA20_SPDIF_CTRL_BIT_MODE_MASK;
+ mask |= TEGRA20_SPDIF_CTRL_PACK |
+ TEGRA20_SPDIF_CTRL_BIT_MODE_MASK;
switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
- val = TEGRA20_SPDIF_CTRL_PACK |
- TEGRA20_SPDIF_CTRL_BIT_MODE_16BIT;
+ val |= TEGRA20_SPDIF_CTRL_PACK |
+ TEGRA20_SPDIF_CTRL_BIT_MODE_16BIT;
break;
default:
return -EINVAL;
diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c
index 6b64f5b..df9224d 100644
--- a/sound/soc/tegra/tegra30_i2s.c
+++ b/sound/soc/tegra/tegra30_i2s.c
@@ -116,7 +116,7 @@ static int tegra30_i2s_set_fmt(struct snd_soc_dai *dai,
unsigned int fmt)
{
struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai);
- unsigned int mask, val;
+ unsigned int mask = 0, val = 0;
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
case SND_SOC_DAIFMT_NB_NF:
@@ -125,10 +125,10 @@ static int tegra30_i2s_set_fmt(struct snd_soc_dai *dai,
return -EINVAL;
}
- mask = TEGRA30_I2S_CTRL_MASTER_ENABLE;
+ mask |= TEGRA30_I2S_CTRL_MASTER_ENABLE;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS:
- val = TEGRA30_I2S_CTRL_MASTER_ENABLE;
+ val |= TEGRA30_I2S_CTRL_MASTER_ENABLE;
break;
case SND_SOC_DAIFMT_CBM_CFM:
break;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 062/166] usb: cdc-wdm: manage_power should always set needs_remote_wakeup
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (60 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 061/166] ASoC: tegra: fix uninitialized variables in set_fmt Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 063/166] usb: serial: zte_ev: move support for ZTE AC2726 from zte_ev back to option Kamal Mostafa
` (103 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Bjørn Mork, Greg Kroah-Hartman, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>
commit 4144bc861ed7934d56f16d2acd808d44af0fcc90 upstream.
Reported-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/class/cdc-wdm.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 46c9379..59f7d32 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -801,13 +801,11 @@ static int wdm_manage_power(struct usb_interface *intf, int on)
{
/* need autopm_get/put here to ensure the usbcore sees the new value */
int rv = usb_autopm_get_interface(intf);
- if (rv < 0)
- goto err;
intf->needs_remote_wakeup = on;
- usb_autopm_put_interface(intf);
-err:
- return rv;
+ if (!rv)
+ usb_autopm_put_interface(intf);
+ return 0;
}
static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 063/166] usb: serial: zte_ev: move support for ZTE AC2726 from zte_ev back to option
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (61 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 062/166] usb: cdc-wdm: manage_power should always set needs_remote_wakeup Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 064/166] xhci: Limit the spurious wakeup fix only to HP machines Kamal Mostafa
` (102 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dmitry Kunilov, Greg Kroah-Hartman, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Kunilov <dmitry.kunilov@gmail.com>
commit 52d0dc7597c89b2ab779f3dcb9b9bf0800dd9218 upstream.
ZTE AC2726 EVDO modem drops ppp connection every minute when driven by
zte_ev but works fine when driven by option. Move the support for AC2726
back to option driver.
Signed-off-by: Dmitry Kunilov <dmitry.kunilov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/option.c | 2 ++
drivers/usb/serial/zte_ev.c | 3 +--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index a03c30e..3c1e5e3 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -251,6 +251,7 @@ static void option_instat_callback(struct urb *urb);
#define ZTE_PRODUCT_MF628 0x0015
#define ZTE_PRODUCT_MF626 0x0031
#define ZTE_PRODUCT_MC2718 0xffe8
+#define ZTE_PRODUCT_AC2726 0xfff1
#define BENQ_VENDOR_ID 0x04a5
#define BENQ_PRODUCT_H10 0x4068
@@ -1453,6 +1454,7 @@ static const struct usb_device_id option_ids[] = {
{ USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) },
{ USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) },
{ USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) },
{ USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) },
{ USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) },
diff --git a/drivers/usb/serial/zte_ev.c b/drivers/usb/serial/zte_ev.c
index fca4c75..eae2c87 100644
--- a/drivers/usb/serial/zte_ev.c
+++ b/drivers/usb/serial/zte_ev.c
@@ -281,8 +281,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x19d2, 0xfffd) },
{ USB_DEVICE(0x19d2, 0xfffc) },
{ USB_DEVICE(0x19d2, 0xfffb) },
- /* AC2726, AC8710_V3 */
- { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xfff1, 0xff, 0xff, 0xff) },
+ /* AC8710_V3 */
{ USB_DEVICE(0x19d2, 0xfff6) },
{ USB_DEVICE(0x19d2, 0xfff7) },
{ USB_DEVICE(0x19d2, 0xfff8) },
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 064/166] xhci: Limit the spurious wakeup fix only to HP machines
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (62 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 063/166] usb: serial: zte_ev: move support for ZTE AC2726 from zte_ev back to option Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 065/166] drm/i915: don't update the dri1 breadcrumb with modesetting Kamal Mostafa
` (101 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Takashi Iwai, Sarah Sharp, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 6962d914f317b119e0db7189199b21ec77a4b3e0 upstream.
We've got regression reports that my previous fix for spurious wakeups
after S5 on HP Haswell machines leads to the automatic reboot at
shutdown on some machines. It turned out that the fix for one side
triggers another BIOS bug in other side. So, it's exclusive.
Since the original S5 wakeups have been confirmed only on HP machines,
it'd be safer to apply it only to limited machines. As a wild guess,
limiting to machines with HP PCI SSID should suffice.
This patch should be backported to kernels as old as 3.12, that
contain the commit 638298dc66ea36623dbc2757a24fc2c4ab41b016 "xhci: Fix
spurious wakeups after S5 on Haswell".
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66171
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Tested-by: <dashing.meng@gmail.com>
Reported-by: Niklas Schnelle <niklas@komani.de>
Reported-by: Giorgos <ganastasiouGR@gmail.com>
Reported-by: <art1@vhex.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/host/xhci-pci.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index ab4b0be..3d8d908 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -124,7 +124,12 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
* any other sleep) on Haswell machines with LPT and LPT-LP
* with the new Intel BIOS
*/
- xhci->quirks |= XHCI_SPURIOUS_WAKEUP;
+ /* Limit the quirk to only known vendors, as this triggers
+ * yet another BIOS bug on some other machines
+ * https://bugzilla.kernel.org/show_bug.cgi?id=66171
+ */
+ if (pdev->subsystem_vendor == PCI_VENDOR_ID_HP)
+ xhci->quirks |= XHCI_SPURIOUS_WAKEUP;
}
if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
pdev->device == PCI_DEVICE_ID_ASROCK_P67) {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 065/166] drm/i915: don't update the dri1 breadcrumb with modesetting
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (63 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 064/166] xhci: Limit the spurious wakeup fix only to HP machines Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 066/166] iscsi-target: Fix-up all zero data-length CDBs with R/W_BIT set Kamal Mostafa
` (100 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Eugene Shatokhin, Daniel Vetter, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Vetter <daniel.vetter@ffwll.ch>
commit 6c719faca2aceca72f1bf5b1645c1734ed3e9447 upstream.
The update is horribly racy since it doesn't protect at all against
concurrent closing of the master fd. And it can't really since that
requires us to grab a mutex.
Instead of jumping through hoops and offloading this to a worker
thread just block this bit of code for the modesetting driver.
Note that the race is fairly easy to hit since we call the breadcrumb
function for any interrupt. So the vblank interrupt (which usually
keeps going for a bit) is enough. But even if we'd block this and only
update the breadcrumb for user interrupts from the CS we could hit
this race with kms/gem userspace: If a non-master is waiting somewhere
(and hence has interrupts enabled) and the master closes its fd
(probably due to crashing).
v2: Add a code comment to explain why fixing this for real isn't
really worth it. Also improve the commit message a bit.
v3: Fix the spelling in the comment.
Reported-by: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
Cc: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/i915_dma.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 92896bf..bb98a4e 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -84,6 +84,14 @@ void i915_update_dri1_breadcrumb(struct drm_device *dev)
drm_i915_private_t *dev_priv = dev->dev_private;
struct drm_i915_master_private *master_priv;
+ /*
+ * The dri breadcrumb update races against the drm master disappearing.
+ * Instead of trying to fix this (this is by far not the only ums issue)
+ * just don't do the update in kms mode.
+ */
+ if (drm_core_check_feature(dev, DRIVER_MODESET))
+ return;
+
if (dev->primary->master) {
master_priv = dev->primary->master->driver_priv;
if (master_priv->sarea_priv)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 066/166] iscsi-target: Fix-up all zero data-length CDBs with R/W_BIT set
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (64 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 065/166] drm/i915: don't update the dri1 breadcrumb with modesetting Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 067/166] qla2xxx: Fix schedule_delayed_work() for target timeout calculations Kamal Mostafa
` (99 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Nicholas Bellinger, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <nab@linux-iscsi.org>
commit 4454b66cb67f14c33cd70ddcf0ff4985b26324b7 upstream.
This patch changes special case handling for ISCSI_OP_SCSI_CMD
where an initiator sends a zero length Expected Data Transfer
Length (EDTL), but still sets the WRITE and/or READ flag bits
when no payload transfer is requested.
Many, many moons ago two special cases where added for an ancient
version of ESX that has long since been fixed, so instead of adding
a new special case for the reported bug with a Broadcom 57800 NIC,
go ahead and always strip off the incorrect WRITE + READ flag bits.
Also, avoid sending a reject here, as RFC-3720 does mandate this
case be handled without protocol error.
Reported-by: Witold Bazakbal <865perl@wp.pl>
Tested-by: Witold Bazakbal <865perl@wp.pl>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/target/iscsi/iscsi_target.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 42a2bf7..7b83945 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -798,24 +798,22 @@ static int iscsit_handle_scsi_cmd(
if (((hdr->flags & ISCSI_FLAG_CMD_READ) ||
(hdr->flags & ISCSI_FLAG_CMD_WRITE)) && !hdr->data_length) {
/*
- * Vmware ESX v3.0 uses a modified Cisco Initiator (v3.4.2)
- * that adds support for RESERVE/RELEASE. There is a bug
- * add with this new functionality that sets R/W bits when
- * neither CDB carries any READ or WRITE datapayloads.
+ * From RFC-3720 Section 10.3.1:
+ *
+ * "Either or both of R and W MAY be 1 when either the
+ * Expected Data Transfer Length and/or Bidirectional Read
+ * Expected Data Transfer Length are 0"
+ *
+ * For this case, go ahead and clear the unnecssary bits
+ * to avoid any confusion with ->data_direction.
*/
- if ((hdr->cdb[0] == 0x16) || (hdr->cdb[0] == 0x17)) {
- hdr->flags &= ~ISCSI_FLAG_CMD_READ;
- hdr->flags &= ~ISCSI_FLAG_CMD_WRITE;
- goto done;
- }
+ hdr->flags &= ~ISCSI_FLAG_CMD_READ;
+ hdr->flags &= ~ISCSI_FLAG_CMD_WRITE;
- pr_err("ISCSI_FLAG_CMD_READ or ISCSI_FLAG_CMD_WRITE"
+ pr_warn("ISCSI_FLAG_CMD_READ or ISCSI_FLAG_CMD_WRITE"
" set when Expected Data Transfer Length is 0 for"
- " CDB: 0x%02x. Bad iSCSI Initiator.\n", hdr->cdb[0]);
- return iscsit_add_reject(ISCSI_REASON_BOOKMARK_INVALID, 1,
- buf, conn);
+ " CDB: 0x%02x, Fixing up flags\n", hdr->cdb[0]);
}
-done:
if (!(hdr->flags & ISCSI_FLAG_CMD_READ) &&
!(hdr->flags & ISCSI_FLAG_CMD_WRITE) && (hdr->data_length != 0)) {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 067/166] qla2xxx: Fix schedule_delayed_work() for target timeout calculations
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (65 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 066/166] iscsi-target: Fix-up all zero data-length CDBs with R/W_BIT set Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 068/166] drm/radeon: Fix sideport problems on certain RS690 boards Kamal Mostafa
` (98 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Shivaram U, Nicholas Bellinger, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Shivaram Upadhyayula <shivaram.u@quadstor.com>
commit 63832aabec12a28a41a221773ab3819d30ba0a67 upstream.
This patch fixes two cases in qla_target.c code where the
schedule_delayed_work() value was being incorrectly calculated
from sess->expires - jiffies.
Signed-off-by: Shivaram U <shivaram.u@quadstor.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/scsi/qla2xxx/qla_target.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 80f4b84..66c6214 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -481,7 +481,7 @@ static void qlt_schedule_sess_for_deletion(struct qla_tgt_sess *sess,
schedule_delayed_work(&tgt->sess_del_work, 0);
else
schedule_delayed_work(&tgt->sess_del_work,
- jiffies - sess->expires);
+ sess->expires - jiffies);
}
/* ha->hardware_lock supposed to be held on entry */
@@ -656,13 +656,14 @@ static void qlt_del_sess_work_fn(struct delayed_work *work)
struct scsi_qla_host *vha = tgt->vha;
struct qla_hw_data *ha = vha->hw;
struct qla_tgt_sess *sess;
- unsigned long flags;
+ unsigned long flags, elapsed;
spin_lock_irqsave(&ha->hardware_lock, flags);
while (!list_empty(&tgt->del_sess_list)) {
sess = list_entry(tgt->del_sess_list.next, typeof(*sess),
del_list_entry);
- if (time_after_eq(jiffies, sess->expires)) {
+ elapsed = jiffies;
+ if (time_after_eq(elapsed, sess->expires)) {
bool cancel;
qlt_undelete_sess(sess);
@@ -702,7 +703,7 @@ static void qlt_del_sess_work_fn(struct delayed_work *work)
spin_lock_irqsave(&ha->hardware_lock, flags);
} else {
schedule_delayed_work(&tgt->sess_del_work,
- jiffies - sess->expires);
+ sess->expires - elapsed);
break;
}
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 068/166] drm/radeon: Fix sideport problems on certain RS690 boards
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (66 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 067/166] qla2xxx: Fix schedule_delayed_work() for target timeout calculations Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 069/166] ALSA: hda - Add enable_msi=0 workaround for four HP machines Kamal Mostafa
` (97 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit 8333f0fe133be420ce3fcddfd568c3a559ab274e upstream.
Some RS690 boards with 64MB of sideport memory show up as
having 128MB sideport + 256MB of UMA. In this case,
just skip the sideport memory and use UMA. This fixes
rendering corruption and should improve performance.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=35457
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/rs690.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
index fad6633..213381f 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
@@ -160,6 +160,17 @@ static void rs690_mc_init(struct radeon_device *rdev)
base = RREG32_MC(R_000100_MCCFG_FB_LOCATION);
base = G_000100_MC_FB_START(base) << 16;
rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev);
+ /* Some boards seem to be configured for 128MB of sideport memory,
+ * but really only have 64MB. Just skip the sideport and use
+ * UMA memory.
+ */
+ if (rdev->mc.igp_sideport_enabled &&
+ (rdev->mc.real_vram_size == (384 * 1024 * 1024))) {
+ base += 128 * 1024 * 1024;
+ rdev->mc.real_vram_size -= 128 * 1024 * 1024;
+ rdev->mc.mc_vram_size = rdev->mc.real_vram_size;
+ }
+
rs690_pm_info(rdev);
radeon_vram_location(rdev, &rdev->mc, base);
rdev->mc.gtt_base_align = rdev->mc.gtt_size - 1;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 069/166] ALSA: hda - Add enable_msi=0 workaround for four HP machines
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (67 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 068/166] drm/radeon: Fix sideport problems on certain RS690 boards Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 070/166] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers Kamal Mostafa
` (96 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: David Henningsson, Takashi Iwai, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: David Henningsson <david.henningsson@canonical.com>
commit 693e0cb052c607e2d41edf9e9f1fa99ff8c266c1 upstream.
While enabling these machines, we found we would sometimes lose an
interrupt if we change hardware volume during playback, and that
disabling msi fixed this issue. (Losing the interrupt caused underruns
and crackling audio, as the one second timeout is usually bigger than
the period size.)
The machines were all machines from HP, running AMD Hudson controller,
and Realtek ALC282 codec.
BugLink: https://bugs.launchpad.net/bugs/1260225
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/hda_intel.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 0614bf4..c142402 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -3100,6 +3100,10 @@ static void check_probe_mask(struct azx *chip, int dev)
* white/black-list for enable_msi
*/
static struct snd_pci_quirk msi_black_list[] = {
+ SND_PCI_QUIRK(0x103c, 0x2191, "HP", 0), /* AMD Hudson */
+ SND_PCI_QUIRK(0x103c, 0x2192, "HP", 0), /* AMD Hudson */
+ SND_PCI_QUIRK(0x103c, 0x21f7, "HP", 0), /* AMD Hudson */
+ SND_PCI_QUIRK(0x103c, 0x21fa, "HP", 0), /* AMD Hudson */
SND_PCI_QUIRK(0x1043, 0x81f2, "ASUS", 0), /* Athlon64 X2 + nvidia */
SND_PCI_QUIRK(0x1043, 0x81f6, "ASUS", 0), /* nvidia */
SND_PCI_QUIRK(0x1043, 0x822d, "ASUS", 0), /* Athlon64 X2 + nvidia MCP55 */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 070/166] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (68 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 069/166] ALSA: hda - Add enable_msi=0 workaround for four HP machines Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 071/166] firewire: sbp2: bring back WRITE SAME support Kamal Mostafa
` (95 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Stephen Boyd, Linus Walleij, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <sboyd@codeaurora.org>
commit 4cc629b7a20945ce35628179180329b6bc9e552b upstream.
We should be writing bits here but instead we're writing the
numbers that correspond to the bits we want to write. Fix it by
wrapping the numbers in the BIT() macro. This fixes gpios acting
as interrupts.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpio/gpio-msm-v2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-msm-v2.c b/drivers/gpio/gpio-msm-v2.c
index 55a7e77..0152b1a 100644
--- a/drivers/gpio/gpio-msm-v2.c
+++ b/drivers/gpio/gpio-msm-v2.c
@@ -249,7 +249,7 @@ static void msm_gpio_irq_mask(struct irq_data *d)
spin_lock_irqsave(&tlmm_lock, irq_flags);
writel(TARGET_PROC_NONE, GPIO_INTR_CFG_SU(gpio));
- clear_gpio_bits(INTR_RAW_STATUS_EN | INTR_ENABLE, GPIO_INTR_CFG(gpio));
+ clear_gpio_bits(BIT(INTR_RAW_STATUS_EN) | BIT(INTR_ENABLE), GPIO_INTR_CFG(gpio));
__clear_bit(gpio, msm_gpio.enabled_irqs);
spin_unlock_irqrestore(&tlmm_lock, irq_flags);
}
@@ -261,7 +261,7 @@ static void msm_gpio_irq_unmask(struct irq_data *d)
spin_lock_irqsave(&tlmm_lock, irq_flags);
__set_bit(gpio, msm_gpio.enabled_irqs);
- set_gpio_bits(INTR_RAW_STATUS_EN | INTR_ENABLE, GPIO_INTR_CFG(gpio));
+ set_gpio_bits(BIT(INTR_RAW_STATUS_EN) | BIT(INTR_ENABLE), GPIO_INTR_CFG(gpio));
writel(TARGET_PROC_SCORPION, GPIO_INTR_CFG_SU(gpio));
spin_unlock_irqrestore(&tlmm_lock, irq_flags);
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 071/166] firewire: sbp2: bring back WRITE SAME support
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (69 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 070/166] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 072/166] ftrace: Initialize the ftrace profiler for each possible cpu Kamal Mostafa
` (94 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Stefan Richter, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
commit ce027ed98fd176710fb14be9d6015697b62436f0 upstream.
Commit 54b2b50c20a6 "[SCSI] Disable WRITE SAME for RAID and virtual
host adapter drivers" disabled WRITE SAME support for all SBP-2 attached
targets. But as described in the changelog of commit b0ea5f19d3d8
"firewire: sbp2: allow WRITE SAME and REPORT SUPPORTED OPERATION CODES",
it is not required to blacklist WRITE SAME.
Bring the feature back by reverting the sbp2.c hunk of commit 54b2b50c20a6.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/firewire/sbp2.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c
index 4882873..1162d6b 100644
--- a/drivers/firewire/sbp2.c
+++ b/drivers/firewire/sbp2.c
@@ -1628,7 +1628,6 @@ static struct scsi_host_template scsi_driver_template = {
.cmd_per_lun = 1,
.can_queue = 1,
.sdev_attrs = sbp2_scsi_sysfs_attrs,
- .no_write_same = 1,
};
MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>");
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 072/166] ftrace: Initialize the ftrace profiler for each possible cpu
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (70 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 071/166] firewire: sbp2: bring back WRITE SAME support Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 073/166] drm/edid: add quirk for BPC in Samsung NP700G7A-S01PL notebook Kamal Mostafa
` (93 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Miao Xie, Steven Rostedt, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Miao Xie <miaox@cn.fujitsu.com>
commit c4602c1c818bd6626178d6d3fcc152d9f2f48ac0 upstream.
Ftrace currently initializes only the online CPUs. This implementation has
two problems:
- If we online a CPU after we enable the function profile, and then run the
test, we will lose the trace information on that CPU.
Steps to reproduce:
# echo 0 > /sys/devices/system/cpu/cpu1/online
# cd <debugfs>/tracing/
# echo <some function name> >> set_ftrace_filter
# echo 1 > function_profile_enabled
# echo 1 > /sys/devices/system/cpu/cpu1/online
# run test
- If we offline a CPU before we enable the function profile, we will not clear
the trace information when we enable the function profile. It will trouble
the users.
Steps to reproduce:
# cd <debugfs>/tracing/
# echo <some function name> >> set_ftrace_filter
# echo 1 > function_profile_enabled
# run test
# cat trace_stat/function*
# echo 0 > /sys/devices/system/cpu/cpu1/online
# echo 0 > function_profile_enabled
# echo 1 > function_profile_enabled
# cat trace_stat/function*
# run test
# cat trace_stat/function*
So it is better that we initialize the ftrace profiler for each possible cpu
every time we enable the function profile instead of just the online ones.
Link: http://lkml.kernel.org/r/1387178401-10619-1-git-send-email-miaox@cn.fujitsu.com
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/trace/ftrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 03dbc77..35d7565 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -720,7 +720,7 @@ static int ftrace_profile_init(void)
int cpu;
int ret = 0;
- for_each_online_cpu(cpu) {
+ for_each_possible_cpu(cpu) {
ret = ftrace_profile_init_cpu(cpu);
if (ret)
break;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 073/166] drm/edid: add quirk for BPC in Samsung NP700G7A-S01PL notebook
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (71 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 072/166] ftrace: Initialize the ftrace profiler for each possible cpu Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 074/166] ASoC: wm5110: Correct HPOUT3 DAPM route typo Kamal Mostafa
` (92 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Rafał Miłecki, Dave Airlie, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
commit 49d45a31b71d7d9da74485922bdb63faf3dc9684 upstream.
This bug in EDID was exposed by:
commit eccea7920cfb009c2fa40e9ecdce8c36f61cab66
Author: Alex Deucher <alexander.deucher@amd.com>
Date: Mon Mar 26 15:12:54 2012 -0400
drm/radeon/kms: improve bpc handling (v2)
Which resulted in kind of regression in 3.5. This fixes
https://bugs.freedesktop.org/show_bug.cgi?id=70934
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/drm_edid.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 60d6b35..559f49b 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -68,6 +68,8 @@
#define EDID_QUIRK_DETAILED_SYNC_PP (1 << 6)
/* Force reduced-blanking timings for detailed modes */
#define EDID_QUIRK_FORCE_REDUCED_BLANKING (1 << 7)
+/* Force 8bpc */
+#define EDID_QUIRK_FORCE_8BPC (1 << 8)
struct detailed_mode_closure {
struct drm_connector *connector;
@@ -128,6 +130,9 @@ static struct edid_quirk {
/* Medion MD 30217 PG */
{ "MED", 0x7b8, EDID_QUIRK_PREFER_LARGE_75 },
+
+ /* Panel in Samsung NP700G7A-S01PL notebook reports 6bpc */
+ { "SEC", 0xd033, EDID_QUIRK_FORCE_8BPC },
};
/*** DDC fetch and block validation ***/
@@ -2034,6 +2039,9 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
drm_add_display_info(edid, &connector->display_info);
+ if (quirks & EDID_QUIRK_FORCE_8BPC)
+ connector->display_info.bpc = 8;
+
return num_modes;
}
EXPORT_SYMBOL(drm_add_edid_modes);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 074/166] ASoC: wm5110: Correct HPOUT3 DAPM route typo
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (72 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 073/166] drm/edid: add quirk for BPC in Samsung NP700G7A-S01PL notebook Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 075/166] sched/rt: Fix rq's cpupri leak while enqueue/dequeue child RT entities Kamal Mostafa
` (91 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Charles Keepax, Mark Brown, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
commit 280484e708a3cc38fe6807718caa460e744c0b20 upstream.
Reported-by: Kyung-Kwee Ryu <kyung-kwee.ryu@wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/codecs/wm5110.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c
index e0bb6dc..bfaf96b 100644
--- a/sound/soc/codecs/wm5110.c
+++ b/sound/soc/codecs/wm5110.c
@@ -860,7 +860,7 @@ static const struct snd_soc_dapm_route wm5110_dapm_routes[] = {
{ "HPOUT2R", NULL, "OUT2R" },
{ "HPOUT3L", NULL, "OUT3L" },
- { "HPOUT3R", NULL, "OUT3L" },
+ { "HPOUT3R", NULL, "OUT3R" },
{ "SPKOUTLN", NULL, "OUT4L" },
{ "SPKOUTLP", NULL, "OUT4L" },
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 075/166] sched/rt: Fix rq's cpupri leak while enqueue/dequeue child RT entities
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (73 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 074/166] ASoC: wm5110: Correct HPOUT3 DAPM route typo Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 076/166] xfs: fix infinite loop by detaching the group/project hints from user dquot Kamal Mostafa
` (90 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Kirill Tkhai, Peter Zijlstra, Steven Rostedt, Ingo Molnar,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Kirill Tkhai <tkhai@yandex.ru>
commit 757dfcaa41844595964f1220f1d33182dae49976 upstream.
This patch touches the RT group scheduling case.
Functions inc_rt_prio_smp() and dec_rt_prio_smp() change (global) rq's
priority, while rt_rq passed to them may be not the top-level rt_rq.
This is wrong, because changing of priority on a child level does not
guarantee that the priority is the highest all over the rq. So, this
leak makes RT balancing unusable.
The short example: the task having the highest priority among all rq's
RT tasks (no one other task has the same priority) are waking on a
throttle rt_rq. The rq's cpupri is set to the task's priority
equivalent, but real rq->rt.highest_prio.curr is less.
The patch below fixes the problem.
Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
CC: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/49231385567953@web4m.yandex.ru
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/sched/rt.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 4f02b28..14a3a35 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -962,6 +962,13 @@ inc_rt_prio_smp(struct rt_rq *rt_rq, int prio, int prev_prio)
{
struct rq *rq = rq_of_rt_rq(rt_rq);
+#ifdef CONFIG_RT_GROUP_SCHED
+ /*
+ * Change rq's cpupri only if rt_rq is the top queue.
+ */
+ if (&rq->rt != rt_rq)
+ return;
+#endif
if (rq->online && prio < prev_prio)
cpupri_set(&rq->rd->cpupri, rq->cpu, prio);
}
@@ -971,6 +978,13 @@ dec_rt_prio_smp(struct rt_rq *rt_rq, int prio, int prev_prio)
{
struct rq *rq = rq_of_rt_rq(rt_rq);
+#ifdef CONFIG_RT_GROUP_SCHED
+ /*
+ * Change rq's cpupri only if rt_rq is the top queue.
+ */
+ if (&rq->rt != rt_rq)
+ return;
+#endif
if (rq->online && rt_rq->highest_prio.curr != prev_prio)
cpupri_set(&rq->rd->cpupri, rq->cpu, rt_rq->highest_prio.curr);
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 076/166] xfs: fix infinite loop by detaching the group/project hints from user dquot
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (74 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 075/166] sched/rt: Fix rq's cpupri leak while enqueue/dequeue child RT entities Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 077/166] ALSA: Add SNDRV_PCM_STATE_PAUSED case in wait_for_avail function Kamal Mostafa
` (89 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Jie Liu, Ben Myers, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jie Liu <jeff.liu@oracle.com>
commit 718cc6f88cbfc4fbd39609f28c4c86883945f90d upstream.
xfs_quota(8) will hang up if trying to turn group/project quota off
before the user quota is off, this could be 100% reproduced by:
# mount -ouquota,gquota /dev/sda7 /xfs
# mkdir /xfs/test
# xfs_quota -xc 'off -g' /xfs <-- hangs up
# echo w > /proc/sysrq-trigger
# dmesg
SysRq : Show Blocked State
task PC stack pid father
xfs_quota D 0000000000000000 0 27574 2551 0x00000000
[snip]
Call Trace:
[<ffffffff81aaa21d>] schedule+0xad/0xc0
[<ffffffff81aa327e>] schedule_timeout+0x35e/0x3c0
[<ffffffff8114b506>] ? mark_held_locks+0x176/0x1c0
[<ffffffff810ad6c0>] ? call_timer_fn+0x2c0/0x2c0
[<ffffffffa0c25380>] ? xfs_qm_shrink_count+0x30/0x30 [xfs]
[<ffffffff81aa3306>] schedule_timeout_uninterruptible+0x26/0x30
[<ffffffffa0c26155>] xfs_qm_dquot_walk+0x235/0x260 [xfs]
[<ffffffffa0c059d8>] ? xfs_perag_get+0x1d8/0x2d0 [xfs]
[<ffffffffa0c05805>] ? xfs_perag_get+0x5/0x2d0 [xfs]
[<ffffffffa0b7707e>] ? xfs_inode_ag_iterator+0xae/0xf0 [xfs]
[<ffffffffa0c22280>] ? xfs_trans_free_dqinfo+0x50/0x50 [xfs]
[<ffffffffa0b7709f>] ? xfs_inode_ag_iterator+0xcf/0xf0 [xfs]
[<ffffffffa0c261e6>] xfs_qm_dqpurge_all+0x66/0xb0 [xfs]
[<ffffffffa0c2497a>] xfs_qm_scall_quotaoff+0x20a/0x5f0 [xfs]
[<ffffffffa0c2b8f6>] xfs_fs_set_xstate+0x136/0x180 [xfs]
[<ffffffff8136cf7a>] do_quotactl+0x53a/0x6b0
[<ffffffff812fba4b>] ? iput+0x5b/0x90
[<ffffffff8136d257>] SyS_quotactl+0x167/0x1d0
[<ffffffff814cf2ee>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[<ffffffff81abcd19>] system_call_fastpath+0x16/0x1b
It's fine if we turn user quota off at first, then turn off other
kind of quotas if they are enabled since the group/project dquot
refcount is decreased to zero once the user quota if off. Otherwise,
those dquots refcount is non-zero due to the user dquot might refer
to them as hint(s). Hence, above operation cause an infinite loop
at xfs_qm_dquot_walk() while trying to purge dquot cache.
This problem has been around since Linux 3.4, it was introduced by:
[ b84a3a9675 xfs: remove the per-filesystem list of dquots ]
Originally we will release the group dquot pointers because the user
dquots maybe carrying around as a hint via xfs_qm_detach_gdquots().
However, with above change, there is no such work to be done before
purging group/project dquot cache.
In order to solve this problem, this patch introduces a special routine
xfs_qm_dqpurge_hints(), and it would release the group/project dquot
pointers the user dquots maybe carrying around as a hint, and then it
will proceed to purge the user dquot cache if requested.
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
[ kamal: backport to 3.8 (no q_pdquot member, just q_gdquot) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/xfs/xfs_qm.c | 58 +++++++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 44 insertions(+), 14 deletions(-)
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 60eff47..e2db199 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -135,7 +135,6 @@ xfs_qm_dqpurge(
{
struct xfs_mount *mp = dqp->q_mount;
struct xfs_quotainfo *qi = mp->m_quotainfo;
- struct xfs_dquot *gdqp = NULL;
xfs_dqlock(dqp);
if ((dqp->dq_flags & XFS_DQ_FREEING) || dqp->q_nrefs != 0) {
@@ -143,16 +142,6 @@ xfs_qm_dqpurge(
return EAGAIN;
}
- /*
- * If this quota has a group hint attached, prepare for releasing it
- * now.
- */
- gdqp = dqp->q_gdquot;
- if (gdqp) {
- xfs_dqlock(gdqp);
- dqp->q_gdquot = NULL;
- }
-
dqp->dq_flags |= XFS_DQ_FREEING;
xfs_dqflock(dqp);
@@ -204,9 +193,40 @@ xfs_qm_dqpurge(
mutex_unlock(&qi->qi_lru_lock);
xfs_qm_dqdestroy(dqp);
+ return 0;
+}
+
+/*
+ * Release the group or project dquot pointers the user dquots maybe carrying
+ * around as a hint, and proceed to purge the user dquot cache if requested.
+*/
+STATIC int
+xfs_qm_dqpurge_hints(
+ struct xfs_dquot *dqp,
+ void *data)
+{
+ struct xfs_dquot *gdqp = NULL;
+ uint flags = *((uint *)data);
+
+ xfs_dqlock(dqp);
+ if (dqp->dq_flags & XFS_DQ_FREEING) {
+ xfs_dqunlock(dqp);
+ return EAGAIN;
+ }
+
+ /* If this quota has a hint attached, prepare for releasing it now */
+ gdqp = dqp->q_gdquot;
+ if (gdqp)
+ dqp->q_gdquot = NULL;
+
+ xfs_dqunlock(dqp);
if (gdqp)
- xfs_qm_dqput(gdqp);
+ xfs_qm_dqrele(gdqp);
+
+ if (flags & XFS_QMOPT_UQUOTA)
+ return xfs_qm_dqpurge(dqp, NULL);
+
return 0;
}
@@ -218,8 +238,18 @@ xfs_qm_dqpurge_all(
struct xfs_mount *mp,
uint flags)
{
- if (flags & XFS_QMOPT_UQUOTA)
- xfs_qm_dquot_walk(mp, XFS_DQ_USER, xfs_qm_dqpurge, NULL);
+ /*
+ * We have to release group/project dquot hint(s) from the user dquot
+ * at first if they are there, otherwise we would run into an infinite
+ * loop while walking through radix tree to purge other type of dquots
+ * since their refcount is not zero if the user dquot refers to them
+ * as hint.
+ *
+ * Call the special xfs_qm_dqpurge_hints() will end up go through the
+ * general xfs_qm_dqpurge() against user dquot cache if requested.
+ */
+ xfs_qm_dquot_walk(mp, XFS_DQ_USER, xfs_qm_dqpurge_hints, &flags);
+
if (flags & XFS_QMOPT_GQUOTA)
xfs_qm_dquot_walk(mp, XFS_DQ_GROUP, xfs_qm_dqpurge, NULL);
if (flags & XFS_QMOPT_PQUOTA)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 077/166] ALSA: Add SNDRV_PCM_STATE_PAUSED case in wait_for_avail function
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (75 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 076/166] xfs: fix infinite loop by detaching the group/project hints from user dquot Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 078/166] cpupower: Fix segfault due to incorrect getopt_long arugments Kamal Mostafa
` (88 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: JongHo Kim, Takashi Iwai, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: JongHo Kim <furmuwon@gmail.com>
commit ed697e1aaf7237b1a62af39f64463b05c262808d upstream.
When the process is sleeping at the SNDRV_PCM_STATE_PAUSED
state from the wait_for_avail function, the sleep process will be woken by
timeout(10 seconds). Even if the sleep process wake up by timeout, by this
patch, the process will continue with sleep and wait for the other state.
Signed-off-by: JongHo Kim <furmuwon@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/core/pcm_lib.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index c4840ff..4be58d2 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -1904,6 +1904,8 @@ static int wait_for_avail(struct snd_pcm_substream *substream,
case SNDRV_PCM_STATE_DISCONNECTED:
err = -EBADFD;
goto _endloop;
+ case SNDRV_PCM_STATE_PAUSED:
+ continue;
}
if (!tout) {
snd_printd("%s write error (DMA or IRQ trouble?)\n",
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 078/166] cpupower: Fix segfault due to incorrect getopt_long arugments
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (76 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 077/166] ALSA: Add SNDRV_PCM_STATE_PAUSED case in wait_for_avail function Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 079/166] iio:adc:ad7887 Fix channel reported endianness from cpu to big endian Kamal Mostafa
` (87 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Josh Boyer, Dominik Brodowski, Thomas Renninger, Linus Torvalds,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Josh Boyer <jwboyer@redhat.com>
commit f447ef4a56dee4b68a91460bcdfe06b5011085f2 upstream.
If a user calls 'cpupower set --perf-bias 15', the process will end with
a SIGSEGV in libc because cpupower-set passes a NULL optarg to the atoi
call. This is because the getopt_long structure currently has all of
the options as having an optional_argument when they really have a
required argument. We change the structure to use required_argument to
match the short options and it resolves the issue.
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1000439
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
tools/power/cpupower/utils/cpupower-set.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/power/cpupower/utils/cpupower-set.c b/tools/power/cpupower/utils/cpupower-set.c
index dc4de37..bcf1d2f 100644
--- a/tools/power/cpupower/utils/cpupower-set.c
+++ b/tools/power/cpupower/utils/cpupower-set.c
@@ -18,9 +18,9 @@
#include "helpers/bitmask.h"
static struct option set_opts[] = {
- { .name = "perf-bias", .has_arg = optional_argument, .flag = NULL, .val = 'b'},
- { .name = "sched-mc", .has_arg = optional_argument, .flag = NULL, .val = 'm'},
- { .name = "sched-smt", .has_arg = optional_argument, .flag = NULL, .val = 's'},
+ { .name = "perf-bias", .has_arg = required_argument, .flag = NULL, .val = 'b'},
+ { .name = "sched-mc", .has_arg = required_argument, .flag = NULL, .val = 'm'},
+ { .name = "sched-smt", .has_arg = required_argument, .flag = NULL, .val = 's'},
{ },
};
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 079/166] iio:adc:ad7887 Fix channel reported endianness from cpu to big endian
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (77 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 078/166] cpupower: Fix segfault due to incorrect getopt_long arugments Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 080/166] ASoC: wm_adsp: Add small delay while polling DSP RAM start Kamal Mostafa
` (86 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Jonathan Cameron, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonathan Cameron <jic23@kernel.org>
commit e39d99059ad7f75d7ae2d3c59055d3c476cdb0d9 upstream.
Note this also sets the endianness to big endian whereas it would
previously have defaulted to the cpu endian. Hence technically
this is a bug fix on LE platforms.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/iio/adc/ad7887.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/adc/ad7887.c b/drivers/iio/adc/ad7887.c
index a33d5cd..b61002b 100644
--- a/drivers/iio/adc/ad7887.c
+++ b/drivers/iio/adc/ad7887.c
@@ -211,7 +211,13 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = {
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.address = 1,
.scan_index = 1,
- .scan_type = IIO_ST('u', 12, 16, 0),
+ .scan_type = {
+ .sign = 'u',
+ .realbits = 12,
+ .storagebits = 16,
+ .shift = 0,
+ .endianness = IIO_BE,
+ },
},
.channel[1] = {
.type = IIO_VOLTAGE,
@@ -221,7 +227,13 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = {
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.address = 0,
.scan_index = 0,
- .scan_type = IIO_ST('u', 12, 16, 0),
+ .scan_type = {
+ .sign = 'u',
+ .realbits = 12,
+ .storagebits = 16,
+ .shift = 0,
+ .endianness = IIO_BE,
+ },
},
.channel[2] = IIO_CHAN_SOFT_TIMESTAMP(2),
.int_vref_mv = 2500,
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 080/166] ASoC: wm_adsp: Add small delay while polling DSP RAM start
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (78 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 079/166] iio:adc:ad7887 Fix channel reported endianness from cpu to big endian Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 081/166] ASoC: wm8904: fix DSP mode B configuration Kamal Mostafa
` (85 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Charles Keepax, Mark Brown, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
commit 939fd1e8d9deff206f12bd9d4e54aa7a4bd0ffd6 upstream.
Some devices are getting very close to the limit whilst polling the RAM
start, this patch adds a small delay to this loop to give a longer
startup timeout.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/codecs/wm_adsp.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index b6b6548..80e2d05 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -535,13 +535,17 @@ static int wm_adsp2_ena(struct wm_adsp *dsp)
return ret;
/* Wait for the RAM to start, should be near instantaneous */
- count = 0;
- do {
+ for (count = 0; count < 10; ++count) {
ret = regmap_read(dsp->regmap, dsp->base + ADSP2_STATUS1,
&val);
if (ret != 0)
return ret;
- } while (!(val & ADSP2_RAM_RDY) && ++count < 10);
+
+ if (val & ADSP2_RAM_RDY)
+ break;
+
+ msleep(1);
+ }
if (!(val & ADSP2_RAM_RDY)) {
adsp_err(dsp, "Failed to start DSP RAM\n");
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 081/166] ASoC: wm8904: fix DSP mode B configuration
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (79 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 080/166] ASoC: wm_adsp: Add small delay while polling DSP RAM start Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 082/166] net_dma: mark broken Kamal Mostafa
` (84 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Bo Shen, Mark Brown, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Bo Shen <voice.shen@atmel.com>
commit f0199bc5e3a3ec13f9bc938556517ec430b36437 upstream.
When wm8904 work in DSP mode B, we still need to configure it to
work in DSP mode. Or else, it will work in Right Justified mode.
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/codecs/wm8904.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 3ff195c..af62f84 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -1449,7 +1449,7 @@ static int wm8904_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_DSP_B:
- aif1 |= WM8904_AIF_LRCLK_INV;
+ aif1 |= 0x3 | WM8904_AIF_LRCLK_INV;
case SND_SOC_DAIFMT_DSP_A:
aif1 |= 0x3;
break;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 082/166] net_dma: mark broken
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (80 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 081/166] ASoC: wm8904: fix DSP mode B configuration Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 083/166] mm: numa: serialise parallel get_user_page against THP migration Kamal Mostafa
` (83 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dave Jiang, Vinod Koul, Alexander Duyck, Dan Williams,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <dan.j.williams@intel.com>
commit 77873803363c9e831fc1d1e6895c084279090c22 upstream.
net_dma can cause data to be copied to a stale mapping if a
copy-on-write fault occurs during dma. The application sees missing
data.
The following trace is triggered by modifying the kernel to WARN if it
ever triggers copy-on-write on a page that is undergoing dma:
WARNING: CPU: 24 PID: 2529 at lib/dma-debug.c:485 debug_dma_assert_idle+0xd2/0x120()
ioatdma 0000:00:04.0: DMA-API: cpu touching an active dma mapped page [pfn=0x16bcd9]
Modules linked in: iTCO_wdt iTCO_vendor_support ioatdma lpc_ich pcspkr dca
CPU: 24 PID: 2529 Comm: linbug Tainted: G W 3.13.0-rc1+ #353
00000000000001e5 ffff88016f45f688 ffffffff81751041 ffff88017ab0ef70
ffff88016f45f6d8 ffff88016f45f6c8 ffffffff8104ed9c ffffffff810f3646
ffff8801768f4840 0000000000000282 ffff88016f6cca10 00007fa2bb699349
Call Trace:
[<ffffffff81751041>] dump_stack+0x46/0x58
[<ffffffff8104ed9c>] warn_slowpath_common+0x8c/0xc0
[<ffffffff810f3646>] ? ftrace_pid_func+0x26/0x30
[<ffffffff8104ee86>] warn_slowpath_fmt+0x46/0x50
[<ffffffff8139c062>] debug_dma_assert_idle+0xd2/0x120
[<ffffffff81154a40>] do_wp_page+0xd0/0x790
[<ffffffff811582ac>] handle_mm_fault+0x51c/0xde0
[<ffffffff813830b9>] ? copy_user_enhanced_fast_string+0x9/0x20
[<ffffffff8175fc2c>] __do_page_fault+0x19c/0x530
[<ffffffff8175c196>] ? _raw_spin_lock_bh+0x16/0x40
[<ffffffff810f3539>] ? trace_clock_local+0x9/0x10
[<ffffffff810fa1f4>] ? rb_reserve_next_event+0x64/0x310
[<ffffffffa0014c00>] ? ioat2_dma_prep_memcpy_lock+0x60/0x130 [ioatdma]
[<ffffffff8175ffce>] do_page_fault+0xe/0x10
[<ffffffff8175c862>] page_fault+0x22/0x30
[<ffffffff81643991>] ? __kfree_skb+0x51/0xd0
[<ffffffff813830b9>] ? copy_user_enhanced_fast_string+0x9/0x20
[<ffffffff81388ea2>] ? memcpy_toiovec+0x52/0xa0
[<ffffffff8164770f>] skb_copy_datagram_iovec+0x5f/0x2a0
[<ffffffff8169d0f4>] tcp_rcv_established+0x674/0x7f0
[<ffffffff816a68c5>] tcp_v4_do_rcv+0x2e5/0x4a0
[..]
---[ end trace e30e3b01191b7617 ]---
Mapped at:
[<ffffffff8139c169>] debug_dma_map_page+0xb9/0x160
[<ffffffff8142bf47>] dma_async_memcpy_pg_to_pg+0x127/0x210
[<ffffffff8142cce9>] dma_memcpy_pg_to_iovec+0x119/0x1f0
[<ffffffff81669d3c>] dma_skb_copy_datagram_iovec+0x11c/0x2b0
[<ffffffff8169d1ca>] tcp_rcv_established+0x74a/0x7f0:
...the problem is that the receive path falls back to cpu-copy in
several locations and this trace is just one of the areas. A few
options were considered to fix this:
1/ sync all dma whenever a cpu copy branch is taken
2/ modify the page fault handler to hold off while dma is in-flight
Option 1 adds yet more cpu overhead to an "offload" that struggles to compete
with cpu-copy. Option 2 adds checks for behavior that is already documented as
broken when using get_user_pages(). At a minimum a debug mode is warranted to
catch and flag these violations of the dma-api vs get_user_pages().
Thanks to David for his reproducer.
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Alexander Duyck <alexander.h.duyck@intel.com>
Reported-by: David Whipple <whipple@securedatainnovations.ch>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/dma/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index d4c1218..11bbcca 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -333,6 +333,7 @@ config NET_DMA
bool "Network: TCP receive copy offload"
depends on DMA_ENGINE && NET
default (INTEL_IOATDMA || FSL_DMA)
+ depends on BROKEN
help
This enables the use of DMA engines in the network stack to
offload receive copy-to-user operations, freeing CPU cycles.
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 083/166] mm: numa: serialise parallel get_user_page against THP migration
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (81 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 082/166] net_dma: mark broken Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 084/166] mm: numa: call MMU notifiers on " Kamal Mostafa
` (82 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mel Gorman, Alex Thorlton, Andrew Morton, Linus Torvalds,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <mgorman@suse.de>
commit 2b4847e73004c10ae6666c2e27b5c5430aed8698 upstream.
Base pages are unmapped and flushed from cache and TLB during normal
page migration and replaced with a migration entry that causes any
parallel NUMA hinting fault or gup to block until migration completes.
THP does not unmap pages due to a lack of support for migration entries
at a PMD level. This allows races with get_user_pages and
get_user_pages_fast which commit 3f926ab945b6 ("mm: Close races between
THP migration and PMD numa clearing") made worse by introducing a
pmd_clear_flush().
This patch forces get_user_page (fast and normal) on a pmd_numa page to
go through the slow get_user_page path where it will serialise against
THP migration and properly account for the NUMA hinting fault. On the
migration side the page table lock is taken for each PTE update.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/mm/gup.c | 13 +++++++++++++
mm/huge_memory.c | 24 ++++++++++++++++--------
mm/migrate.c | 38 +++++++++++++++++++++++++++++++-------
3 files changed, 60 insertions(+), 15 deletions(-)
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c
index dd74e46..0596e8e 100644
--- a/arch/x86/mm/gup.c
+++ b/arch/x86/mm/gup.c
@@ -83,6 +83,12 @@ static noinline int gup_pte_range(pmd_t pmd, unsigned long addr,
pte_t pte = gup_get_pte(ptep);
struct page *page;
+ /* Similar to the PMD case, NUMA hinting must take slow path */
+ if (pte_numa(pte)) {
+ pte_unmap(ptep);
+ return 0;
+ }
+
if ((pte_flags(pte) & (mask | _PAGE_SPECIAL)) != mask) {
pte_unmap(ptep);
return 0;
@@ -167,6 +173,13 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
if (pmd_none(pmd) || pmd_trans_splitting(pmd))
return 0;
if (unlikely(pmd_large(pmd))) {
+ /*
+ * NUMA hinting faults need to be handled in the GUP
+ * slowpath for accounting purposes and so that they
+ * can be serialised against THP migration.
+ */
+ if (pmd_numa(pmd))
+ return 0;
if (!gup_huge_pmd(pmd, addr, next, write, pages, nr))
return 0;
} else {
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 9d0b5f5..a72d5ca 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1261,6 +1261,10 @@ struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
if ((flags & FOLL_DUMP) && is_huge_zero_pmd(*pmd))
return ERR_PTR(-EFAULT);
+ /* Full NUMA hinting faults to serialise migration in fault paths */
+ if ((flags & FOLL_NUMA) && pmd_numa(*pmd))
+ goto out;
+
page = pmd_page(*pmd);
VM_BUG_ON(!PageHead(page));
if (flags & FOLL_TOUCH) {
@@ -1325,23 +1329,27 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
/* If the page was locked, there are no parallel migrations */
if (page_locked)
goto clear_pmdnuma;
+ }
- /*
- * Otherwise wait for potential migrations and retry. We do
- * relock and check_same as the page may no longer be mapped.
- * As the fault is being retried, do not account for it.
- */
+ /*
+ * If there are potential migrations, wait for completion and retry. We
+ * do not relock and check_same as the page may no longer be mapped.
+ * Furtermore, even if the page is currently misplaced, there is no
+ * guarantee it is still misplaced after the migration completes.
+ */
+ if (!page_locked) {
spin_unlock(&mm->page_table_lock);
wait_on_page_locked(page);
page_nid = -1;
goto out;
}
- /* Page is misplaced, serialise migrations and parallel THP splits */
+ /*
+ * Page is misplaced. Page lock serialises migrations. Acquire anon_vma
+ * to serialises splits
+ */
get_page(page);
spin_unlock(&mm->page_table_lock);
- if (!page_locked)
- lock_page(page);
anon_vma = page_lock_anon_vma_read(page);
/* Confirm the PTE did not while locked */
diff --git a/mm/migrate.c b/mm/migrate.c
index d2296c5..09c881c 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1671,6 +1671,7 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
struct page *new_page = NULL;
struct mem_cgroup *memcg = NULL;
int page_lru = page_is_file_cache(page);
+ pmd_t orig_entry;
/*
* Don't migrate pages that are mapped in multiple processes.
@@ -1712,7 +1713,8 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
/* Recheck the target PMD */
spin_lock(&mm->page_table_lock);
- if (unlikely(!pmd_same(*pmd, entry))) {
+ if (unlikely(!pmd_same(*pmd, entry) || page_count(page) != 2)) {
+fail_putback:
spin_unlock(&mm->page_table_lock);
/* Reverse changes made by migrate_page_copy() */
@@ -1742,16 +1744,34 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
*/
mem_cgroup_prepare_migration(page, new_page, &memcg);
+ orig_entry = *pmd;
entry = mk_pmd(new_page, vma->vm_page_prot);
- entry = pmd_mknonnuma(entry);
- entry = maybe_pmd_mkwrite(pmd_mkdirty(entry), vma);
entry = pmd_mkhuge(entry);
+ entry = maybe_pmd_mkwrite(pmd_mkdirty(entry), vma);
+ /*
+ * Clear the old entry under pagetable lock and establish the new PTE.
+ * Any parallel GUP will either observe the old page blocking on the
+ * page lock, block on the page table lock or observe the new page.
+ * The SetPageUptodate on the new page and page_add_new_anon_rmap
+ * guarantee the copy is visible before the pagetable update.
+ */
+ flush_cache_range(vma, haddr, haddr + HPAGE_PMD_SIZE);
+ page_add_new_anon_rmap(new_page, vma, haddr);
pmdp_clear_flush(vma, haddr, pmd);
set_pmd_at(mm, haddr, pmd, entry);
- page_add_new_anon_rmap(new_page, vma, haddr);
update_mmu_cache_pmd(vma, address, &entry);
+
+ if (page_count(page) != 2) {
+ set_pmd_at(mm, haddr, pmd, orig_entry);
+ flush_tlb_range(vma, haddr, haddr + HPAGE_PMD_SIZE);
+ update_mmu_cache_pmd(vma, address, &entry);
+ page_remove_rmap(new_page);
+ goto fail_putback;
+ }
+
page_remove_rmap(page);
+
/*
* Finish the charge transaction under the page table lock to
* prevent split_huge_page() from dividing up the charge
@@ -1776,9 +1796,13 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
out_fail:
count_vm_events(PGMIGRATE_FAIL, HPAGE_PMD_NR);
out_dropref:
- entry = pmd_mknonnuma(entry);
- set_pmd_at(mm, haddr, pmd, entry);
- update_mmu_cache_pmd(vma, address, &entry);
+ spin_lock(&mm->page_table_lock);
+ if (pmd_same(*pmd, entry)) {
+ entry = pmd_mknonnuma(entry);
+ set_pmd_at(mm, haddr, pmd, entry);
+ update_mmu_cache_pmd(vma, address, &entry);
+ }
+ spin_unlock(&mm->page_table_lock);
unlock_page(page);
put_page(page);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 084/166] mm: numa: call MMU notifiers on THP migration
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (82 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 083/166] mm: numa: serialise parallel get_user_page against THP migration Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 085/166] mm: clear pmd_numa before invalidating Kamal Mostafa
` (81 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mel Gorman, Alex Thorlton, Andrew Morton, Linus Torvalds,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <mgorman@suse.de>
commit f714f4f20e59ea6eea264a86b9a51fd51b88fc54 upstream.
MMU notifiers must be called on THP page migration or secondary MMUs
will get very confused.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
mm/migrate.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/mm/migrate.c b/mm/migrate.c
index 09c881c..6344541 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -36,6 +36,7 @@
#include <linux/hugetlb_cgroup.h>
#include <linux/gfp.h>
#include <linux/balloon_compaction.h>
+#include <linux/mmu_notifier.h>
#include <asm/tlbflush.h>
@@ -1665,12 +1666,13 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
unsigned long address,
struct page *page, int node)
{
- unsigned long haddr = address & HPAGE_PMD_MASK;
pg_data_t *pgdat = NODE_DATA(node);
int isolated = 0;
struct page *new_page = NULL;
struct mem_cgroup *memcg = NULL;
int page_lru = page_is_file_cache(page);
+ unsigned long mmun_start = address & HPAGE_PMD_MASK;
+ unsigned long mmun_end = mmun_start + HPAGE_PMD_SIZE;
pmd_t orig_entry;
/*
@@ -1712,10 +1714,12 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
WARN_ON(PageLRU(new_page));
/* Recheck the target PMD */
+ mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end);
spin_lock(&mm->page_table_lock);
if (unlikely(!pmd_same(*pmd, entry) || page_count(page) != 2)) {
fail_putback:
spin_unlock(&mm->page_table_lock);
+ mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end);
/* Reverse changes made by migrate_page_copy() */
if (TestClearPageActive(new_page))
@@ -1756,15 +1760,16 @@ fail_putback:
* The SetPageUptodate on the new page and page_add_new_anon_rmap
* guarantee the copy is visible before the pagetable update.
*/
- flush_cache_range(vma, haddr, haddr + HPAGE_PMD_SIZE);
- page_add_new_anon_rmap(new_page, vma, haddr);
- pmdp_clear_flush(vma, haddr, pmd);
- set_pmd_at(mm, haddr, pmd, entry);
+ flush_cache_range(vma, mmun_start, mmun_end);
+ page_add_new_anon_rmap(new_page, vma, mmun_start);
+ pmdp_clear_flush(vma, mmun_start, pmd);
+ set_pmd_at(mm, mmun_start, pmd, entry);
+ flush_tlb_range(vma, mmun_start, mmun_end);
update_mmu_cache_pmd(vma, address, &entry);
if (page_count(page) != 2) {
- set_pmd_at(mm, haddr, pmd, orig_entry);
- flush_tlb_range(vma, haddr, haddr + HPAGE_PMD_SIZE);
+ set_pmd_at(mm, mmun_start, pmd, orig_entry);
+ flush_tlb_range(vma, mmun_start, mmun_end);
update_mmu_cache_pmd(vma, address, &entry);
page_remove_rmap(new_page);
goto fail_putback;
@@ -1779,6 +1784,7 @@ fail_putback:
*/
mem_cgroup_end_migration(memcg, page, new_page, true);
spin_unlock(&mm->page_table_lock);
+ mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end);
unlock_page(new_page);
unlock_page(page);
@@ -1799,7 +1805,7 @@ out_dropref:
spin_lock(&mm->page_table_lock);
if (pmd_same(*pmd, entry)) {
entry = pmd_mknonnuma(entry);
- set_pmd_at(mm, haddr, pmd, entry);
+ set_pmd_at(mm, mmun_start, pmd, entry);
update_mmu_cache_pmd(vma, address, &entry);
}
spin_unlock(&mm->page_table_lock);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 085/166] mm: clear pmd_numa before invalidating
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (83 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 084/166] mm: numa: call MMU notifiers on " Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 086/166] mm: numa: do not clear PMD during PTE update scan Kamal Mostafa
` (80 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mel Gorman, Alex Thorlton, Andrew Morton, Linus Torvalds,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <mgorman@suse.de>
commit 67f87463d3a3362424efcbe8b40e4772fd34fc61 upstream.
On x86, PMD entries are similar to _PAGE_PROTNONE protection and are
handled as NUMA hinting faults. The following two page table protection
bits are what defines them
_PAGE_NUMA:set _PAGE_PRESENT:clear
A PMD is considered present if any of the _PAGE_PRESENT, _PAGE_PROTNONE,
_PAGE_PSE or _PAGE_NUMA bits are set. If pmdp_invalidate encounters a
pmd_numa, it clears the present bit leaving _PAGE_NUMA which will be
considered not present by the CPU but present by pmd_present. The
existing caller of pmdp_invalidate should handle it but it's an
inconsistent state for a PMD. This patch keeps the state consistent
when calling pmdp_invalidate.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.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/pgtable-generic.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index 0c8323f..eb900bb 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -166,6 +166,9 @@ pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm)
void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
pmd_t *pmdp)
{
+ pmd_t entry = *pmdp;
+ if (pmd_numa(entry))
+ entry = pmd_mknonnuma(entry);
set_pmd_at(vma->vm_mm, address, pmdp, pmd_mknotpresent(*pmdp));
flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 086/166] mm: numa: do not clear PMD during PTE update scan
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (84 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 085/166] mm: clear pmd_numa before invalidating Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 087/166] mm: numa: do not clear PTE for pte_numa update Kamal Mostafa
` (79 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mel Gorman, Alex Thorlton, Andrew Morton, Linus Torvalds,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <mgorman@suse.de>
commit 5a6dac3ec5f583cc8ee7bc53b5500a207c4ca433 upstream.
If the PMD is flushed then a parallel fault in handle_mm_fault() will
enter the pmd_none and do_huge_pmd_anonymous_page() path where it'll
attempt to insert a huge zero page. This is wasteful so the patch
avoids clearing the PMD when setting pmd_numa.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.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/huge_memory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index a72d5ca..5d7dc7c 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1506,7 +1506,7 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
/* only check non-shared pages */
if (page_mapcount(page) == 1 &&
!pmd_numa(*pmd)) {
- entry = pmdp_get_and_clear(mm, addr, pmd);
+ entry = *pmd;
entry = pmd_mknuma(entry);
ret = HPAGE_PMD_NR;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 087/166] mm: numa: do not clear PTE for pte_numa update
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (85 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 086/166] mm: numa: do not clear PMD during PTE update scan Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 088/166] mm: numa: ensure anon_vma is locked to prevent parallel THP splits Kamal Mostafa
` (78 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mel Gorman, Rik van Riel, Alex Thorlton, Chegu Vinod,
Andrew Morton, Linus Torvalds, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <mgorman@suse.de>
commit 0c5f83c23ca703d32f930393825487257a5cde6d upstream.
The TLB must be flushed if the PTE is updated but change_pte_range is
clearing the PTE while marking PTEs pte_numa without necessarily
flushing the TLB if it reinserts the same entry. Without the flush,
it's conceivable that two processors have different TLBs for the same
virtual address and at the very least it would generate spurious faults.
This patch only unmaps the pages in change_pte_range for a full
protection change.
[riel@redhat.com: write pte_numa pte back to the page tables]
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Rik van Riel <riel@redhat.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.com>
Cc: Chegu Vinod <chegu_vinod@hp.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/mprotect.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 4c35eb8..79abf13 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -54,13 +54,14 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
pte_t ptent;
bool updated = false;
- ptent = ptep_modify_prot_start(mm, addr, pte);
if (!prot_numa) {
+ ptent = ptep_modify_prot_start(mm, addr, pte);
ptent = pte_modify(ptent, newprot);
updated = true;
} else {
struct page *page;
+ ptent = *pte;
page = vm_normal_page(vma, addr, oldpte);
if (page) {
int this_nid = page_to_nid(page);
@@ -73,6 +74,7 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
if (!pte_numa(oldpte) &&
page_mapcount(page) == 1) {
ptent = pte_mknuma(ptent);
+ set_pte_at(mm, addr, pte, ptent);
updated = true;
}
}
@@ -89,7 +91,10 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
if (updated)
pages++;
- ptep_modify_prot_commit(mm, addr, pte, ptent);
+
+ /* Only !prot_numa always clears the pte */
+ if (!prot_numa)
+ ptep_modify_prot_commit(mm, addr, pte, ptent);
} else if (IS_ENABLED(CONFIG_MIGRATION) && !pte_file(oldpte)) {
swp_entry_t entry = pte_to_swp_entry(oldpte);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 088/166] mm: numa: ensure anon_vma is locked to prevent parallel THP splits
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (86 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 087/166] mm: numa: do not clear PTE for pte_numa update Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 089/166] mm: numa: avoid unnecessary work on the failure path Kamal Mostafa
` (77 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mel Gorman, Alex Thorlton, Andrew Morton, Linus Torvalds,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <mgorman@suse.de>
commit c3a489cac38d43ea6dc4ac240473b44b46deecf7 upstream.
The anon_vma lock prevents parallel THP splits and any associated
complexity that arises when handling splits during THP migration. This
patch checks if the lock was successfully acquired and bails from THP
migration if it failed for any reason.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.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/huge_memory.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 5d7dc7c..594b3c1 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1361,6 +1361,13 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
goto out_unlock;
}
+ /* Bail if we fail to protect against THP splits for any reason */
+ if (unlikely(!anon_vma)) {
+ put_page(page);
+ page_nid = -1;
+ goto clear_pmdnuma;
+ }
+
/*
* Migrate the THP to the requested node, returns with page unlocked
* and pmd_numa cleared.
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 089/166] mm: numa: avoid unnecessary work on the failure path
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (87 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 088/166] mm: numa: ensure anon_vma is locked to prevent parallel THP splits Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 090/166] sched: numa: skip inaccessible VMAs Kamal Mostafa
` (76 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mel Gorman, Alex Thorlton, Andrew Morton, Linus Torvalds,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <mgorman@suse.de>
commit eb4489f69f224356193364dc2762aa009738ca7f upstream.
If a PMD changes during a THP migration then migration aborts but the
failure path is doing more work than is necessary.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.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/migrate.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/migrate.c b/mm/migrate.c
index 6344541..5a62622 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1736,7 +1736,8 @@ fail_putback:
putback_lru_page(page);
mod_zone_page_state(page_zone(page),
NR_ISOLATED_ANON + page_lru, -HPAGE_PMD_NR);
- goto out_fail;
+
+ goto out_unlock;
}
/*
@@ -1810,6 +1811,7 @@ out_dropref:
}
spin_unlock(&mm->page_table_lock);
+out_unlock:
unlock_page(page);
put_page(page);
return 0;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 090/166] sched: numa: skip inaccessible VMAs
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (88 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 089/166] mm: numa: avoid unnecessary work on the failure path Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 091/166] mm: numa: clear numa hinting information on mprotect Kamal Mostafa
` (75 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mel Gorman, Alex Thorlton, Andrew Morton, Linus Torvalds,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <mgorman@suse.de>
commit 3c67f474558748b604e247d92b55dfe89654c81d upstream.
Inaccessible VMA should not be trapping NUMA hint faults. Skip them.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.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/sched/fair.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 6c8930e..843ab0b 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -935,6 +935,13 @@ void task_numa_work(struct callback_head *work)
if (vma->vm_end - vma->vm_start < HPAGE_SIZE)
continue;
+ /*
+ * Skip inaccessible VMAs to avoid any confusion between
+ * PROT_NONE and NUMA hinting ptes
+ */
+ if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
+ continue;
+
do {
start = max(start, vma->vm_start);
end = ALIGN(start + (pages << PAGE_SHIFT), HPAGE_SIZE);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 091/166] mm: numa: clear numa hinting information on mprotect
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (89 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 090/166] sched: numa: skip inaccessible VMAs Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 092/166] mm: numa: avoid unnecessary disruption of NUMA hinting during migration Kamal Mostafa
` (74 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mel Gorman, Alex Thorlton, Andrew Morton, Linus Torvalds,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <mgorman@suse.de>
commit 1667918b6483b12a6496bf54151b827b8235d7b1 upstream.
On a protection change it is no longer clear if the page should be still
accessible. This patch clears the NUMA hinting fault bits on a
protection change.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.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/huge_memory.c | 2 ++
mm/mprotect.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 594b3c1..a67726d 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1504,6 +1504,8 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
ret = 1;
if (!prot_numa) {
entry = pmdp_get_and_clear(mm, addr, pmd);
+ if (pmd_numa(entry))
+ entry = pmd_mknonnuma(entry);
entry = pmd_modify(entry, newprot);
ret = HPAGE_PMD_NR;
BUG_ON(pmd_write(entry));
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 79abf13..c477655 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -56,6 +56,8 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
if (!prot_numa) {
ptent = ptep_modify_prot_start(mm, addr, pte);
+ if (pte_numa(ptent))
+ ptent = pte_mknonnuma(ptent);
ptent = pte_modify(ptent, newprot);
updated = true;
} else {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 092/166] mm: numa: avoid unnecessary disruption of NUMA hinting during migration
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (90 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 091/166] mm: numa: clear numa hinting information on mprotect Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 093/166] mm: fix TLB flush race between migration, and change_protection_range Kamal Mostafa
` (73 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mel Gorman, Alex Thorlton, Andrew Morton, Linus Torvalds,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <mgorman@suse.de>
commit de466bd628e8d663fdf3f791bc8db318ee85c714 upstream.
do_huge_pmd_numa_page() handles the case where there is parallel THP
migration. However, by the time it is checked the NUMA hinting
information has already been disrupted. This patch adds an earlier
check with some helpers.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.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/migrate.h | 9 +++++++++
mm/huge_memory.c | 22 ++++++++++++++++------
mm/migrate.c | 12 ++++++++++++
3 files changed, 37 insertions(+), 6 deletions(-)
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 1e9f627..270447e 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -94,10 +94,19 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping,
#endif /* CONFIG_MIGRATION */
#ifdef CONFIG_NUMA_BALANCING
+extern bool pmd_trans_migrating(pmd_t pmd);
+extern void wait_migrate_huge_page(struct anon_vma *anon_vma, pmd_t *pmd);
extern int migrate_misplaced_page(struct page *page, int node);
extern int migrate_misplaced_page(struct page *page, int node);
extern bool migrate_ratelimited(int node);
#else
+static inline bool pmd_trans_migrating(pmd_t pmd)
+{
+ return false;
+}
+static inline void wait_migrate_huge_page(struct anon_vma *anon_vma, pmd_t *pmd)
+{
+}
static inline int migrate_misplaced_page(struct page *page, int node)
{
return -EAGAIN; /* can't migrate now */
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index a67726d..21ca328 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -908,6 +908,10 @@ int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm,
ret = 0;
goto out_unlock;
}
+
+ /* mmap_sem prevents this happening but warn if that changes */
+ WARN_ON(pmd_trans_migrating(pmd));
+
if (unlikely(pmd_trans_splitting(pmd))) {
/* split huge page running from under us */
spin_unlock(&src_mm->page_table_lock);
@@ -1313,6 +1317,17 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
if (unlikely(!pmd_same(pmd, *pmdp)))
goto out_unlock;
+ /*
+ * If there are potential migrations, wait for completion and retry
+ * without disrupting NUMA hinting information. Do not relock and
+ * check_same as the page may no longer be mapped.
+ */
+ if (unlikely(pmd_trans_migrating(*pmdp))) {
+ spin_unlock(&mm->page_table_lock);
+ wait_migrate_huge_page(vma->anon_vma, pmdp);
+ goto out;
+ }
+
page = pmd_page(pmd);
page_nid = page_to_nid(page);
count_vm_numa_event(NUMA_HINT_FAULTS);
@@ -1331,12 +1346,7 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
goto clear_pmdnuma;
}
- /*
- * If there are potential migrations, wait for completion and retry. We
- * do not relock and check_same as the page may no longer be mapped.
- * Furtermore, even if the page is currently misplaced, there is no
- * guarantee it is still misplaced after the migration completes.
- */
+ /* Migration could have started since the pmd_trans_migrating check */
if (!page_locked) {
spin_unlock(&mm->page_table_lock);
wait_on_page_locked(page);
diff --git a/mm/migrate.c b/mm/migrate.c
index 5a62622..8e117b7 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1605,6 +1605,18 @@ int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page)
return 1;
}
+bool pmd_trans_migrating(pmd_t pmd)
+{
+ struct page *page = pmd_page(pmd);
+ return PageLocked(page);
+}
+
+void wait_migrate_huge_page(struct anon_vma *anon_vma, pmd_t *pmd)
+{
+ struct page *page = pmd_page(*pmd);
+ wait_on_page_locked(page);
+}
+
/*
* Attempt to migrate a misplaced page to the specified destination
* node. Caller is expected to have an elevated reference count on
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 093/166] mm: fix TLB flush race between migration, and change_protection_range
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (91 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 092/166] mm: numa: avoid unnecessary disruption of NUMA hinting during migration Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 094/166] mm: numa: defer TLB flush for THP migration as long as possible Kamal Mostafa
` (72 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Rik van Riel, Mel Gorman, Alex Thorlton, Andrew Morton,
Linus Torvalds, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Rik van Riel <riel@redhat.com>
commit 20841405940e7be0617612d521e206e4b6b325db upstream.
There are a few subtle races, between change_protection_range (used by
mprotect and change_prot_numa) on one side, and NUMA page migration and
compaction on the other side.
The basic race is that there is a time window between when the PTE gets
made non-present (PROT_NONE or NUMA), and the TLB is flushed.
During that time, a CPU may continue writing to the page.
This is fine most of the time, however compaction or the NUMA migration
code may come in, and migrate the page away.
When that happens, the CPU may continue writing, through the cached
translation, to what is no longer the current memory location of the
process.
This only affects x86, which has a somewhat optimistic pte_accessible.
All other architectures appear to be safe, and will either always flush,
or flush whenever there is a valid mapping, even with no permissions
(SPARC).
The basic race looks like this:
CPU A CPU B CPU C
load TLB entry
make entry PTE/PMD_NUMA
fault on entry
read/write old page
start migrating page
change PTE/PMD to new page
read/write old page [*]
flush TLB
reload TLB from new entry
read/write new page
lose data
[*] the old page may belong to a new user at this point!
The obvious fix is to flush remote TLB entries, by making sure that
pte_accessible aware of the fact that PROT_NONE and PROT_NUMA memory may
still be accessible if there is a TLB flush pending for the mm.
This should fix both NUMA migration and compaction.
[mgorman@suse.de: fix build]
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Cc: Alex Thorlton <athorlton@sgi.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>
---
arch/sparc/include/asm/pgtable_64.h | 4 ++--
arch/x86/include/asm/pgtable.h | 11 ++++++++--
include/asm-generic/pgtable.h | 2 +-
include/linux/mm_types.h | 44 +++++++++++++++++++++++++++++++++++++
kernel/fork.c | 1 +
mm/huge_memory.c | 7 ++++++
mm/mprotect.c | 2 ++
mm/pgtable-generic.c | 5 +++--
8 files changed, 69 insertions(+), 7 deletions(-)
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h
index 7619f2f..dfb0019 100644
--- a/arch/sparc/include/asm/pgtable_64.h
+++ b/arch/sparc/include/asm/pgtable_64.h
@@ -616,7 +616,7 @@ static inline unsigned long pte_present(pte_t pte)
}
#define pte_accessible pte_accessible
-static inline unsigned long pte_accessible(pte_t a)
+static inline unsigned long pte_accessible(struct mm_struct *mm, pte_t a)
{
return pte_val(a) & _PAGE_VALID;
}
@@ -806,7 +806,7 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
* SUN4V NOTE: _PAGE_VALID is the same value in both the SUN4U
* and SUN4V pte layout, so this inline test is fine.
*/
- if (likely(mm != &init_mm) && pte_accessible(orig))
+ if (likely(mm != &init_mm) && pte_accessible(mm, orig))
tlb_batch_add(mm, addr, ptep, orig, fullmm);
}
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 1c1a955..e4f518b 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -414,9 +414,16 @@ static inline int pte_present(pte_t a)
}
#define pte_accessible pte_accessible
-static inline int pte_accessible(pte_t a)
+static inline bool pte_accessible(struct mm_struct *mm, pte_t a)
{
- return pte_flags(a) & _PAGE_PRESENT;
+ if (pte_flags(a) & _PAGE_PRESENT)
+ return true;
+
+ if ((pte_flags(a) & (_PAGE_PROTNONE | _PAGE_NUMA)) &&
+ mm_tlb_flush_pending(mm))
+ return true;
+
+ return false;
}
static inline int pte_hidden(pte_t pte)
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index f50a87d..1af32dc 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -230,7 +230,7 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
#endif
#ifndef pte_accessible
-# define pte_accessible(pte) ((void)(pte),1)
+# define pte_accessible(mm, pte) ((void)(pte), 1)
#endif
#ifndef flush_tlb_fix_spurious_fault
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 7716e38..939fbd3 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -436,6 +436,14 @@ struct mm_struct {
*/
int first_nid;
#endif
+#if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION)
+ /*
+ * An operation with batched TLB flushing is going on. Anything that
+ * can move process memory needs to flush the TLB when moving a
+ * PROT_NONE or PROT_NUMA mapped page.
+ */
+ bool tlb_flush_pending;
+#endif
struct uprobes_state uprobes_state;
};
@@ -456,4 +464,40 @@ static inline cpumask_t *mm_cpumask(struct mm_struct *mm)
return mm->cpu_vm_mask_var;
}
+#if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION)
+/*
+ * Memory barriers to keep this state in sync are graciously provided by
+ * the page table locks, outside of which no page table modifications happen.
+ * The barriers below prevent the compiler from re-ordering the instructions
+ * around the memory barriers that are already present in the code.
+ */
+static inline bool mm_tlb_flush_pending(struct mm_struct *mm)
+{
+ barrier();
+ return mm->tlb_flush_pending;
+}
+static inline void set_tlb_flush_pending(struct mm_struct *mm)
+{
+ mm->tlb_flush_pending = true;
+ barrier();
+}
+/* Clearing is done after a TLB flush, which also provides a barrier. */
+static inline void clear_tlb_flush_pending(struct mm_struct *mm)
+{
+ barrier();
+ mm->tlb_flush_pending = false;
+}
+#else
+static inline bool mm_tlb_flush_pending(struct mm_struct *mm)
+{
+ return false;
+}
+static inline void set_tlb_flush_pending(struct mm_struct *mm)
+{
+}
+static inline void clear_tlb_flush_pending(struct mm_struct *mm)
+{
+}
+#endif
+
#endif /* _LINUX_MM_TYPES_H */
diff --git a/kernel/fork.c b/kernel/fork.c
index 5c992f8..65b8b0a 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -543,6 +543,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p)
mm->cached_hole_size = ~0UL;
mm_init_aio(mm);
mm_init_owner(mm, p);
+ clear_tlb_flush_pending(mm);
if (likely(!mm_alloc_pgd(mm))) {
mm->def_flags = 0;
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 21ca328..b43f35a 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1379,6 +1379,13 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
}
/*
+ * The page_table_lock above provides a memory barrier
+ * with change_protection_range.
+ */
+ if (mm_tlb_flush_pending(mm))
+ flush_tlb_range(vma, haddr, haddr + HPAGE_PMD_SIZE);
+
+ /*
* Migrate the THP to the requested node, returns with page unlocked
* and pmd_numa cleared.
*/
diff --git a/mm/mprotect.c b/mm/mprotect.c
index c477655..0b6c605 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -218,6 +218,7 @@ static unsigned long change_protection_range(struct vm_area_struct *vma,
BUG_ON(addr >= end);
pgd = pgd_offset(mm, addr);
flush_cache_range(vma, addr, end);
+ set_tlb_flush_pending(mm);
do {
next = pgd_addr_end(addr, end);
if (pgd_none_or_clear_bad(pgd))
@@ -229,6 +230,7 @@ static unsigned long change_protection_range(struct vm_area_struct *vma,
/* Only flush the TLB if we actually modified any entries: */
if (pages)
flush_tlb_range(vma, start, end);
+ clear_tlb_flush_pending(mm);
return pages;
}
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index eb900bb..4b62a16 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -86,9 +86,10 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma,
pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address,
pte_t *ptep)
{
+ struct mm_struct *mm = (vma)->vm_mm;
pte_t pte;
- pte = ptep_get_and_clear((vma)->vm_mm, address, ptep);
- if (pte_accessible(pte))
+ pte = ptep_get_and_clear(mm, address, ptep);
+ if (pte_accessible(mm, pte))
flush_tlb_page(vma, address);
return pte;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 094/166] mm: numa: defer TLB flush for THP migration as long as possible
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (92 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 093/166] mm: fix TLB flush race between migration, and change_protection_range Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 095/166] mm/compaction: respect ignore_skip_hint in update_pageblock_skip Kamal Mostafa
` (71 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mel Gorman, Alex Thorlton, Andrew Morton, Linus Torvalds,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <mgorman@suse.de>
commit b0943d61b8fa420180f92f64ef67662b4f6cc493 upstream.
THP migration can fail for a variety of reasons. Avoid flushing the TLB
to deal with THP migration races until the copy is ready to start.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.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/huge_memory.c | 7 -------
mm/migrate.c | 3 +++
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index b43f35a..21ca328 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1379,13 +1379,6 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
}
/*
- * The page_table_lock above provides a memory barrier
- * with change_protection_range.
- */
- if (mm_tlb_flush_pending(mm))
- flush_tlb_range(vma, haddr, haddr + HPAGE_PMD_SIZE);
-
- /*
* Migrate the THP to the requested node, returns with page unlocked
* and pmd_numa cleared.
*/
diff --git a/mm/migrate.c b/mm/migrate.c
index 8e117b7..8edfa00 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1715,6 +1715,9 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
goto out_fail;
}
+ if (mm_tlb_flush_pending(mm))
+ flush_tlb_range(vma, mmun_start, mmun_end);
+
/* Prepare a page as a migration target */
__set_page_locked(new_page);
SetPageSwapBacked(new_page);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 095/166] mm/compaction: respect ignore_skip_hint in update_pageblock_skip
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (93 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 094/166] mm: numa: defer TLB flush for THP migration as long as possible Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 096/166] target/file: Update hw_max_sectors based on current block_size Kamal Mostafa
` (70 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Joonsoo Kim, Christoph Lameter, Rafael Aquini, Vlastimil Babka,
Wanpeng Li, Mel Gorman, Rik van Riel, Zhang Yanfei, Andrew Morton,
Linus Torvalds, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
commit 6815bf3f233e0b10c99a758497d5d236063b010b upstream.
update_pageblock_skip() only fits to compaction which tries to isolate
by pageblock unit. If isolate_migratepages_range() is called by CMA, it
try to isolate regardless of pageblock unit and it don't reference
get_pageblock_skip() by ignore_skip_hint. We should also respect it on
update_pageblock_skip() to prevent from setting the wrong information.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Rafael Aquini <aquini@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.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/compaction.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/mm/compaction.c b/mm/compaction.c
index c62bd06..2a17e96 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -133,6 +133,10 @@ static void update_pageblock_skip(struct compact_control *cc,
bool migrate_scanner)
{
struct zone *zone = cc->zone;
+
+ if (cc->ignore_skip_hint)
+ return;
+
if (!page)
return;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 096/166] target/file: Update hw_max_sectors based on current block_size
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (94 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 095/166] mm/compaction: respect ignore_skip_hint in update_pageblock_skip Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 097/166] arm64: ptrace: avoid using HW_BREAKPOINT_EMPTY for disabled events Kamal Mostafa
` (69 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Nicholas Bellinger, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <nab@linux-iscsi.org>
commit 95cadace8f3959282e76ebf8b382bd0930807d2c upstream.
This patch allows FILEIO to update hw_max_sectors based on the current
max_bytes_per_io. This is required because vfs_[writev,readv]() can accept
a maximum of 2048 iovecs per call, so the enforced hw_max_sectors really
needs to be calculated based on block_size.
This addresses a >= v3.5 bug where block_size=512 was rejecting > 1M
sized I/O requests, because FD_MAX_SECTORS was hardcoded to 2048 for
the block_size=4096 case.
(v2: Use max_bytes_per_io instead of ->update_hw_max_sectors)
Reported-by: Henrik Goldman <hg@x-formation.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/target/target_core_device.c | 5 +++++
drivers/target/target_core_file.c | 8 ++++----
drivers/target/target_core_file.h | 5 ++++-
include/target/target_core_base.h | 1 +
4 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 96f4981..c461180 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -1048,6 +1048,11 @@ int se_dev_set_block_size(struct se_device *dev, u32 block_size)
dev->dev_attrib.block_size = block_size;
pr_debug("dev[%p]: SE Device block_size changed to %u\n",
dev, block_size);
+
+ if (dev->dev_attrib.max_bytes_per_io)
+ dev->dev_attrib.hw_max_sectors =
+ dev->dev_attrib.max_bytes_per_io / block_size;
+
return 0;
}
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 89aa3b2a..9bfe625 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -64,9 +64,8 @@ static int fd_attach_hba(struct se_hba *hba, u32 host_id)
pr_debug("CORE_HBA[%d] - TCM FILEIO HBA Driver %s on Generic"
" Target Core Stack %s\n", hba->hba_id, FD_VERSION,
TARGET_CORE_MOD_VERSION);
- pr_debug("CORE_HBA[%d] - Attached FILEIO HBA: %u to Generic"
- " MaxSectors: %u\n",
- hba->hba_id, fd_host->fd_host_id, FD_MAX_SECTORS);
+ pr_debug("CORE_HBA[%d] - Attached FILEIO HBA: %u to Generic\n",
+ hba->hba_id, fd_host->fd_host_id);
return 0;
}
@@ -174,7 +173,8 @@ static int fd_configure_device(struct se_device *dev)
fd_dev->fd_block_size = dev->dev_attrib.hw_block_size;
dev->dev_attrib.hw_block_size = FD_BLOCKSIZE;
- dev->dev_attrib.hw_max_sectors = FD_MAX_SECTORS;
+ dev->dev_attrib.max_bytes_per_io = FD_MAX_BYTES;
+ dev->dev_attrib.hw_max_sectors = FD_MAX_BYTES / fd_dev->fd_block_size;
dev->dev_attrib.hw_queue_depth = FD_MAX_DEVICE_QUEUE_DEPTH;
if (fd_dev->fbd_flags & FDBD_HAS_BUFFERED_IO_WCE) {
diff --git a/drivers/target/target_core_file.h b/drivers/target/target_core_file.h
index 37ffc5b..d7772c1 100644
--- a/drivers/target/target_core_file.h
+++ b/drivers/target/target_core_file.h
@@ -7,7 +7,10 @@
#define FD_DEVICE_QUEUE_DEPTH 32
#define FD_MAX_DEVICE_QUEUE_DEPTH 128
#define FD_BLOCKSIZE 512
-#define FD_MAX_SECTORS 2048
+/*
+ * Limited by the number of iovecs (2048) per vfs_[writev,readv] call
+ */
+#define FD_MAX_BYTES 8388608
#define RRF_EMULATE_CDB 0x01
#define RRF_GOT_LBA 0x02
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 663e34a..55bf359 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -615,6 +615,7 @@ struct se_dev_attrib {
u32 unmap_granularity;
u32 unmap_granularity_alignment;
u32 max_write_same_len;
+ u32 max_bytes_per_io;
struct se_device *da_dev;
struct config_group da_group;
};
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 097/166] arm64: ptrace: avoid using HW_BREAKPOINT_EMPTY for disabled events
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (95 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 096/166] target/file: Update hw_max_sectors based on current block_size Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 098/166] libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8 Kamal Mostafa
` (68 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Will Deacon, Catalin Marinas, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <will.deacon@arm.com>
commit cdc27c27843248ae7eb0df5fc261dd004eaa5670 upstream.
Commit 8f34a1da35ae ("arm64: ptrace: use HW_BREAKPOINT_EMPTY type for
disabled breakpoints") fixed an issue with GDB trying to zero breakpoint
control registers. The problem there is that the arch hw_breakpoint code
will attempt to create a (disabled), execute breakpoint of length 0.
This will fail validation and report unexpected failure to GDB. To avoid
this, we treated disabled breakpoints as HW_BREAKPOINT_EMPTY, but that
seems to have broken with recent kernels, causing watchpoints to be
treated as TYPE_INST in the core code and returning ENOSPC for any
further breakpoints.
This patch fixes the problem by prioritising the `enable' field of the
breakpoint: if it is cleared, we simply update the perf_event_attr to
indicate that the thing is disabled and don't bother changing either the
type or the length. This reinforces the behaviour that the breakpoint
control register is essentially read-only apart from the enable bit
when disabling a breakpoint.
Reported-by: Aaron Liu <liucy214@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm64/kernel/ptrace.c | 38 ++++++++++++++++++--------------------
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 6e1e77f..5341534 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -236,31 +236,29 @@ static int ptrace_hbp_fill_attr_ctrl(unsigned int note_type,
{
int err, len, type, disabled = !ctrl.enabled;
- if (disabled) {
- len = 0;
- type = HW_BREAKPOINT_EMPTY;
- } else {
- err = arch_bp_generic_fields(ctrl, &len, &type);
- if (err)
- return err;
-
- switch (note_type) {
- case NT_ARM_HW_BREAK:
- if ((type & HW_BREAKPOINT_X) != type)
- return -EINVAL;
- break;
- case NT_ARM_HW_WATCH:
- if ((type & HW_BREAKPOINT_RW) != type)
- return -EINVAL;
- break;
- default:
+ attr->disabled = disabled;
+ if (disabled)
+ return 0;
+
+ err = arch_bp_generic_fields(ctrl, &len, &type);
+ if (err)
+ return err;
+
+ switch (note_type) {
+ case NT_ARM_HW_BREAK:
+ if ((type & HW_BREAKPOINT_X) != type)
return -EINVAL;
- }
+ break;
+ case NT_ARM_HW_WATCH:
+ if ((type & HW_BREAKPOINT_RW) != type)
+ return -EINVAL;
+ break;
+ default:
+ return -EINVAL;
}
attr->bp_len = len;
attr->bp_type = type;
- attr->disabled = disabled;
return 0;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 098/166] libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (96 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 097/166] arm64: ptrace: avoid using HW_BREAKPOINT_EMPTY for disabled events Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 099/166] ext4: call ext4_error_inode() if jbd2_journal_dirty_metadata() fails Kamal Mostafa
` (67 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Michele Baldessari, Tejun Heo, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Michele Baldessari <michele@acksyn.org>
commit 87809942d3fa60bafb7a58d0bdb1c79e90a6821d upstream.
We've received multiple reports in Fedora via (BZ 907193)
that the Seagate Momentus SpinPoint M8 errors out when enabling AA:
[ 2.555905] ata2.00: failed to enable AA (error_mask=0x1)
[ 2.568482] ata2.00: failed to enable AA (error_mask=0x1)
Add the ATA_HORKAGE_BROKEN_FPDMA_AA for this specific harddisk.
Reported-by: Nicholas <arealityfarbetween@googlemail.com>
Signed-off-by: Michele Baldessari <michele@acksyn.org>
Tested-by: Nicholas <arealityfarbetween@googlemail.com>
Acked-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/ata/libata-core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index d32d6bb..d6534f5 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4138,6 +4138,9 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
{ "ST3320[68]13AS", "SD1[5-9]", ATA_HORKAGE_NONCQ |
ATA_HORKAGE_FIRMWARE_WARN },
+ /* Seagate Momentus SpinPoint M8 seem to have FPMDA_AA issues */
+ { "ST1000LM024 HN-M101MBB", "2AR10001", ATA_HORKAGE_BROKEN_FPDMA_AA },
+
/* Blacklist entries taken from Silicon Image 3124/3132
Windows driver .inf file - also several Linux problem reports */
{ "HTS541060G9SA00", "MB3OC60D", ATA_HORKAGE_NONCQ, },
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 099/166] ext4: call ext4_error_inode() if jbd2_journal_dirty_metadata() fails
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (97 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 098/166] libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8 Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 100/166] ext4: fix use-after-free in ext4_mb_new_blocks Kamal Mostafa
` (66 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Theodore Ts'o, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <tytso@mit.edu>
commit ae1495b12df1897d4f42842a7aa7276d920f6290 upstream.
While it's true that errors can only happen if there is a bug in
jbd2_journal_dirty_metadata(), if a bug does happen, we need to halt
the kernel or remount the file system read-only in order to avoid
further data loss. The ext4_journal_abort_handle() function doesn't
do any of this, and while it's likely that this call (since it doesn't
adjust refcounts) will likely result in the file system eventually
deadlocking since the current transaction will never be able to close,
it's much cleaner to call let ext4's error handling system deal with
this situation.
There's a separate bug here which is that if certain jbd2 errors
errors occur and file system is mounted errors=continue, the file
system will probably eventually end grind to a halt as described
above. But things have been this way in a long time, and usually when
we have these sorts of errors it's pretty much a disaster --- and
that's why the jbd2 layer aggressively retries memory allocations,
which is the most likely cause of these jbd2 errors.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
[ kamal: backport to 3.8 (print available struct members only) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/ext4/ext4_jbd2.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index 6d7abb1..ee73a81 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -113,6 +113,11 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line,
if (WARN_ON_ONCE(err)) {
ext4_journal_abort_handle(where, line, __func__, bh,
handle, err);
+ ext4_error_inode(inode, where, line,
+ bh->b_blocknr,
+ "journal_dirty_metadata failed: "
+ "credits %u, errcode %d",
+ handle->h_buffer_credits, err);
}
} else {
if (inode)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 100/166] ext4: fix use-after-free in ext4_mb_new_blocks
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (98 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 099/166] ext4: call ext4_error_inode() if jbd2_journal_dirty_metadata() fails Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 101/166] ext4: check for overlapping extents in ext4_valid_extent_entries() Kamal Mostafa
` (65 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Junho Ryu, Theodore Ts'o, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Junho Ryu <jayr@google.com>
commit 4e8d2139802ce4f41936a687f06c560b12115247 upstream.
ext4_mb_put_pa should hold pa->pa_lock before accessing pa->pa_count.
While ext4_mb_use_preallocated checks pa->pa_deleted first and then
increments pa->count later, ext4_mb_put_pa decrements pa->pa_count
before holding pa->pa_lock and then sets pa->pa_deleted.
* Free sequence
ext4_mb_put_pa (1): atomic_dec_and_test pa->pa_count
ext4_mb_put_pa (2): lock pa->pa_lock
ext4_mb_put_pa (3): check pa->pa_deleted
ext4_mb_put_pa (4): set pa->pa_deleted=1
ext4_mb_put_pa (5): unlock pa->pa_lock
ext4_mb_put_pa (6): remove pa from a list
ext4_mb_pa_callback: free pa
* Use sequence
ext4_mb_use_preallocated (1): iterate over preallocation
ext4_mb_use_preallocated (2): lock pa->pa_lock
ext4_mb_use_preallocated (3): check pa->pa_deleted
ext4_mb_use_preallocated (4): increase pa->pa_count
ext4_mb_use_preallocated (5): unlock pa->pa_lock
ext4_mb_release_context: access pa
* Use-after-free sequence
[initial status] <pa->pa_deleted = 0, pa_count = 1>
ext4_mb_use_preallocated (1): iterate over preallocation
ext4_mb_use_preallocated (2): lock pa->pa_lock
ext4_mb_use_preallocated (3): check pa->pa_deleted
ext4_mb_put_pa (1): atomic_dec_and_test pa->pa_count
[pa_count decremented] <pa->pa_deleted = 0, pa_count = 0>
ext4_mb_use_preallocated (4): increase pa->pa_count
[pa_count incremented] <pa->pa_deleted = 0, pa_count = 1>
ext4_mb_use_preallocated (5): unlock pa->pa_lock
ext4_mb_put_pa (2): lock pa->pa_lock
ext4_mb_put_pa (3): check pa->pa_deleted
ext4_mb_put_pa (4): set pa->pa_deleted=1
[race condition!] <pa->pa_deleted = 1, pa_count = 1>
ext4_mb_put_pa (5): unlock pa->pa_lock
ext4_mb_put_pa (6): remove pa from a list
ext4_mb_pa_callback: free pa
ext4_mb_release_context: access pa
AddressSanitizer has detected use-after-free in ext4_mb_new_blocks
Bug report: http://goo.gl/rG1On3
Signed-off-by: Junho Ryu <jayr@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/ext4/mballoc.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index c8003a1..2167e90 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3337,6 +3337,9 @@ static void ext4_mb_pa_callback(struct rcu_head *head)
{
struct ext4_prealloc_space *pa;
pa = container_of(head, struct ext4_prealloc_space, u.pa_rcu);
+
+ BUG_ON(atomic_read(&pa->pa_count));
+ BUG_ON(pa->pa_deleted == 0);
kmem_cache_free(ext4_pspace_cachep, pa);
}
@@ -3350,11 +3353,13 @@ static void ext4_mb_put_pa(struct ext4_allocation_context *ac,
ext4_group_t grp;
ext4_fsblk_t grp_blk;
- if (!atomic_dec_and_test(&pa->pa_count) || pa->pa_free != 0)
- return;
-
/* in this short window concurrent discard can set pa_deleted */
spin_lock(&pa->pa_lock);
+ if (!atomic_dec_and_test(&pa->pa_count) || pa->pa_free != 0) {
+ spin_unlock(&pa->pa_lock);
+ return;
+ }
+
if (pa->pa_deleted == 1) {
spin_unlock(&pa->pa_lock);
return;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 101/166] ext4: check for overlapping extents in ext4_valid_extent_entries()
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (99 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 100/166] ext4: fix use-after-free in ext4_mb_new_blocks Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 102/166] ext2: Fix oops in ext2_get_block() called from ext2_quota_write() Kamal Mostafa
` (64 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Lukáš Czerner, Eryu Guan, Theodore Ts'o,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Eryu Guan <guaneryu@gmail.com>
commit 5946d089379a35dda0e531710b48fca05446a196 upstream.
A corrupted ext4 may have out of order leaf extents, i.e.
extent: lblk 0--1023, len 1024, pblk 9217, flags: LEAF UNINIT
extent: lblk 1000--2047, len 1024, pblk 10241, flags: LEAF UNINIT
^^^^ overlap with previous extent
Reading such extent could hit BUG_ON() in ext4_es_cache_extent().
BUG_ON(end < lblk);
The problem is that __read_extent_tree_block() tries to cache holes as
well but assumes 'lblk' is greater than 'prev' and passes underflowed
length to ext4_es_cache_extent(). Fix it by checking for overlapping
extents in ext4_valid_extent_entries().
I hit this when fuzz testing ext4, and am able to reproduce it by
modifying the on-disk extent by hand.
Also add the check for (ee_block + len - 1) in ext4_valid_extent() to
make sure the value is not overflow.
Ran xfstests on patched ext4 and no regression.
Cc: Lukáš Czerner <lczerner@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/ext4/extents.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index c3db941..8b5c264 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -363,8 +363,10 @@ static int ext4_valid_extent(struct inode *inode, struct ext4_extent *ext)
{
ext4_fsblk_t block = ext4_ext_pblock(ext);
int len = ext4_ext_get_actual_len(ext);
+ ext4_lblk_t lblock = le32_to_cpu(ext->ee_block);
+ ext4_lblk_t last = lblock + len - 1;
- if (len == 0)
+ if (lblock > last)
return 0;
return ext4_data_block_valid(EXT4_SB(inode->i_sb), block, len);
}
@@ -390,11 +392,26 @@ static int ext4_valid_extent_entries(struct inode *inode,
if (depth == 0) {
/* leaf entries */
struct ext4_extent *ext = EXT_FIRST_EXTENT(eh);
+ struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es;
+ ext4_fsblk_t pblock = 0;
+ ext4_lblk_t lblock = 0;
+ ext4_lblk_t prev = 0;
+ int len = 0;
while (entries) {
if (!ext4_valid_extent(inode, ext))
return 0;
+
+ /* Check for overlapping extents */
+ lblock = le32_to_cpu(ext->ee_block);
+ len = ext4_ext_get_actual_len(ext);
+ if ((lblock <= prev) && prev) {
+ pblock = ext4_ext_pblock(ext);
+ es->s_last_error_block = cpu_to_le64(pblock);
+ return 0;
+ }
ext++;
entries--;
+ prev = lblock + len - 1;
}
} else {
struct ext4_extent_idx *ext_idx = EXT_FIRST_INDEX(eh);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 102/166] ext2: Fix oops in ext2_get_block() called from ext2_quota_write()
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (100 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 101/166] ext4: check for overlapping extents in ext4_valid_extent_entries() Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 103/166] ext4: fix del_timer() misuse for ->s_err_report Kamal Mostafa
` (63 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Jan Kara, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
commit df4e7ac0bb70abc97fbfd9ef09671fc084b3f9db upstream.
ext2_quota_write() doesn't properly setup bh it passes to
ext2_get_block() and thus we hit assertion BUG_ON(maxblocks == 0) in
ext2_get_blocks() (or we could actually ask for mapping arbitrary number
of blocks depending on whatever value was on stack).
Fix ext2_quota_write() to properly fill in number of blocks to map.
Reviewed-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/ext2/super.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index fa04d02..9d8b0ad 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -1493,6 +1493,7 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
sb->s_blocksize - offset : towrite;
tmp_bh.b_state = 0;
+ tmp_bh.b_size = sb->s_blocksize;
err = ext2_get_block(inode, blk, &tmp_bh, 1);
if (err < 0)
goto out;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 103/166] ext4: fix del_timer() misuse for ->s_err_report
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (101 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 102/166] ext2: Fix oops in ext2_get_block() called from ext2_quota_write() Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 104/166] scripts/link-vmlinux.sh: only filter kernel symbols for arm Kamal Mostafa
` (62 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Al Viro, Theodore Ts'o, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <viro@ZenIV.linux.org.uk>
commit 9105bb149bbbc555d2e11ba5166dfe7a24eae09e upstream.
That thing should be del_timer_sync(); consider what happens
if ext4_put_super() call of del_timer() happens to come just as it's
getting run on another CPU. Since that timer reschedules itself
to run next day, you are pretty much guaranteed that you'll end up
with kfree'd scheduled timer, with usual fun consequences. AFAICS,
that's -stable fodder all way back to 2010... [the second del_timer_sync()
is almost certainly not needed, but it doesn't hurt either]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/ext4/super.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index b83f75d..c27683e 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -861,7 +861,7 @@ static void ext4_put_super(struct super_block *sb)
ext4_abort(sb, "Couldn't clean up the journal");
}
- del_timer(&sbi->s_err_report);
+ del_timer_sync(&sbi->s_err_report);
ext4_release_system_zone(sb);
ext4_mb_release(sb);
ext4_ext_release(sb);
@@ -4055,7 +4055,7 @@ failed_mount_wq:
sbi->s_journal = NULL;
}
failed_mount3:
- del_timer(&sbi->s_err_report);
+ del_timer_sync(&sbi->s_err_report);
if (sbi->s_flex_groups)
ext4_kvfree(sbi->s_flex_groups);
percpu_counter_destroy(&sbi->s_freeclusters_counter);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 104/166] scripts/link-vmlinux.sh: only filter kernel symbols for arm
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (102 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 103/166] ext4: fix del_timer() misuse for ->s_err_report Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 105/166] drm/i915: Use the correct GMCH_CTRL register for Sandybridge+ Kamal Mostafa
` (61 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Rusty Russell, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Lei <tom.leiming@gmail.com>
commit 7122c3e9154b5d9a7422f68f02d8acf050fad2b0 upstream.
Actually CONFIG_PAGE_OFFSET isn't same with PAGE_OFFSET, so
it isn't easy to figue out PAGE_OFFSET defined in header
file from scripts.
Because CONFIG_PAGE_OFFSET may not be defined in some ARCHs(
64bit ARCH), or defined as bogus value in !MMU case, so
this patch only applys the filter on ARM when CONFIG_PAGE_OFFSET
is defined as the original problem is only on ARM.
Cc: Rusty Russell <rusty@rustcorp.com.au>
Fixes: f6537f2f0eba4eba3354e48dbe3047db6d8b6254
Singed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
scripts/link-vmlinux.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 5716ba1..d6a4eab 100644
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -83,7 +83,9 @@ kallsyms()
kallsymopt="${kallsymopt} --all-symbols"
fi
- kallsymopt="${kallsymopt} --page-offset=$CONFIG_PAGE_OFFSET"
+ if [ -n "${CONFIG_ARM}" ] && [ -n "${CONFIG_PAGE_OFFSET}" ]; then
+ kallsymopt="${kallsymopt} --page-offset=$CONFIG_PAGE_OFFSET"
+ fi
local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \
${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}"
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 105/166] drm/i915: Use the correct GMCH_CTRL register for Sandybridge+
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (103 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 104/166] scripts/link-vmlinux.sh: only filter kernel symbols for arm Kamal Mostafa
@ 2014-01-15 21:51 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 106/166] ext4: fix deadlock when writing in ENOSPC conditions Kamal Mostafa
` (60 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:51 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Chris Wilson, Jani Nikula, Ville Syrjälä, Daniel Vetter,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <chris@chris-wilson.co.uk>
commit a885b3ccc74d8e38074e1c43a47c354c5ea0b01e upstream.
The GMCH_CTRL register (or MGCC in the spec) is at a different address
on Sandybridge, and the address to which we currently write to is
undefined. These stray writes appear to upset (hard hang) my Ivybridge
machine whilst it is in UEFI mode.
Note that the register is still marked as locked RO on Sandybridge, so
vgaarb is still dysfunctional.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/intel_display.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5b769a7..7330c58 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9438,14 +9438,15 @@ void intel_connector_attach_encoder(struct intel_connector *connector,
int intel_modeset_vga_set_state(struct drm_device *dev, bool state)
{
struct drm_i915_private *dev_priv = dev->dev_private;
+ unsigned reg = INTEL_INFO(dev)->gen >= 6 ? SNB_GMCH_CTRL : INTEL_GMCH_CTRL;
u16 gmch_ctrl;
- pci_read_config_word(dev_priv->bridge_dev, INTEL_GMCH_CTRL, &gmch_ctrl);
+ pci_read_config_word(dev_priv->bridge_dev, reg, &gmch_ctrl);
if (state)
gmch_ctrl &= ~INTEL_GMCH_VGA_DISABLE;
else
gmch_ctrl |= INTEL_GMCH_VGA_DISABLE;
- pci_write_config_word(dev_priv->bridge_dev, INTEL_GMCH_CTRL, gmch_ctrl);
+ pci_write_config_word(dev_priv->bridge_dev, reg, gmch_ctrl);
return 0;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 106/166] ext4: fix deadlock when writing in ENOSPC conditions
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (104 preceding siblings ...)
2014-01-15 21:51 ` [PATCH 3.8 105/166] drm/i915: Use the correct GMCH_CTRL register for Sandybridge+ Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 107/166] libata, freezer: avoid block device removal while system is frozen Kamal Mostafa
` (59 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jan Kara, Theodore Ts'o, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
commit 34cf865d54813aab3497838132fb1bbd293f4054 upstream.
Akira-san has been reporting rare deadlocks of his machine when running
xfstests test 269 on ext4 filesystem. The problem turned out to be in
ext4_da_reserve_metadata() and ext4_da_reserve_space() which called
ext4_should_retry_alloc() while holding i_data_sem. Since
ext4_should_retry_alloc() can force a transaction commit, this is a
lock ordering violation and leads to deadlocks.
Fix the problem by just removing the retry loops. These functions should
just report ENOSPC to the caller (e.g. ext4_da_write_begin()) and that
function must take care of retrying after dropping all necessary locks.
Reported-and-tested-by: Akira Fujita <a-fujita@rs.jp.nec.com>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
[ kamal: backport to 3.8 (no ext4_da_reserve_metadata) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/ext4/inode.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index fe1fada..46c10b5 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1182,7 +1182,6 @@ static int ext4_journalled_write_end(struct file *file,
*/
static int ext4_da_reserve_space(struct inode *inode, ext4_lblk_t lblock)
{
- int retries = 0;
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
struct ext4_inode_info *ei = EXT4_I(inode);
unsigned int md_needed;
@@ -1204,7 +1203,6 @@ static int ext4_da_reserve_space(struct inode *inode, ext4_lblk_t lblock)
* in order to allocate nrblocks
* worse case is one extent per block
*/
-repeat:
spin_lock(&ei->i_block_reservation_lock);
/*
* ext4_calc_metadata_amount() has side effects, which we have
@@ -1224,10 +1222,6 @@ repeat:
ei->i_da_metadata_calc_len = save_len;
ei->i_da_metadata_calc_last_lblock = save_last_lblock;
spin_unlock(&ei->i_block_reservation_lock);
- if (ext4_should_retry_alloc(inode->i_sb, &retries)) {
- yield();
- goto repeat;
- }
dquot_release_reservation_block(inode, EXT4_C2B(sbi, 1));
return -ENOSPC;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 107/166] libata, freezer: avoid block device removal while system is frozen
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (105 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 106/166] ext4: fix deadlock when writing in ENOSPC conditions Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 108/166] drm/radeon: fix asic gfx values for scrapper asics Kamal Mostafa
` (58 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Tejun Heo, Greg Kroah-Hartman, Len Brown, Oleg Nesterov,
kbuild test robot, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
commit 85fbd722ad0f5d64d1ad15888cd1eb2188bfb557 upstream.
Freezable kthreads and workqueues are fundamentally problematic in
that they effectively introduce a big kernel lock widely used in the
kernel and have already been the culprit of several deadlock
scenarios. This is the latest occurrence.
During resume, libata rescans all the ports and revalidates all
pre-existing devices. If it determines that a device has gone
missing, the device is removed from the system which involves
invalidating block device and flushing bdi while holding driver core
layer locks. Unfortunately, this can race with the rest of device
resume. Because freezable kthreads and workqueues are thawed after
device resume is complete and block device removal depends on
freezable workqueues and kthreads (e.g. bdi_wq, jbd2) to make
progress, this can lead to deadlock - block device removal can't
proceed because kthreads are frozen and kthreads can't be thawed
because device resume is blocked behind block device removal.
839a8e8660b6 ("writeback: replace custom worker pool implementation
with unbound workqueue") made this particular deadlock scenario more
visible but the underlying problem has always been there - the
original forker task and jbd2 are freezable too. In fact, this is
highly likely just one of many possible deadlock scenarios given that
freezer behaves as a big kernel lock and we don't have any debug
mechanism around it.
I believe the right thing to do is getting rid of freezable kthreads
and workqueues. This is something fundamentally broken. For now,
implement a funny workaround in libata - just avoid doing block device
hot[un]plug while the system is frozen. Kernel engineering at its
finest. :(
v2: Add EXPORT_SYMBOL_GPL(pm_freezing) for cases where libata is built
as a module.
v3: Comment updated and polling interval changed to 10ms as suggested
by Rafael.
v4: Add #ifdef CONFIG_FREEZER around the hack as pm_freezing is not
defined when FREEZER is not configured thus breaking build.
Reported by kbuild test robot.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Tomaž Šolc <tomaz.solc@tablix.org>
Reviewed-by: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=62801
Link: http://lkml.kernel.org/r/20131213174932.GA27070@htj.dyndns.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Len Brown <len.brown@intel.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/ata/libata-scsi.c | 21 +++++++++++++++++++++
kernel/freezer.c | 6 ++++++
2 files changed, 27 insertions(+)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index f677e94..2b628d6 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3851,6 +3851,27 @@ void ata_scsi_hotplug(struct work_struct *work)
return;
}
+ /*
+ * XXX - UGLY HACK
+ *
+ * The block layer suspend/resume path is fundamentally broken due
+ * to freezable kthreads and workqueue and may deadlock if a block
+ * device gets removed while resume is in progress. I don't know
+ * what the solution is short of removing freezable kthreads and
+ * workqueues altogether.
+ *
+ * The following is an ugly hack to avoid kicking off device
+ * removal while freezer is active. This is a joke but does avoid
+ * this particular deadlock scenario.
+ *
+ * https://bugzilla.kernel.org/show_bug.cgi?id=62801
+ * http://marc.info/?l=linux-kernel&m=138695698516487
+ */
+#ifdef CONFIG_FREEZER
+ while (pm_freezing)
+ msleep(10);
+#endif
+
DPRINTK("ENTER\n");
mutex_lock(&ap->scsi_scan_mutex);
diff --git a/kernel/freezer.c b/kernel/freezer.c
index c38893b..7875851 100644
--- a/kernel/freezer.c
+++ b/kernel/freezer.c
@@ -19,6 +19,12 @@ EXPORT_SYMBOL(system_freezing_cnt);
bool pm_freezing;
bool pm_nosig_freezing;
+/*
+ * Temporary export for the deadlock workaround in ata_scsi_hotplug().
+ * Remove once the hack becomes unnecessary.
+ */
+EXPORT_SYMBOL_GPL(pm_freezing);
+
/* protects freezing and frozen transitions */
static DEFINE_SPINLOCK(freezer_lock);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 108/166] drm/radeon: fix asic gfx values for scrapper asics
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (106 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 107/166] libata, freezer: avoid block device removal while system is frozen Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 109/166] selinux: fix broken peer recv check Kamal Mostafa
` (57 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit e2f6c88fb903e123edfd1106b0b8310d5117f774 upstream.
Fixes gfx corruption on certain TN/RL parts.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=60389
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/ni.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index ce94b27..326bdea 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -475,6 +475,10 @@ static void cayman_gpu_init(struct radeon_device *rdev)
(rdev->pdev->device == 0x999C)) {
rdev->config.cayman.max_simds_per_se = 6;
rdev->config.cayman.max_backends_per_se = 2;
+ rdev->config.cayman.max_hw_contexts = 8;
+ rdev->config.cayman.sx_max_export_size = 256;
+ rdev->config.cayman.sx_max_export_pos_size = 64;
+ rdev->config.cayman.sx_max_export_smx_size = 192;
} else if ((rdev->pdev->device == 0x9903) ||
(rdev->pdev->device == 0x9904) ||
(rdev->pdev->device == 0x990A) ||
@@ -485,6 +489,10 @@ static void cayman_gpu_init(struct radeon_device *rdev)
(rdev->pdev->device == 0x999D)) {
rdev->config.cayman.max_simds_per_se = 4;
rdev->config.cayman.max_backends_per_se = 2;
+ rdev->config.cayman.max_hw_contexts = 8;
+ rdev->config.cayman.sx_max_export_size = 256;
+ rdev->config.cayman.sx_max_export_pos_size = 64;
+ rdev->config.cayman.sx_max_export_smx_size = 192;
} else if ((rdev->pdev->device == 0x9919) ||
(rdev->pdev->device == 0x9990) ||
(rdev->pdev->device == 0x9991) ||
@@ -495,9 +503,17 @@ static void cayman_gpu_init(struct radeon_device *rdev)
(rdev->pdev->device == 0x99A0)) {
rdev->config.cayman.max_simds_per_se = 3;
rdev->config.cayman.max_backends_per_se = 1;
+ rdev->config.cayman.max_hw_contexts = 4;
+ rdev->config.cayman.sx_max_export_size = 128;
+ rdev->config.cayman.sx_max_export_pos_size = 32;
+ rdev->config.cayman.sx_max_export_smx_size = 96;
} else {
rdev->config.cayman.max_simds_per_se = 2;
rdev->config.cayman.max_backends_per_se = 1;
+ rdev->config.cayman.max_hw_contexts = 4;
+ rdev->config.cayman.sx_max_export_size = 128;
+ rdev->config.cayman.sx_max_export_pos_size = 32;
+ rdev->config.cayman.sx_max_export_smx_size = 96;
}
rdev->config.cayman.max_texture_channel_caches = 2;
rdev->config.cayman.max_gprs = 256;
@@ -505,10 +521,6 @@ static void cayman_gpu_init(struct radeon_device *rdev)
rdev->config.cayman.max_gs_threads = 32;
rdev->config.cayman.max_stack_entries = 512;
rdev->config.cayman.sx_num_of_sets = 8;
- rdev->config.cayman.sx_max_export_size = 256;
- rdev->config.cayman.sx_max_export_pos_size = 64;
- rdev->config.cayman.sx_max_export_smx_size = 192;
- rdev->config.cayman.max_hw_contexts = 8;
rdev->config.cayman.sq_num_cf_insts = 2;
rdev->config.cayman.sc_prim_fifo_size = 0x40;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 109/166] selinux: fix broken peer recv check
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (107 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 108/166] drm/radeon: fix asic gfx values for scrapper asics Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 110/166] selinux: selinux_setprocattr()->ptrace_parent() needs rcu_read_lock() Kamal Mostafa
` (56 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Chad Hanson, Paul Moore, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Chad Hanson <chanson@trustedcs.com>
commit 46d01d63221c3508421dd72ff9c879f61053cffc upstream.
Fix a broken networking check. Return an error if peer recv fails. If
secmark is active and the packet recv succeeds the peer recv error is
ignored.
Signed-off-by: Chad Hanson <chanson@trustedcs.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
security/selinux/hooks.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 1ce432d..0963169 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -4205,8 +4205,10 @@ static int selinux_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
}
err = avc_has_perm(sk_sid, peer_sid, SECCLASS_PEER,
PEER__RECV, &ad);
- if (err)
+ if (err) {
selinux_netlbl_err(skb, err, 0);
+ return err;
+ }
}
if (secmark_active) {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 110/166] selinux: selinux_setprocattr()->ptrace_parent() needs rcu_read_lock()
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (108 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 109/166] selinux: fix broken peer recv check Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 111/166] auxvec.h: account for AT_HWCAP2 in AT_VECTOR_SIZE_BASE Kamal Mostafa
` (55 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Oleg Nesterov, Paul Moore, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <oleg@redhat.com>
commit c0c1439541f5305b57a83d599af32b74182933fe upstream.
selinux_setprocattr() does ptrace_parent(p) under task_lock(p),
but task_struct->alloc_lock doesn't pin ->parent or ->ptrace,
this looks confusing and triggers the "suspicious RCU usage"
warning because ptrace_parent() does rcu_dereference_check().
And in theory this is wrong, spin_lock()->preempt_disable()
doesn't necessarily imply rcu_read_lock() we need to access
the ->parent.
Reported-by: Evan McNabb <emcnabb@redhat.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
security/selinux/hooks.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 0963169..6b0b250 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -5455,11 +5455,11 @@ static int selinux_setprocattr(struct task_struct *p,
/* Check for ptracing, and update the task SID if ok.
Otherwise, leave SID unchanged and fail. */
ptsid = 0;
- task_lock(p);
+ rcu_read_lock();
tracer = ptrace_parent(p);
if (tracer)
ptsid = task_sid(tracer);
- task_unlock(p);
+ rcu_read_unlock();
if (tracer) {
error = avc_has_perm(ptsid, sid, SECCLASS_PROCESS,
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 111/166] auxvec.h: account for AT_HWCAP2 in AT_VECTOR_SIZE_BASE
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (109 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 110/166] selinux: selinux_setprocattr()->ptrace_parent() needs rcu_read_lock() Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 112/166] power_supply: Fix Oops from NULL pointer dereference from wakeup_source_activate Kamal Mostafa
` (54 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ard Biesheuvel, Nishanth Aravamudan, Benjamin Herrenschmidt,
Linus Torvalds, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
commit f60900f2609e893c7f8d0bccc7ada4947dac4cd5 upstream.
Commit 2171364d1a92 ("powerpc: Add HWCAP2 aux entry") introduced a new
AT_ auxv entry type AT_HWCAP2 but failed to update AT_VECTOR_SIZE_BASE
accordingly.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: 2171364d1a92 (powerpc: Add HWCAP2 aux entry)
Acked-by: Michael Neuling <michael@neuling.org>
Cc: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/auxvec.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h
index 669fef5..3e0fbe4 100644
--- a/include/linux/auxvec.h
+++ b/include/linux/auxvec.h
@@ -3,6 +3,6 @@
#include <uapi/linux/auxvec.h>
-#define AT_VECTOR_SIZE_BASE 19 /* NEW_AUX_ENT entries in auxiliary table */
+#define AT_VECTOR_SIZE_BASE 20 /* NEW_AUX_ENT entries in auxiliary table */
/* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */
#endif /* _LINUX_AUXVEC_H */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 112/166] power_supply: Fix Oops from NULL pointer dereference from wakeup_source_activate
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (110 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 111/166] auxvec.h: account for AT_HWCAP2 in AT_VECTOR_SIZE_BASE Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-16 17:48 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 113/166] radiotap: fix bitmap-end-finding buffer overrun Kamal Mostafa
` (53 subsequent siblings)
165 siblings, 1 reply; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Shuah Khan, Anton Vorontsov, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuah Khan <shuah.kh@samsung.com>
commit 80c6463e2fa3377febfc98a6672d92d07f3c26c1 upstream.
power_supply_register() calls device_init_wakeup() to register a wakeup
source before initializing dev_name. As a result, device_wakeup_enable()
end up registering wakeup source with a null name when
wakeup_source_register() gets called with dev_name(dev) which is null at
the time.
When kernel is booted with wakeup_source_activate enabled, it will panic
when the trace point code tries to dereference ws->name.
Fixed the problem by moving up the kobject_set_name() call prior to
accesses to dev_name(). Replaced kobject_set_name() with dev_set_name()
which is the right interface to be called from drivers. Fixed the call to
device_del() prior to device_add() in for wakeup_init_failed error
handling code.
Trace after the change:
bash-2143 [003] d... 132.280697: wakeup_source_activate: BAT1 state=0x20001
kworker/3:2-1169 [003] d... 132.281305: wakeup_source_deactivate: BAT1 state=0x30000
Oops message:
[ 819.769934] device: 'BAT1': device_add
[ 819.770078] PM: Adding info for No Bus:BAT1
[ 819.770235] BUG: unable to handle kernel NULL pointer dereference at (null)
[ 819.770435] IP: [<ffffffff813381c0>] skip_spaces+0x30/0x30
[ 819.770572] PGD 3efd90067 PUD 3eff61067 PMD 0
[ 819.770716] Oops: 0000 [#1] SMP
[ 819.770829] Modules linked in: arc4 iwldvm mac80211 x86_pkg_temp_thermal coretemp kvm_intel joydev i915 kvm uvcvideo ghash_clmulni_intel videobuf2_vmalloc aesni_intel videobuf2_memops videobuf2_core aes_x86_64 ablk_helper cryptd videodev iwlwifi lrw rfcomm gf128mul glue_helper bnep btusb media bluetooth parport_pc hid_generic ppdev snd_hda_codec_hdmi drm_kms_helper snd_hda_codec_realtek cfg80211 drm tpm_infineon samsung_laptop snd_hda_intel usbhid snd_hda_codec hid snd_hwdep snd_pcm microcode snd_page_alloc snd_timer psmouse i2c_algo_bit lpc_ich tpm_tis video wmi mac_hid serio_raw ext2 lp parport r8169 mii
[ 819.771802] CPU: 0 PID: 2167 Comm: bash Not tainted 3.12.0+ #25
[ 819.771876] Hardware name: SAMSUNG ELECTRONICS CO., LTD. 900X3C/900X3D/900X4C/900X4D/SAMSUNG_NP1234567890, BIOS P03AAC 07/12/2012
[ 819.772022] task: ffff88002e6ddcc0 ti: ffff8804015ca000 task.ti: ffff8804015ca000
[ 819.772119] RIP: 0010:[<ffffffff813381c0>] [<ffffffff813381c0>] skip_spaces+0x30/0x30
[ 819.772242] RSP: 0018:ffff8804015cbc70 EFLAGS: 00010046
[ 819.772310] RAX: 0000000000000003 RBX: ffff88040cfd6d40 RCX: 0000000000000018
[ 819.772397] RDX: 0000000000020001 RSI: 0000000000000000 RDI: 0000000000000000
[ 819.772484] RBP: ffff8804015cbcc0 R08: 0000000000000000 R09: ffff8803f0768d40
[ 819.772570] R10: ffffea001033b800 R11: 0000000000000000 R12: ffffffff81c519c0
[ 819.772656] R13: 0000000000020001 R14: 0000000000000000 R15: 0000000000020001
[ 819.772744] FS: 00007ff98309b740(0000) GS:ffff88041f200000(0000) knlGS:0000000000000000
[ 819.772845] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 819.772917] CR2: 0000000000000000 CR3: 00000003f59dc000 CR4: 00000000001407f0
[ 819.773001] Stack:
[ 819.773030] ffffffff81114003 ffff8804015cbcb0 0000000000000000 0000000000000046
[ 819.773146] ffff880409757a18 ffff8803f065a160 0000000000000000 0000000000020001
[ 819.773273] 0000000000000000 0000000000000000 ffff8804015cbce8 ffffffff8143e388
[ 819.773387] Call Trace:
[ 819.773434] [<ffffffff81114003>] ? ftrace_raw_event_wakeup_source+0x43/0xe0
[ 819.773520] [<ffffffff8143e388>] wakeup_source_report_event+0xb8/0xd0
[ 819.773595] [<ffffffff8143e3cd>] __pm_stay_awake+0x2d/0x50
[ 819.773724] [<ffffffff8153395c>] power_supply_changed+0x3c/0x90
[ 819.773795] [<ffffffff8153407c>] power_supply_register+0x18c/0x250
[ 819.773869] [<ffffffff813d8d18>] sysfs_add_battery+0x61/0x7b
[ 819.773935] [<ffffffff813d8d69>] battery_notify+0x37/0x3f
[ 819.774001] [<ffffffff816ccb7c>] notifier_call_chain+0x4c/0x70
[ 819.774071] [<ffffffff81073ded>] __blocking_notifier_call_chain+0x4d/0x70
[ 819.774149] [<ffffffff81073e26>] blocking_notifier_call_chain+0x16/0x20
[ 819.774227] [<ffffffff8109397a>] pm_notifier_call_chain+0x1a/0x40
[ 819.774316] [<ffffffff81095b66>] hibernate+0x66/0x1c0
[ 819.774407] [<ffffffff81093931>] state_store+0x71/0xa0
[ 819.774507] [<ffffffff81331d8f>] kobj_attr_store+0xf/0x20
[ 819.774613] [<ffffffff811f8618>] sysfs_write_file+0x128/0x1c0
[ 819.774735] [<ffffffff8118579d>] vfs_write+0xbd/0x1e0
[ 819.774841] [<ffffffff811861d9>] SyS_write+0x49/0xa0
[ 819.774939] [<ffffffff816d1052>] system_call_fastpath+0x16/0x1b
[ 819.775055] Code: 89 f8 48 89 e5 f6 82 c0 a6 84 81 20 74 15 0f 1f 44 00 00 48 83 c0 01 0f b6 10 f6 82 c0 a6 84 81 20 75 f0 5d c3 66 0f 1f 44 00 00 <80> 3f 00 55 48 89 e5 74 15 48 89 f8 0f 1f 40 00 48 83 c0 01 80
[ 819.775760] RIP [<ffffffff813381c0>] skip_spaces+0x30/0x30
[ 819.775881] RSP <ffff8804015cbc70>
[ 819.775949] CR2: 0000000000000000
[ 819.794175] ---[ end trace c4ef25127039952e ]---
Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Acked-by: Anton Vorontsov <anton@enomsg.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/power/power_supply_core.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
index 8a7cfb3..b89ca61 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -334,11 +334,11 @@ int power_supply_register(struct device *parent, struct power_supply *psy)
dev_set_drvdata(dev, psy);
psy->dev = dev;
- INIT_WORK(&psy->changed_work, power_supply_changed_work);
-
- rc = kobject_set_name(&dev->kobj, "%s", psy->name);
+ rc = dev_set_name(dev, "%s", psy->name);
if (rc)
- goto kobject_set_name_failed;
+ goto dev_set_name_failed;
+
+ INIT_WORK(&psy->changed_work, power_supply_changed_work);
rc = device_add(dev);
if (rc)
@@ -366,8 +366,8 @@ register_cooler_failed:
psy_unregister_thermal(psy);
register_thermal_failed:
device_del(dev);
-kobject_set_name_failed:
device_add_failed:
+dev_set_name_failed:
put_device(dev);
success:
return rc;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 113/166] radiotap: fix bitmap-end-finding buffer overrun
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (111 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 112/166] power_supply: Fix Oops from NULL pointer dereference from wakeup_source_activate Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 114/166] rtlwifi: pci: Fix oops on driver unload Kamal Mostafa
` (52 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Johannes Berg, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
commit bd02cd2549cfcdfc57cb5ce57ffc3feb94f70575 upstream.
Evan Huus found (by fuzzing in wireshark) that the radiotap
iterator code can access beyond the length of the buffer if
the first bitmap claims an extension but then there's no
data at all. Fix this.
Reported-by: Evan Huus <eapache@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/wireless/radiotap.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/wireless/radiotap.c b/net/wireless/radiotap.c
index a271c27..722da61 100644
--- a/net/wireless/radiotap.c
+++ b/net/wireless/radiotap.c
@@ -124,6 +124,10 @@ int ieee80211_radiotap_iterator_init(
/* find payload start allowing for extended bitmap(s) */
if (iterator->_bitmap_shifter & (1<<IEEE80211_RADIOTAP_EXT)) {
+ if ((unsigned long)iterator->_arg -
+ (unsigned long)iterator->_rtheader + sizeof(uint32_t) >
+ (unsigned long)iterator->_max_length)
+ return -EINVAL;
while (get_unaligned_le32(iterator->_arg) &
(1 << IEEE80211_RADIOTAP_EXT)) {
iterator->_arg += sizeof(uint32_t);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 114/166] rtlwifi: pci: Fix oops on driver unload
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (112 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 113/166] radiotap: fix bitmap-end-finding buffer overrun Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 115/166] ath9k: Fix interrupt handling for the AR9002 family Kamal Mostafa
` (51 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Larry Finger, John W. Linville, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <Larry.Finger@lwfinger.net>
commit 9278db6279e28d4d433bc8a848e10b4ece8793ed upstream.
On Fedora systems, unloading rtl8192ce causes an oops. This patch fixes the
problem reported at https://bugzilla.redhat.com/show_bug.cgi?id=852761.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/rtlwifi/pci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 4261e8e..8fdb04c 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -677,6 +677,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
};
int index = rtlpci->rx_ring[rx_queue_idx].idx;
+ if (rtlpci->driver_is_goingto_unload)
+ return;
/*RX NORMAL PKT */
while (count--) {
/*rx descriptor */
@@ -1565,6 +1567,7 @@ static void rtl_pci_stop(struct ieee80211_hw *hw)
*/
set_hal_stop(rtlhal);
+ rtlpci->driver_is_goingto_unload = true;
rtlpriv->cfg->ops->disable_interrupt(hw);
cancel_work_sync(&rtlpriv->works.lps_leave_work);
@@ -1582,7 +1585,6 @@ static void rtl_pci_stop(struct ieee80211_hw *hw)
ppsc->rfchange_inprogress = true;
spin_unlock_irqrestore(&rtlpriv->locks.rf_ps_lock, flags);
- rtlpci->driver_is_goingto_unload = true;
rtlpriv->cfg->ops->hw_disable(hw);
/* some things are not needed if firmware not available */
if (!rtlpriv->max_fw_size)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 115/166] ath9k: Fix interrupt handling for the AR9002 family
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (113 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 114/166] rtlwifi: pci: Fix oops on driver unload Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 116/166] dm9601: fix reception of full size ethernet frames on dm9620/dm9621a Kamal Mostafa
` (50 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Felix Fietkau, Sujith Manoharan, John W. Linville, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
commit 73f0b56a1ff64e7fb6c3a62088804bab93bcedc2 upstream.
This patch adds a driver workaround for a HW issue.
A race condition in the HW results in missing interrupts,
which can be avoided by a read/write with the ISR register.
All chips in the AR9002 series are affected by this bug - AR9003
and above do not have this problem.
Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/ath/ath9k/ar9002_mac.c | 52 ++++++++++++++++++++++++-----
1 file changed, 43 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_mac.c b/drivers/net/wireless/ath/ath9k/ar9002_mac.c
index 8d78253..a366d6b 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_mac.c
@@ -76,9 +76,16 @@ static bool ar9002_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked)
mask2 |= ATH9K_INT_CST;
if (isr2 & AR_ISR_S2_TSFOOR)
mask2 |= ATH9K_INT_TSFOOR;
+
+ if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) {
+ REG_WRITE(ah, AR_ISR_S2, isr2);
+ isr &= ~AR_ISR_BCNMISC;
+ }
}
- isr = REG_READ(ah, AR_ISR_RAC);
+ if (pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)
+ isr = REG_READ(ah, AR_ISR_RAC);
+
if (isr == 0xffffffff) {
*masked = 0;
return false;
@@ -97,11 +104,23 @@ static bool ar9002_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked)
*masked |= ATH9K_INT_TX;
- s0_s = REG_READ(ah, AR_ISR_S0_S);
+ if (pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED) {
+ s0_s = REG_READ(ah, AR_ISR_S0_S);
+ s1_s = REG_READ(ah, AR_ISR_S1_S);
+ } else {
+ s0_s = REG_READ(ah, AR_ISR_S0);
+ REG_WRITE(ah, AR_ISR_S0, s0_s);
+ s1_s = REG_READ(ah, AR_ISR_S1);
+ REG_WRITE(ah, AR_ISR_S1, s1_s);
+
+ isr &= ~(AR_ISR_TXOK |
+ AR_ISR_TXDESC |
+ AR_ISR_TXERR |
+ AR_ISR_TXEOL);
+ }
+
ah->intr_txqs |= MS(s0_s, AR_ISR_S0_QCU_TXOK);
ah->intr_txqs |= MS(s0_s, AR_ISR_S0_QCU_TXDESC);
-
- s1_s = REG_READ(ah, AR_ISR_S1_S);
ah->intr_txqs |= MS(s1_s, AR_ISR_S1_QCU_TXERR);
ah->intr_txqs |= MS(s1_s, AR_ISR_S1_QCU_TXEOL);
}
@@ -114,13 +133,15 @@ static bool ar9002_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked)
*masked |= mask2;
}
- if (AR_SREV_9100(ah))
- return true;
-
- if (isr & AR_ISR_GENTMR) {
+ if (!AR_SREV_9100(ah) && (isr & AR_ISR_GENTMR)) {
u32 s5_s;
- s5_s = REG_READ(ah, AR_ISR_S5_S);
+ if (pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED) {
+ s5_s = REG_READ(ah, AR_ISR_S5_S);
+ } else {
+ s5_s = REG_READ(ah, AR_ISR_S5);
+ }
+
ah->intr_gen_timer_trigger =
MS(s5_s, AR_ISR_S5_GENTIMER_TRIG);
@@ -133,8 +154,21 @@ static bool ar9002_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked)
if ((s5_s & AR_ISR_S5_TIM_TIMER) &&
!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP))
*masked |= ATH9K_INT_TIM_TIMER;
+
+ if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) {
+ REG_WRITE(ah, AR_ISR_S5, s5_s);
+ isr &= ~AR_ISR_GENTMR;
+ }
}
+ if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) {
+ REG_WRITE(ah, AR_ISR, isr);
+ REG_READ(ah, AR_ISR);
+ }
+
+ if (AR_SREV_9100(ah))
+ return true;
+
if (sync_cause) {
ath9k_debug_sync_cause(common, sync_cause);
fatal_int =
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 116/166] dm9601: fix reception of full size ethernet frames on dm9620/dm9621a
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (114 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 115/166] ath9k: Fix interrupt handling for the AR9002 family Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 117/166] dm9601: work around tx fifo sync issue on dm962x Kamal Mostafa
` (49 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Peter Korsgaard, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Korsgaard <peter@korsgaard.com>
commit 407900cfb54bdb2cfa228010b6697305f66b2948 upstream.
dm9620/dm9621a require room for 4 byte padding even in dm9601 (3 byte
header) mode.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/usb/dm9601.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index c929122..ae2668e 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -364,7 +364,12 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
dev->net->ethtool_ops = &dm9601_ethtool_ops;
dev->net->hard_header_len += DM_TX_OVERHEAD;
dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
- dev->rx_urb_size = dev->net->mtu + ETH_HLEN + DM_RX_OVERHEAD;
+
+ /* dm9620/21a require room for 4 byte padding, even in dm9601
+ * mode, so we need +1 to be able to receive full size
+ * ethernet frames.
+ */
+ dev->rx_urb_size = dev->net->mtu + ETH_HLEN + DM_RX_OVERHEAD + 1;
dev->mii.dev = dev->net;
dev->mii.mdio_read = dm9601_mdio_read;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 117/166] dm9601: work around tx fifo sync issue on dm962x
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (115 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 116/166] dm9601: fix reception of full size ethernet frames on dm9620/dm9621a Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 118/166] drm/radeon: 0x9649 is SUMO2 not SUMO Kamal Mostafa
` (48 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Peter Korsgaard, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Korsgaard <peter@korsgaard.com>
commit 4263c86dca5198da6bd3ad826d0b2304fbe25776 upstream.
Certain dm962x revisions contain an bug, where if a USB bulk transfer retry
(E.G. if bulk crc mismatch) happens right after a transfer with odd or
maxpacket length, the internal tx hardware fifo gets out of sync causing
the interface to stop working.
Work around it by adding up to 3 bytes of padding to ensure this situation
cannot trigger.
This workaround also means we never pass multiple-of-maxpacket size skb's
to usbnet, so the length adjustment to handle usbnet's padding of those can
be removed.
Reported-by: Joseph Chang <joseph_chang@davicom.com.tw>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/usb/dm9601.c | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index ae2668e..d3891b1 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -473,7 +473,7 @@ static int dm9601_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
gfp_t flags)
{
- int len;
+ int len, pad;
/* format:
b1: packet length low
@@ -481,12 +481,23 @@ static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
b3..n: packet data
*/
- len = skb->len;
+ len = skb->len + DM_TX_OVERHEAD;
+
+ /* workaround for dm962x errata with tx fifo getting out of
+ * sync if a USB bulk transfer retry happens right after a
+ * packet with odd / maxpacket length by adding up to 3 bytes
+ * padding.
+ */
+ while ((len & 1) || !(len % dev->maxpacket))
+ len++;
- if (skb_headroom(skb) < DM_TX_OVERHEAD) {
+ len -= DM_TX_OVERHEAD; /* hw header doesn't count as part of length */
+ pad = len - skb->len;
+
+ if (skb_headroom(skb) < DM_TX_OVERHEAD || skb_tailroom(skb) < pad) {
struct sk_buff *skb2;
- skb2 = skb_copy_expand(skb, DM_TX_OVERHEAD, 0, flags);
+ skb2 = skb_copy_expand(skb, DM_TX_OVERHEAD, pad, flags);
dev_kfree_skb_any(skb);
skb = skb2;
if (!skb)
@@ -495,10 +506,10 @@ static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
__skb_push(skb, DM_TX_OVERHEAD);
- /* usbnet adds padding if length is a multiple of packet size
- if so, adjust length value in header */
- if ((skb->len % dev->maxpacket) == 0)
- len++;
+ if (pad) {
+ memset(skb->data + skb->len, 0, pad);
+ __skb_put(skb, pad);
+ }
skb->data[0] = len;
skb->data[1] = len >> 8;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 118/166] drm/radeon: 0x9649 is SUMO2 not SUMO
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (116 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 117/166] dm9601: work around tx fifo sync issue on dm962x Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 119/166] drm/radeon: fix render backend setup for SI and CIK Kamal Mostafa
` (47 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit d00adcc8ae9e22eca9d8af5f66c59ad9a74c90ec upstream.
Fixes rendering corruption due to incorrect
gfx configuration.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=63599
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/drm/drm_pciids.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index d7da55c..01dcb06 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -540,7 +540,7 @@
{0x1002, 0x9645, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
{0x1002, 0x9647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
{0x1002, 0x9648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
- {0x1002, 0x9649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
+ {0x1002, 0x9649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
{0x1002, 0x964a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
{0x1002, 0x964b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
{0x1002, 0x964c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 119/166] drm/radeon: fix render backend setup for SI and CIK
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (117 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 118/166] drm/radeon: 0x9649 is SUMO2 not SUMO Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 120/166] drm/radeon: expose render backend mask to the userspace Kamal Mostafa
` (46 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Marek Olšák, Alex Deucher, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <marek.olsak@amd.com>
commit 9fadb352ed73edd7801a280b552d33a6040c8721 upstream.
Only the render backends of the first shader engine were enabled. The others
were erroneously disabled. Enabling the other render backends improves
performance a lot.
Unigine Sanctuary on Bonaire:
Before: 15 fps
After: 90 fps
Judging from the fan noise, the GPU was also underclocked when the other
render backends were disabled, resulting in horrible performance. The fan is
a lot noisy under load now.
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[ kamal: backport to 3.8 (SI only; no CIK in 3.8) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/si.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index ff9a680..0746272 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -1456,7 +1456,7 @@ static void si_setup_spi(struct radeon_device *rdev,
}
static u32 si_get_rb_disabled(struct radeon_device *rdev,
- u32 max_rb_num, u32 se_num,
+ u32 max_rb_num_per_se,
u32 sh_per_se)
{
u32 data, mask;
@@ -1470,14 +1470,14 @@ static u32 si_get_rb_disabled(struct radeon_device *rdev,
data >>= BACKEND_DISABLE_SHIFT;
- mask = si_create_bitmask(max_rb_num / se_num / sh_per_se);
+ mask = si_create_bitmask(max_rb_num_per_se / sh_per_se);
return data & mask;
}
static void si_setup_rb(struct radeon_device *rdev,
u32 se_num, u32 sh_per_se,
- u32 max_rb_num)
+ u32 max_rb_num_per_se)
{
int i, j;
u32 data, mask;
@@ -1487,14 +1487,14 @@ static void si_setup_rb(struct radeon_device *rdev,
for (i = 0; i < se_num; i++) {
for (j = 0; j < sh_per_se; j++) {
si_select_se_sh(rdev, i, j);
- data = si_get_rb_disabled(rdev, max_rb_num, se_num, sh_per_se);
+ data = si_get_rb_disabled(rdev, max_rb_num_per_se, sh_per_se);
disabled_rbs |= data << ((i * sh_per_se + j) * TAHITI_RB_BITMAP_WIDTH_PER_SH);
}
}
si_select_se_sh(rdev, 0xffffffff, 0xffffffff);
mask = 1;
- for (i = 0; i < max_rb_num; i++) {
+ for (i = 0; i < max_rb_num_per_se * se_num; i++) {
if (!(disabled_rbs & mask))
enabled_rbs |= mask;
mask <<= 1;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 120/166] drm/radeon: expose render backend mask to the userspace
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (118 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 119/166] drm/radeon: fix render backend setup for SI and CIK Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 121/166] tg3: Expand 4g_overflow_test workaround to skb fragments of any size Kamal Mostafa
` (45 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Marek Olšák, Alex Deucher, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <marek.olsak@amd.com>
commit 439a1cfffe2c1a06e5a6394ccd5d18a8e89b15d3 upstream.
This will allow userspace to correctly program the PA_SC_RASTER_CONFIG
register, so it can be considered a fix.
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[ kamal: backport to 3.8 (SI only, no CIK in 3.8; context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon.h | 2 +-
drivers/gpu/drm/radeon/radeon_kms.c | 7 +++++++
drivers/gpu/drm/radeon/si.c | 2 ++
include/uapi/drm/radeon_drm.h | 2 ++
4 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index aa2d2e2..b2cfbf1 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -1418,7 +1418,7 @@ struct si_asic {
unsigned sc_earlyz_tile_fifo_size;
unsigned num_tile_pipes;
- unsigned num_backends_per_se;
+ unsigned backend_enable_mask;
unsigned backend_disable_mask_per_asic;
unsigned backend_map;
unsigned num_texture_channel_caches;
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 799ce63..2e9209c 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -384,6 +384,13 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
case RADEON_INFO_SI_CP_DMA_COMPUTE:
value = 1;
break;
+ case RADEON_INFO_SI_BACKEND_ENABLED_MASK:
+ if (rdev->family >= CHIP_TAHITI) {
+ value = rdev->config.si.backend_enable_mask;
+ } else {
+ DRM_DEBUG_KMS("BACKEND_ENABLED_MASK is si+ only!\n");
+ }
+ break;
default:
DRM_DEBUG_KMS("Invalid request %d\n", info->request);
return -EINVAL;
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 0746272..c2c14d6 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -1500,6 +1500,8 @@ static void si_setup_rb(struct radeon_device *rdev,
mask <<= 1;
}
+ rdev->config.si.backend_enable_mask = enabled_rbs;
+
for (i = 0; i < se_num; i++) {
si_select_se_sh(rdev, i, 0xffffffff);
data = 0;
diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
index 59c1b31..753b4e1 100644
--- a/include/uapi/drm/radeon_drm.h
+++ b/include/uapi/drm/radeon_drm.h
@@ -974,6 +974,8 @@ struct drm_radeon_cs {
#define RADEON_INFO_MAX_SH_PER_SE 0x13
/* query if CP DMA is supported on the compute ring */
#define RADEON_INFO_SI_CP_DMA_COMPUTE 0x17
+/* query the number of render backends */
+#define RADEON_INFO_SI_BACKEND_ENABLED_MASK 0x19
struct drm_radeon_info {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 121/166] tg3: Expand 4g_overflow_test workaround to skb fragments of any size.
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (119 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 120/166] drm/radeon: expose render backend mask to the userspace Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 122/166] powerpc: Fix bad stack check in exception entry Kamal Mostafa
` (44 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Nithin Nayak Sujir, Michael Chan, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nithin Sujir <nsujir@broadcom.com>
commit 375679104ab3ccfd18dcbd7ba503734fb9a2c63a upstream.
The current driver assumes that an skb fragment can only be upto jumbo
size. Presumably this was a fast-path optimization. This assumption is
no longer true as fragments can be upto 32k.
v2: Remove unnecessary parantheses per Eric Dumazet.
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/ethernet/broadcom/tg3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 79096af..3149f5b 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -7030,7 +7030,7 @@ static inline int tg3_4g_overflow_test(dma_addr_t mapping, int len)
{
u32 base = (u32) mapping & 0xffffffff;
- return (base > 0xffffdcc0) && (base + len + 8 < base);
+ return base + len + 8 < base;
}
/* Test for DMA addresses > 40-bit */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 122/166] powerpc: Fix bad stack check in exception entry
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (120 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 121/166] tg3: Expand 4g_overflow_test workaround to skb fragments of any size Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 123/166] Revert "of/address: Handle #address-cells > 2 specially" Kamal Mostafa
` (43 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Michael Neuling, Benjamin Herrenschmidt, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Neuling <mikey@neuling.org>
commit 90ff5d688e61f49f23545ffab6228bd7e87e6dc7 upstream.
In EXCEPTION_PROLOG_COMMON() we check to see if the stack pointer (r1)
is valid when coming from the kernel. If it's not valid, we die but
with a nice oops message.
Currently we allocate a stack frame (subtract INT_FRAME_SIZE) before we
check to see if the stack pointer is negative. Unfortunately, this
won't detect a bad stack where r1 is less than INT_FRAME_SIZE.
This patch fixes the check to compare the modified r1 with
-INT_FRAME_SIZE. With this, bad kernel stack pointers (including NULL
pointers) are correctly detected again.
Kudos to Paulus for finding this.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/powerpc/include/asm/exception-64s.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 88e0825..7d8f88e 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -210,7 +210,7 @@ do_kvm_##n: \
subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */ \
beq- 1f; \
ld r1,PACAKSAVE(r13); /* kernel stack to use */ \
-1: cmpdi cr1,r1,0; /* check if r1 is in userspace */ \
+1: cmpdi cr1,r1,-INT_FRAME_SIZE; /* check if r1 is in userspace */ \
blt+ cr1,3f; /* abort if it is */ \
li r1,(n); /* will be reloaded later */ \
sth r1,PACA_TRAP_SAVE(r13); \
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 123/166] Revert "of/address: Handle #address-cells > 2 specially"
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (121 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 122/166] powerpc: Fix bad stack check in exception entry Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 124/166] KVM: x86: Fix APIC map calculation after re-enabling Kamal Mostafa
` (42 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Rob Herring, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Herring <robh@kernel.org>
commit 13fcca8f25f4e9ce7f55da9cd353bb743236e212 upstream.
This reverts commit e38c0a1fbc5803cbacdaac0557c70ac8ca5152e7.
Nikita Yushchenko reports:
While trying to make freescale p2020ds and mpc8572ds boards working
with mainline kernel, I faced that commit e38c0a1f (Handle
Both these boards have uli1575 chip.
Corresponding part in device tree is something like
uli1575@0 {
reg = <0x0 0x0 0x0 0x0 0x0>;
#size-cells = <2>;
#address-cells = <3>;
ranges = <0x2000000 0x0 0x80000000
0x2000000 0x0 0x80000000
0x0 0x20000000
0x1000000 0x0 0x0
0x1000000 0x0 0x0
0x0 0x10000>;
isa@1e {
...
I.e. it has #address-cells = <3>
With commit e38c0a1f reverted, devices under uli1575 are registered
correctly, e.g. for rtc
OF: ** translation for device /pcie@ffe09000/pcie@0/uli1575@0/isa@1e/rtc@70 **
OF: bus is isa (na=2, ns=1) on /pcie@ffe09000/pcie@0/uli1575@0/isa@1e
OF: translating address: 00000001 00000070
OF: parent bus is default (na=3, ns=2) on /pcie@ffe09000/pcie@0/uli1575@0
OF: walking ranges...
OF: ISA map, cp=0, s=1000, da=70
OF: parent translation for: 01000000 00000000 00000000
OF: with offset: 70
OF: one level translation: 00000000 00000000 00000070
OF: parent bus is pci (na=3, ns=2) on /pcie@ffe09000/pcie@0
OF: walking ranges...
OF: default map, cp=a0000000, s=20000000, da=70
OF: default map, cp=0, s=10000, da=70
OF: parent translation for: 01000000 00000000 00000000
OF: with offset: 70
OF: one level translation: 01000000 00000000 00000070
OF: parent bus is pci (na=3, ns=2) on /pcie@ffe09000
OF: walking ranges...
OF: PCI map, cp=0, s=10000, da=70
OF: parent translation for: 01000000 00000000 00000000
OF: with offset: 70
OF: one level translation: 01000000 00000000 00000070
OF: parent bus is default (na=2, ns=2) on /
OF: walking ranges...
OF: PCI map, cp=0, s=10000, da=70
OF: parent translation for: 00000000 ffc10000
OF: with offset: 70
OF: one level translation: 00000000 ffc10070
OF: reached root node
With commit e38c0a1f in place, address translation fails:
OF: ** translation for device /pcie@ffe09000/pcie@0/uli1575@0/isa@1e/rtc@70 **
OF: bus is isa (na=2, ns=1) on /pcie@ffe09000/pcie@0/uli1575@0/isa@1e
OF: translating address: 00000001 00000070
OF: parent bus is default (na=3, ns=2) on /pcie@ffe09000/pcie@0/uli1575@0
OF: walking ranges...
OF: ISA map, cp=0, s=1000, da=70
OF: parent translation for: 01000000 00000000 00000000
OF: with offset: 70
OF: one level translation: 00000000 00000000 00000070
OF: parent bus is pci (na=3, ns=2) on /pcie@ffe09000/pcie@0
OF: walking ranges...
OF: default map, cp=a0000000, s=20000000, da=70
OF: default map, cp=0, s=10000, da=70
OF: not found !
Thierry Reding confirmed this commit was not needed after all:
"We ended up merging a different address representation for Tegra PCIe
and I've confirmed that reverting this commit doesn't cause any obvious
regressions. I think all other drivers in drivers/pci/host ended up
copying what we did on Tegra, so I wouldn't expect any other breakage
either."
There doesn't appear to be a simple way to support both behaviours, so
reverting this as nothing should be depending on the new behaviour.
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/of/address.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/of/address.c b/drivers/of/address.c
index 0125524..fb2a4e8 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -69,14 +69,6 @@ static u64 of_bus_default_map(__be32 *addr, const __be32 *range,
(unsigned long long)cp, (unsigned long long)s,
(unsigned long long)da);
- /*
- * If the number of address cells is larger than 2 we assume the
- * mapping doesn't specify a physical address. Rather, the address
- * specifies an identifier that must match exactly.
- */
- if (na > 2 && memcmp(range, addr, na * 4) != 0)
- return OF_BAD_ADDR;
-
if (da < cp || da >= (cp + s))
return OF_BAD_ADDR;
return da - cp;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 124/166] KVM: x86: Fix APIC map calculation after re-enabling
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (122 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 123/166] Revert "of/address: Handle #address-cells > 2 specially" Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 125/166] x86, fpu, amd: Clear exceptions in AMD FXSAVE workaround Kamal Mostafa
` (41 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jan Kiszka, Marcelo Tosatti, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kiszka <jan.kiszka@siemens.com>
commit e66d2ae7c67bd9ac982a3d1890564de7f7eabf4b upstream.
Update arch.apic_base before triggering recalculate_apic_map. Otherwise
the recalculation will work against the previous state of the APIC and
will fail to build the correct map when an APIC is hardware-enabled
again.
This fixes a regression of 1e08ec4a13.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kvm/lapic.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 360aed5..8da302f 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1300,6 +1300,10 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
return;
}
+ if (!kvm_vcpu_is_bsp(apic->vcpu))
+ value &= ~MSR_IA32_APICBASE_BSP;
+ vcpu->arch.apic_base = value;
+
/* update jump label if enable bit changes */
if ((vcpu->arch.apic_base ^ value) & MSR_IA32_APICBASE_ENABLE) {
if (value & MSR_IA32_APICBASE_ENABLE)
@@ -1309,10 +1313,6 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
recalculate_apic_map(vcpu->kvm);
}
- if (!kvm_vcpu_is_bsp(apic->vcpu))
- value &= ~MSR_IA32_APICBASE_BSP;
-
- vcpu->arch.apic_base = value;
if (apic_x2apic_mode(apic)) {
u32 id = kvm_apic_id(apic);
u32 ldr = ((id >> 4) << 16) | (1 << (id & 0xf));
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 125/166] x86, fpu, amd: Clear exceptions in AMD FXSAVE workaround
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (123 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 124/166] KVM: x86: Fix APIC map calculation after re-enabling Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 126/166] ath9k_htc: properly set MAC address and BSSID mask Kamal Mostafa
` (40 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: H. Peter Anvin, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <torvalds@linux-foundation.org>
commit 26bef1318adc1b3a530ecc807ef99346db2aa8b0 upstream.
Before we do an EMMS in the AMD FXSAVE information leak workaround we
need to clear any pending exceptions, otherwise we trap with a
floating-point exception inside this code.
Reported-by: halfdog <me@halfdog.net>
Tested-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/CA%2B55aFxQnY_PCG_n4=0w-VG=YLXL-yr7oMxyy0WU2gCBAf3ydg@mail.gmail.com
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/include/asm/fpu-internal.h | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h
index 41ab26e..87fac9e 100644
--- a/arch/x86/include/asm/fpu-internal.h
+++ b/arch/x86/include/asm/fpu-internal.h
@@ -294,12 +294,13 @@ static inline int restore_fpu_checking(struct task_struct *tsk)
/* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
is pending. Clear the x87 state here by setting it to fixed
values. "m" is a random variable that should be in L1 */
- alternative_input(
- ASM_NOP8 ASM_NOP2,
- "emms\n\t" /* clear stack tags */
- "fildl %P[addr]", /* set F?P to defined value */
- X86_FEATURE_FXSAVE_LEAK,
- [addr] "m" (tsk->thread.fpu.has_fpu));
+ if (unlikely(static_cpu_has(X86_FEATURE_FXSAVE_LEAK))) {
+ asm volatile(
+ "fnclex\n\t"
+ "emms\n\t"
+ "fildl %P[addr]" /* set F?P to defined value */
+ : : [addr] "m" (tsk->thread.fpu.has_fpu));
+ }
return fpu_restore_checking(&tsk->thread.fpu);
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 126/166] ath9k_htc: properly set MAC address and BSSID mask
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (124 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 125/166] x86, fpu, amd: Clear exceptions in AMD FXSAVE workaround Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 127/166] aacraid: prevent invalid pointer dereference Kamal Mostafa
` (39 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mathy Vanhoef, John W. Linville, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathy Vanhoef <vanhoefm@gmail.com>
commit 657eb17d87852c42b55c4b06d5425baa08b2ddb3 upstream.
Pick the MAC address of the first virtual interface as the new hardware MAC
address. Set BSSID mask according to this MAC address. This fixes CVE-2013-4579.
Signed-off-by: Mathy Vanhoef <vanhoefm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 25 +++++++++++++++++--------
drivers/net/wireless/ath/ath9k/main.c | 5 +++--
2 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 2f34993..112116b 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -145,21 +145,26 @@ static void ath9k_htc_bssid_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
struct ath9k_vif_iter_data *iter_data = data;
int i;
- for (i = 0; i < ETH_ALEN; i++)
- iter_data->mask[i] &= ~(iter_data->hw_macaddr[i] ^ mac[i]);
+ if (iter_data->hw_macaddr != NULL) {
+ for (i = 0; i < ETH_ALEN; i++)
+ iter_data->mask[i] &= ~(iter_data->hw_macaddr[i] ^ mac[i]);
+ } else {
+ iter_data->hw_macaddr = mac;
+ }
}
-static void ath9k_htc_set_bssid_mask(struct ath9k_htc_priv *priv,
+static void ath9k_htc_set_mac_bssid_mask(struct ath9k_htc_priv *priv,
struct ieee80211_vif *vif)
{
struct ath_common *common = ath9k_hw_common(priv->ah);
struct ath9k_vif_iter_data iter_data;
/*
- * Use the hardware MAC address as reference, the hardware uses it
- * together with the BSSID mask when matching addresses.
+ * Pick the MAC address of the first interface as the new hardware
+ * MAC address. The hardware will use it together with the BSSID mask
+ * when matching addresses.
*/
- iter_data.hw_macaddr = common->macaddr;
+ iter_data.hw_macaddr = NULL;
memset(&iter_data.mask, 0xff, ETH_ALEN);
if (vif)
@@ -171,6 +176,10 @@ static void ath9k_htc_set_bssid_mask(struct ath9k_htc_priv *priv,
ath9k_htc_bssid_iter, &iter_data);
memcpy(common->bssidmask, iter_data.mask, ETH_ALEN);
+
+ if (iter_data.hw_macaddr)
+ memcpy(common->macaddr, iter_data.hw_macaddr, ETH_ALEN);
+
ath_hw_setbssidmask(common);
}
@@ -1076,7 +1085,7 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,
goto out;
}
- ath9k_htc_set_bssid_mask(priv, vif);
+ ath9k_htc_set_mac_bssid_mask(priv, vif);
priv->vif_slot |= (1 << avp->index);
priv->nvifs++;
@@ -1139,7 +1148,7 @@ static void ath9k_htc_remove_interface(struct ieee80211_hw *hw,
ath9k_htc_set_opmode(priv);
- ath9k_htc_set_bssid_mask(priv, vif);
+ ath9k_htc_set_mac_bssid_mask(priv, vif);
/*
* Stop ANI only if there are no associated station interfaces.
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index e0eb87b..667319b 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -886,8 +886,9 @@ void ath9k_calculate_iter_data(struct ieee80211_hw *hw,
struct ath_common *common = ath9k_hw_common(ah);
/*
- * Use the hardware MAC address as reference, the hardware uses it
- * together with the BSSID mask when matching addresses.
+ * Pick the MAC address of the first interface as the new hardware
+ * MAC address. The hardware will use it together with the BSSID mask
+ * when matching addresses.
*/
memset(iter_data, 0, sizeof(*iter_data));
iter_data->hw_macaddr = common->macaddr;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 127/166] aacraid: prevent invalid pointer dereference
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (125 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 126/166] ath9k_htc: properly set MAC address and BSSID mask Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 128/166] mfd: rtsx_pcr: Disable interrupts before cancelling delayed works Kamal Mostafa
` (38 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mahesh Rajashekhara, Linus Torvalds, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
commit b4789b8e6be3151a955ade74872822f30e8cd914 upstream.
It appears that driver runs into a problem here if fibsize is too small
because we allocate user_srbcmd with fibsize size only but later we
access it until user_srbcmd->sg.count to copy it over to srbcmd.
It is not correct to test (fibsize < sizeof(*user_srbcmd)) because this
structure already includes one sg element and this is not needed for
commands without data. So, we would recommend to add the following
(instead of test for fibsize == 0).
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reported-by: Nico Golde <nico@ngolde.de>
Reported-by: Fabian Yamaguchi <fabs@goesec.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/scsi/aacraid/commctrl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
index 1ef041b..ee6cadd 100644
--- a/drivers/scsi/aacraid/commctrl.c
+++ b/drivers/scsi/aacraid/commctrl.c
@@ -510,7 +510,8 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
goto cleanup;
}
- if (fibsize > (dev->max_fib_size - sizeof(struct aac_fibhdr))) {
+ if ((fibsize < (sizeof(struct user_aac_srb) - sizeof(struct user_sgentry))) ||
+ (fibsize > (dev->max_fib_size - sizeof(struct aac_fibhdr)))) {
rcode = -EINVAL;
goto cleanup;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 128/166] mfd: rtsx_pcr: Disable interrupts before cancelling delayed works
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (126 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 127/166] aacraid: prevent invalid pointer dereference Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 129/166] mac80211: move "bufferable MMPDU" check to fix AP mode scan Kamal Mostafa
` (37 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Thomas Gleixner, Samuel Ortiz, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <tglx@linutronix.de>
commit 73beb63d290f961c299526852884846b0d868840 upstream.
This fixes a kernel panic when resuming from suspend to RAM.
Without this fix an interrupt hits after the delayed work is canceled
and thus requeues it. So we end up freeing an armed timer.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mfd/rtsx_pcr.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
index 148aa18..0c0a84d 100644
--- a/drivers/mfd/rtsx_pcr.c
+++ b/drivers/mfd/rtsx_pcr.c
@@ -1188,8 +1188,14 @@ static void rtsx_pci_remove(struct pci_dev *pcidev)
pcr->remove_pci = true;
- cancel_delayed_work(&pcr->carddet_work);
- cancel_delayed_work(&pcr->idle_work);
+ /* Disable interrupts at the pcr level */
+ spin_lock_irq(&pcr->lock);
+ rtsx_pci_writel(pcr, RTSX_BIER, 0);
+ pcr->bier = 0;
+ spin_unlock_irq(&pcr->lock);
+
+ cancel_delayed_work_sync(&pcr->carddet_work);
+ cancel_delayed_work_sync(&pcr->idle_work);
mfd_remove_devices(&pcidev->dev);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 129/166] mac80211: move "bufferable MMPDU" check to fix AP mode scan
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (127 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 128/166] mfd: rtsx_pcr: Disable interrupts before cancelling delayed works Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 130/166] ARM: fix footbridge clockevent device Kamal Mostafa
` (36 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Felix Fietkau, Johannes Berg, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <nbd@openwrt.org>
commit 277d916fc2e959c3f106904116bb4f7b1148d47a upstream.
The check needs to apply to both multicast and unicast packets,
otherwise probe requests on AP mode scans are sent through the multicast
buffer queue, which adds long delays (often longer than the scanning
interval).
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/mac80211/tx.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 6b976b7..0892d9a 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -442,7 +442,6 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
{
struct sta_info *sta = tx->sta;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data;
struct ieee80211_local *local = tx->local;
if (unlikely(!sta))
@@ -453,15 +452,6 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
!(info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER))) {
int ac = skb_get_queue_mapping(tx->skb);
- /* only deauth, disassoc and action are bufferable MMPDUs */
- if (ieee80211_is_mgmt(hdr->frame_control) &&
- !ieee80211_is_deauth(hdr->frame_control) &&
- !ieee80211_is_disassoc(hdr->frame_control) &&
- !ieee80211_is_action(hdr->frame_control)) {
- info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER;
- return TX_CONTINUE;
- }
-
ps_dbg(sta->sdata, "STA %pM aid %d: PS buffer for AC %d\n",
sta->sta.addr, sta->sta.aid, ac);
if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER)
@@ -504,9 +494,22 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
static ieee80211_tx_result debug_noinline
ieee80211_tx_h_ps_buf(struct ieee80211_tx_data *tx)
{
+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data;
+
if (unlikely(tx->flags & IEEE80211_TX_PS_BUFFERED))
return TX_CONTINUE;
+ /* only deauth, disassoc and action are bufferable MMPDUs */
+ if (ieee80211_is_mgmt(hdr->frame_control) &&
+ !ieee80211_is_deauth(hdr->frame_control) &&
+ !ieee80211_is_disassoc(hdr->frame_control) &&
+ !ieee80211_is_action(hdr->frame_control)) {
+ if (tx->flags & IEEE80211_TX_UNICAST)
+ info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER;
+ return TX_CONTINUE;
+ }
+
if (tx->flags & IEEE80211_TX_UNICAST)
return ieee80211_tx_h_unicast_ps_buf(tx);
else
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 130/166] ARM: fix footbridge clockevent device
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (128 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 129/166] mac80211: move "bufferable MMPDU" check to fix AP mode scan Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 131/166] ahci: add PCI ID for Marvell 88SE9170 SATA controller Kamal Mostafa
` (35 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Russell King, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell King <rmk+kernel@arm.linux.org.uk>
commit 4ff859fe1dc0da0f87bbdfff78f527898878fa4a upstream.
The clockevents code was being told that the footbridge clock event
device ticks at 16x the rate which it actually does. This leads to
timekeeping problems since it allows the clocksource to wrap before
the kernel notices. Fix this by using the correct clock.
Fixes: 4e8d76373c9fd ("ARM: footbridge: convert to clockevents/clocksource")
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
[ kamal: backport to 3.8: also applied prereq dc21285-timer.c change from
838a2ae "ARM: use clockevents_config_and_register() where possible" ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
| 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
--git a/arch/arm/mach-footbridge/dc21285-timer.c b/arch/arm/mach-footbridge/dc21285-timer.c
index 3b54196..edb0ef3 100644
--- a/arch/arm/mach-footbridge/dc21285-timer.c
+++ b/arch/arm/mach-footbridge/dc21285-timer.c
@@ -96,17 +96,14 @@ static struct irqaction footbridge_timer_irq = {
static void __init footbridge_timer_init(void)
{
struct clock_event_device *ce = &ckevt_dc21285;
+ unsigned rate = DIV_ROUND_CLOSEST(mem_fclk_21285, 16);
- clocksource_register_hz(&cksrc_dc21285, (mem_fclk_21285 + 8) / 16);
+ clocksource_register_hz(&cksrc_dc21285, rate);
setup_irq(ce->irq, &footbridge_timer_irq);
- clockevents_calc_mult_shift(ce, mem_fclk_21285, 5);
- ce->max_delta_ns = clockevent_delta2ns(0xffffff, ce);
- ce->min_delta_ns = clockevent_delta2ns(0x000004, ce);
ce->cpumask = cpumask_of(smp_processor_id());
-
- clockevents_register_device(ce);
+ clockevents_config_and_register(ce, rate, 0x4, 0xffffff);
}
struct sys_timer footbridge_timer = {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 131/166] ahci: add PCI ID for Marvell 88SE9170 SATA controller
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (129 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 130/166] ARM: fix footbridge clockevent device Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 132/166] ARM: fix "bad mode in ... handler" message for undefined instructions Kamal Mostafa
` (34 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Simon Guinot, Tejun Heo, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Simon Guinot <sguinot@lacie.com>
commit e098f5cbe9d410e7878b50f524dce36cc83ec40e upstream.
This patch adds support for the PCI ID provided by the Marvell 88SE9170
SATA controller.
Signed-off-by: Simon Guinot <sguinot@lacie.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
[ kamal: backport to 3.8 (revert to hardcoded PCI id)
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/ata/ahci.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 6468d43..67fb282 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -425,6 +425,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
.driver_data = board_ahci_yes_fbs }, /* 88se9128 */
{ PCI_DEVICE(0x1b4b, 0x9125),
.driver_data = board_ahci_yes_fbs }, /* 88se9125 */
+ { PCI_DEVICE_SUB(0x1b4b, 0x9178,
+ 0x1b4b, 0x9170),
+ .driver_data = board_ahci_yes_fbs }, /* 88se9170 */
{ PCI_DEVICE(0x1b4b, 0x917a),
.driver_data = board_ahci_yes_fbs }, /* 88se9172 */
{ PCI_DEVICE(0x1b4b, 0x9192),
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 132/166] ARM: fix "bad mode in ... handler" message for undefined instructions
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (130 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 131/166] ahci: add PCI ID for Marvell 88SE9170 SATA controller Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 133/166] ACPI / TPM: fix memory leak when walking ACPI namespace Kamal Mostafa
` (33 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Russell King, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell King <rmk+kernel@arm.linux.org.uk>
commit 29c350bf28da333e41e30497b649fe335712a2ab upstream.
The array was missing the final entry for the undefined instruction
exception handler; this commit adds it.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/kernel/traps.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 1392beb..cb49efe 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -37,7 +37,13 @@
#include "signal.h"
-static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" };
+static const char *handler[]= {
+ "prefetch abort",
+ "data abort",
+ "address exception",
+ "interrupt",
+ "undefined instruction",
+};
void *vectors_page;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 133/166] ACPI / TPM: fix memory leak when walking ACPI namespace
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (131 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 132/166] ARM: fix "bad mode in ... handler" message for undefined instructions Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 134/166] ACPI / Battery: Add a _BIX quirk for NEC LZ750/LS Kamal Mostafa
` (32 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jiang Liu, Rafael J. Wysocki, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiang Liu <jiang.liu@linux.intel.com>
commit df45c712d1f4ef37714245fb75de726f4ca2bf8d upstream.
In function ppi_callback(), memory allocated by acpi_get_name() will get
leaked when current device isn't the desired TPM device, so fix the
memory leak.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/char/tpm/tpm_ppi.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c
index 720ebcf..d0f1bdd 100644
--- a/drivers/char/tpm/tpm_ppi.c
+++ b/drivers/char/tpm/tpm_ppi.c
@@ -27,15 +27,18 @@ static char *tpm_device_name = "TPM";
static acpi_status ppi_callback(acpi_handle handle, u32 level, void *context,
void **return_value)
{
- acpi_status status;
+ acpi_status status = AE_OK;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
- status = acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
- if (strstr(buffer.pointer, context) != NULL) {
- *return_value = handle;
+
+ if (ACPI_SUCCESS(acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer))) {
+ if (strstr(buffer.pointer, context) != NULL) {
+ *return_value = handle;
+ status = AE_CTRL_TERMINATE;
+ }
kfree(buffer.pointer);
- return AE_CTRL_TERMINATE;
}
- return AE_OK;
+
+ return status;
}
static inline void ppi_assign_params(union acpi_object params[4],
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 134/166] ACPI / Battery: Add a _BIX quirk for NEC LZ750/LS
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (132 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 133/166] ACPI / TPM: fix memory leak when walking ACPI namespace Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 135/166] drm/nouveau/bios: make jump conditional Kamal Mostafa
` (31 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Lan Tianyu, Rafael J. Wysocki, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Lan Tianyu <tianyu.lan@intel.com>
commit a90b40385735af0d3031f98e97b439e8944a31b3 upstream.
The AML method _BIX of NEC LZ750/LS returns a broken package which
skips the first member "Revision" (ACPI 5.0, Table 10-234).
Add a quirk for this machine to skip member "Revision" during parsing
the package returned by _BIX.
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=67351
Reported-and-tested-by: Francisco Castro <fcr@adinet.com.uy>
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ kamal: backport to 3.8 (context in acpi_battery_init_async) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/acpi/battery.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 7663df7..a16a725 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -68,6 +68,7 @@ MODULE_AUTHOR("Alexey Starikovskiy <astarikovskiy@suse.de>");
MODULE_DESCRIPTION("ACPI Battery Driver");
MODULE_LICENSE("GPL");
+static int battery_bix_broken_package;
static unsigned int cache_time = 1000;
module_param(cache_time, uint, 0644);
MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
@@ -443,7 +444,12 @@ static int acpi_battery_get_info(struct acpi_battery *battery)
ACPI_EXCEPTION((AE_INFO, status, "Evaluating %s", name));
return -ENODEV;
}
- if (test_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags))
+
+ if (battery_bix_broken_package)
+ result = extract_package(battery, buffer.pointer,
+ extended_info_offsets + 1,
+ ARRAY_SIZE(extended_info_offsets) - 1);
+ else if (test_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags))
result = extract_package(battery, buffer.pointer,
extended_info_offsets,
ARRAY_SIZE(extended_info_offsets));
@@ -1064,6 +1070,17 @@ static int battery_notify(struct notifier_block *nb,
return 0;
}
+static struct dmi_system_id bat_dmi_table[] = {
+ {
+ .ident = "NEC LZ750/LS",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "NEC"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "PC-LZ750LS"),
+ },
+ },
+ {},
+};
+
static int acpi_battery_add(struct acpi_device *device)
{
int result = 0;
@@ -1169,6 +1186,10 @@ static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie)
{
if (acpi_disabled)
return;
+
+ if (dmi_check_system(bat_dmi_table))
+ battery_bix_broken_package = 1;
+
#ifdef CONFIG_ACPI_PROCFS_POWER
acpi_battery_dir = acpi_lock_battery_dir();
if (!acpi_battery_dir)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 135/166] drm/nouveau/bios: make jump conditional
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (133 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 134/166] ACPI / Battery: Add a _BIX quirk for NEC LZ750/LS Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 136/166] clk: clk-divider: fix divisor > 255 bug Kamal Mostafa
` (30 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Ilia Mirkin, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilia Mirkin <imirkin@alum.mit.edu>
commit 6d60792ec059d9f2139828f9f017679abb81aa73 upstream.
This fixes a hang in VBIOS scripts of the form "condition; jump".
The jump used to always be executed, while now it will only be
executed if the condition is true.
See https://bugs.freedesktop.org/show_bug.cgi?id=72943
Reported-by: Darcy Brás da Silva <dardevelin@cidadecool.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/nouveau/core/subdev/bios/init.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
index ad6662c..9e0cb43 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
@@ -1262,7 +1262,11 @@ init_jump(struct nvbios_init *init)
u16 offset = nv_ro16(bios, init->offset + 1);
trace("JUMP\t0x%04x\n", offset);
- init->offset = offset;
+
+ if (init_exec(init))
+ init->offset = offset;
+ else
+ init->offset += 3;
}
/**
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 136/166] clk: clk-divider: fix divisor > 255 bug
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (134 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 135/166] drm/nouveau/bios: make jump conditional Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 137/166] SELinux: Fix possible NULL pointer dereference in selinux_inode_permission() Kamal Mostafa
` (29 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: James Hogan, Rajendra Nayak, linux-arm-kernel, Mike Turquette,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hogan <james.hogan@imgtec.com>
commit 778037e1ccb75609846deca9e419449c1dc137fa upstream.
Commit 6d9252bd9a4bb (clk: Add support for power of two type dividers)
merged in v3.6 added the _get_val function to convert a divisor value to
a register field value depending on the flags. However it used the type
u8 for the div field, causing divisors larger than 255 to be masked
and the resultant clock rate to be too high.
E.g. in my case an 11bit divider was supposed to divide 24.576 MHz down
to 32.768KHz. The divisor was correctly calculated as 750 (0x2ee). This
was masked to 238 (0xee) resulting in a frequency of 103.26KHz.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/clk/clk-divider.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
index a9204c6..f253ce1 100644
--- a/drivers/clk/clk-divider.c
+++ b/drivers/clk/clk-divider.c
@@ -87,7 +87,7 @@ static unsigned int _get_table_val(const struct clk_div_table *table,
return 0;
}
-static unsigned int _get_val(struct clk_divider *divider, u8 div)
+static unsigned int _get_val(struct clk_divider *divider, unsigned int div)
{
if (divider->flags & CLK_DIVIDER_ONE_BASED)
return div;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 137/166] SELinux: Fix possible NULL pointer dereference in selinux_inode_permission()
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (135 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 136/166] clk: clk-divider: fix divisor > 255 bug Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 138/166] IPv6: Fixed support for blackhole and prohibit routes Kamal Mostafa
` (28 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Steven Rostedt, Linus Torvalds, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt <rostedt@goodmis.org>
commit 3dc91d4338d698ce77832985f9cb183d8eeaf6be upstream.
While running stress tests on adding and deleting ftrace instances I hit
this bug:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
IP: selinux_inode_permission+0x85/0x160
PGD 63681067 PUD 7ddbe067 PMD 0
Oops: 0000 [#1] PREEMPT
CPU: 0 PID: 5634 Comm: ftrace-test-mki Not tainted 3.13.0-rc4-test-00033-gd2a6dde-dirty #20
Hardware name: /DG965MQ, BIOS MQ96510J.86A.0372.2006.0605.1717 06/05/2006
task: ffff880078375800 ti: ffff88007ddb0000 task.ti: ffff88007ddb0000
RIP: 0010:[<ffffffff812d8bc5>] [<ffffffff812d8bc5>] selinux_inode_permission+0x85/0x160
RSP: 0018:ffff88007ddb1c48 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000800000 RCX: ffff88006dd43840
RDX: 0000000000000001 RSI: 0000000000000081 RDI: ffff88006ee46000
RBP: ffff88007ddb1c88 R08: 0000000000000000 R09: ffff88007ddb1c54
R10: 6e6576652f6f6f66 R11: 0000000000000003 R12: 0000000000000000
R13: 0000000000000081 R14: ffff88006ee46000 R15: 0000000000000000
FS: 00007f217b5b6700(0000) GS:ffffffff81e21000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033^M
CR2: 0000000000000020 CR3: 000000006a0fe000 CR4: 00000000000007f0
Call Trace:
security_inode_permission+0x1c/0x30
__inode_permission+0x41/0xa0
inode_permission+0x18/0x50
link_path_walk+0x66/0x920
path_openat+0xa6/0x6c0
do_filp_open+0x43/0xa0
do_sys_open+0x146/0x240
SyS_open+0x1e/0x20
system_call_fastpath+0x16/0x1b
Code: 84 a1 00 00 00 81 e3 00 20 00 00 89 d8 83 c8 02 40 f6 c6 04 0f 45 d8 40 f6 c6 08 74 71 80 cf 02 49 8b 46 38 4c 8d 4d cc 45 31 c0 <0f> b7 50 20 8b 70 1c 48 8b 41 70 89 d9 8b 78 04 e8 36 cf ff ff
RIP selinux_inode_permission+0x85/0x160
CR2: 0000000000000020
Investigating, I found that the inode->i_security was NULL, and the
dereference of it caused the oops.
in selinux_inode_permission():
isec = inode->i_security;
rc = avc_has_perm_noaudit(sid, isec->sid, isec->sclass, perms, 0, &avd);
Note, the crash came from stressing the deletion and reading of debugfs
files. I was not able to recreate this via normal files. But I'm not
sure they are safe. It may just be that the race window is much harder
to hit.
What seems to have happened (and what I have traced), is the file is
being opened at the same time the file or directory is being deleted.
As the dentry and inode locks are not held during the path walk, nor is
the inodes ref counts being incremented, there is nothing saving these
structures from being discarded except for an rcu_read_lock().
The rcu_read_lock() protects against freeing of the inode, but it does
not protect freeing of the inode_security_struct. Now if the freeing of
the i_security happens with a call_rcu(), and the i_security field of
the inode is not changed (it gets freed as the inode gets freed) then
there will be no issue here. (Linus Torvalds suggested not setting the
field to NULL such that we do not need to check if it is NULL in the
permission check).
Note, this is a hack, but it fixes the problem at hand. A real fix is
to restructure the destroy_inode() to call all the destructor handlers
from the RCU callback. But that is a major job to do, and requires a
lot of work. For now, we just band-aid this bug with this fix (it
works), and work on a more maintainable solution in the future.
Link: http://lkml.kernel.org/r/20140109101932.0508dec7@gandalf.local.home
Link: http://lkml.kernel.org/r/20140109182756.17abaaa8@gandalf.local.home
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
security/selinux/hooks.c | 20 ++++++++++++++++++--
security/selinux/include/objsec.h | 5 ++++-
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 6b0b250..89c986e 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -218,6 +218,14 @@ static int inode_alloc_security(struct inode *inode)
return 0;
}
+static void inode_free_rcu(struct rcu_head *head)
+{
+ struct inode_security_struct *isec;
+
+ isec = container_of(head, struct inode_security_struct, rcu);
+ kmem_cache_free(sel_inode_cache, isec);
+}
+
static void inode_free_security(struct inode *inode)
{
struct inode_security_struct *isec = inode->i_security;
@@ -228,8 +236,16 @@ static void inode_free_security(struct inode *inode)
list_del_init(&isec->list);
spin_unlock(&sbsec->isec_lock);
- inode->i_security = NULL;
- kmem_cache_free(sel_inode_cache, isec);
+ /*
+ * The inode may still be referenced in a path walk and
+ * a call to selinux_inode_permission() can be made
+ * after inode_free_security() is called. Ideally, the VFS
+ * wouldn't do this, but fixing that is a much harder
+ * job. For now, simply free the i_security via RCU, and
+ * leave the current inode->i_security pointer intact.
+ * The inode will be freed after the RCU grace period too.
+ */
+ call_rcu(&isec->rcu, inode_free_rcu);
}
static int file_alloc_security(struct file *file)
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
index aa47bca..6fd9dd2 100644
--- a/security/selinux/include/objsec.h
+++ b/security/selinux/include/objsec.h
@@ -38,7 +38,10 @@ struct task_security_struct {
struct inode_security_struct {
struct inode *inode; /* back pointer to inode object */
- struct list_head list; /* list of inode_security_struct */
+ union {
+ struct list_head list; /* list of inode_security_struct */
+ struct rcu_head rcu; /* for freeing the inode_security_struct */
+ };
u32 task_sid; /* SID of creating task */
u32 sid; /* SID of this object */
u16 sclass; /* security class of this object */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 138/166] IPv6: Fixed support for blackhole and prohibit routes
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (136 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 137/166] SELinux: Fix possible NULL pointer dereference in selinux_inode_permission() Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 139/166] net: do not pretend FRAGLIST support Kamal Mostafa
` (27 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Kamala R, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Kamala R <kamala@aristanetworks.com>
[ Upstream commit 7150aede5dd241539686e17d9592f5ebd28a2cda ]
The behaviour of blackhole and prohibit routes has been corrected by setting
the input and output pointers of the dst variable appropriately. For
blackhole routes, they are set to dst_discard and to ip6_pkt_discard and
ip6_pkt_discard_out respectively for prohibit routes.
ipv6: ip6_pkt_prohibit(_out) should not depend on
CONFIG_IPV6_MULTIPLE_TABLES
We need ip6_pkt_prohibit(_out) available without
CONFIG_IPV6_MULTIPLE_TABLES
Signed-off-by: Kamala R <kamala@aristanetworks.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/ipv6/route.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index abf3556..9b530eb 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -78,6 +78,8 @@ static int ip6_dst_gc(struct dst_ops *ops);
static int ip6_pkt_discard(struct sk_buff *skb);
static int ip6_pkt_discard_out(struct sk_buff *skb);
+static int ip6_pkt_prohibit(struct sk_buff *skb);
+static int ip6_pkt_prohibit_out(struct sk_buff *skb);
static void ip6_link_failure(struct sk_buff *skb);
static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
struct sk_buff *skb, u32 mtu);
@@ -240,9 +242,6 @@ static const struct rt6_info ip6_null_entry_template = {
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
-static int ip6_pkt_prohibit(struct sk_buff *skb);
-static int ip6_pkt_prohibit_out(struct sk_buff *skb);
-
static const struct rt6_info ip6_prohibit_entry_template = {
.dst = {
.__refcnt = ATOMIC_INIT(1),
@@ -1512,21 +1511,24 @@ int ip6_route_add(struct fib6_config *cfg)
goto out;
}
}
- rt->dst.output = ip6_pkt_discard_out;
- rt->dst.input = ip6_pkt_discard;
rt->rt6i_flags = RTF_REJECT|RTF_NONEXTHOP;
switch (cfg->fc_type) {
case RTN_BLACKHOLE:
rt->dst.error = -EINVAL;
+ rt->dst.output = dst_discard;
+ rt->dst.input = dst_discard;
break;
case RTN_PROHIBIT:
rt->dst.error = -EACCES;
+ rt->dst.output = ip6_pkt_prohibit_out;
+ rt->dst.input = ip6_pkt_prohibit;
break;
case RTN_THROW:
- rt->dst.error = -EAGAIN;
- break;
default:
- rt->dst.error = -ENETUNREACH;
+ rt->dst.error = (cfg->fc_type == RTN_THROW) ? -EAGAIN
+ : -ENETUNREACH;
+ rt->dst.output = ip6_pkt_discard_out;
+ rt->dst.input = ip6_pkt_discard;
break;
}
goto install_route;
@@ -2106,8 +2108,6 @@ static int ip6_pkt_discard_out(struct sk_buff *skb)
return ip6_pkt_drop(skb, ICMPV6_NOROUTE, IPSTATS_MIB_OUTNOROUTES);
}
-#ifdef CONFIG_IPV6_MULTIPLE_TABLES
-
static int ip6_pkt_prohibit(struct sk_buff *skb)
{
return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_INNOROUTES);
@@ -2119,8 +2119,6 @@ static int ip6_pkt_prohibit_out(struct sk_buff *skb)
return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
}
-#endif
-
/*
* Allocate a dst for local (unicast / anycast) address.
*/
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 139/166] net: do not pretend FRAGLIST support
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (137 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 138/166] IPv6: Fixed support for blackhole and prohibit routes Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 140/166] rds: prevent BUG_ON triggered on congestion update to loopback Kamal Mostafa
` (26 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Eric Dumazet, Thadeu Lima de Souza Cascardo, Anirudha Sarangi,
David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 28e24c62ab3062e965ef1b3bcc244d50aee7fa85 ]
Few network drivers really supports frag_list : virtual drivers.
Some drivers wrongly advertise NETIF_F_FRAGLIST feature.
If skb with a frag_list is given to them, packet on the wire will be
corrupt.
Remove this flag, as core networking stack will make sure to
provide packets that can be sent without corruption.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Cc: Anirudha Sarangi <anirudh@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/ethernet/ibm/ehea/ehea_main.c | 2 +-
drivers/net/ethernet/tehuti/tehuti.c | 1 -
drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +-
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
4 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 19b64de..69e5296 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -3029,7 +3029,7 @@ static struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
dev->hw_features = NETIF_F_SG | NETIF_F_TSO
| NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX;
- dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO
+ dev->features = NETIF_F_SG | NETIF_F_TSO
| NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX
| NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER
| NETIF_F_RXCSUM;
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c
index 1e4d743..aab44f2 100644
--- a/drivers/net/ethernet/tehuti/tehuti.c
+++ b/drivers/net/ethernet/tehuti/tehuti.c
@@ -2020,7 +2020,6 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ndev->features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO
| NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX |
NETIF_F_HW_VLAN_FILTER | NETIF_F_RXCSUM
- /*| NETIF_F_FRAGLIST */
;
ndev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG |
NETIF_F_TSO | NETIF_F_HW_VLAN_TX;
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 33c111d..42d4173 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -1026,7 +1026,7 @@ static int temac_of_probe(struct platform_device *op)
dev_set_drvdata(&op->dev, ndev);
SET_NETDEV_DEV(ndev, &op->dev);
ndev->flags &= ~IFF_MULTICAST; /* clear multicast */
- ndev->features = NETIF_F_SG | NETIF_F_FRAGLIST;
+ ndev->features = NETIF_F_SG;
ndev->netdev_ops = &temac_netdev_ops;
ndev->ethtool_ops = &temac_ethtool_ops;
#if 0
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 6f47100..26176eb 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1500,7 +1500,7 @@ static int axienet_of_probe(struct platform_device *op)
SET_NETDEV_DEV(ndev, &op->dev);
ndev->flags &= ~IFF_MULTICAST; /* clear multicast */
- ndev->features = NETIF_F_SG | NETIF_F_FRAGLIST;
+ ndev->features = NETIF_F_SG;
ndev->netdev_ops = &axienet_netdev_ops;
ndev->ethtool_ops = &axienet_ethtool_ops;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 140/166] rds: prevent BUG_ON triggered on congestion update to loopback
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (138 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 139/166] net: do not pretend FRAGLIST support Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 141/166] macvtap: Do not double-count received packets Kamal Mostafa
` (25 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Venkat Venkatsubra, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
[ Upstream commit 18fc25c94eadc52a42c025125af24657a93638c0 ]
After congestion update on a local connection, when rds_ib_xmit returns
less bytes than that are there in the message, rds_send_xmit calls
back rds_ib_xmit with an offset that causes BUG_ON(off & RDS_FRAG_SIZE)
to trigger.
For a 4Kb PAGE_SIZE rds_ib_xmit returns min(8240,4096)=4096 when actually
the message contains 8240 bytes. rds_send_xmit thinks there is more to send
and calls rds_ib_xmit again with a data offset "off" of 4096-48(rds header)
=4048 bytes thus hitting the BUG_ON(off & RDS_FRAG_SIZE) [RDS_FRAG_SIZE=4k].
The commit 6094628bfd94323fc1cea05ec2c6affd98c18f7f
"rds: prevent BUG_ON triggering on congestion map updates" introduced
this regression. That change was addressing the triggering of a different
BUG_ON in rds_send_xmit() on PowerPC architecture with 64Kbytes PAGE_SIZE:
BUG_ON(ret != 0 &&
conn->c_xmit_sg == rm->data.op_nents);
This was the sequence it was going through:
(rds_ib_xmit)
/* Do not send cong updates to IB loopback */
if (conn->c_loopback
&& rm->m_inc.i_hdr.h_flags & RDS_FLAG_CONG_BITMAP) {
rds_cong_map_updated(conn->c_fcong, ~(u64) 0);
return sizeof(struct rds_header) + RDS_CONG_MAP_BYTES;
}
rds_ib_xmit returns 8240
rds_send_xmit:
c_xmit_data_off = 0 + 8240 - 48 (rds header accounted only the first time)
= 8192
c_xmit_data_off < 65536 (sg->length), so calls rds_ib_xmit again
rds_ib_xmit returns 8240
rds_send_xmit:
c_xmit_data_off = 8192 + 8240 = 16432, calls rds_ib_xmit again
and so on (c_xmit_data_off 24672,32912,41152,49392,57632)
rds_ib_xmit returns 8240
On this iteration this sequence causes the BUG_ON in rds_send_xmit:
while (ret) {
tmp = min_t(int, ret, sg->length - conn->c_xmit_data_off);
[tmp = 65536 - 57632 = 7904]
conn->c_xmit_data_off += tmp;
[c_xmit_data_off = 57632 + 7904 = 65536]
ret -= tmp;
[ret = 8240 - 7904 = 336]
if (conn->c_xmit_data_off == sg->length) {
conn->c_xmit_data_off = 0;
sg++;
conn->c_xmit_sg++;
BUG_ON(ret != 0 &&
conn->c_xmit_sg == rm->data.op_nents);
[c_xmit_sg = 1, rm->data.op_nents = 1]
What the current fix does:
Since the congestion update over loopback is not actually transmitted
as a message, all that rds_ib_xmit needs to do is let the caller think
the full message has been transmitted and not return partial bytes.
It will return 8240 (RDS_CONG_MAP_BYTES+48) when PAGE_SIZE is 4Kb.
And 64Kb+48 when page size is 64Kb.
Reported-by: Josh Hunt <joshhunt00@gmail.com>
Tested-by: Honggang Li <honli@redhat.com>
Acked-by: Bang Nguyen <bang.nguyen@oracle.com>
Signed-off-by: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/rds/ib_send.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c
index e590949..37be6e2 100644
--- a/net/rds/ib_send.c
+++ b/net/rds/ib_send.c
@@ -552,9 +552,8 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
&& rm->m_inc.i_hdr.h_flags & RDS_FLAG_CONG_BITMAP) {
rds_cong_map_updated(conn->c_fcong, ~(u64) 0);
scat = &rm->data.op_sg[sg];
- ret = sizeof(struct rds_header) + RDS_CONG_MAP_BYTES;
- ret = min_t(int, ret, scat->length - conn->c_xmit_data_off);
- return ret;
+ ret = max_t(int, RDS_CONG_MAP_BYTES, scat->length);
+ return sizeof(struct rds_header) + ret;
}
/* FIXME we may overallocate here */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 141/166] macvtap: Do not double-count received packets
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (139 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 140/166] rds: prevent BUG_ON triggered on congestion update to loopback Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 142/166] macvtap: update file current position Kamal Mostafa
` (24 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Vlad Yasevich, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Vlad Yasevich <vyasevic@redhat.com>
[ Upstream commit 006da7b07bc4d3a7ffabad17cf639eec6849c9dc ]
Currently macvlan will count received packets after calling each
vlans receive handler. Macvtap attempts to count the packet
yet again when the user reads the packet from the tap socket.
This code doesn't do this consistently either. Remove the
counting from macvtap and let only macvlan count received
packets.
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/macvtap.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 15820ab..a4df37f 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -805,7 +805,6 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
const struct sk_buff *skb,
const struct iovec *iv, int len)
{
- struct macvlan_dev *vlan;
int ret;
int vnet_hdr_len = 0;
int vlan_offset = 0;
@@ -859,12 +858,6 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
copied += len;
done:
- rcu_read_lock_bh();
- vlan = rcu_dereference_bh(q->vlan);
- if (vlan)
- macvlan_count_rx(vlan, copied - vnet_hdr_len, ret == 0, 0);
- rcu_read_unlock_bh();
-
return ret ? ret : copied;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 142/166] macvtap: update file current position
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (140 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 141/166] macvtap: Do not double-count received packets Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 143/166] tun: " Kamal Mostafa
` (23 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Zhi Yong Wu, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
[ Upstream commit e6ebc7f16ca1434a334647aa56399c546be4e64b ]
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/macvtap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index a4df37f..c8c9bcc 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -911,6 +911,8 @@ static ssize_t macvtap_aio_read(struct kiocb *iocb, const struct iovec *iv,
ret = macvtap_do_read(q, iocb, iv, len, file->f_flags & O_NONBLOCK);
ret = min_t(ssize_t, ret, len); /* XXX copied from tun.c. Why? */
+ if (ret > 0)
+ iocb->ki_pos = ret;
out:
return ret;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 143/166] tun: update file current position
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (141 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 142/166] macvtap: update file current position Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 144/166] macvtap: signal truncated packets Kamal Mostafa
` (22 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Zhi Yong Wu, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
[ Upstream commit d0b7da8afa079ffe018ab3e92879b7138977fc8f ]
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/tun.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 1bff29f..7882545 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1410,6 +1410,8 @@ static ssize_t tun_chr_aio_read(struct kiocb *iocb, const struct iovec *iv,
ret = tun_do_read(tun, tfile, iocb, iv, len,
file->f_flags & O_NONBLOCK);
ret = min_t(ssize_t, ret, len);
+ if (ret > 0)
+ iocb->ki_pos = ret;
out:
tun_put(tun);
return ret;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 144/166] macvtap: signal truncated packets
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (142 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 143/166] tun: " Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 145/166] virtio: delete napi structures from netdev before releasing memory Kamal Mostafa
` (21 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Vlad Yasevich, Zhi Yong Wu, Michael S. Tsirkin, Jason Wang,
David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Wang <jasowang@redhat.com>
[ Upstream commit ce232ce01d61b184202bb185103d119820e1260c ]
macvtap_put_user() never return a value grater than iov length, this in fact
bypasses the truncated checking in macvtap_recvmsg(). Fix this by always
returning the size of packet plus the possible vlan header to let the trunca
checking work.
Cc: Vlad Yasevich <vyasevich@gmail.com>
Cc: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/macvtap.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index c8c9bcc..894613c 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -808,7 +808,7 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
int ret;
int vnet_hdr_len = 0;
int vlan_offset = 0;
- int copied;
+ int copied, total;
if (q->flags & IFF_VNET_HDR) {
struct virtio_net_hdr vnet_hdr;
@@ -823,7 +823,8 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr)))
return -EFAULT;
}
- copied = vnet_hdr_len;
+ total = copied = vnet_hdr_len;
+ total += skb->len;
if (!vlan_tx_tag_present(skb))
len = min_t(int, skb->len, len);
@@ -838,6 +839,7 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
vlan_offset = offsetof(struct vlan_ethhdr, h_vlan_proto);
len = min_t(int, skb->len + VLAN_HLEN, len);
+ total += VLAN_HLEN;
copy = min_t(int, vlan_offset, len);
ret = skb_copy_datagram_const_iovec(skb, 0, iv, copied, copy);
@@ -855,10 +857,9 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
}
ret = skb_copy_datagram_const_iovec(skb, vlan_offset, iv, copied, len);
- copied += len;
done:
- return ret ? ret : copied;
+ return ret ? ret : total;
}
static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb,
@@ -910,7 +911,7 @@ static ssize_t macvtap_aio_read(struct kiocb *iocb, const struct iovec *iv,
}
ret = macvtap_do_read(q, iocb, iv, len, file->f_flags & O_NONBLOCK);
- ret = min_t(ssize_t, ret, len); /* XXX copied from tun.c. Why? */
+ ret = min_t(ssize_t, ret, len);
if (ret > 0)
iocb->ki_pos = ret;
out:
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 145/166] virtio: delete napi structures from netdev before releasing memory
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (143 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 144/166] macvtap: signal truncated packets Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 146/166] packet: fix send path when running with proto == 0 Kamal Mostafa
` (20 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Rusty Russell, Michael S. Tsirkin, Andrey Vagin, David S. Miller,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Vagin <avagin@openvz.org>
[ Upstream commit d4fb84eefe5164f6a6ea51d0a9e26280c661a0dd ]
free_netdev calls netif_napi_del too, but it's too late, because napi
structures are placed on vi->rq. netif_napi_add() is called from
virtnet_alloc_queues.
general protection fault: 0000 [#1] SMP
Dumping ftrace buffer:
(ftrace buffer empty)
Modules linked in: ip6table_filter ip6_tables iptable_filter ip_tables virtio_balloon pcspkr virtio_net(-) i2c_pii
CPU: 1 PID: 347 Comm: rmmod Not tainted 3.13.0-rc2+ #171
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
task: ffff8800b779c420 ti: ffff8800379e0000 task.ti: ffff8800379e0000
RIP: 0010:[<ffffffff81322e19>] [<ffffffff81322e19>] __list_del_entry+0x29/0xd0
RSP: 0018:ffff8800379e1dd0 EFLAGS: 00010a83
RAX: 6b6b6b6b6b6b6b6b RBX: ffff8800379c2fd0 RCX: dead000000200200
RDX: 6b6b6b6b6b6b6b6b RSI: 0000000000000001 RDI: ffff8800379c2fd0
RBP: ffff8800379e1dd0 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000001 R12: ffff8800379c2f90
R13: ffff880037839160 R14: 0000000000000000 R15: 00000000013352f0
FS: 00007f1400e34740(0000) GS:ffff8800bfb00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007f464124c763 CR3: 00000000b68cf000 CR4: 00000000000006e0
Stack:
ffff8800379e1df0 ffffffff8155beab 6b6b6b6b6b6b6b2b ffff8800378391c0
ffff8800379e1e18 ffffffff8156499b ffff880037839be0 ffff880037839d20
ffff88003779d3f0 ffff8800379e1e38 ffffffffa003477c ffff88003779d388
Call Trace:
[<ffffffff8155beab>] netif_napi_del+0x1b/0x80
[<ffffffff8156499b>] free_netdev+0x8b/0x110
[<ffffffffa003477c>] virtnet_remove+0x7c/0x90 [virtio_net]
[<ffffffff813ae323>] virtio_dev_remove+0x23/0x80
[<ffffffff813f62ef>] __device_release_driver+0x7f/0xf0
[<ffffffff813f6ca0>] driver_detach+0xc0/0xd0
[<ffffffff813f5f28>] bus_remove_driver+0x58/0xd0
[<ffffffff813f72ec>] driver_unregister+0x2c/0x50
[<ffffffff813ae65e>] unregister_virtio_driver+0xe/0x10
[<ffffffffa0036942>] virtio_net_driver_exit+0x10/0x6ce [virtio_net]
[<ffffffff810d7cf2>] SyS_delete_module+0x172/0x220
[<ffffffff810a732d>] ? trace_hardirqs_on+0xd/0x10
[<ffffffff810f5d4c>] ? __audit_syscall_entry+0x9c/0xf0
[<ffffffff81677f69>] system_call_fastpath+0x16/0x1b
Code: 00 00 55 48 8b 17 48 b9 00 01 10 00 00 00 ad de 48 8b 47 08 48 89 e5 48 39 ca 74 29 48 b9 00 02 20 00 00 00
RIP [<ffffffff81322e19>] __list_del_entry+0x29/0xd0
RSP <ffff8800379e1dd0>
---[ end trace d5931cd3f87c9763 ]---
Fixes: 986a4f4d452d (virtio_net: multiqueue support)
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/virtio_net.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index c3bcb4a..fa2385a 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1265,6 +1265,11 @@ static void virtnet_config_changed(struct virtio_device *vdev)
static void virtnet_free_queues(struct virtnet_info *vi)
{
+ int i;
+
+ for (i = 0; i < vi->max_queue_pairs; i++)
+ netif_napi_del(&vi->rq[i].napi);
+
kfree(vi->rq);
kfree(vi->sq);
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 146/166] packet: fix send path when running with proto == 0
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (144 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 145/166] virtio: delete napi structures from netdev before releasing memory Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 147/166] ipv6: don't count addrconf generated routes against gc limit Kamal Mostafa
` (19 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Daniel Borkmann, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <dborkman@redhat.com>
[ Upstream commit 66e56cd46b93ef407c60adcac62cf33b06119d50 ]
Commit e40526cb20b5 introduced a cached dev pointer, that gets
hooked into register_prot_hook(), __unregister_prot_hook() to
update the device used for the send path.
We need to fix this up, as otherwise this will not work with
sockets created with protocol = 0, plus with sll_protocol = 0
passed via sockaddr_ll when doing the bind.
So instead, assign the pointer directly. The compiler can inline
these helper functions automagically.
While at it, also assume the cached dev fast-path as likely(),
and document this variant of socket creation as it seems it is
not widely used (seems not even the author of TX_RING was aware
of that in his reference example [1]). Tested with reproducer
from e40526cb20b5.
[1] http://wiki.ipxwarzone.com/index.php5?title=Linux_packet_mmap#Example
Fixes: e40526cb20b5 ("packet: fix use after free race in send path when dev is released")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Tested-by: Salam Noureddine <noureddine@aristanetworks.com>
Tested-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
Documentation/networking/packet_mmap.txt | 10 +++++
net/packet/af_packet.c | 65 ++++++++++++++++++++------------
2 files changed, 50 insertions(+), 25 deletions(-)
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt
index 94444b1..9bac174 100644
--- a/Documentation/networking/packet_mmap.txt
+++ b/Documentation/networking/packet_mmap.txt
@@ -123,6 +123,16 @@ Transmission process is similar to capture as shown below.
[shutdown] close() --------> destruction of the transmission socket and
deallocation of all associated resources.
+Socket creation and destruction is also straight forward, and is done
+the same way as in capturing described in the previous paragraph:
+
+ int fd = socket(PF_PACKET, mode, 0);
+
+The protocol can optionally be 0 in case we only want to transmit
+via this socket, which avoids an expensive call to packet_rcv().
+In this case, you also need to bind(2) the TX_RING with sll_protocol = 0
+set. Otherwise, htons(ETH_P_ALL) or any other protocol, for example.
+
Binding the socket to your network interface is mandatory (with zero copy) to
know the header size of frames used in the circular buffer.
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 90c1a21..111217c 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -229,6 +229,30 @@ struct packet_skb_cb {
static void __fanout_unlink(struct sock *sk, struct packet_sock *po);
static void __fanout_link(struct sock *sk, struct packet_sock *po);
+static struct net_device *packet_cached_dev_get(struct packet_sock *po)
+{
+ struct net_device *dev;
+
+ rcu_read_lock();
+ dev = rcu_dereference(po->cached_dev);
+ if (likely(dev))
+ dev_hold(dev);
+ rcu_read_unlock();
+
+ return dev;
+}
+
+static void packet_cached_dev_assign(struct packet_sock *po,
+ struct net_device *dev)
+{
+ rcu_assign_pointer(po->cached_dev, dev);
+}
+
+static void packet_cached_dev_reset(struct packet_sock *po)
+{
+ RCU_INIT_POINTER(po->cached_dev, NULL);
+}
+
/* register_prot_hook must be invoked with the po->bind_lock held,
* or from a context in which asynchronous accesses to the packet
* socket is not possible (packet_create()).
@@ -238,12 +262,10 @@ static void register_prot_hook(struct sock *sk)
struct packet_sock *po = pkt_sk(sk);
if (!po->running) {
- if (po->fanout) {
+ if (po->fanout)
__fanout_link(sk, po);
- } else {
+ else
dev_add_pack(&po->prot_hook);
- rcu_assign_pointer(po->cached_dev, po->prot_hook.dev);
- }
sock_hold(sk);
po->running = 1;
@@ -262,12 +284,11 @@ static void __unregister_prot_hook(struct sock *sk, bool sync)
struct packet_sock *po = pkt_sk(sk);
po->running = 0;
- if (po->fanout) {
+
+ if (po->fanout)
__fanout_unlink(sk, po);
- } else {
+ else
__dev_remove_pack(&po->prot_hook);
- RCU_INIT_POINTER(po->cached_dev, NULL);
- }
__sock_put(sk);
@@ -1967,19 +1988,6 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
return tp_len;
}
-static struct net_device *packet_cached_dev_get(struct packet_sock *po)
-{
- struct net_device *dev;
-
- rcu_read_lock();
- dev = rcu_dereference(po->cached_dev);
- if (dev)
- dev_hold(dev);
- rcu_read_unlock();
-
- return dev;
-}
-
static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
{
struct sk_buff *skb;
@@ -1996,7 +2004,7 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
mutex_lock(&po->pg_vec_lock);
- if (saddr == NULL) {
+ if (likely(saddr == NULL)) {
dev = packet_cached_dev_get(po);
proto = po->num;
addr = NULL;
@@ -2150,7 +2158,7 @@ static int packet_snd(struct socket *sock,
* Get and verify the address.
*/
- if (saddr == NULL) {
+ if (likely(saddr == NULL)) {
dev = packet_cached_dev_get(po);
proto = po->num;
addr = NULL;
@@ -2358,6 +2366,8 @@ static int packet_release(struct socket *sock)
spin_lock(&po->bind_lock);
unregister_prot_hook(sk, false);
+ packet_cached_dev_reset(po);
+
if (po->prot_hook.dev) {
dev_put(po->prot_hook.dev);
po->prot_hook.dev = NULL;
@@ -2413,14 +2423,17 @@ static int packet_do_bind(struct sock *sk, struct net_device *dev, __be16 protoc
spin_lock(&po->bind_lock);
unregister_prot_hook(sk, true);
+
po->num = protocol;
po->prot_hook.type = protocol;
if (po->prot_hook.dev)
dev_put(po->prot_hook.dev);
- po->prot_hook.dev = dev;
+ po->prot_hook.dev = dev;
po->ifindex = dev ? dev->ifindex : 0;
+ packet_cached_dev_assign(po, dev);
+
if (protocol == 0)
goto out_unlock;
@@ -2533,7 +2546,8 @@ static int packet_create(struct net *net, struct socket *sock, int protocol,
po = pkt_sk(sk);
sk->sk_family = PF_PACKET;
po->num = proto;
- RCU_INIT_POINTER(po->cached_dev, NULL);
+
+ packet_cached_dev_reset(po);
sk->sk_destruct = packet_sock_destruct;
sk_refcnt_debug_inc(sk);
@@ -3290,6 +3304,7 @@ static int packet_notifier(struct notifier_block *this, unsigned long msg, void
sk->sk_error_report(sk);
}
if (msg == NETDEV_UNREGISTER) {
+ packet_cached_dev_reset(po);
po->ifindex = -1;
if (po->prot_hook.dev)
dev_put(po->prot_hook.dev);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 147/166] ipv6: don't count addrconf generated routes against gc limit
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (145 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 146/166] packet: fix send path when running with proto == 0 Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 148/166] net: drop_monitor: fix the value of maxattr Kamal Mostafa
` (18 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Hannes Frederic Sowa, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
[ Upstream commit a3300ef4bbb1f1e33ff0400e1e6cf7733d988f4f ]
Brett Ciphery reported that new ipv6 addresses failed to get installed
because the addrconf generated dsts where counted against the dst gc
limit. We don't need to count those routes like we currently don't count
administratively added routes.
Because the max_addresses check enforces a limit on unbounded address
generation first in case someone plays with router advertisments, we
are still safe here.
Reported-by: Brett Ciphery <brett.ciphery@windriver.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/ipv6/route.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 9b530eb..7352014 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2128,13 +2128,12 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
bool anycast)
{
struct net *net = dev_net(idev->dev);
- struct rt6_info *rt = ip6_dst_alloc(net, net->loopback_dev, 0, NULL);
+ struct rt6_info *rt = ip6_dst_alloc(net, net->loopback_dev,
+ DST_NOCOUNT, NULL);
int err;
- if (!rt) {
- net_warn_ratelimited("Maximum number of routes reached, consider increasing route/max_size\n");
+ if (!rt)
return ERR_PTR(-ENOMEM);
- }
in6_dev_hold(idev);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 148/166] net: drop_monitor: fix the value of maxattr
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (146 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 147/166] ipv6: don't count addrconf generated routes against gc limit Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 149/166] net: unix: allow set_peek_off to fail Kamal Mostafa
` (17 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Changli Gao <xiaosuo@gmail.com>
[ Upstream commit d323e92cc3f4edd943610557c9ea1bb4bb5056e8 ]
maxattr in genl_family should be used to save the max attribute
type, but not the max command type. Drop monitor doesn't support
any attributes, so we should leave it as zero.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/core/drop_monitor.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index d23b668..a974dfe 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -64,7 +64,6 @@ static struct genl_family net_drop_monitor_family = {
.hdrsize = 0,
.name = "NET_DM",
.version = 2,
- .maxattr = NET_DM_CMD_MAX,
};
static DEFINE_PER_CPU(struct per_cpu_dm_data, dm_cpu_data);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 149/166] net: unix: allow set_peek_off to fail
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (147 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 148/166] net: drop_monitor: fix the value of maxattr Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 150/166] tg3: Initialize REG_BASE_ADDR at PCI config offset 120 to 0 Kamal Mostafa
` (16 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sasha Levin, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit 12663bfc97c8b3fdb292428105dd92d563164050 ]
unix_dgram_recvmsg() will hold the readlock of the socket until recv
is complete.
In the same time, we may try to setsockopt(SO_PEEK_OFF) which will hang until
unix_dgram_recvmsg() will complete (which can take a while) without allowing
us to break out of it, triggering a hung task spew.
Instead, allow set_peek_off to fail, this way userspace will not hang.
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/net.h | 2 +-
net/core/sock.c | 2 +-
net/unix/af_unix.c | 8 ++++++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/include/linux/net.h b/include/linux/net.h
index 5ea38d9..f6dc1f5 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -180,7 +180,7 @@ struct proto_ops {
int offset, size_t size, int flags);
ssize_t (*splice_read)(struct socket *sock, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len, unsigned int flags);
- void (*set_peek_off)(struct sock *sk, int val);
+ int (*set_peek_off)(struct sock *sk, int val);
};
#define DECLARE_SOCKADDR(type, dst, src) \
diff --git a/net/core/sock.c b/net/core/sock.c
index fc0d751..7367c05 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -886,7 +886,7 @@ set_rcvbuf:
case SO_PEEK_OFF:
if (sock->ops->set_peek_off)
- sock->ops->set_peek_off(sk, val);
+ ret = sock->ops->set_peek_off(sk, val);
else
ret = -EOPNOTSUPP;
break;
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 6cc5803..499efb7 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -531,13 +531,17 @@ static int unix_seqpacket_sendmsg(struct kiocb *, struct socket *,
static int unix_seqpacket_recvmsg(struct kiocb *, struct socket *,
struct msghdr *, size_t, int);
-static void unix_set_peek_off(struct sock *sk, int val)
+static int unix_set_peek_off(struct sock *sk, int val)
{
struct unix_sock *u = unix_sk(sk);
- mutex_lock(&u->readlock);
+ if (mutex_lock_interruptible(&u->readlock))
+ return -EINTR;
+
sk->sk_peek_off = val;
mutex_unlock(&u->readlock);
+
+ return 0;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 150/166] tg3: Initialize REG_BASE_ADDR at PCI config offset 120 to 0
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (148 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 149/166] net: unix: allow set_peek_off to fail Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 151/166] netvsc: don't flush peers notifying work during setting mtu Kamal Mostafa
` (15 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Nat Gurumoorthy, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nat Gurumoorthy <natg@google.com>
[ Upstream commit 388d3335575f4c056dcf7138a30f1454e2145cd8 ]
The new tg3 driver leaves REG_BASE_ADDR (PCI config offset 120)
uninitialized. From power on reset this register may have garbage in it. The
Register Base Address register defines the device local address of a
register. The data pointed to by this location is read or written using
the Register Data register (PCI config offset 128). When REG_BASE_ADDR has
garbage any read or write of Register Data Register (PCI 128) will cause the
PCI bus to lock up. The TCO watchdog will fire and bring down the system.
Signed-off-by: Nat Gurumoorthy <natg@google.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/ethernet/broadcom/tg3.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 3149f5b..b8aecd4 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -15589,6 +15589,9 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)
/* Clear this out for sanity. */
tw32(TG3PCI_MEM_WIN_BASE_ADDR, 0);
+ /* Clear TG3PCI_REG_BASE_ADDR to prevent hangs. */
+ tw32(TG3PCI_REG_BASE_ADDR, 0);
+
pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE,
&pci_state_reg);
if ((pci_state_reg & PCISTATE_CONV_PCI_MODE) == 0 &&
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 151/166] netvsc: don't flush peers notifying work during setting mtu
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (149 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 150/166] tg3: Initialize REG_BASE_ADDR at PCI config offset 120 to 0 Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 152/166] net: unix: allow bind to fail on mutex lock Kamal Mostafa
` (14 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: K. Y. Srinivasan, Haiyang Zhang, Jason Wang, David S. Miller,
Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Wang <jasowang@redhat.com>
[ Upstream commit 50dc875f2e6e2e04aed3b3033eb0ac99192d6d02 ]
There's a possible deadlock if we flush the peers notifying work during setting
mtu:
[ 22.991149] ======================================================
[ 22.991173] [ INFO: possible circular locking dependency detected ]
[ 22.991198] 3.10.0-54.0.1.el7.x86_64.debug #1 Not tainted
[ 22.991219] -------------------------------------------------------
[ 22.991243] ip/974 is trying to acquire lock:
[ 22.991261] ((&(&net_device_ctx->dwork)->work)){+.+.+.}, at: [<ffffffff8108af95>] flush_work+0x5/0x2e0
[ 22.991307]
but task is already holding lock:
[ 22.991330] (rtnl_mutex){+.+.+.}, at: [<ffffffff81539deb>] rtnetlink_rcv+0x1b/0x40
[ 22.991367]
which lock already depends on the new lock.
[ 22.991398]
the existing dependency chain (in reverse order) is:
[ 22.991426]
-> #1 (rtnl_mutex){+.+.+.}:
[ 22.991449] [<ffffffff810dfdd9>] __lock_acquire+0xb19/0x1260
[ 22.991477] [<ffffffff810e0d12>] lock_acquire+0xa2/0x1f0
[ 22.991501] [<ffffffff81673659>] mutex_lock_nested+0x89/0x4f0
[ 22.991529] [<ffffffff815392b7>] rtnl_lock+0x17/0x20
[ 22.991552] [<ffffffff815230b2>] netdev_notify_peers+0x12/0x30
[ 22.991579] [<ffffffffa0340212>] netvsc_send_garp+0x22/0x30 [hv_netvsc]
[ 22.991610] [<ffffffff8108d251>] process_one_work+0x211/0x6e0
[ 22.991637] [<ffffffff8108d83b>] worker_thread+0x11b/0x3a0
[ 22.991663] [<ffffffff81095e5d>] kthread+0xed/0x100
[ 22.991686] [<ffffffff81681c6c>] ret_from_fork+0x7c/0xb0
[ 22.991715]
-> #0 ((&(&net_device_ctx->dwork)->work)){+.+.+.}:
[ 22.991715] [<ffffffff810de817>] check_prevs_add+0x967/0x970
[ 22.991715] [<ffffffff810dfdd9>] __lock_acquire+0xb19/0x1260
[ 22.991715] [<ffffffff810e0d12>] lock_acquire+0xa2/0x1f0
[ 22.991715] [<ffffffff8108afde>] flush_work+0x4e/0x2e0
[ 22.991715] [<ffffffff8108e1b5>] __cancel_work_timer+0x95/0x130
[ 22.991715] [<ffffffff8108e303>] cancel_delayed_work_sync+0x13/0x20
[ 22.991715] [<ffffffffa03404e4>] netvsc_change_mtu+0x84/0x200 [hv_netvsc]
[ 22.991715] [<ffffffff815233d4>] dev_set_mtu+0x34/0x80
[ 22.991715] [<ffffffff8153bc2a>] do_setlink+0x23a/0xa00
[ 22.991715] [<ffffffff8153d054>] rtnl_newlink+0x394/0x5e0
[ 22.991715] [<ffffffff81539eac>] rtnetlink_rcv_msg+0x9c/0x260
[ 22.991715] [<ffffffff8155cdd9>] netlink_rcv_skb+0xa9/0xc0
[ 22.991715] [<ffffffff81539dfa>] rtnetlink_rcv+0x2a/0x40
[ 22.991715] [<ffffffff8155c41d>] netlink_unicast+0xdd/0x190
[ 22.991715] [<ffffffff8155c807>] netlink_sendmsg+0x337/0x750
[ 22.991715] [<ffffffff8150d219>] sock_sendmsg+0x99/0xd0
[ 22.991715] [<ffffffff8150d63e>] ___sys_sendmsg+0x39e/0x3b0
[ 22.991715] [<ffffffff8150eba2>] __sys_sendmsg+0x42/0x80
[ 22.991715] [<ffffffff8150ebf2>] SyS_sendmsg+0x12/0x20
[ 22.991715] [<ffffffff81681d19>] system_call_fastpath+0x16/0x1b
This is because we hold the rtnl_lock() before ndo_change_mtu() and try to flush
the work in netvsc_change_mtu(), in the mean time, netdev_notify_peers() may be
called from worker and also trying to hold the rtnl_lock. This will lead the
flush won't succeed forever. Solve this by not canceling and flushing the work,
this is safe because the transmission done by NETDEV_NOTIFY_PEERS was
synchronized with the netif_tx_disable() called by netvsc_change_mtu().
Reported-by: Yaju Cao <yacao@redhat.com>
Tested-by: Yaju Cao <yacao@redhat.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/hyperv/netvsc_drv.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 8264f0e..d573483 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -327,7 +327,6 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu)
return -EINVAL;
nvdev->start_remove = true;
- cancel_delayed_work_sync(&ndevctx->dwork);
cancel_work_sync(&ndevctx->work);
netif_tx_disable(ndev);
rndis_filter_device_remove(hdev);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 152/166] net: unix: allow bind to fail on mutex lock
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (150 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 151/166] netvsc: don't flush peers notifying work during setting mtu Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 153/166] net: inet_diag: zero out uninitialized idiag_{src,dst} fields Kamal Mostafa
` (13 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sasha Levin, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit 37ab4fa7844a044dc21fde45e2a0fc2f3c3b6490 ]
This is similar to the set_peek_off patch where calling bind while the
socket is stuck in unix_dgram_recvmsg() will block and cause a hung task
spew after a while.
This is also the last place that did a straightforward mutex_lock(), so
there shouldn't be any more of these patches.
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/unix/af_unix.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 499efb7..fdf0900 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -719,7 +719,9 @@ static int unix_autobind(struct socket *sock)
int err;
unsigned int retries = 0;
- mutex_lock(&u->readlock);
+ err = mutex_lock_interruptible(&u->readlock);
+ if (err)
+ return err;
err = 0;
if (u->addr)
@@ -878,7 +880,9 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
goto out;
addr_len = err;
- mutex_lock(&u->readlock);
+ err = mutex_lock_interruptible(&u->readlock);
+ if (err)
+ goto out;
err = -EINVAL;
if (u->addr)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 153/166] net: inet_diag: zero out uninitialized idiag_{src,dst} fields
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (151 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 152/166] net: unix: allow bind to fail on mutex lock Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 154/166] drivers/net/hamradio: Integer overflow in hdlcdrv_ioctl() Kamal Mostafa
` (12 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Daniel Borkmann, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <dborkman@redhat.com>
[ Upstream commit b1aac815c0891fe4a55a6b0b715910142227700f ]
Jakub reported while working with nlmon netlink sniffer that parts of
the inet_diag_sockid are not initialized when r->idiag_family != AF_INET6.
That is, fields of r->id.idiag_src[1 ... 3], r->id.idiag_dst[1 ... 3].
In fact, it seems that we can leak 6 * sizeof(u32) byte of kernel [slab]
memory through this. At least, in udp_dump_one(), we allocate a skb in ...
rep = nlmsg_new(sizeof(struct inet_diag_msg) + ..., GFP_KERNEL);
... and then pass that to inet_sk_diag_fill() that puts the whole struct
inet_diag_msg into the skb, where we only fill out r->id.idiag_src[0],
r->id.idiag_dst[0] and leave the rest untouched:
r->id.idiag_src[0] = inet->inet_rcv_saddr;
r->id.idiag_dst[0] = inet->inet_daddr;
struct inet_diag_msg embeds struct inet_diag_sockid that is correctly /
fully filled out in IPv6 case, but for IPv4 not.
So just zero them out by using plain memset (for this little amount of
bytes it's probably not worth the extra check for idiag_family == AF_INET).
Similarly, fix also other places where we fill that out.
Reported-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/ipv4/inet_diag.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 7afa2c3..84e812a 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -106,6 +106,10 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
r->id.idiag_sport = inet->inet_sport;
r->id.idiag_dport = inet->inet_dport;
+
+ memset(&r->id.idiag_src, 0, sizeof(r->id.idiag_src));
+ memset(&r->id.idiag_dst, 0, sizeof(r->id.idiag_dst));
+
r->id.idiag_src[0] = inet->inet_rcv_saddr;
r->id.idiag_dst[0] = inet->inet_daddr;
@@ -238,12 +242,19 @@ static int inet_twsk_diag_fill(struct inet_timewait_sock *tw,
r->idiag_family = tw->tw_family;
r->idiag_retrans = 0;
+
r->id.idiag_if = tw->tw_bound_dev_if;
sock_diag_save_cookie(tw, r->id.idiag_cookie);
+
r->id.idiag_sport = tw->tw_sport;
r->id.idiag_dport = tw->tw_dport;
+
+ memset(&r->id.idiag_src, 0, sizeof(r->id.idiag_src));
+ memset(&r->id.idiag_dst, 0, sizeof(r->id.idiag_dst));
+
r->id.idiag_src[0] = tw->tw_rcv_saddr;
r->id.idiag_dst[0] = tw->tw_daddr;
+
r->idiag_state = tw->tw_substate;
r->idiag_timer = 3;
r->idiag_expires = DIV_ROUND_UP(tmo * 1000, HZ);
@@ -730,8 +741,13 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk,
r->id.idiag_sport = inet->inet_sport;
r->id.idiag_dport = ireq->rmt_port;
+
+ memset(&r->id.idiag_src, 0, sizeof(r->id.idiag_src));
+ memset(&r->id.idiag_dst, 0, sizeof(r->id.idiag_dst));
+
r->id.idiag_src[0] = ireq->loc_addr;
r->id.idiag_dst[0] = ireq->rmt_addr;
+
r->idiag_expires = jiffies_to_msecs(tmo);
r->idiag_rqueue = 0;
r->idiag_wqueue = 0;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 154/166] drivers/net/hamradio: Integer overflow in hdlcdrv_ioctl()
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (152 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 153/166] net: inet_diag: zero out uninitialized idiag_{src,dst} fields Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 155/166] hamradio/yam: fix info leak in ioctl Kamal Mostafa
` (11 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Wenliang Fan, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenliang Fan <fanwlexca@gmail.com>
[ Upstream commit e9db5c21d3646a6454fcd04938dd215ac3ab620a ]
The local variable 'bi' comes from userspace. If userspace passed a
large number to 'bi.data.calibrate', there would be an integer overflow
in the following line:
s->hdlctx.calibrate = bi.data.calibrate * s->par.bitrate / 16;
Signed-off-by: Wenliang Fan <fanwlexca@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/hamradio/hdlcdrv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c
index a4a3516..3b3a7e0 100644
--- a/drivers/net/hamradio/hdlcdrv.c
+++ b/drivers/net/hamradio/hdlcdrv.c
@@ -571,6 +571,8 @@ static int hdlcdrv_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
case HDLCDRVCTL_CALIBRATE:
if(!capable(CAP_SYS_RAWIO))
return -EPERM;
+ if (bi.data.calibrate > INT_MAX / s->par.bitrate)
+ return -EINVAL;
s->hdlctx.calibrate = bi.data.calibrate * s->par.bitrate / 16;
return 0;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 155/166] hamradio/yam: fix info leak in ioctl
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (153 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 154/166] drivers/net/hamradio: Integer overflow in hdlcdrv_ioctl() Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 156/166] ipv6: always set the new created dst's from in ip6_rt_copy Kamal Mostafa
` (10 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Salva Peiró, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Salva=20Peir=C3=B3?= <speiro@ai2.upv.es>
[ Upstream commit 8e3fbf870481eb53b2d3a322d1fc395ad8b367ed ]
The yam_ioctl() code fails to initialise the cmd field
of the struct yamdrv_ioctl_cfg. Add an explicit memset(0)
before filling the structure to avoid the 4-byte info leak.
Signed-off-by: Salva Peiró <speiro@ai2.upv.es>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/hamradio/yam.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index c6645f1..ab378e0 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -1058,6 +1058,7 @@ static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
break;
case SIOCYAMGCFG:
+ memset(&yi, 0, sizeof(yi));
yi.cfg.mask = 0xffffffff;
yi.cfg.iobase = yp->iobase;
yi.cfg.irq = yp->irq;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 156/166] ipv6: always set the new created dst's from in ip6_rt_copy
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (154 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 155/166] hamradio/yam: fix info leak in ioctl Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 157/166] rds: prevent dereference of a NULL device Kamal Mostafa
` (9 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Gao feng, Li RongQing, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <roy.qing.li@gmail.com>
[ Upstream commit 24f5b855e17df7e355eacd6c4a12cc4d6a6c9ff0 ]
ip6_rt_copy only sets dst.from if ort has flag RTF_ADDRCONF and RTF_DEFAULT.
but the prefix routes which did get installed by hand locally can have an
expiration, and no any flag combination which can ensure a potential from
does never expire, so we should always set the new created dst's from.
This also fixes the new created dst is always expired since the ort, which
is created by RA, maybe has RTF_EXPIRES and RTF_ADDRCONF, but no RTF_DEFAULT.
Suggested-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
CC: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/ipv6/route.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 7352014..d8ba7c5 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1867,9 +1867,7 @@ static struct rt6_info *ip6_rt_copy(struct rt6_info *ort,
rt->rt6i_gateway = ort->rt6i_gateway;
rt->rt6i_flags = ort->rt6i_flags;
- if ((ort->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) ==
- (RTF_DEFAULT | RTF_ADDRCONF))
- rt6_set_from(rt, ort);
+ rt6_set_from(rt, ort);
rt->rt6i_metric = 0;
#ifdef CONFIG_IPV6_SUBTREES
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 157/166] rds: prevent dereference of a NULL device
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (155 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 156/166] ipv6: always set the new created dst's from in ip6_rt_copy Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 158/166] net: rose: restore old recvmsg behavior Kamal Mostafa
` (8 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sasha Levin, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <sasha.levin@oracle.com>
[ Upstream commit c2349758acf1874e4c2b93fe41d072336f1a31d0 ]
Binding might result in a NULL device, which is dereferenced
causing this BUG:
[ 1317.260548] BUG: unable to handle kernel NULL pointer dereference at 000000000000097
4
[ 1317.261847] IP: [<ffffffff84225f52>] rds_ib_laddr_check+0x82/0x110
[ 1317.263315] PGD 418bcb067 PUD 3ceb21067 PMD 0
[ 1317.263502] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
[ 1317.264179] Dumping ftrace buffer:
[ 1317.264774] (ftrace buffer empty)
[ 1317.265220] Modules linked in:
[ 1317.265824] CPU: 4 PID: 836 Comm: trinity-child46 Tainted: G W 3.13.0-rc4-
next-20131218-sasha-00013-g2cebb9b-dirty #4159
[ 1317.267415] task: ffff8803ddf33000 ti: ffff8803cd31a000 task.ti: ffff8803cd31a000
[ 1317.268399] RIP: 0010:[<ffffffff84225f52>] [<ffffffff84225f52>] rds_ib_laddr_check+
0x82/0x110
[ 1317.269670] RSP: 0000:ffff8803cd31bdf8 EFLAGS: 00010246
[ 1317.270230] RAX: 0000000000000000 RBX: ffff88020b0dd388 RCX: 0000000000000000
[ 1317.270230] RDX: ffffffff8439822e RSI: 00000000000c000a RDI: 0000000000000286
[ 1317.270230] RBP: ffff8803cd31be38 R08: 0000000000000000 R09: 0000000000000000
[ 1317.270230] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
[ 1317.270230] R13: 0000000054086700 R14: 0000000000a25de0 R15: 0000000000000031
[ 1317.270230] FS: 00007ff40251d700(0000) GS:ffff88022e200000(0000) knlGS:000000000000
0000
[ 1317.270230] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 1317.270230] CR2: 0000000000000974 CR3: 00000003cd478000 CR4: 00000000000006e0
[ 1317.270230] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1317.270230] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000090602
[ 1317.270230] Stack:
[ 1317.270230] 0000000054086700 5408670000a25de0 5408670000000002 0000000000000000
[ 1317.270230] ffffffff84223542 00000000ea54c767 0000000000000000 ffffffff86d26160
[ 1317.270230] ffff8803cd31be68 ffffffff84223556 ffff8803cd31beb8 ffff8800c6765280
[ 1317.270230] Call Trace:
[ 1317.270230] [<ffffffff84223542>] ? rds_trans_get_preferred+0x42/0xa0
[ 1317.270230] [<ffffffff84223556>] rds_trans_get_preferred+0x56/0xa0
[ 1317.270230] [<ffffffff8421c9c3>] rds_bind+0x73/0xf0
[ 1317.270230] [<ffffffff83e4ce62>] SYSC_bind+0x92/0xf0
[ 1317.270230] [<ffffffff812493f8>] ? context_tracking_user_exit+0xb8/0x1d0
[ 1317.270230] [<ffffffff8119313d>] ? trace_hardirqs_on+0xd/0x10
[ 1317.270230] [<ffffffff8107a852>] ? syscall_trace_enter+0x32/0x290
[ 1317.270230] [<ffffffff83e4cece>] SyS_bind+0xe/0x10
[ 1317.270230] [<ffffffff843a6ad0>] tracesys+0xdd/0xe2
[ 1317.270230] Code: 00 8b 45 cc 48 8d 75 d0 48 c7 45 d8 00 00 00 00 66 c7 45 d0 02 00
89 45 d4 48 89 df e8 78 49 76 ff 41 89 c4 85 c0 75 0c 48 8b 03 <80> b8 74 09 00 00 01 7
4 06 41 bc 9d ff ff ff f6 05 2a b6 c2 02
[ 1317.270230] RIP [<ffffffff84225f52>] rds_ib_laddr_check+0x82/0x110
[ 1317.270230] RSP <ffff8803cd31bdf8>
[ 1317.270230] CR2: 0000000000000974
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/rds/ib.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/rds/ib.c b/net/rds/ib.c
index b4c8b00..ba2dffe 100644
--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -338,7 +338,8 @@ static int rds_ib_laddr_check(__be32 addr)
ret = rdma_bind_addr(cm_id, (struct sockaddr *)&sin);
/* due to this, we will claim to support iWARP devices unless we
check node_type. */
- if (ret || cm_id->device->node_type != RDMA_NODE_IB_CA)
+ if (ret || !cm_id->device ||
+ cm_id->device->node_type != RDMA_NODE_IB_CA)
ret = -EADDRNOTAVAIL;
rdsdebug("addr %pI4 ret %d node type %d\n",
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 158/166] net: rose: restore old recvmsg behavior
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (156 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 157/166] rds: prevent dereference of a NULL device Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 159/166] vlan: Fix header ops passthru when doing TX VLAN offload Kamal Mostafa
` (7 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Florian Westphal, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <fw@strlen.de>
[ Upstream commit f81152e35001e91997ec74a7b4e040e6ab0acccf ]
recvmsg handler in net/rose/af_rose.c performs size-check ->msg_namelen.
After commit f3d3342602f8bcbf37d7c46641cb9bca7618eb1c
(net: rework recvmsg handler msg_name and msg_namelen logic), we now
always take the else branch due to namelen being initialized to 0.
Digging in netdev-vger-cvs git repo shows that msg_namelen was
initialized with a fixed-size since at least 1995, so the else branch
was never taken.
Compile tested only.
Signed-off-by: Florian Westphal <fw@strlen.de>
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/rose/af_rose.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index ce5f5b9..bde7d69 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -1257,6 +1257,7 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock,
if (msg->msg_name) {
struct sockaddr_rose *srose;
+ struct full_sockaddr_rose *full_srose = msg->msg_name;
memset(msg->msg_name, 0, sizeof(struct full_sockaddr_rose));
srose = msg->msg_name;
@@ -1264,18 +1265,9 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock,
srose->srose_addr = rose->dest_addr;
srose->srose_call = rose->dest_call;
srose->srose_ndigis = rose->dest_ndigis;
- if (msg->msg_namelen >= sizeof(struct full_sockaddr_rose)) {
- struct full_sockaddr_rose *full_srose = (struct full_sockaddr_rose *)msg->msg_name;
- for (n = 0 ; n < rose->dest_ndigis ; n++)
- full_srose->srose_digis[n] = rose->dest_digis[n];
- msg->msg_namelen = sizeof(struct full_sockaddr_rose);
- } else {
- if (rose->dest_ndigis >= 1) {
- srose->srose_ndigis = 1;
- srose->srose_digi = rose->dest_digis[0];
- }
- msg->msg_namelen = sizeof(struct sockaddr_rose);
- }
+ for (n = 0 ; n < rose->dest_ndigis ; n++)
+ full_srose->srose_digis[n] = rose->dest_digis[n];
+ msg->msg_namelen = sizeof(struct full_sockaddr_rose);
}
skb_free_datagram(sk, skb);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 159/166] vlan: Fix header ops passthru when doing TX VLAN offload.
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (157 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 158/166] net: rose: restore old recvmsg behavior Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 160/166] virtio_net: fix error handling for mergeable buffers Kamal Mostafa
` (6 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <davem@davemloft.net>
[ Upstream commit 2205369a314e12fcec4781cc73ac9c08fc2b47de ]
When the vlan code detects that the real device can do TX VLAN offloads
in hardware, it tries to arrange for the real device's header_ops to
be invoked directly.
But it does so illegally, by simply hooking the real device's
header_ops up to the VLAN device.
This doesn't work because we will end up invoking a set of header_ops
routines which expect a device type which matches the real device, but
will see a VLAN device instead.
Fix this by providing a pass-thru set of header_ops which will arrange
to pass the proper real device instead.
To facilitate this add a dev_rebuild_header(). There are
implementations which provide a ->cache and ->create but not a
->rebuild (f.e. PLIP). So we need a helper function just like
dev_hard_header() to avoid crashes.
Use this helper in the one existing place where the
header_ops->rebuild was being invoked, the neighbour code.
With lots of help from Florian Westphal.
Signed-off-by: David S. Miller <davem@davemloft.net>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/netdevice.h | 9 +++++++++
net/8021q/vlan_dev.c | 19 ++++++++++++++++++-
net/core/neighbour.c | 2 +-
3 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 0e182f9..0cabad8 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1747,6 +1747,15 @@ static inline int dev_parse_header(const struct sk_buff *skb,
return dev->header_ops->parse(skb, haddr);
}
+static inline int dev_rebuild_header(struct sk_buff *skb)
+{
+ const struct net_device *dev = skb->dev;
+
+ if (!dev->header_ops || !dev->header_ops->rebuild)
+ return 0;
+ return dev->header_ops->rebuild(skb);
+}
+
typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len);
extern int register_gifconf(unsigned int family, gifconf_func_t * gifconf);
static inline int unregister_gifconf(unsigned int family)
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 4c14e8a..bd0ba90 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -538,6 +538,23 @@ static const struct header_ops vlan_header_ops = {
.parse = eth_header_parse,
};
+static int vlan_passthru_hard_header(struct sk_buff *skb, struct net_device *dev,
+ unsigned short type,
+ const void *daddr, const void *saddr,
+ unsigned int len)
+{
+ struct vlan_dev_priv *vlan = vlan_dev_priv(dev);
+ struct net_device *real_dev = vlan->real_dev;
+
+ return dev_hard_header(skb, real_dev, type, daddr, saddr, len);
+}
+
+static const struct header_ops vlan_passthru_header_ops = {
+ .create = vlan_passthru_hard_header,
+ .rebuild = dev_rebuild_header,
+ .parse = eth_header_parse,
+};
+
static struct device_type vlan_type = {
.name = "vlan",
};
@@ -581,7 +598,7 @@ static int vlan_dev_init(struct net_device *dev)
dev->needed_headroom = real_dev->needed_headroom;
if (real_dev->features & NETIF_F_HW_VLAN_TX) {
- dev->header_ops = real_dev->header_ops;
+ dev->header_ops = &vlan_passthru_header_ops;
dev->hard_header_len = real_dev->hard_header_len;
} else {
dev->header_ops = &vlan_header_ops;
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index e7f5bff..4aa92e3 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1286,7 +1286,7 @@ int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb)
if (dev_hard_header(skb, dev, ntohs(skb->protocol), NULL, NULL,
skb->len) < 0 &&
- dev->header_ops->rebuild(skb))
+ dev_rebuild_header(skb))
return 0;
return dev_queue_xmit(skb);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 160/166] virtio_net: fix error handling for mergeable buffers
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (158 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 159/166] vlan: Fix header ops passthru when doing TX VLAN offload Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 161/166] virtio-net: make all RX paths handle errors consistently Kamal Mostafa
` (5 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Rusty Russell, Michael Dalton, Eric Dumazet, Jason Wang,
David S. Miller, Michael S. Tsirkin, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: "Michael S. Tsirkin" <mst@redhat.com>
commit 8fc3b9e9a229778e5af3aa453c44f1a3857ba769 upstream.
Eric Dumazet noticed that if we encounter an error
when processing a mergeable buffer, we don't
dequeue all of the buffers from this packet,
the result is almost sure to be loss of networking.
Fix this issue.
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michael Dalton <mwdalton@google.com>
Acked-by: Michael Dalton <mwdalton@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 8fc3b9e9a229778e5af3aa453c44f1a3857ba769)
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/virtio_net.c | 66 +++++++++++++++++++++++++++++++++---------------
1 file changed, 46 insertions(+), 20 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index fa2385a..184c59c 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -294,26 +294,33 @@ static struct sk_buff *page_to_skb(struct receive_queue *rq,
return skb;
}
-static int receive_mergeable(struct receive_queue *rq, struct sk_buff *skb)
+static struct sk_buff *receive_mergeable(struct net_device *dev,
+ struct receive_queue *rq,
+ void *buf,
+ unsigned int len)
{
- struct skb_vnet_hdr *hdr = skb_vnet_hdr(skb);
- struct page *page;
- int num_buf, i, len;
+ struct skb_vnet_hdr *hdr = page_address(buf);
+ int num_buf = hdr->mhdr.num_buffers;
+ struct page *page = buf;
+ struct sk_buff *skb = page_to_skb(rq, page, len);
+ int i;
+
+ if (unlikely(!skb))
+ goto err_skb;
- num_buf = hdr->mhdr.num_buffers;
while (--num_buf) {
i = skb_shinfo(skb)->nr_frags;
if (i >= MAX_SKB_FRAGS) {
pr_debug("%s: packet too long\n", skb->dev->name);
skb->dev->stats.rx_length_errors++;
- return -EINVAL;
+ return NULL;
}
page = virtqueue_get_buf(rq->vq, &len);
if (!page) {
- pr_debug("%s: rx error: %d buffers missing\n",
- skb->dev->name, hdr->mhdr.num_buffers);
- skb->dev->stats.rx_length_errors++;
- return -EINVAL;
+ pr_debug("%s: rx error: %d buffers %d missing\n",
+ dev->name, hdr->mhdr.num_buffers, num_buf);
+ dev->stats.rx_length_errors++;
+ goto err_buf;
}
if (len > PAGE_SIZE)
@@ -323,7 +330,25 @@ static int receive_mergeable(struct receive_queue *rq, struct sk_buff *skb)
--rq->num;
}
- return 0;
+ return skb;
+err_skb:
+ give_pages(rq, page);
+ while (--num_buf) {
+ buf = virtqueue_get_buf(rq->vq, &len);
+ if (unlikely(!buf)) {
+ pr_debug("%s: rx error: %d buffers missing\n",
+ dev->name, num_buf);
+ dev->stats.rx_length_errors++;
+ break;
+ }
+ page = buf;
+ give_pages(rq, page);
+ --rq->num;
+ }
+err_buf:
+ dev->stats.rx_dropped++;
+ dev_kfree_skb(skb);
+ return NULL;
}
static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len)
@@ -351,17 +376,18 @@ static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len)
skb_trim(skb, len);
} else {
page = buf;
- skb = page_to_skb(rq, page, len);
- if (unlikely(!skb)) {
- dev->stats.rx_dropped++;
- give_pages(rq, page);
- return;
- }
- if (vi->mergeable_rx_bufs)
- if (receive_mergeable(rq, skb)) {
- dev_kfree_skb(skb);
+ if (vi->mergeable_rx_bufs) {
+ skb = receive_mergeable(dev, rq, page, len);
+ if (unlikely(!skb))
+ return;
+ } else {
+ skb = page_to_skb(rq, page, len);
+ if (unlikely(!skb)) {
+ dev->stats.rx_dropped++;
+ give_pages(rq, page);
return;
}
+ }
}
hdr = skb_vnet_hdr(skb);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 161/166] virtio-net: make all RX paths handle errors consistently
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (159 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 160/166] virtio_net: fix error handling for mergeable buffers Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 162/166] virtio_net: don't leak memory or block when too many frags Kamal Mostafa
` (4 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jason Wang, David S. Miller, Michael S. Tsirkin, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: "Michael S. Tsirkin" <mst@redhat.com>
commit f121159d72091f25afb22007c833e60a6845e912 upstream.
receive mergeable now handles errors internally.
Do same for big and small packet paths, otherwise
the logic is too hard to follow.
Cc: Jason Wang <jasowang@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Acked-by: Michael Dalton <mwdalton@google.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit f121159d72091f25afb22007c833e60a6845e912)
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/virtio_net.c | 56 +++++++++++++++++++++++++++++++-----------------
1 file changed, 36 insertions(+), 20 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 184c59c..840cf2f 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -294,6 +294,34 @@ static struct sk_buff *page_to_skb(struct receive_queue *rq,
return skb;
}
+static struct sk_buff *receive_small(void *buf, unsigned int len)
+{
+ struct sk_buff * skb = buf;
+
+ len -= sizeof(struct virtio_net_hdr);
+ skb_trim(skb, len);
+
+ return skb;
+}
+
+static struct sk_buff *receive_big(struct net_device *dev,
+ struct receive_queue *rq,
+ void *buf)
+{
+ struct page *page = buf;
+ struct sk_buff *skb = page_to_skb(rq, page, 0);
+
+ if (unlikely(!skb))
+ goto err;
+
+ return skb;
+
+err:
+ dev->stats.rx_dropped++;
+ give_pages(rq, page);
+ return NULL;
+}
+
static struct sk_buff *receive_mergeable(struct net_device *dev,
struct receive_queue *rq,
void *buf,
@@ -357,7 +385,6 @@ static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len)
struct net_device *dev = vi->dev;
struct virtnet_stats *stats = this_cpu_ptr(vi->stats);
struct sk_buff *skb;
- struct page *page;
struct skb_vnet_hdr *hdr;
if (unlikely(len < sizeof(struct virtio_net_hdr) + ETH_HLEN)) {
@@ -369,26 +396,15 @@ static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len)
dev_kfree_skb(buf);
return;
}
+ if (vi->mergeable_rx_bufs)
+ skb = receive_mergeable(dev, rq, buf, len);
+ else if (vi->big_packets)
+ skb = receive_big(dev, rq, buf);
+ else
+ skb = receive_small(buf, len);
- if (!vi->mergeable_rx_bufs && !vi->big_packets) {
- skb = buf;
- len -= sizeof(struct virtio_net_hdr);
- skb_trim(skb, len);
- } else {
- page = buf;
- if (vi->mergeable_rx_bufs) {
- skb = receive_mergeable(dev, rq, page, len);
- if (unlikely(!skb))
- return;
- } else {
- skb = page_to_skb(rq, page, len);
- if (unlikely(!skb)) {
- dev->stats.rx_dropped++;
- give_pages(rq, page);
- return;
- }
- }
- }
+ if (unlikely(!skb))
+ return;
hdr = skb_vnet_hdr(skb);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 162/166] virtio_net: don't leak memory or block when too many frags
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (160 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 161/166] virtio-net: make all RX paths handle errors consistently Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 163/166] virtio-net: fix refill races during restore Kamal Mostafa
` (3 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Michael S. Tsirkin, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: "Michael S. Tsirkin" <mst@redhat.com>
We leak an skb when there are too many frags,
we also stop processing the packet in the middle,
the result is almost sure to be loss of networking.
Reported-by: Michael Dalton <mwdalton@google.com>
Acked-by: Michael Dalton <mwdalton@google.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/virtio_net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 840cf2f..8f009899 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -341,7 +341,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
if (i >= MAX_SKB_FRAGS) {
pr_debug("%s: packet too long\n", skb->dev->name);
skb->dev->stats.rx_length_errors++;
- return NULL;
+ goto err_frags;
}
page = virtqueue_get_buf(rq->vq, &len);
if (!page) {
@@ -362,6 +362,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
err_skb:
give_pages(rq, page);
while (--num_buf) {
+err_frags:
buf = virtqueue_get_buf(rq->vq, &len);
if (unlikely(!buf)) {
pr_debug("%s: rx error: %d buffers missing\n",
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 163/166] virtio-net: fix refill races during restore
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (161 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 162/166] virtio_net: don't leak memory or block when too many frags Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 164/166] net: llc: fix use after free in llc_ui_recvmsg Kamal Mostafa
` (2 subsequent siblings)
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Amit Shah, Rusty Russell, Michael S. Tsirkin, Eric Dumazet,
Jason Wang, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Wang <jasowang@redhat.com>
[ Upstream commit 6cd4ce0099da7702f885b6fa9ebb49e3831d90b4 ]
During restoring, try_fill_recv() was called with neither napi lock nor napi
disabled. This can lead two try_fill_recv() was called in the same time. Fix
this by refilling before trying to enable napi.
Fixes 0741bcb5584f9e2390ae6261573c4de8314999f2
(virtio: net: Add freeze, restore handlers to support S4).
Cc: Amit Shah <amit.shah@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/virtio_net.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 8f009899..4380036 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1723,16 +1723,17 @@ static int virtnet_restore(struct virtio_device *vdev)
if (err)
return err;
- if (netif_running(vi->dev))
+ if (netif_running(vi->dev)) {
+ for (i = 0; i < vi->curr_queue_pairs; i++)
+ if (!try_fill_recv(&vi->rq[i], GFP_KERNEL))
+ schedule_delayed_work(&vi->refill, 0);
+
for (i = 0; i < vi->max_queue_pairs; i++)
virtnet_napi_enable(&vi->rq[i]);
+ }
netif_device_attach(vi->dev);
- for (i = 0; i < vi->max_queue_pairs; i++)
- if (!try_fill_recv(&vi->rq[i], GFP_KERNEL))
- schedule_delayed_work(&vi->refill, 0);
-
mutex_lock(&vi->config_lock);
vi->config_enable = true;
mutex_unlock(&vi->config_lock);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 164/166] net: llc: fix use after free in llc_ui_recvmsg
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (162 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 163/166] virtio-net: fix refill races during restore Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 165/166] netpoll: Fix missing TXQ unlock and and OOPS Kamal Mostafa
2014-01-15 21:53 ` [PATCH 3.8 166/166] bridge: use spin_lock_bh() in br_multicast_set_hash_max Kamal Mostafa
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Daniel Borkmann, Stephen Hemminger, Arnaldo Carvalho de Melo,
David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <dborkman@redhat.com>
[ Upstream commit 4d231b76eef6c4a6bd9c96769e191517765942cb ]
While commit 30a584d944fb fixes datagram interface in LLC, a use
after free bug has been introduced for SOCK_STREAM sockets that do
not make use of MSG_PEEK.
The flow is as follow ...
if (!(flags & MSG_PEEK)) {
...
sk_eat_skb(sk, skb, false);
...
}
...
if (used + offset < skb->len)
continue;
... where sk_eat_skb() calls __kfree_skb(). Therefore, cache
original length and work on skb_len to check partial reads.
Fixes: 30a584d944fb ("[LLX]: SOCK_DGRAM interface fixes")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/llc/af_llc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 8870988..c3ee805 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -715,7 +715,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
unsigned long cpu_flags;
size_t copied = 0;
u32 peek_seq = 0;
- u32 *seq;
+ u32 *seq, skb_len;
unsigned long used;
int target; /* Read at least this many bytes */
long timeo;
@@ -812,6 +812,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
}
continue;
found_ok_skb:
+ skb_len = skb->len;
/* Ok so how much can we use? */
used = skb->len - offset;
if (len < used)
@@ -844,7 +845,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
}
/* Partial read */
- if (used + offset < skb->len)
+ if (used + offset < skb_len)
continue;
} while (len > 0);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 165/166] netpoll: Fix missing TXQ unlock and and OOPS.
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (163 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 164/166] net: llc: fix use after free in llc_ui_recvmsg Kamal Mostafa
@ 2014-01-15 21:52 ` Kamal Mostafa
2014-01-15 21:53 ` [PATCH 3.8 166/166] bridge: use spin_lock_bh() in br_multicast_set_hash_max Kamal Mostafa
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:52 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <davem@davemloft.net>
[ Upstream commit aca5f58f9ba803ec8c2e6bcf890db17589e8dfcc ]
The VLAN tag handling code in netpoll_send_skb_on_dev() has two problems.
1) It exits without unlocking the TXQ.
2) It then tries to queue a NULL skb to npinfo->txq.
Reported-by: Ahmed Tamrawi <atamrawi@iastate.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/core/netpoll.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 40c1496..0281162 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -338,8 +338,14 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
if (vlan_tx_tag_present(skb) &&
!(netif_skb_features(skb) & NETIF_F_HW_VLAN_TX)) {
skb = __vlan_put_tag(skb, vlan_tx_tag_get(skb));
- if (unlikely(!skb))
- break;
+ if (unlikely(!skb)) {
+ /* This is actually a packet drop, but we
+ * don't want the code at the end of this
+ * function to try and re-queue a NULL skb.
+ */
+ status = NETDEV_TX_OK;
+ goto unlock_txq;
+ }
skb->vlan_tci = 0;
}
@@ -347,6 +353,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
if (status == NETDEV_TX_OK)
txq_trans_update(txq);
}
+ unlock_txq:
__netif_tx_unlock(txq);
if (status == NETDEV_TX_OK)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* [PATCH 3.8 166/166] bridge: use spin_lock_bh() in br_multicast_set_hash_max
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
` (164 preceding siblings ...)
2014-01-15 21:52 ` [PATCH 3.8 165/166] netpoll: Fix missing TXQ unlock and and OOPS Kamal Mostafa
@ 2014-01-15 21:53 ` Kamal Mostafa
165 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-15 21:53 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Curt Brune, Scott Feldman, David S. Miller, Kamal Mostafa
3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Curt Brune <curt@cumulusnetworks.com>
[ Upstream commit fe0d692bbc645786bce1a98439e548ae619269f5 ]
br_multicast_set_hash_max() is called from process context in
net/bridge/br_sysfs_br.c by the sysfs store_hash_max() function.
br_multicast_set_hash_max() calls spin_lock(&br->multicast_lock),
which can deadlock the CPU if a softirq that also tries to take the
same lock interrupts br_multicast_set_hash_max() while the lock is
held . This can happen quite easily when any of the bridge multicast
timers expire, which try to take the same lock.
The fix here is to use spin_lock_bh(), preventing other softirqs from
executing on this CPU.
Steps to reproduce:
1. Create a bridge with several interfaces (I used 4).
2. Set the "multicast query interval" to a low number, like 2.
3. Enable the bridge as a multicast querier.
4. Repeatedly set the bridge hash_max parameter via sysfs.
# brctl addbr br0
# brctl addif br0 eth1 eth2 eth3 eth4
# brctl setmcqi br0 2
# brctl setmcquerier br0 1
# while true ; do echo 4096 > /sys/class/net/br0/bridge/hash_max; done
Signed-off-by: Curt Brune <curt@cumulusnetworks.com>
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/bridge/br_multicast.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 4a51874..fda703b 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1812,7 +1812,7 @@ int br_multicast_set_hash_max(struct net_bridge *br, unsigned long val)
u32 old;
struct net_bridge_mdb_htable *mdb;
- spin_lock(&br->multicast_lock);
+ spin_lock_bh(&br->multicast_lock);
if (!netif_running(br->dev))
goto unlock;
@@ -1844,7 +1844,7 @@ rollback:
}
unlock:
- spin_unlock(&br->multicast_lock);
+ spin_unlock_bh(&br->multicast_lock);
return err;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 168+ messages in thread
* Re: [PATCH 3.8 112/166] power_supply: Fix Oops from NULL pointer dereference from wakeup_source_activate
2014-01-15 21:52 ` [PATCH 3.8 112/166] power_supply: Fix Oops from NULL pointer dereference from wakeup_source_activate Kamal Mostafa
@ 2014-01-16 17:48 ` Kamal Mostafa
0 siblings, 0 replies; 168+ messages in thread
From: Kamal Mostafa @ 2014-01-16 17:48 UTC (permalink / raw)
To: linux-kernel; +Cc: stable, kernel-team, Shuah Khan, Anton Vorontsov
[-- Attachment #1: Type: text/plain, Size: 6893 bytes --]
On Wed, 2014-01-15 at 13:52 -0800, Kamal Mostafa wrote:
> 3.8.13.16 -stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Shuah Khan <shuah.kh@samsung.com>
>
> commit 80c6463e2fa3377febfc98a6672d92d07f3c26c1 upstream.
Actually, I'm dropping this one from the 3.8-stable queue since it isn't
really needed until 3.12.
-Kamal
> power_supply_register() calls device_init_wakeup() to register a wakeup
> source before initializing dev_name. As a result, device_wakeup_enable()
> end up registering wakeup source with a null name when
> wakeup_source_register() gets called with dev_name(dev) which is null at
> the time.
>
> When kernel is booted with wakeup_source_activate enabled, it will panic
> when the trace point code tries to dereference ws->name.
>
> Fixed the problem by moving up the kobject_set_name() call prior to
> accesses to dev_name(). Replaced kobject_set_name() with dev_set_name()
> which is the right interface to be called from drivers. Fixed the call to
> device_del() prior to device_add() in for wakeup_init_failed error
> handling code.
>
> Trace after the change:
>
> bash-2143 [003] d... 132.280697: wakeup_source_activate: BAT1 state=0x20001
> kworker/3:2-1169 [003] d... 132.281305: wakeup_source_deactivate: BAT1 state=0x30000
>
> Oops message:
>
> [ 819.769934] device: 'BAT1': device_add
> [ 819.770078] PM: Adding info for No Bus:BAT1
> [ 819.770235] BUG: unable to handle kernel NULL pointer dereference at (null)
> [ 819.770435] IP: [<ffffffff813381c0>] skip_spaces+0x30/0x30
> [ 819.770572] PGD 3efd90067 PUD 3eff61067 PMD 0
> [ 819.770716] Oops: 0000 [#1] SMP
> [ 819.770829] Modules linked in: arc4 iwldvm mac80211 x86_pkg_temp_thermal coretemp kvm_intel joydev i915 kvm uvcvideo ghash_clmulni_intel videobuf2_vmalloc aesni_intel videobuf2_memops videobuf2_core aes_x86_64 ablk_helper cryptd videodev iwlwifi lrw rfcomm gf128mul glue_helper bnep btusb media bluetooth parport_pc hid_generic ppdev snd_hda_codec_hdmi drm_kms_helper snd_hda_codec_realtek cfg80211 drm tpm_infineon samsung_laptop snd_hda_intel usbhid snd_hda_codec hid snd_hwdep snd_pcm microcode snd_page_alloc snd_timer psmouse i2c_algo_bit lpc_ich tpm_tis video wmi mac_hid serio_raw ext2 lp parport r8169 mii
> [ 819.771802] CPU: 0 PID: 2167 Comm: bash Not tainted 3.12.0+ #25
> [ 819.771876] Hardware name: SAMSUNG ELECTRONICS CO., LTD. 900X3C/900X3D/900X4C/900X4D/SAMSUNG_NP1234567890, BIOS P03AAC 07/12/2012
> [ 819.772022] task: ffff88002e6ddcc0 ti: ffff8804015ca000 task.ti: ffff8804015ca000
> [ 819.772119] RIP: 0010:[<ffffffff813381c0>] [<ffffffff813381c0>] skip_spaces+0x30/0x30
> [ 819.772242] RSP: 0018:ffff8804015cbc70 EFLAGS: 00010046
> [ 819.772310] RAX: 0000000000000003 RBX: ffff88040cfd6d40 RCX: 0000000000000018
> [ 819.772397] RDX: 0000000000020001 RSI: 0000000000000000 RDI: 0000000000000000
> [ 819.772484] RBP: ffff8804015cbcc0 R08: 0000000000000000 R09: ffff8803f0768d40
> [ 819.772570] R10: ffffea001033b800 R11: 0000000000000000 R12: ffffffff81c519c0
> [ 819.772656] R13: 0000000000020001 R14: 0000000000000000 R15: 0000000000020001
> [ 819.772744] FS: 00007ff98309b740(0000) GS:ffff88041f200000(0000) knlGS:0000000000000000
> [ 819.772845] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 819.772917] CR2: 0000000000000000 CR3: 00000003f59dc000 CR4: 00000000001407f0
> [ 819.773001] Stack:
> [ 819.773030] ffffffff81114003 ffff8804015cbcb0 0000000000000000 0000000000000046
> [ 819.773146] ffff880409757a18 ffff8803f065a160 0000000000000000 0000000000020001
> [ 819.773273] 0000000000000000 0000000000000000 ffff8804015cbce8 ffffffff8143e388
> [ 819.773387] Call Trace:
> [ 819.773434] [<ffffffff81114003>] ? ftrace_raw_event_wakeup_source+0x43/0xe0
> [ 819.773520] [<ffffffff8143e388>] wakeup_source_report_event+0xb8/0xd0
> [ 819.773595] [<ffffffff8143e3cd>] __pm_stay_awake+0x2d/0x50
> [ 819.773724] [<ffffffff8153395c>] power_supply_changed+0x3c/0x90
> [ 819.773795] [<ffffffff8153407c>] power_supply_register+0x18c/0x250
> [ 819.773869] [<ffffffff813d8d18>] sysfs_add_battery+0x61/0x7b
> [ 819.773935] [<ffffffff813d8d69>] battery_notify+0x37/0x3f
> [ 819.774001] [<ffffffff816ccb7c>] notifier_call_chain+0x4c/0x70
> [ 819.774071] [<ffffffff81073ded>] __blocking_notifier_call_chain+0x4d/0x70
> [ 819.774149] [<ffffffff81073e26>] blocking_notifier_call_chain+0x16/0x20
> [ 819.774227] [<ffffffff8109397a>] pm_notifier_call_chain+0x1a/0x40
> [ 819.774316] [<ffffffff81095b66>] hibernate+0x66/0x1c0
> [ 819.774407] [<ffffffff81093931>] state_store+0x71/0xa0
> [ 819.774507] [<ffffffff81331d8f>] kobj_attr_store+0xf/0x20
> [ 819.774613] [<ffffffff811f8618>] sysfs_write_file+0x128/0x1c0
> [ 819.774735] [<ffffffff8118579d>] vfs_write+0xbd/0x1e0
> [ 819.774841] [<ffffffff811861d9>] SyS_write+0x49/0xa0
> [ 819.774939] [<ffffffff816d1052>] system_call_fastpath+0x16/0x1b
> [ 819.775055] Code: 89 f8 48 89 e5 f6 82 c0 a6 84 81 20 74 15 0f 1f 44 00 00 48 83 c0 01 0f b6 10 f6 82 c0 a6 84 81 20 75 f0 5d c3 66 0f 1f 44 00 00 <80> 3f 00 55 48 89 e5 74 15 48 89 f8 0f 1f 40 00 48 83 c0 01 80
> [ 819.775760] RIP [<ffffffff813381c0>] skip_spaces+0x30/0x30
> [ 819.775881] RSP <ffff8804015cbc70>
> [ 819.775949] CR2: 0000000000000000
> [ 819.794175] ---[ end trace c4ef25127039952e ]---
>
> Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
> Acked-by: Anton Vorontsov <anton@enomsg.org>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
> [ kamal: backport to 3.8 (context) ]
> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> ---
> drivers/power/power_supply_core.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
> index 8a7cfb3..b89ca61 100644
> --- a/drivers/power/power_supply_core.c
> +++ b/drivers/power/power_supply_core.c
> @@ -334,11 +334,11 @@ int power_supply_register(struct device *parent, struct power_supply *psy)
> dev_set_drvdata(dev, psy);
> psy->dev = dev;
>
> - INIT_WORK(&psy->changed_work, power_supply_changed_work);
> -
> - rc = kobject_set_name(&dev->kobj, "%s", psy->name);
> + rc = dev_set_name(dev, "%s", psy->name);
> if (rc)
> - goto kobject_set_name_failed;
> + goto dev_set_name_failed;
> +
> + INIT_WORK(&psy->changed_work, power_supply_changed_work);
>
> rc = device_add(dev);
> if (rc)
> @@ -366,8 +366,8 @@ register_cooler_failed:
> psy_unregister_thermal(psy);
> register_thermal_failed:
> device_del(dev);
> -kobject_set_name_failed:
> device_add_failed:
> +dev_set_name_failed:
> put_device(dev);
> success:
> return rc;
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 168+ messages in thread
end of thread, other threads:[~2014-01-16 17:48 UTC | newest]
Thread overview: 168+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-15 21:50 [3.8.y.z extended stable] Linux 3.8.13.16 stable review Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 001/166] selinux: handle TCP SYN-ACK packets correctly in selinux_ip_postroute() Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 002/166] selinux: look for IPsec labels on both inbound and outbound packets Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 003/166] selinux: process labeled IPsec TCP SYN-ACK packets properly in selinux_ip_postroute() Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 004/166] dm delay: fix a possible deadlock due to shared workqueue Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 005/166] mac80211: fix scheduled scan rtnl deadlock Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 006/166] mac80211: don't attempt to reorder multicast frames Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 007/166] usb: gadget: composite: reset delayed_status on reset_config Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 008/166] usb: musb: only cancel work if it is initialized Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 009/166] usb: dwc3: fix implementation of endpoint wedge Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 010/166] [media] af9035: add ID [0ccd:00aa] TerraTec Cinergy T Stick (rev. 2) Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 011/166] [media] af9035: [0ccd:0099] TerraTec Cinergy T Stick Dual RC " Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 012/166] [media] af9035: add [0413:6a05] Leadtek WinFast DTV Dongle Dual Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 013/166] [media] saa7164: fix return value check in saa7164_initdev() Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 014/166] ath9k: Fix QuickDrop usage Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 015/166] ath9k: Fix XLNA bias strength Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 016/166] USB: serial: option: blacklist interface 1 for Huawei E173s-6 Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 017/166] USB: option: support new huawei devices Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 018/166] USB: spcp8x5: correct handling of CS5 setting Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 019/166] USB: mos7840: " Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 020/166] USB: ftdi_sio: fixed handling of unsupported CSIZE setting Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 021/166] USB: pl2303: fixed handling of CS5 setting Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 022/166] USB: cdc-acm: Added support for the Lenovo RD02-D400 USB Modem Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 023/166] drm/radeon: fixup bad vram size on SI Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 024/166] drm/radeon/atom: fix bus probes when hw_i2c is set (v2) Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 025/166] usb: hub: Use correct reset for wedged USB3 devices that are NOTATTACHED Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 026/166] drivers/char/i8k.c: add Dell XPLS L421X Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 027/166] PCI: Disable Bus Master only on kexec reboot Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 028/166] ARM: 7912/1: check stack pointer in get_wchan Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 029/166] ARM: 7913/1: fix framepointer check in unwind_frame Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 030/166] x86, build: Pass in additional -mno-mmx, -mno-sse options Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 031/166] ALSA: memalloc.h - fix wrong truncation of dma_addr_t Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 032/166] ALSA: compress: Fix 64bit ABI incompatibility Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 033/166] dm snapshot: avoid snapshot space leak on crash Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 034/166] dm table: fail dm_table_create on dm_round_up overflow Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 035/166] dm thin: switch to read only mode if a mapping insert fails Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 036/166] dm thin: switch to read-only mode if metadata space is exhausted Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 037/166] dm thin: always fallback the pool mode if commit fails Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 038/166] dm thin: re-establish read-only state when switching to fail mode Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 039/166] dm thin: allow pool in read-only mode to transition to read-write mode Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 040/166] x86, build, icc: Remove uninitialized_var() from compiler-intel.h Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 041/166] x86, efi: Don't use (U)EFI time services on 32 bit Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 042/166] dm bufio: initialize read-only module parameters Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 043/166] ALSA: hda - hdmi: Fix IEC958 ctl indexes for some simple HDMI devices Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 044/166] ARM: pxa: tosa: fix keys mapping Kamal Mostafa
2014-01-15 21:50 ` [PATCH 3.8 045/166] ARM: pxa: prevent PXA270 occasional reboot freezes Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 046/166] hwmon: (w83l786ng) Fix fan speed control mode setting and reporting Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 047/166] hwmon: (w83l768ng) Fix fan speed control range Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 048/166] hwmon: Prevent some divide by zeros in FAN_TO_REG() Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 049/166] Btrfs: fix access_ok() check in btrfs_ioctl_send() Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 050/166] futex: fix handling of read-only-mapped hugepages Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 051/166] KVM: Improve create VCPU parameter (CVE-2013-4587) Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 052/166] KVM: x86: Fix potential divide by 0 in lapic (CVE-2013-6367) Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 053/166] KVM: x86: Convert vapic synchronization to _cached functions (CVE-2013-6368) Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 054/166] KVM: x86: fix guest-initiated crash with x2apic (CVE-2013-6376) Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 055/166] selinux: handle TCP SYN-ACK packets correctly in selinux_ip_output() Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 056/166] drivers/rtc/rtc-at91rm9200.c: correct alarm over day/month wrap Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 057/166] mm: memcg: fix race condition between memcg teardown and swapin Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 058/166] powerpc: kvm: fix rare but potential deadlock scene Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 059/166] drm/i915: Do not clobber config status after a forced restore of hw state Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 060/166] drm/i915: Hold mutex across i915_gem_release Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 061/166] ASoC: tegra: fix uninitialized variables in set_fmt Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 062/166] usb: cdc-wdm: manage_power should always set needs_remote_wakeup Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 063/166] usb: serial: zte_ev: move support for ZTE AC2726 from zte_ev back to option Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 064/166] xhci: Limit the spurious wakeup fix only to HP machines Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 065/166] drm/i915: don't update the dri1 breadcrumb with modesetting Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 066/166] iscsi-target: Fix-up all zero data-length CDBs with R/W_BIT set Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 067/166] qla2xxx: Fix schedule_delayed_work() for target timeout calculations Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 068/166] drm/radeon: Fix sideport problems on certain RS690 boards Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 069/166] ALSA: hda - Add enable_msi=0 workaround for four HP machines Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 070/166] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 071/166] firewire: sbp2: bring back WRITE SAME support Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 072/166] ftrace: Initialize the ftrace profiler for each possible cpu Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 073/166] drm/edid: add quirk for BPC in Samsung NP700G7A-S01PL notebook Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 074/166] ASoC: wm5110: Correct HPOUT3 DAPM route typo Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 075/166] sched/rt: Fix rq's cpupri leak while enqueue/dequeue child RT entities Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 076/166] xfs: fix infinite loop by detaching the group/project hints from user dquot Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 077/166] ALSA: Add SNDRV_PCM_STATE_PAUSED case in wait_for_avail function Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 078/166] cpupower: Fix segfault due to incorrect getopt_long arugments Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 079/166] iio:adc:ad7887 Fix channel reported endianness from cpu to big endian Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 080/166] ASoC: wm_adsp: Add small delay while polling DSP RAM start Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 081/166] ASoC: wm8904: fix DSP mode B configuration Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 082/166] net_dma: mark broken Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 083/166] mm: numa: serialise parallel get_user_page against THP migration Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 084/166] mm: numa: call MMU notifiers on " Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 085/166] mm: clear pmd_numa before invalidating Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 086/166] mm: numa: do not clear PMD during PTE update scan Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 087/166] mm: numa: do not clear PTE for pte_numa update Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 088/166] mm: numa: ensure anon_vma is locked to prevent parallel THP splits Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 089/166] mm: numa: avoid unnecessary work on the failure path Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 090/166] sched: numa: skip inaccessible VMAs Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 091/166] mm: numa: clear numa hinting information on mprotect Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 092/166] mm: numa: avoid unnecessary disruption of NUMA hinting during migration Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 093/166] mm: fix TLB flush race between migration, and change_protection_range Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 094/166] mm: numa: defer TLB flush for THP migration as long as possible Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 095/166] mm/compaction: respect ignore_skip_hint in update_pageblock_skip Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 096/166] target/file: Update hw_max_sectors based on current block_size Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 097/166] arm64: ptrace: avoid using HW_BREAKPOINT_EMPTY for disabled events Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 098/166] libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8 Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 099/166] ext4: call ext4_error_inode() if jbd2_journal_dirty_metadata() fails Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 100/166] ext4: fix use-after-free in ext4_mb_new_blocks Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 101/166] ext4: check for overlapping extents in ext4_valid_extent_entries() Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 102/166] ext2: Fix oops in ext2_get_block() called from ext2_quota_write() Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 103/166] ext4: fix del_timer() misuse for ->s_err_report Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 104/166] scripts/link-vmlinux.sh: only filter kernel symbols for arm Kamal Mostafa
2014-01-15 21:51 ` [PATCH 3.8 105/166] drm/i915: Use the correct GMCH_CTRL register for Sandybridge+ Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 106/166] ext4: fix deadlock when writing in ENOSPC conditions Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 107/166] libata, freezer: avoid block device removal while system is frozen Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 108/166] drm/radeon: fix asic gfx values for scrapper asics Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 109/166] selinux: fix broken peer recv check Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 110/166] selinux: selinux_setprocattr()->ptrace_parent() needs rcu_read_lock() Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 111/166] auxvec.h: account for AT_HWCAP2 in AT_VECTOR_SIZE_BASE Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 112/166] power_supply: Fix Oops from NULL pointer dereference from wakeup_source_activate Kamal Mostafa
2014-01-16 17:48 ` Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 113/166] radiotap: fix bitmap-end-finding buffer overrun Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 114/166] rtlwifi: pci: Fix oops on driver unload Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 115/166] ath9k: Fix interrupt handling for the AR9002 family Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 116/166] dm9601: fix reception of full size ethernet frames on dm9620/dm9621a Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 117/166] dm9601: work around tx fifo sync issue on dm962x Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 118/166] drm/radeon: 0x9649 is SUMO2 not SUMO Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 119/166] drm/radeon: fix render backend setup for SI and CIK Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 120/166] drm/radeon: expose render backend mask to the userspace Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 121/166] tg3: Expand 4g_overflow_test workaround to skb fragments of any size Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 122/166] powerpc: Fix bad stack check in exception entry Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 123/166] Revert "of/address: Handle #address-cells > 2 specially" Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 124/166] KVM: x86: Fix APIC map calculation after re-enabling Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 125/166] x86, fpu, amd: Clear exceptions in AMD FXSAVE workaround Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 126/166] ath9k_htc: properly set MAC address and BSSID mask Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 127/166] aacraid: prevent invalid pointer dereference Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 128/166] mfd: rtsx_pcr: Disable interrupts before cancelling delayed works Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 129/166] mac80211: move "bufferable MMPDU" check to fix AP mode scan Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 130/166] ARM: fix footbridge clockevent device Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 131/166] ahci: add PCI ID for Marvell 88SE9170 SATA controller Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 132/166] ARM: fix "bad mode in ... handler" message for undefined instructions Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 133/166] ACPI / TPM: fix memory leak when walking ACPI namespace Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 134/166] ACPI / Battery: Add a _BIX quirk for NEC LZ750/LS Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 135/166] drm/nouveau/bios: make jump conditional Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 136/166] clk: clk-divider: fix divisor > 255 bug Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 137/166] SELinux: Fix possible NULL pointer dereference in selinux_inode_permission() Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 138/166] IPv6: Fixed support for blackhole and prohibit routes Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 139/166] net: do not pretend FRAGLIST support Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 140/166] rds: prevent BUG_ON triggered on congestion update to loopback Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 141/166] macvtap: Do not double-count received packets Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 142/166] macvtap: update file current position Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 143/166] tun: " Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 144/166] macvtap: signal truncated packets Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 145/166] virtio: delete napi structures from netdev before releasing memory Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 146/166] packet: fix send path when running with proto == 0 Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 147/166] ipv6: don't count addrconf generated routes against gc limit Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 148/166] net: drop_monitor: fix the value of maxattr Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 149/166] net: unix: allow set_peek_off to fail Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 150/166] tg3: Initialize REG_BASE_ADDR at PCI config offset 120 to 0 Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 151/166] netvsc: don't flush peers notifying work during setting mtu Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 152/166] net: unix: allow bind to fail on mutex lock Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 153/166] net: inet_diag: zero out uninitialized idiag_{src,dst} fields Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 154/166] drivers/net/hamradio: Integer overflow in hdlcdrv_ioctl() Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 155/166] hamradio/yam: fix info leak in ioctl Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 156/166] ipv6: always set the new created dst's from in ip6_rt_copy Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 157/166] rds: prevent dereference of a NULL device Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 158/166] net: rose: restore old recvmsg behavior Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 159/166] vlan: Fix header ops passthru when doing TX VLAN offload Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 160/166] virtio_net: fix error handling for mergeable buffers Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 161/166] virtio-net: make all RX paths handle errors consistently Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 162/166] virtio_net: don't leak memory or block when too many frags Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 163/166] virtio-net: fix refill races during restore Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 164/166] net: llc: fix use after free in llc_ui_recvmsg Kamal Mostafa
2014-01-15 21:52 ` [PATCH 3.8 165/166] netpoll: Fix missing TXQ unlock and and OOPS Kamal Mostafa
2014-01-15 21:53 ` [PATCH 3.8 166/166] bridge: use spin_lock_bh() in br_multicast_set_hash_max Kamal Mostafa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox