* [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review
@ 2015-12-16 17:37 Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 001/128] vf610_adc: Fix internal temperature calculation Kamal Mostafa
` (127 more replies)
0 siblings, 128 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Kamal Mostafa
This is the start of the review cycle for the Linux 3.19.8-ckt12 stable kernel.
This version contains 128 new patches, summarized below. The new patches are
posted as replies to this message and also available in this git branch:
http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.19.y-review
git://kernel.ubuntu.com/ubuntu/linux.git linux-3.19.y-review
The review period for version 3.19.8-ckt12 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.19.y-ckt extended stable kernel version,
see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable .
-Kamal
--
arch/arc/kernel/unwind.c | 37 +----
arch/arm/boot/dts/kirkwood-ts219.dtsi | 2 +-
arch/arm/boot/dts/vfxxx.dtsi | 2 +-
arch/arm/kvm/mmu.c | 15 +-
arch/arm/mach-dove/include/mach/entry-macro.S | 4 +-
arch/arm/mach-orion5x/include/mach/entry-macro.S | 2 +-
arch/arm64/include/asm/kvm_emulate.h | 8 +-
arch/arm64/kernel/setup.c | 3 +
arch/arm64/kernel/suspend.c | 10 ++
arch/arm64/kvm/inject_fault.c | 2 +-
arch/mips/kvm/emulate.c | 2 +-
arch/mips/kvm/locore.S | 16 +-
arch/mips/kvm/mips.c | 5 +-
arch/parisc/include/uapi/asm/mman.h | 10 --
arch/powerpc/include/asm/reg.h | 1 +
arch/powerpc/kernel/process.c | 18 +++
arch/powerpc/kernel/signal_32.c | 14 +-
arch/powerpc/kernel/signal_64.c | 4 +
arch/s390/kvm/interrupt.c | 4 +
arch/s390/kvm/sigp.c | 8 +-
arch/x86/include/asm/mmu_context.h | 13 ++
arch/x86/include/asm/mpx.h | 1 -
arch/x86/kernel/cpu/common.c | 3 +-
arch/x86/kernel/signal.c | 17 ++-
arch/x86/kernel/uprobes.c | 10 +-
arch/x86/kernel/xsave.c | 11 +-
arch/x86/mm/mpx.c | 77 ++++++++--
block/blk-core.c | 21 +--
block/partitions/mac.c | 10 +-
drivers/base/power/domain.c | 3 +-
drivers/block/rbd.c | 1 +
drivers/char/ipmi/ipmi_si_intf.c | 73 +++++----
drivers/crypto/nx/nx-aes-ccm.c | 2 +-
drivers/crypto/nx/nx-aes-gcm.c | 2 +-
drivers/crypto/qat/qat_common/adf_ctl_drv.c | 2 +-
drivers/crypto/talitos.c | 2 +-
drivers/gpu/drm/drm_drv.c | 5 +
drivers/gpu/drm/drm_fops.c | 84 +++++++----
drivers/gpu/drm/i915/i915_gem.c | 8 +-
drivers/gpu/drm/i915/intel_display.c | 3 +
drivers/gpu/drm/i915/intel_dp.c | 3 +-
drivers/gpu/drm/imx/ipuv3-crtc.c | 3 +-
drivers/gpu/drm/radeon/radeon_object.c | 6 +
drivers/gpu/drm/radeon/radeon_pm.c | 3 +-
drivers/gpu/drm/radeon/rv730_dpm.c | 2 +-
drivers/gpu/drm/radeon/rv770_dpm.c | 4 +-
drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 1 +
drivers/iio/adc/ad7793.c | 2 +-
drivers/iio/adc/vf610_adc.c | 19 ++-
drivers/iio/adc/xilinx-xadc-core.c | 1 +
drivers/iio/dac/ad5064.c | 91 +++++++----
drivers/iio/humidity/si7020.c | 8 +-
drivers/isdn/hisax/config.c | 2 +-
drivers/isdn/hisax/hfc_pci.c | 2 +-
drivers/isdn/hisax/hfc_sx.c | 2 +-
drivers/isdn/hisax/q931.c | 6 +-
drivers/md/dm-mpath.c | 2 +-
drivers/md/dm-thin.c | 1 +
drivers/md/dm.c | 2 +-
drivers/mmc/card/block.c | 11 +-
drivers/net/can/sja1000/sja1000.c | 3 +
drivers/net/ethernet/marvell/mvneta.c | 6 +-
drivers/net/ethernet/mellanox/mlx4/main.c | 8 +-
drivers/net/ipvlan/ipvlan_core.c | 14 +-
drivers/net/macvlan.c | 2 +
drivers/net/phy/broadcom.c | 2 +-
drivers/net/wan/x25_asy.c | 6 +-
drivers/net/wireless/ath/ath10k/mac.c | 2 +-
drivers/pci/pci-sysfs.c | 5 +-
drivers/remoteproc/remoteproc_debugfs.c | 2 +-
drivers/scsi/hosts.c | 11 ++
drivers/staging/iio/adc/lpc32xx_adc.c | 4 +-
drivers/target/iscsi/iscsi_target.c | 13 +-
drivers/target/iscsi/iscsi_target_nego.c | 1 +
drivers/target/target_core_sbc.c | 17 ++-
drivers/target/target_core_transport.c | 14 +-
drivers/tty/tty_io.c | 4 +
drivers/tty/tty_ioctl.c | 4 -
drivers/usb/chipidea/debug.c | 2 +
drivers/usb/class/usblp.c | 2 +-
drivers/usb/dwc3/gadget.c | 23 ++-
drivers/usb/host/xhci-hub.c | 15 +-
drivers/usb/host/xhci.c | 10 ++
drivers/usb/musb/musb_core.c | 10 +-
drivers/usb/serial/option.c | 11 ++
drivers/usb/serial/qcserial.c | 94 +++++++++---
drivers/usb/serial/ti_usb_3410_5052.c | 2 +
drivers/usb/serial/ti_usb_3410_5052.h | 4 +
drivers/xen/gntdev.c | 2 +-
fs/btrfs/file.c | 11 +-
fs/cachefiles/rdwr.c | 2 +-
fs/fat/dir.c | 16 +-
fs/nfs/inode.c | 6 +-
fs/nfs/nfs4client.c | 2 +-
fs/ocfs2/namei.c | 2 +
fs/overlayfs/inode.c | 8 +-
fs/splice.c | 8 +
fs/sysv/inode.c | 10 +-
include/drm/drmP.h | 6 +
include/linux/blkdev.h | 1 -
include/linux/kvm_host.h | 11 ++
include/linux/signal.h | 1 -
include/net/af_unix.h | 1 +
include/target/target_core_base.h | 2 +-
kernel/bpf/arraymap.c | 2 +-
kernel/sched/core.c | 9 +-
kernel/sched/wait.c | 16 +-
kernel/signal.c | 2 +-
kernel/trace/ring_buffer.c | 12 +-
net/bluetooth/smp.c | 7 +-
net/core/neighbour.c | 4 +-
net/ipv4/igmp.c | 5 +-
net/ipv4/tcp_input.c | 22 ++-
net/ipv4/tcp_ipv4.c | 3 +-
net/ipv6/ip6mr.c | 15 +-
net/mac80211/mesh_pathtbl.c | 8 +-
net/mac80211/scan.c | 9 +-
net/packet/af_packet.c | 72 ++++-----
net/rds/connection.c | 6 -
net/rds/send.c | 4 +-
net/sctp/auth.c | 4 +-
net/sunrpc/svc.c | 13 ++
net/unix/af_unix.c | 183 ++++++++++++++++++++---
sound/pci/hda/patch_realtek.c | 22 +++
sound/pci/hda/patch_sigmatel.c | 45 ++++--
sound/soc/codecs/wm8962.c | 4 +-
sound/usb/midi.c | 46 ++++++
sound/usb/quirks-table.h | 11 ++
sound/usb/quirks.c | 1 +
sound/usb/usbaudio.h | 1 +
tools/net/Makefile | 7 +-
tools/perf/util/dso.c | 17 +++
tools/perf/util/dso.h | 1 +
tools/perf/util/machine.c | 1 +
134 files changed, 1126 insertions(+), 492 deletions(-)
Aaro Koskinen (1):
broadcom: fix PHY_ID_BCM5481 entry in the id table
Adrian Hunter (1):
perf symbols: Fix dso lookup by long name and missing buildids
Al Viro (1):
fix sysvfs symlinks
Aleksander Morgado (1):
USB: serial: option: add support for Novatel MiFi USB620L
Alex Deucher (3):
drm/radeon: unconditionally set sysfs_initialized
drm/radeon: make rv770_set_sw_state failures non-fatal
drm/radeon: make some dpm errors debug only
Andrew Cooper (1):
x86/cpu: Fix SMAP check in PVOPS environments
Andrew Lunn (1):
ipv4: igmp: Allow removing groups from a removed interface
Antonio Quartulli (1):
mac80211: do not actively scan DFS channels
Ard Biesheuvel (2):
ARM/arm64: KVM: test properly for a PTE's uncachedness
ARM/arm64: KVM: correct PTE uncachedness check
Arnd Bergmann (1):
remoteproc: avoid stack overflow in debugfs file
Bart Van Assche (1):
Fix a memory leak in scsi_host_dev_release()
Ben McCauley (1):
usb: dwc3: gadget: let us set lower max_speed
Benjamin Coddington (2):
nfs4: start callback_ident at idr 1
nfs4: limit callback decoding to received bytes
Bhuvanchandra DV (1):
vf610_adc: Fix internal temperature calculation
Bjørn Mork (2):
USB: qcserial: Fix support for HP lt4112 LTE/HSPA+ Gobi 4G Modem
USB: option: add XS Stick W100-2 from 4G Systems
Boris Ostrovsky (1):
xen/gntdev: Grant maps should not be subject to NUMA balancing
Chris Lesiak (1):
iio: si7020: Swap data byte order
Christoph Biedl (1):
isdn: Partially revert debug format string usage clean up
Clemens Ladisch (3):
ALSA: usb-audio: add packet size quirk for the Medeli DD305
ALSA: usb-audio: prevent CH345 multiport output SysEx corruption
ALSA: usb-audio: work around CH345 input SysEx corruption
Corey Minyard (1):
ipmi: Start the timer and thread on internal msgs
Cory Tusar (1):
ARM: dts: vfxxx: Fix dspi[01] spi-num-chipselects.
Daniel Borkmann (4):
packet: do skb_probe_transport_header when we actually have data
packet: only allow extra vlan len on ethernet devices
packet: fix tpacket_snd max frame len
bpf, array: fix heap out-of-bounds access when updating elements
Dave Hansen (6):
x86/mpx: Add temporary variable to reduce masking
x86: Make is_64bit_mm() widely available
x86/mpx: Introduce new 'directory entry' to 'addr' helper function
x86/mpx: Do proper get_user() when running 32-bit binaries on 64-bit kernels
x86/fpu: Fix 32-bit signal frame handling
x86/mpx: Fix instruction decoder condition
David Gstir (2):
crypto: nx - Fix timing leak in GCM and CCM decryption
crypto: talitos - Fix timing leak in ESP ICV verification
David Hildenbrand (3):
KVM: Provide function for VCPU lookup by id
KVM: s390: avoid memory overwrites on emergency signal injection
KVM: s390: fix wrong lookup of VCPUs by array index
David Sterba (1):
btrfs: fix signed overflows in btrfs_sync_file
David Woodhouse (1):
USB: ti_usb_3410_5052: Add Honeywell HGI80 ID
Dmitry V. Levin (1):
x86/signal: Fix restart_syscall number for x32 tasks
Eric Anholt (1):
PM / Domains: Fix bad of_node_put() in failure paths of genpd_dev_pm_attach()
Eric Dumazet (2):
tcp: md5: fix lockdep annotation
tcp: fix potential huge kmalloc() calls in TCP_REPAIR
Geert Uytterhoeven (1):
FS-Cache: Add missing initialization of ret in cachefiles_write_page()
Hannes Reinecke (1):
block: Always check queue limits for cloned requests
Heiko Stuebner (1):
drm/rockchip: unset pgoff when mmap'ing gems
Helge Deller (1):
parisc: Drop unused MADV_xxxK_PAGES flags from asm/mman.h
Helmut Klein (1):
ARM: dts: Kirkwood: Fix QNAP TS219 power-off
Hui Wang (1):
ALSA: hda - Fix headphone noise after Dell XPS 13 resume back from S3
Ilya Dryomov (1):
rbd: don't put snap_context twice in rbd_queue_workfn()
Imre Deak (1):
drm/i915: get runtime PM reference around GEM set_caching IOCTL
James Hogan (3):
MIPS: KVM: Fix ASID restoration logic
MIPS: KVM: Fix CACHE immediate offset sign extension
MIPS: KVM: Uninit VCPU in vcpu_create error path
Jan Engelhardt (1):
target: fix COMPARE_AND_WRITE non zero SGL offset data corruption
Jan Kara (2):
vfs: Make sendfile(2) killable even better
vfs: Avoid softlockups with sendfile(2)
Jani Nikula (1):
drm/i915: quirk backlight present on Macbook 4, 1
Jeff Layton (1):
nfs: if we have no valid attrs, then don't declare the attribute cache valid
Jiri Slaby (1):
usblp: do not set TASK_INTERRUPTIBLE before lock
Johan Hedberg (1):
Bluetooth: Fix l2cap_chan leak in SMP
Johannes Berg (1):
mac80211: mesh: fix call_rcu() usage
Junichi Nomura (1):
dm: fix ioctl retry termination with signal
Junxiao Bi (1):
ocfs2: fix umask ignored issue
Kamal Mostafa (1):
tools/net: Use include/uapi with __EXPORTED_HEADERS__
Kees Cook (1):
mac: validate mac_partition is within sector
Konstantin Khlebnikov (1):
net/neighbour: fix crash at dumping device-agnostic proxy entries
Lars-Peter Clausen (2):
iio: ad5064: Fix ad5629/ad5669 shift
iio:ad7793: Fix ad7785 product ID
Li Jun (1):
usb: chipidea: debug: disable usb irq while role switch
Lorenzo Pieralisi (1):
arm64: kernel: pause/unpause function graph tracer in cpu_suspend()
Luca Porzio (1):
mmc: remove bondage between REQ_META and reliable write
Marc Zyngier (1):
arm64: KVM: Fix AArch32 to AArch64 register mapping
Marcin Wojtas (3):
net: mvneta: add configuration for MBUS windows access protection
net: mvneta: fix bit assignment in MVNETA_RXQ_CONFIG_REG
net: mvneta: fix bit assignment for RX packet irq enable
Mathias Krause (1):
PCI: Prevent out of bounds access in numa_node override
Mathias Nyman (1):
xhci: Fix a race in usb2 LPM resume, blocking U3 for usb2 devices
Michael Hennerich (1):
iio:ad5064: Make sure ad5064_i2c_write() returns 0 on success
Michael Neuling (2):
powerpc/tm: Block signal return setting invalid MSR state
powerpc/tm: Check for already reclaimed tasks
Michel Dänzer (1):
drm/radeon: Disable uncacheable CPU mappings of GTT with RV6xx
Mike Snitzer (1):
dm thin: restore requested 'error_if_no_space' setting on OODS to WRITE transition
Miklos Szeredi (1):
ovl: fix permission checking for setattr
Mirza Krak (1):
can: sja1000: clear interrupts on start
Nicholas Bellinger (2):
iscsi-target: Fix rx_login_comp hang after login failure
target: Fix race for SCF_COMPARE_AND_WRITE_POST checking
Nicolas Pitre (2):
ARM: dove: Fix legacy get_irqnr_and_base
ARM: orion5x: Fix legacy get_irqnr_and_base
Nikolay Aleksandrov (1):
net: ip6mr: fix static mfc/dev leaks on table destruction
Noa Osherovich (1):
net/mlx4_core: Avoid returning success in case of an error flow
OGAWA Hirofumi (1):
fat: fix fake_offset handling on error path
Peter Hurley (2):
tty: Fix tty_send_xchar() lock order inversion
wan/x25: Fix use-after-free in x25_asy_open_tty()
Peter Zijlstra (1):
sched/wait: Fix signal handling in bit wait helpers
Petr Štetiar (1):
USB: qcserial: Add support for Quectel EC20 Mini PCIe module
Quentin Casasnovas (1):
RDS: fix race condition when sending a message on unbound socket
Rainer Weikusat (1):
unix: avoid use-after-free in ep_remove_wait_queue
Rajkumar Manoharan (1):
ath10k: fix invalid NSS for 4x4 devices
Rajmohan Mani (1):
xhci: Workaround to get Intel xHCI reset working more reliably
Richard Weinberger (1):
kernel/signal.c: unexport sigsuspend()
Russell King (1):
drm: imx: convert to drm_crtc_send_vblank_event()
Sabrina Dubroca (3):
ipvlan: fix leak in ipvlan_rcv_frame
ipvlan: fix use after free of skb
macvlan: fix leak in macvlan_handle_frame
Sachin Pandhare (1):
ASoC: wm8962: correct addresses for HPF_C_0/1
Sasha Levin (1):
sched/core: Remove false-positive warning from wake_up_process()
Steven Rostedt (Red Hat) (1):
ring-buffer: Update read stamp with first real commit on page
Tadeusz Struk (1):
crypto: qat - don't use userspace pointer
Takashi Iwai (4):
ALSA: hda - Add fixup for Acer Aspire One Cloudbook 14
ALSA: hda - Apply HP headphone fixups more generically
ALSA: hda - Fix noise on Gigabyte Z170X mobo
drm/i915: Don't override output type for DDI HDMI
Thomas Betker (1):
iio: adc: xilinx: Fix VREFN scale
Thomas Hellstrom (1):
drm: Fix an unwanted master inheritance v2
Trond Myklebust (1):
SUNRPC: Fix callback channel
Uwe Kleine-König (1):
usb: musb: core: fix order of arguments to ulpi write callback
Vineet Gupta (1):
ARC: dw2 unwind: Remove falllback linear search thru FDE entries
Vladimir Zapolskiy (1):
iio: lpc32xx_adc: fix warnings caused by enabling unprepared clock
Xunlei Pang (1):
sched/core: Clear the root_domain cpumasks in init_rootdomain()
Yang Shi (1):
arm64: restore bogomips information in /proc/cpuinfo
lucien (1):
sctp: translate host order to network order when setting a hmacid
^ permalink raw reply [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 001/128] vf610_adc: Fix internal temperature calculation
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 002/128] iio: lpc32xx_adc: fix warnings caused by enabling unprepared clock Kamal Mostafa
` (126 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Bhuvanchandra DV, Jonathan Cameron, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
commit 6219f432ec037317a77c40910da12a626c34af1c upstream.
Calculate ADCR_VTEMP25 using VTEMP25 at VREFH_ADC 3V3. Existing
calculations consider the typical values provided in datasheet.
Those typical values are valid for VREFH_ADC at 3.0V. VTEMP25
is different for different VREFH_ADC voltages. With VREFH_ADC
at 3.3V, voltage at 25°C is 0.699V. Hence update the VTEMP25
to 0.699V which gives ADCR@Temp25 as 867.
Formula for finding ADCR@Temp25:
ADCR@Temp25 = (ADCR@Vdd * V@TEMP25 * 10) / VDDconv
ADCR@Vdd for 12-Bit ADC = 4095
VDDconv = VREFH_ADC * 10
VREFH_ADC@3.3V
ADCR@Temp25 = (4095 * .699 * 10) / 33
ADCR@Temp25 ~= 867
| VREFH_ADC | V@TEMP25 | VDDconv | ADCR@Temp25 |
| 3.0V | 0.696mV | 30 | 950 |
| 3.3V | 0.699mV | 33 | 867 |
Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/iio/adc/vf610_adc.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c
index 60617ed..cf56404 100644
--- a/drivers/iio/adc/vf610_adc.c
+++ b/drivers/iio/adc/vf610_adc.c
@@ -98,6 +98,13 @@
#define VF610_ADC_CALF 0x2
#define VF610_ADC_TIMEOUT msecs_to_jiffies(100)
+/* V at 25°C of 696 mV */
+#define VF610_VTEMP25_3V0 950
+/* V at 25°C of 699 mV */
+#define VF610_VTEMP25_3V3 867
+/* Typical sensor slope coefficient at all temperatures */
+#define VF610_TEMP_SLOPE_COEFF 1840
+
enum clk_sel {
VF610_ADCIOC_BUSCLK_SET,
VF610_ADCIOC_ALTCLK_SET,
@@ -513,11 +520,13 @@ static int vf610_read_raw(struct iio_dev *indio_dev,
break;
case IIO_TEMP:
/*
- * Calculate in degree Celsius times 1000
- * Using sensor slope of 1.84 mV/°C and
- * V at 25°C of 696 mV
- */
- *val = 25000 - ((int)info->value - 864) * 1000000 / 1840;
+ * Calculate in degree Celsius times 1000
+ * Using the typical sensor slope of 1.84 mV/°C
+ * and VREFH_ADC at 3.3V, V at 25°C of 699 mV
+ */
+ *val = 25000 - ((int)info->value - VF610_VTEMP25_3V3) *
+ 1000000 / VF610_TEMP_SLOPE_COEFF;
+
break;
default:
mutex_unlock(&indio_dev->mlock);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 002/128] iio: lpc32xx_adc: fix warnings caused by enabling unprepared clock
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 001/128] vf610_adc: Fix internal temperature calculation Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 003/128] iio:ad5064: Make sure ad5064_i2c_write() returns 0 on success Kamal Mostafa
` (125 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Vladimir Zapolskiy, Jonathan Cameron, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Zapolskiy <vz@mleia.com>
commit 01bb70ae0b98d266fa3e860482c7ce22fa482a6e upstream.
If common clock framework is configured, the driver generates a warning,
which is fixed by this change:
root@devkit3250:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
------------[ cut here ]------------
WARNING: CPU: 0 PID: 724 at drivers/clk/clk.c:727 clk_core_enable+0x2c/0xa4()
Modules linked in: sc16is7xx snd_soc_uda1380
CPU: 0 PID: 724 Comm: cat Not tainted 4.3.0-rc2+ #198
Hardware name: LPC32XX SoC (Flattened Device Tree)
Backtrace:
[<>] (dump_backtrace) from [<>] (show_stack+0x18/0x1c)
[<>] (show_stack) from [<>] (dump_stack+0x20/0x28)
[<>] (dump_stack) from [<>] (warn_slowpath_common+0x90/0xb8)
[<>] (warn_slowpath_common) from [<>] (warn_slowpath_null+0x24/0x2c)
[<>] (warn_slowpath_null) from [<>] (clk_core_enable+0x2c/0xa4)
[<>] (clk_core_enable) from [<>] (clk_enable+0x24/0x38)
[<>] (clk_enable) from [<>] (lpc32xx_read_raw+0x38/0x80)
[<>] (lpc32xx_read_raw) from [<>] (iio_read_channel_info+0x70/0x94)
[<>] (iio_read_channel_info) from [<>] (dev_attr_show+0x28/0x4c)
[<>] (dev_attr_show) from [<>] (sysfs_kf_seq_show+0x8c/0xf0)
[<>] (sysfs_kf_seq_show) from [<>] (kernfs_seq_show+0x2c/0x30)
[<>] (kernfs_seq_show) from [<>] (seq_read+0x1c8/0x440)
[<>] (seq_read) from [<>] (kernfs_fop_read+0x38/0x170)
[<>] (kernfs_fop_read) from [<>] (do_readv_writev+0x16c/0x238)
[<>] (do_readv_writev) from [<>] (vfs_readv+0x50/0x58)
[<>] (vfs_readv) from [<>] (default_file_splice_read+0x1a4/0x308)
[<>] (default_file_splice_read) from [<>] (do_splice_to+0x78/0x84)
[<>] (do_splice_to) from [<>] (splice_direct_to_actor+0xc8/0x1cc)
[<>] (splice_direct_to_actor) from [<>] (do_splice_direct+0xa0/0xb8)
[<>] (do_splice_direct) from [<>] (do_sendfile+0x1a8/0x30c)
[<>] (do_sendfile) from [<>] (SyS_sendfile64+0x104/0x10c)
[<>] (SyS_sendfile64) from [<>] (ret_fast_syscall+0x0/0x38)
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/staging/iio/adc/lpc32xx_adc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/iio/adc/lpc32xx_adc.c b/drivers/staging/iio/adc/lpc32xx_adc.c
index 5331c44..ef6d0b0 100644
--- a/drivers/staging/iio/adc/lpc32xx_adc.c
+++ b/drivers/staging/iio/adc/lpc32xx_adc.c
@@ -76,7 +76,7 @@ static int lpc32xx_read_raw(struct iio_dev *indio_dev,
if (mask == IIO_CHAN_INFO_RAW) {
mutex_lock(&indio_dev->mlock);
- clk_enable(info->clk);
+ clk_prepare_enable(info->clk);
/* Measurement setup */
__raw_writel(AD_INTERNAL | (chan->address) | AD_REFp | AD_REFm,
LPC32XX_ADC_SELECT(info->adc_base));
@@ -84,7 +84,7 @@ static int lpc32xx_read_raw(struct iio_dev *indio_dev,
__raw_writel(AD_PDN_CTRL | AD_STROBE,
LPC32XX_ADC_CTRL(info->adc_base));
wait_for_completion(&info->completion); /* set by ISR */
- clk_disable(info->clk);
+ clk_disable_unprepare(info->clk);
*val = info->value;
mutex_unlock(&indio_dev->mlock);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 003/128] iio:ad5064: Make sure ad5064_i2c_write() returns 0 on success
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 001/128] vf610_adc: Fix internal temperature calculation Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 002/128] iio: lpc32xx_adc: fix warnings caused by enabling unprepared clock Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 004/128] iio: ad5064: Fix ad5629/ad5669 shift Kamal Mostafa
` (124 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Michael Hennerich, Lars-Peter Clausen, Jonathan Cameron,
Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Hennerich <michael.hennerich@analog.com>
commit 03fe472ef33b7f31fbd11d300dbb3fdab9c00fd4 upstream.
i2c_master_send() returns the number of bytes transferred on success while
the ad5064 driver expects that the write() callback returns 0 on success.
Fix that by translating any non negative return value of i2c_master_send()
to 0.
Fixes: commit 6a17a0768f77 ("iio:dac:ad5064: Add support for the ad5629r and ad5669r")
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/iio/dac/ad5064.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/dac/ad5064.c b/drivers/iio/dac/ad5064.c
index f03b92f..1b43069 100644
--- a/drivers/iio/dac/ad5064.c
+++ b/drivers/iio/dac/ad5064.c
@@ -598,10 +598,16 @@ static int ad5064_i2c_write(struct ad5064_state *st, unsigned int cmd,
unsigned int addr, unsigned int val)
{
struct i2c_client *i2c = to_i2c_client(st->dev);
+ int ret;
st->data.i2c[0] = (cmd << 4) | addr;
put_unaligned_be16(val, &st->data.i2c[1]);
- return i2c_master_send(i2c, st->data.i2c, 3);
+
+ ret = i2c_master_send(i2c, st->data.i2c, 3);
+ if (ret < 0)
+ return ret;
+
+ return 0;
}
static int ad5064_i2c_probe(struct i2c_client *i2c,
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 004/128] iio: ad5064: Fix ad5629/ad5669 shift
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (2 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 003/128] iio:ad5064: Make sure ad5064_i2c_write() returns 0 on success Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 005/128] iio:ad7793: Fix ad7785 product ID Kamal Mostafa
` (123 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Lars-Peter Clausen, Jonathan Cameron, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Lars-Peter Clausen <lars@metafoo.de>
commit 5dcbe97bedd6ba4b0f574a96cc2e293d26f3d857 upstream.
The ad5629/ad5669 are the I2C variant of the ad5628/ad5668, which has a SPI
interface. They are mostly identical with the exception that the shift
factor is different. Currently the driver does not take care of this
difference which leads to incorrect DAC output values.
Fix this by introducing a custom channel spec for the ad5629/ad5669 with
the correct shift factor.
Fixes: commit 6a17a0768f77 ("iio:dac:ad5064: Add support for the ad5629r and ad5669r")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/iio/dac/ad5064.c | 83 +++++++++++++++++++++++++++++++++---------------
1 file changed, 57 insertions(+), 26 deletions(-)
diff --git a/drivers/iio/dac/ad5064.c b/drivers/iio/dac/ad5064.c
index 1b43069..aac16fe 100644
--- a/drivers/iio/dac/ad5064.c
+++ b/drivers/iio/dac/ad5064.c
@@ -113,12 +113,16 @@ enum ad5064_type {
ID_AD5065,
ID_AD5628_1,
ID_AD5628_2,
+ ID_AD5629_1,
+ ID_AD5629_2,
ID_AD5648_1,
ID_AD5648_2,
ID_AD5666_1,
ID_AD5666_2,
ID_AD5668_1,
ID_AD5668_2,
+ ID_AD5669_1,
+ ID_AD5669_2,
};
static int ad5064_write(struct ad5064_state *st, unsigned int cmd,
@@ -291,7 +295,7 @@ static const struct iio_chan_spec_ext_info ad5064_ext_info[] = {
{ },
};
-#define AD5064_CHANNEL(chan, addr, bits) { \
+#define AD5064_CHANNEL(chan, addr, bits, _shift) { \
.type = IIO_VOLTAGE, \
.indexed = 1, \
.output = 1, \
@@ -303,36 +307,39 @@ static const struct iio_chan_spec_ext_info ad5064_ext_info[] = {
.sign = 'u', \
.realbits = (bits), \
.storagebits = 16, \
- .shift = 20 - bits, \
+ .shift = (_shift), \
}, \
.ext_info = ad5064_ext_info, \
}
-#define DECLARE_AD5064_CHANNELS(name, bits) \
+#define DECLARE_AD5064_CHANNELS(name, bits, shift) \
const struct iio_chan_spec name[] = { \
- AD5064_CHANNEL(0, 0, bits), \
- AD5064_CHANNEL(1, 1, bits), \
- AD5064_CHANNEL(2, 2, bits), \
- AD5064_CHANNEL(3, 3, bits), \
- AD5064_CHANNEL(4, 4, bits), \
- AD5064_CHANNEL(5, 5, bits), \
- AD5064_CHANNEL(6, 6, bits), \
- AD5064_CHANNEL(7, 7, bits), \
+ AD5064_CHANNEL(0, 0, bits, shift), \
+ AD5064_CHANNEL(1, 1, bits, shift), \
+ AD5064_CHANNEL(2, 2, bits, shift), \
+ AD5064_CHANNEL(3, 3, bits, shift), \
+ AD5064_CHANNEL(4, 4, bits, shift), \
+ AD5064_CHANNEL(5, 5, bits, shift), \
+ AD5064_CHANNEL(6, 6, bits, shift), \
+ AD5064_CHANNEL(7, 7, bits, shift), \
}
-#define DECLARE_AD5065_CHANNELS(name, bits) \
+#define DECLARE_AD5065_CHANNELS(name, bits, shift) \
const struct iio_chan_spec name[] = { \
- AD5064_CHANNEL(0, 0, bits), \
- AD5064_CHANNEL(1, 3, bits), \
+ AD5064_CHANNEL(0, 0, bits, shift), \
+ AD5064_CHANNEL(1, 3, bits, shift), \
}
-static DECLARE_AD5064_CHANNELS(ad5024_channels, 12);
-static DECLARE_AD5064_CHANNELS(ad5044_channels, 14);
-static DECLARE_AD5064_CHANNELS(ad5064_channels, 16);
+static DECLARE_AD5064_CHANNELS(ad5024_channels, 12, 8);
+static DECLARE_AD5064_CHANNELS(ad5044_channels, 14, 6);
+static DECLARE_AD5064_CHANNELS(ad5064_channels, 16, 4);
-static DECLARE_AD5065_CHANNELS(ad5025_channels, 12);
-static DECLARE_AD5065_CHANNELS(ad5045_channels, 14);
-static DECLARE_AD5065_CHANNELS(ad5065_channels, 16);
+static DECLARE_AD5065_CHANNELS(ad5025_channels, 12, 8);
+static DECLARE_AD5065_CHANNELS(ad5045_channels, 14, 6);
+static DECLARE_AD5065_CHANNELS(ad5065_channels, 16, 4);
+
+static DECLARE_AD5064_CHANNELS(ad5629_channels, 12, 4);
+static DECLARE_AD5064_CHANNELS(ad5669_channels, 16, 0);
static const struct ad5064_chip_info ad5064_chip_info_tbl[] = {
[ID_AD5024] = {
@@ -382,6 +389,18 @@ static const struct ad5064_chip_info ad5064_chip_info_tbl[] = {
.channels = ad5024_channels,
.num_channels = 8,
},
+ [ID_AD5629_1] = {
+ .shared_vref = true,
+ .internal_vref = 2500000,
+ .channels = ad5629_channels,
+ .num_channels = 8,
+ },
+ [ID_AD5629_2] = {
+ .shared_vref = true,
+ .internal_vref = 5000000,
+ .channels = ad5629_channels,
+ .num_channels = 8,
+ },
[ID_AD5648_1] = {
.shared_vref = true,
.internal_vref = 2500000,
@@ -418,6 +437,18 @@ static const struct ad5064_chip_info ad5064_chip_info_tbl[] = {
.channels = ad5064_channels,
.num_channels = 8,
},
+ [ID_AD5669_1] = {
+ .shared_vref = true,
+ .internal_vref = 2500000,
+ .channels = ad5669_channels,
+ .num_channels = 8,
+ },
+ [ID_AD5669_2] = {
+ .shared_vref = true,
+ .internal_vref = 5000000,
+ .channels = ad5669_channels,
+ .num_channels = 8,
+ },
};
static inline unsigned int ad5064_num_vref(struct ad5064_state *st)
@@ -623,12 +654,12 @@ static int ad5064_i2c_remove(struct i2c_client *i2c)
}
static const struct i2c_device_id ad5064_i2c_ids[] = {
- {"ad5629-1", ID_AD5628_1},
- {"ad5629-2", ID_AD5628_2},
- {"ad5629-3", ID_AD5628_2}, /* similar enough to ad5629-2 */
- {"ad5669-1", ID_AD5668_1},
- {"ad5669-2", ID_AD5668_2},
- {"ad5669-3", ID_AD5668_2}, /* similar enough to ad5669-2 */
+ {"ad5629-1", ID_AD5629_1},
+ {"ad5629-2", ID_AD5629_2},
+ {"ad5629-3", ID_AD5629_2}, /* similar enough to ad5629-2 */
+ {"ad5669-1", ID_AD5669_1},
+ {"ad5669-2", ID_AD5669_2},
+ {"ad5669-3", ID_AD5669_2}, /* similar enough to ad5669-2 */
{}
};
MODULE_DEVICE_TABLE(i2c, ad5064_i2c_ids);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 005/128] iio:ad7793: Fix ad7785 product ID
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (3 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 004/128] iio: ad5064: Fix ad5629/ad5669 shift Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 006/128] x86/mpx: Add temporary variable to reduce masking Kamal Mostafa
` (122 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Lars-Peter Clausen, Jonathan Cameron, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Lars-Peter Clausen <lars@metafoo.de>
commit 785171fd6cd7dcd7ada5a733b6a2d44ec566c3a0 upstream.
While the datasheet for the AD7785 lists 0xXB as the product ID the actual
product ID is 0xX3.
Fix the product ID otherwise the driver will reject the device due to non
matching IDs.
Fixes: e786cc26dcc5 ("staging:iio:ad7793: Implement stricter id checking")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/iio/adc/ad7793.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/adc/ad7793.c b/drivers/iio/adc/ad7793.c
index 4dddeab..5da0754 100644
--- a/drivers/iio/adc/ad7793.c
+++ b/drivers/iio/adc/ad7793.c
@@ -101,7 +101,7 @@
#define AD7795_CH_AIN1M_AIN1M 8 /* AIN1(-) - AIN1(-) */
/* ID Register Bit Designations (AD7793_REG_ID) */
-#define AD7785_ID 0xB
+#define AD7785_ID 0x3
#define AD7792_ID 0xA
#define AD7793_ID 0xB
#define AD7794_ID 0xF
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 006/128] x86/mpx: Add temporary variable to reduce masking
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (4 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 005/128] iio:ad7793: Fix ad7785 product ID Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 007/128] x86: Make is_64bit_mm() widely available Kamal Mostafa
` (121 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dave Hansen, Andrew Morton, Dave Hansen, H. Peter Anvin,
Linus Torvalds, Peter Zijlstra, Ingo Molnar, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Hansen <dave.hansen@linux.intel.com>
commit a1149fc83a1f97612e72ec24a0bdbabff7b85e77 upstream.
When we allocate a bounds table, we call mmap(), then add a
"valid" bit to the value before storing it in to the bounds
directory.
If we fail along the way, we go and mask that valid bit
_back_ out. That seems a little silly, and this makes it
much more clear when we have a plain address versus an
actual table _entry_.
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Hansen <dave@sr71.net>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150607183704.3D69D5F4@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[ kamal: 3.19-stable prereq for "46561c3 x86/mpx: Do proper get_user() when
running 32-bit binaries on 64-bit kernels" ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/mm/mpx.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
index 4d1c11c..9c208e4 100644
--- a/arch/x86/mm/mpx.c
+++ b/arch/x86/mm/mpx.c
@@ -409,6 +409,7 @@ static int allocate_bt(long __user *bd_entry)
unsigned long expected_old_val = 0;
unsigned long actual_old_val = 0;
unsigned long bt_addr;
+ unsigned long bd_new_entry;
int ret = 0;
/*
@@ -421,7 +422,7 @@ static int allocate_bt(long __user *bd_entry)
/*
* Set the valid flag (kinda like _PAGE_PRESENT in a pte)
*/
- bt_addr = bt_addr | MPX_BD_ENTRY_VALID_FLAG;
+ bd_new_entry = bt_addr | MPX_BD_ENTRY_VALID_FLAG;
/*
* Go poke the address of the new bounds table in to the
@@ -435,7 +436,7 @@ static int allocate_bt(long __user *bd_entry)
* of the MPX code that have to pagefault_disable().
*/
ret = user_atomic_cmpxchg_inatomic(&actual_old_val, bd_entry,
- expected_old_val, bt_addr);
+ expected_old_val, bd_new_entry);
if (ret)
goto out_unmap;
@@ -465,7 +466,7 @@ static int allocate_bt(long __user *bd_entry)
}
return 0;
out_unmap:
- vm_munmap(bt_addr & MPX_BT_ADDR_MASK, MPX_BT_SIZE_BYTES);
+ vm_munmap(bt_addr, MPX_BT_SIZE_BYTES);
return ret;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 007/128] x86: Make is_64bit_mm() widely available
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (5 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 006/128] x86/mpx: Add temporary variable to reduce masking Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 008/128] x86/mpx: Introduce new 'directory entry' to 'addr' helper function Kamal Mostafa
` (120 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dave Hansen, Andrew Morton, Dave Hansen, H. Peter Anvin,
Linus Torvalds, Oleg Nesterov, Peter Zijlstra, Ingo Molnar,
Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Hansen <dave.hansen@linux.intel.com>
commit b0e9b09b3bd64e67bba862e238d3757b2482b6de upstream.
The uprobes code has a nice helper, is_64bit_mm(), that consults
both the runtime and compile-time flags for 32-bit support.
Instead of reinventing the wheel, pull it in to an x86 header so
we can use it for MPX.
I prefer passing the 'mm' around to test_thread_flag(TIF_IA32)
because it makes it explicit where the context is coming from.
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Hansen <dave@sr71.net>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150607183704.F0209999@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[ kamal: 3.19-stable prereq for "46561c3 x86/mpx: Do proper get_user() when
running 32-bit binaries on 64-bit kernels" ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/include/asm/mmu_context.h | 13 +++++++++++++
arch/x86/kernel/uprobes.c | 10 +---------
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h
index 1ab38a4..acdeb2be 100644
--- a/arch/x86/include/asm/mmu_context.h
+++ b/arch/x86/include/asm/mmu_context.h
@@ -165,6 +165,19 @@ static inline void arch_exit_mmap(struct mm_struct *mm)
paravirt_arch_exit_mmap(mm);
}
+#ifdef CONFIG_X86_64
+static inline bool is_64bit_mm(struct mm_struct *mm)
+{
+ return !config_enabled(CONFIG_IA32_EMULATION) ||
+ !(mm->context.ia32_compat == TIF_IA32);
+}
+#else
+static inline bool is_64bit_mm(struct mm_struct *mm)
+{
+ return false;
+}
+#endif
+
static inline void arch_bprm_mm_init(struct mm_struct *mm,
struct vm_area_struct *vma)
{
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index 8b96a94..6b1ca70 100644
--- a/arch/x86/kernel/uprobes.c
+++ b/arch/x86/kernel/uprobes.c
@@ -29,6 +29,7 @@
#include <linux/kdebug.h>
#include <asm/processor.h>
#include <asm/insn.h>
+#include <asm/mmu_context.h>
/* Post-execution fixups. */
@@ -245,11 +246,6 @@ static int uprobe_init_insn(struct arch_uprobe *auprobe, struct insn *insn, bool
}
#ifdef CONFIG_X86_64
-static inline bool is_64bit_mm(struct mm_struct *mm)
-{
- return !config_enabled(CONFIG_IA32_EMULATION) ||
- !(mm->context.ia32_compat == TIF_IA32);
-}
/*
* If arch_uprobe->insn doesn't use rip-relative addressing, return
* immediately. Otherwise, rewrite the instruction so that it accesses
@@ -430,10 +426,6 @@ static void riprel_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
}
}
#else /* 32-bit: */
-static inline bool is_64bit_mm(struct mm_struct *mm)
-{
- return false;
-}
/*
* No RIP-relative addressing on 32-bit
*/
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 008/128] x86/mpx: Introduce new 'directory entry' to 'addr' helper function
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (6 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 007/128] x86: Make is_64bit_mm() widely available Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 009/128] x86/mpx: Do proper get_user() when running 32-bit binaries on 64-bit kernels Kamal Mostafa
` (119 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dave Hansen, Andrew Morton, Dave Hansen, H. Peter Anvin,
Linus Torvalds, Peter Zijlstra, Ingo Molnar, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Hansen <dave.hansen@linux.intel.com>
commit 54587653904c552c56b9dec153d7a89063394b09 upstream.
Currently, to get from a bounds directory entry to the virtual
address of a bounds table, we simply mask off a few low bits.
However, the set of bits we mask off is different for 32-bit and
64-bit binaries.
This breaks the operation out in to a helper function and also
adds a temporary variable to store the result until we are
sure we are returning one.
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Hansen <dave@sr71.net>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150607183704.007686CE@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[ kamal: 3.19-stable prereq for "46561c3 x86/mpx: Do proper get_user() when
running 32-bit binaries on 64-bit kernels" ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/include/asm/mpx.h | 1 -
arch/x86/mm/mpx.c | 41 ++++++++++++++++++++++++++++++++++-------
2 files changed, 34 insertions(+), 8 deletions(-)
diff --git a/arch/x86/include/asm/mpx.h b/arch/x86/include/asm/mpx.h
index a952a13d..2857144 100644
--- a/arch/x86/include/asm/mpx.h
+++ b/arch/x86/include/asm/mpx.h
@@ -46,7 +46,6 @@
#define MPX_BNDCFG_TAIL 12
#define MPX_BNDSTA_ADDR_MASK (~((1UL<<MPX_BNDSTA_TAIL)-1))
#define MPX_BNDCFG_ADDR_MASK (~((1UL<<MPX_BNDCFG_TAIL)-1))
-#define MPX_BT_ADDR_MASK (~((1UL<<MPX_BD_ENTRY_TAIL)-1))
#define MPX_BNDCFG_ADDR_MASK (~((1UL<<MPX_BNDCFG_TAIL)-1))
#define MPX_BNDSTA_ERROR_CODE 0x3
diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
index 9c208e4..1013f04 100644
--- a/arch/x86/mm/mpx.c
+++ b/arch/x86/mm/mpx.c
@@ -555,29 +555,55 @@ static int mpx_resolve_fault(long __user *addr, int write)
return 0;
}
+static unsigned long mpx_bd_entry_to_bt_addr(struct mm_struct *mm,
+ unsigned long bd_entry)
+{
+ unsigned long bt_addr = bd_entry;
+ int align_to_bytes;
+ /*
+ * Bit 0 in a bt_entry is always the valid bit.
+ */
+ bt_addr &= ~MPX_BD_ENTRY_VALID_FLAG;
+ /*
+ * Tables are naturally aligned at 8-byte boundaries
+ * on 64-bit and 4-byte boundaries on 32-bit. The
+ * documentation makes it appear that the low bits
+ * are ignored by the hardware, so we do the same.
+ */
+ if (is_64bit_mm(mm))
+ align_to_bytes = 8;
+ else
+ align_to_bytes = 4;
+ bt_addr &= ~(align_to_bytes-1);
+ return bt_addr;
+}
+
/*
* Get the base of bounds tables pointed by specific bounds
* directory entry.
*/
static int get_bt_addr(struct mm_struct *mm,
- long __user *bd_entry, unsigned long *bt_addr)
+ long __user *bd_entry_ptr,
+ unsigned long *bt_addr_result)
{
int ret;
int valid_bit;
+ unsigned long bd_entry;
+ unsigned long bt_addr;
- if (!access_ok(VERIFY_READ, (bd_entry), sizeof(*bd_entry)))
+ if (!access_ok(VERIFY_READ, (bd_entry_ptr), sizeof(*bd_entry_ptr)))
return -EFAULT;
while (1) {
int need_write = 0;
pagefault_disable();
- ret = get_user(*bt_addr, bd_entry);
+ ret = get_user(bd_entry, bd_entry_ptr);
pagefault_enable();
if (!ret)
break;
if (ret == -EFAULT)
- ret = mpx_resolve_fault(bd_entry, need_write);
+ ret = mpx_resolve_fault(bd_entry_ptr, need_write);
/*
* If we could not resolve the fault, consider it
* userspace's fault and error out.
@@ -586,8 +612,8 @@ static int get_bt_addr(struct mm_struct *mm,
return ret;
}
- valid_bit = *bt_addr & MPX_BD_ENTRY_VALID_FLAG;
- *bt_addr &= MPX_BT_ADDR_MASK;
+ valid_bit = bd_entry & MPX_BD_ENTRY_VALID_FLAG;
+ bt_addr = mpx_bd_entry_to_bt_addr(mm, bd_entry);
/*
* When the kernel is managing bounds tables, a bounds directory
@@ -596,7 +622,7 @@ static int get_bt_addr(struct mm_struct *mm,
* data in the address field, we know something is wrong. This
* -EINVAL return will cause a SIGSEGV.
*/
- if (!valid_bit && *bt_addr)
+ if (!valid_bit && bt_addr)
return -EINVAL;
/*
* Do we have an completely zeroed bt entry? That is OK. It
@@ -607,6 +633,7 @@ static int get_bt_addr(struct mm_struct *mm,
if (!valid_bit)
return -ENOENT;
+ *bt_addr_result = bt_addr;
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 009/128] x86/mpx: Do proper get_user() when running 32-bit binaries on 64-bit kernels
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (7 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 008/128] x86/mpx: Introduce new 'directory entry' to 'addr' helper function Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 010/128] x86/fpu: Fix 32-bit signal frame handling Kamal Mostafa
` (118 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dave Hansen, Andy Lutomirski, Borislav Petkov, Brian Gerst,
Dave Hansen, Denys Vlasenko, H. Peter Anvin, Linus Torvalds,
Peter Zijlstra, Thomas Gleixner, Ingo Molnar, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Hansen <dave.hansen@linux.intel.com>
commit 46561c3959d6307d22139c24cd0bf196162e5681 upstream.
When you call get_user(foo, bar), you effectively do a
copy_from_user(&foo, bar, sizeof(*bar));
Note that the sizeof() is implicit.
When we reach out to userspace to try to zap an entire "bounds
table" we need to go read a "bounds directory entry" in order to
locate the table's address. The size of a "directory entry"
depends on the binary being run and is always the size of a
pointer.
But, when we have a 64-bit kernel and a 32-bit application, the
directory entry is still only 32-bits long, but we fetch it with
a 64-bit pointer which makes get_user() does a 64-bit fetch.
Reading 4 extra bytes isn't harmful, unless we are at the end of
and run off the table. It might also cause the zero page to get
faulted in unnecessarily even if you are not at the end.
Fix it up by doing a special 32-bit get_user() via a cast when
we have 32-bit userspace.
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave@sr71.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20151111181931.3ACF6822@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/mm/mpx.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
index 1013f04..3df5f1a 100644
--- a/arch/x86/mm/mpx.c
+++ b/arch/x86/mm/mpx.c
@@ -579,6 +579,29 @@ static unsigned long mpx_bd_entry_to_bt_addr(struct mm_struct *mm,
}
/*
+ * We only want to do a 4-byte get_user() on 32-bit. Otherwise,
+ * we might run off the end of the bounds table if we are on
+ * a 64-bit kernel and try to get 8 bytes.
+ */
+int get_user_bd_entry(struct mm_struct *mm, unsigned long *bd_entry_ret,
+ long __user *bd_entry_ptr)
+{
+ u32 bd_entry_32;
+ int ret;
+
+ if (is_64bit_mm(mm))
+ return get_user(*bd_entry_ret, bd_entry_ptr);
+
+ /*
+ * Note that get_user() uses the type of the *pointer* to
+ * establish the size of the get, not the destination.
+ */
+ ret = get_user(bd_entry_32, (u32 __user *)bd_entry_ptr);
+ *bd_entry_ret = bd_entry_32;
+ return ret;
+}
+
+/*
* Get the base of bounds tables pointed by specific bounds
* directory entry.
*/
@@ -598,7 +621,7 @@ static int get_bt_addr(struct mm_struct *mm,
int need_write = 0;
pagefault_disable();
- ret = get_user(bd_entry, bd_entry_ptr);
+ ret = get_user_bd_entry(mm, &bd_entry, bd_entry_ptr);
pagefault_enable();
if (!ret)
break;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 010/128] x86/fpu: Fix 32-bit signal frame handling
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (8 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 009/128] x86/mpx: Do proper get_user() when running 32-bit binaries on 64-bit kernels Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 011/128] crypto: qat - don't use userspace pointer Kamal Mostafa
` (117 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dave Hansen, Andy Lutomirski, Borislav Petkov, Brian Gerst,
Denys Vlasenko, H. Peter Anvin, Linus Torvalds, Peter Zijlstra,
Thomas Gleixner, dave, fenghua.yu, yu-cheng.yu, Ingo Molnar,
Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Hansen <dave.hansen@linux.intel.com>
commit ab6b52947545a5355154f64f449f97af9d05845f upstream.
(This should have gone to LKML originally. Sorry for the extra
noise, folks on the cc.)
Background:
Signal frames on x86 have two formats:
1. For 32-bit executables (whether on a real 32-bit kernel or
under 32-bit emulation on a 64-bit kernel) we have a
'fpregset_t' that includes the "FSAVE" registers.
2. For 64-bit executables (on 64-bit kernels obviously), the
'fpregset_t' is smaller and does not contain the "FSAVE"
state.
When creating the signal frame, we have to be aware of whether
we are running a 32 or 64-bit executable so we create the
correct format signal frame.
Problem:
save_xstate_epilog() uses 'fx_sw_reserved_ia32' whenever it is
called for a 32-bit executable. This is for real 32-bit and
ia32 emulation.
But, fpu__init_prepare_fx_sw_frame() only initializes
'fx_sw_reserved_ia32' when emulation is enabled, *NOT* for real
32-bit kernels.
This leads to really wierd situations where 32-bit programs
lose their extended state when returning from a signal handler.
The kernel copies the uninitialized (zero) 'fx_sw_reserved_ia32'
out to userspace in save_xstate_epilog(). But when returning
from the signal, the kernel errors out in check_for_xstate()
when it does not see FP_XSTATE_MAGIC1 present (because it was
zeroed). This leads to the FPU/XSAVE state being initialized.
For MPX, this leads to the most permissive state and means we
silently lose bounds violations. I think this would also mean
that we could lose *ANY* FPU/SSE/AVX state. I'm not sure why
no one has spotted this bug.
I believe this was broken by:
72a671ced66d ("x86, fpu: Unify signal handling code paths for x86 and x86_64 kernels")
way back in 2012.
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: dave@sr71.net
Cc: fenghua.yu@intel.com
Cc: yu-cheng.yu@intel.com
Link: http://lkml.kernel.org/r/20151111002354.A0799571@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[ kamal: backport to 3.19-stable: applied to kernel/xsave.c; context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kernel/xsave.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 8be1e17..8c2b709 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -432,20 +432,19 @@ int __restore_xstate_sig(void __user *buf, void __user *buf_fx, int size)
*/
static void prepare_fx_sw_frame(void)
{
- int fsave_header_size = sizeof(struct i387_fsave_struct);
int size = xstate_size + FP_XSTATE_MAGIC2_SIZE;
- if (config_enabled(CONFIG_X86_32))
- size += fsave_header_size;
-
fx_sw_reserved.magic1 = FP_XSTATE_MAGIC1;
fx_sw_reserved.extended_size = size;
fx_sw_reserved.xstate_bv = pcntxt_mask;
fx_sw_reserved.xstate_size = xstate_size;
- if (config_enabled(CONFIG_IA32_EMULATION)) {
+ if (config_enabled(CONFIG_IA32_EMULATION) ||
+ config_enabled(CONFIG_X86_32)) {
+ int fsave_header_size = sizeof(struct i387_fsave_struct);
+
fx_sw_reserved_ia32 = fx_sw_reserved;
- fx_sw_reserved_ia32.extended_size += fsave_header_size;
+ fx_sw_reserved_ia32.extended_size = size + fsave_header_size;
}
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 011/128] crypto: qat - don't use userspace pointer
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (9 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 010/128] x86/fpu: Fix 32-bit signal frame handling Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 012/128] iio: si7020: Swap data byte order Kamal Mostafa
` (116 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Tadeusz Struk, Herbert Xu, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Tadeusz Struk <tadeusz.struk@intel.com>
commit 176155dac13f528e0a58c14dc322623219365d91 upstream.
Bugfix - don't dereference userspace pointer.
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/crypto/qat/qat_common/adf_ctl_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/qat/qat_common/adf_ctl_drv.c b/drivers/crypto/qat/qat_common/adf_ctl_drv.c
index 7ee93f8..54e9e0b 100644
--- a/drivers/crypto/qat/qat_common/adf_ctl_drv.c
+++ b/drivers/crypto/qat/qat_common/adf_ctl_drv.c
@@ -194,7 +194,7 @@ static int adf_copy_key_value_data(struct adf_accel_dev *accel_dev,
goto out_err;
}
- params_head = section_head->params;
+ params_head = section.params;
while (params_head) {
if (copy_from_user(&key_val, (void __user *)params_head,
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 012/128] iio: si7020: Swap data byte order
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (10 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 011/128] crypto: qat - don't use userspace pointer Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 013/128] iio: adc: xilinx: Fix VREFN scale Kamal Mostafa
` (115 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Chris Lesiak, Jonathan Cameron, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Lesiak <chris.lesiak@licor.com>
commit 0d2f6fd3ffd5e7a447233a57112246bc00064752 upstream.
The Silicon Labs Si7013, Si7020, and Si7021 family of I2C humidity and
temperature sensors deliver 16 bit data high byte first.
See the datasheet available at:
https://www.silabs.com/Support%20Documents%2fTechnicalDocs%2fSi7020-A20.pdf
But as documented in Documentation/i2c/smbus-protocol,
i2c_smbus_read_word_data() expects the low byte first.
Change the driver to use i2c_smbus_read_word_swapped to get correct byte
order.
Signed-off-by: Chris Lesiak <chris.lesiak@licor.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/iio/humidity/si7020.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/humidity/si7020.c b/drivers/iio/humidity/si7020.c
index fa3b809..1b6935d 100644
--- a/drivers/iio/humidity/si7020.c
+++ b/drivers/iio/humidity/si7020.c
@@ -50,10 +50,10 @@ static int si7020_read_raw(struct iio_dev *indio_dev,
switch (mask) {
case IIO_CHAN_INFO_RAW:
- ret = i2c_smbus_read_word_data(*client,
- chan->type == IIO_TEMP ?
- SI7020CMD_TEMP_HOLD :
- SI7020CMD_RH_HOLD);
+ ret = i2c_smbus_read_word_swapped(*client,
+ chan->type == IIO_TEMP ?
+ SI7020CMD_TEMP_HOLD :
+ SI7020CMD_RH_HOLD);
if (ret < 0)
return ret;
*val = ret >> 2;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 013/128] iio: adc: xilinx: Fix VREFN scale
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (11 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 012/128] iio: si7020: Swap data byte order Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 014/128] ipmi: Start the timer and thread on internal msgs Kamal Mostafa
` (114 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Thomas Betker, Jonathan Cameron, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Betker <thomas.betker@rohde-schwarz.com>
commit a57f8dac46fbac5ab0e31aef1a98b3f6eb30c079 upstream.
The scaling factor for VREFN is 3.0/4096 (not 1.0/4096), just as for
VREFP. This is not immediately obvious from the specification (Xilinx
UG480), but has been confirmed by Xilinx support.
Suggested-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/iio/adc/xilinx-xadc-core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
index ce93bd8..95c0b3d 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -857,6 +857,7 @@ static int xadc_read_raw(struct iio_dev *indio_dev,
case XADC_REG_VCCINT:
case XADC_REG_VCCAUX:
case XADC_REG_VREFP:
+ case XADC_REG_VREFN:
case XADC_REG_VCCBRAM:
case XADC_REG_VCCPINT:
case XADC_REG_VCCPAUX:
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 014/128] ipmi: Start the timer and thread on internal msgs
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (12 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 013/128] iio: adc: xilinx: Fix VREFN scale Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 015/128] drm/i915: quirk backlight present on Macbook 4, 1 Kamal Mostafa
` (113 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Corey Minyard, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Corey Minyard <cminyard@mvista.com>
commit 0cfec916e86d881e209de4b4ae9959a6271e6660 upstream.
The timer and thread were not being started for internal messages,
so in interrupt mode if something hung the timer would never go
off and clean things up. Factor out the internal message sending
and start the timer for those messages, too.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Tested-by: Gouji, Masayuki <gouji.masayuki@jp.fujitsu.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/char/ipmi/ipmi_si_intf.c | 73 ++++++++++++++++++++++++----------------
1 file changed, 44 insertions(+), 29 deletions(-)
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 967b73a..ecc34a9 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -393,18 +393,42 @@ static enum si_sm_result start_next_msg(struct smi_info *smi_info)
return rv;
}
-static void start_check_enables(struct smi_info *smi_info)
+static void smi_mod_timer(struct smi_info *smi_info, unsigned long new_val)
+{
+ smi_info->last_timeout_jiffies = jiffies;
+ mod_timer(&smi_info->si_timer, new_val);
+ smi_info->timer_running = true;
+}
+
+/*
+ * Start a new message and (re)start the timer and thread.
+ */
+static void start_new_msg(struct smi_info *smi_info, unsigned char *msg,
+ unsigned int size)
+{
+ smi_mod_timer(smi_info, jiffies + SI_TIMEOUT_JIFFIES);
+
+ if (smi_info->thread)
+ wake_up_process(smi_info->thread);
+
+ smi_info->handlers->start_transaction(smi_info->si_sm, msg, size);
+}
+
+static void start_check_enables(struct smi_info *smi_info, bool start_timer)
{
unsigned char msg[2];
msg[0] = (IPMI_NETFN_APP_REQUEST << 2);
msg[1] = IPMI_GET_BMC_GLOBAL_ENABLES_CMD;
- smi_info->handlers->start_transaction(smi_info->si_sm, msg, 2);
+ if (start_timer)
+ start_new_msg(smi_info, msg, 2);
+ else
+ smi_info->handlers->start_transaction(smi_info->si_sm, msg, 2);
smi_info->si_state = SI_CHECKING_ENABLES;
}
-static void start_clear_flags(struct smi_info *smi_info)
+static void start_clear_flags(struct smi_info *smi_info, bool start_timer)
{
unsigned char msg[3];
@@ -413,7 +437,10 @@ static void start_clear_flags(struct smi_info *smi_info)
msg[1] = IPMI_CLEAR_MSG_FLAGS_CMD;
msg[2] = WDT_PRE_TIMEOUT_INT;
- smi_info->handlers->start_transaction(smi_info->si_sm, msg, 3);
+ if (start_timer)
+ start_new_msg(smi_info, msg, 3);
+ else
+ smi_info->handlers->start_transaction(smi_info->si_sm, msg, 3);
smi_info->si_state = SI_CLEARING_FLAGS;
}
@@ -423,10 +450,8 @@ static void start_getting_msg_queue(struct smi_info *smi_info)
smi_info->curr_msg->data[1] = IPMI_GET_MSG_CMD;
smi_info->curr_msg->data_size = 2;
- smi_info->handlers->start_transaction(
- smi_info->si_sm,
- smi_info->curr_msg->data,
- smi_info->curr_msg->data_size);
+ start_new_msg(smi_info, smi_info->curr_msg->data,
+ smi_info->curr_msg->data_size);
smi_info->si_state = SI_GETTING_MESSAGES;
}
@@ -436,31 +461,22 @@ static void start_getting_events(struct smi_info *smi_info)
smi_info->curr_msg->data[1] = IPMI_READ_EVENT_MSG_BUFFER_CMD;
smi_info->curr_msg->data_size = 2;
- smi_info->handlers->start_transaction(
- smi_info->si_sm,
- smi_info->curr_msg->data,
- smi_info->curr_msg->data_size);
+ start_new_msg(smi_info, smi_info->curr_msg->data,
+ smi_info->curr_msg->data_size);
smi_info->si_state = SI_GETTING_EVENTS;
}
-static void smi_mod_timer(struct smi_info *smi_info, unsigned long new_val)
-{
- smi_info->last_timeout_jiffies = jiffies;
- mod_timer(&smi_info->si_timer, new_val);
- smi_info->timer_running = true;
-}
-
/*
* When we have a situtaion where we run out of memory and cannot
* allocate messages, we just leave them in the BMC and run the system
* polled until we can allocate some memory. Once we have some
* memory, we will re-enable the interrupt.
*/
-static inline bool disable_si_irq(struct smi_info *smi_info)
+static inline bool disable_si_irq(struct smi_info *smi_info, bool start_timer)
{
if ((smi_info->irq) && (!smi_info->interrupt_disabled)) {
smi_info->interrupt_disabled = true;
- start_check_enables(smi_info);
+ start_check_enables(smi_info, start_timer);
return true;
}
return false;
@@ -470,7 +486,7 @@ static inline bool enable_si_irq(struct smi_info *smi_info)
{
if ((smi_info->irq) && (smi_info->interrupt_disabled)) {
smi_info->interrupt_disabled = false;
- start_check_enables(smi_info);
+ start_check_enables(smi_info, true);
return true;
}
return false;
@@ -488,7 +504,7 @@ static struct ipmi_smi_msg *alloc_msg_handle_irq(struct smi_info *smi_info)
msg = ipmi_alloc_smi_msg();
if (!msg) {
- if (!disable_si_irq(smi_info))
+ if (!disable_si_irq(smi_info, true))
smi_info->si_state = SI_NORMAL;
} else if (enable_si_irq(smi_info)) {
ipmi_free_smi_msg(msg);
@@ -504,7 +520,7 @@ static void handle_flags(struct smi_info *smi_info)
/* Watchdog pre-timeout */
smi_inc_stat(smi_info, watchdog_pretimeouts);
- start_clear_flags(smi_info);
+ start_clear_flags(smi_info, true);
smi_info->msg_flags &= ~WDT_PRE_TIMEOUT_INT;
if (smi_info->intf)
ipmi_smi_watchdog_pretimeout(smi_info->intf);
@@ -865,8 +881,7 @@ static enum si_sm_result smi_event_handler(struct smi_info *smi_info,
msg[0] = (IPMI_NETFN_APP_REQUEST << 2);
msg[1] = IPMI_GET_MSG_FLAGS_CMD;
- smi_info->handlers->start_transaction(
- smi_info->si_sm, msg, 2);
+ start_new_msg(smi_info, msg, 2);
smi_info->si_state = SI_GETTING_FLAGS;
goto restart;
}
@@ -896,7 +911,7 @@ static enum si_sm_result smi_event_handler(struct smi_info *smi_info,
* disable and messages disabled.
*/
if (smi_info->supports_event_msg_buff || smi_info->irq) {
- start_check_enables(smi_info);
+ start_check_enables(smi_info, true);
} else {
smi_info->curr_msg = alloc_msg_handle_irq(smi_info);
if (!smi_info->curr_msg)
@@ -3427,7 +3442,7 @@ static int try_smi_init(struct smi_info *new_smi)
* Start clearing the flags before we enable interrupts or the
* timer to avoid racing with the timer.
*/
- start_clear_flags(new_smi);
+ start_clear_flags(new_smi, false);
/*
* IRQ is defined to be set when non-zero. req_events will
@@ -3729,7 +3744,7 @@ static void cleanup_one_si(struct smi_info *to_clean)
poll(to_clean);
schedule_timeout_uninterruptible(1);
}
- disable_si_irq(to_clean);
+ disable_si_irq(to_clean, false);
while (to_clean->curr_msg || (to_clean->si_state != SI_NORMAL)) {
poll(to_clean);
schedule_timeout_uninterruptible(1);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 015/128] drm/i915: quirk backlight present on Macbook 4, 1
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (13 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 014/128] ipmi: Start the timer and thread on internal msgs Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 016/128] USB: qcserial: Add support for Quectel EC20 Mini PCIe module Kamal Mostafa
` (112 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Jani Nikula, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <jani.nikula@intel.com>
commit 1b9448b071caa7d10bb2569fabe3020a2c25ae59 upstream.
Unsurprisingly macbooks have backlights, just the VBT doesn't seem to
know it in this case.
Reported-and-tested-by: Daniel Nicoletti <dantti12@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88325
Fixes: c675949ec58c ("drm/i915: do not setup backlight if not available according to VBT")
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1446716999-1796-1-git-send-email-jani.nikula@intel.com
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/intel_display.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index ca0ec27..48a19dc 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13025,6 +13025,9 @@ static struct intel_quirk intel_quirks[] = {
/* Apple Macbook 2,1 (Core 2 T7400) */
{ 0x27a2, 0x8086, 0x7270, quirk_backlight_present },
+ /* Apple Macbook 4,1 */
+ { 0x2a02, 0x106b, 0x00a1, quirk_backlight_present },
+
/* Toshiba CB35 Chromebook (Celeron 2955U) */
{ 0x0a06, 0x1179, 0x0a88, quirk_backlight_present },
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 016/128] USB: qcserial: Add support for Quectel EC20 Mini PCIe module
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (14 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 015/128] drm/i915: quirk backlight present on Macbook 4, 1 Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 017/128] USB: serial: option: add support for Novatel MiFi USB620L Kamal Mostafa
` (111 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Petr Štetiar, Johan Hovold, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <ynezz@true.cz>
commit 9d5b5ed796d7afd7e8d2ac4b4fb77c6a49463f4b upstream.
It seems like this device has same vendor and product IDs as G2K
devices, but it has different number of interfaces(4 vs 5) and also
different interface layout which makes it currently unusable:
usbcore: registered new interface driver qcserial
usbserial: USB Serial support registered for Qualcomm USB modem
usb 2-1.2: unknown number of interfaces: 5
lsusb output:
Bus 002 Device 003: ID 05c6:9215 Qualcomm, Inc. Acer Gobi 2000 Wireless
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x05c6 Qualcomm, Inc.
idProduct 0x9215 Acer Gobi 2000 Wireless Modem
bcdDevice 2.32
iManufacturer 1 Quectel
iProduct 2 Quectel LTE Module
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 209
bNumInterfaces 5
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 500mA
Signed-off-by: Petr Štetiar <ynezz@true.cz>
[johan: rename define and add comment ]
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/qcserial.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
index f49d262..1d7a2a4 100644
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -22,6 +22,8 @@
#define DRIVER_AUTHOR "Qualcomm Inc"
#define DRIVER_DESC "Qualcomm USB Serial driver"
+#define QUECTEL_EC20_PID 0x9215
+
/* standard device layouts supported by this driver */
enum qcserial_layouts {
QCSERIAL_G2K = 0, /* Gobi 2000 */
@@ -169,6 +171,38 @@ static const struct usb_device_id id_table[] = {
};
MODULE_DEVICE_TABLE(usb, id_table);
+static int handle_quectel_ec20(struct device *dev, int ifnum)
+{
+ int altsetting = 0;
+
+ /*
+ * Quectel EC20 Mini PCIe LTE module layout:
+ * 0: DM/DIAG (use libqcdm from ModemManager for communication)
+ * 1: NMEA
+ * 2: AT-capable modem port
+ * 3: Modem interface
+ * 4: NDIS
+ */
+ switch (ifnum) {
+ case 0:
+ dev_dbg(dev, "Quectel EC20 DM/DIAG interface found\n");
+ break;
+ case 1:
+ dev_dbg(dev, "Quectel EC20 NMEA GPS interface found\n");
+ break;
+ case 2:
+ case 3:
+ dev_dbg(dev, "Quectel EC20 Modem port found\n");
+ break;
+ case 4:
+ /* Don't claim the QMI/net interface */
+ altsetting = -1;
+ break;
+ }
+
+ return altsetting;
+}
+
static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
{
struct usb_host_interface *intf = serial->interface->cur_altsetting;
@@ -237,6 +271,12 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
altsetting = -1;
break;
case QCSERIAL_G2K:
+ /* handle non-standard layouts */
+ if (nintf == 5 && id->idProduct == QUECTEL_EC20_PID) {
+ altsetting = handle_quectel_ec20(dev, ifnum);
+ goto done;
+ }
+
/*
* Gobi 2K+ USB layout:
* 0: QMI/net
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 017/128] USB: serial: option: add support for Novatel MiFi USB620L
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (15 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 016/128] USB: qcserial: Add support for Quectel EC20 Mini PCIe module Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 018/128] USB: ti_usb_3410_5052: Add Honeywell HGI80 ID Kamal Mostafa
` (110 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Aleksander Morgado, Johan Hovold, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksander Morgado <aleksander@aleksander.es>
commit e07af133c3e2716db25e3e1e1d9f10c2088e9c1a upstream.
Also known as Verizon U620L.
The device is modeswitched from 1410:9020 to 1410:9022 by selecting the
4th USB configuration:
$ sudo usb_modeswitch –v 0x1410 –p 0x9020 –u 4
This configuration provides a ECM interface as well as TTYs ('Enterprise
Mode' according to the U620 Linux integration guide).
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/option.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 17d04d9..a7a0156 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -162,6 +162,7 @@ static void option_instat_callback(struct urb *urb);
#define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001
#define NOVATELWIRELESS_PRODUCT_E362 0x9010
#define NOVATELWIRELESS_PRODUCT_E371 0x9011
+#define NOVATELWIRELESS_PRODUCT_U620L 0x9022
#define NOVATELWIRELESS_PRODUCT_G2 0xA010
#define NOVATELWIRELESS_PRODUCT_MC551 0xB001
@@ -1068,6 +1069,7 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E362, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E371, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U620L, 0xff, 0x00, 0x00) },
{ USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) },
{ USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) },
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 018/128] USB: ti_usb_3410_5052: Add Honeywell HGI80 ID
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (16 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 017/128] USB: serial: option: add support for Novatel MiFi USB620L Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 019/128] drm/i915: get runtime PM reference around GEM set_caching IOCTL Kamal Mostafa
` (109 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: David Woodhouse, Johan Hovold, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: David Woodhouse <dwmw2@infradead.org>
commit 1bcb49e663f88bccee35b8688e6a3da2bea31fd4 upstream.
The Honeywell HGI80 is a wireless interface to the evohome connected
thermostat. It uses a TI 3410 USB-serial port.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/ti_usb_3410_5052.c | 2 ++
drivers/usb/serial/ti_usb_3410_5052.h | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index e9da41d..2694df2 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -159,6 +159,7 @@ static const struct usb_device_id ti_id_table_3410[] = {
{ USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STEREO_PLUG_ID) },
{ USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STRIP_PORT_ID) },
{ USB_DEVICE(TI_VENDOR_ID, FRI2_PRODUCT_ID) },
+ { USB_DEVICE(HONEYWELL_VENDOR_ID, HONEYWELL_HGI80_PRODUCT_ID) },
{ } /* terminator */
};
@@ -191,6 +192,7 @@ static const struct usb_device_id ti_id_table_combined[] = {
{ USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) },
{ USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STRIP_PORT_ID) },
{ USB_DEVICE(TI_VENDOR_ID, FRI2_PRODUCT_ID) },
+ { USB_DEVICE(HONEYWELL_VENDOR_ID, HONEYWELL_HGI80_PRODUCT_ID) },
{ } /* terminator */
};
diff --git a/drivers/usb/serial/ti_usb_3410_5052.h b/drivers/usb/serial/ti_usb_3410_5052.h
index 4a2423e..98f35c6 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.h
+++ b/drivers/usb/serial/ti_usb_3410_5052.h
@@ -56,6 +56,10 @@
#define ABBOTT_PRODUCT_ID ABBOTT_STEREO_PLUG_ID
#define ABBOTT_STRIP_PORT_ID 0x3420
+/* Honeywell vendor and product IDs */
+#define HONEYWELL_VENDOR_ID 0x10ac
+#define HONEYWELL_HGI80_PRODUCT_ID 0x0102 /* Honeywell HGI80 */
+
/* Commands */
#define TI_GET_VERSION 0x01
#define TI_GET_PORT_STATUS 0x02
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 019/128] drm/i915: get runtime PM reference around GEM set_caching IOCTL
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (17 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 018/128] USB: ti_usb_3410_5052: Add Honeywell HGI80 ID Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 020/128] drm/radeon: Disable uncacheable CPU mappings of GTT with RV6xx Kamal Mostafa
` (108 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Imre Deak, Jani Nikula, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Imre Deak <imre.deak@intel.com>
commit fd0fe6acf1dd88aabfbf383f7e4c16315387a7b7 upstream.
After Damien's D3 fix I started to get runtime suspend residency for the
first time and that revealed a breakage on the set_caching IOCTL path
that accesses the HW but doesn't take an RPM ref. Fix this up.
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1446665132-22491-1-git-send-email-imre.deak@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/i915_gem.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 5f61482..3655910 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3864,6 +3864,7 @@ unlock:
int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
{
+ struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_i915_gem_caching *args = data;
struct drm_i915_gem_object *obj;
enum i915_cache_level level;
@@ -3883,9 +3884,11 @@ int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,
return -EINVAL;
}
+ intel_runtime_pm_get(dev_priv);
+
ret = i915_mutex_lock_interruptible(dev);
if (ret)
- return ret;
+ goto rpm_put;
obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
if (&obj->base == NULL) {
@@ -3898,6 +3901,9 @@ int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,
drm_gem_object_unreference(&obj->base);
unlock:
mutex_unlock(&dev->struct_mutex);
+rpm_put:
+ intel_runtime_pm_put(dev_priv);
+
return ret;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 020/128] drm/radeon: Disable uncacheable CPU mappings of GTT with RV6xx
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (18 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 019/128] drm/i915: get runtime PM reference around GEM set_caching IOCTL Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 021/128] drm/radeon: unconditionally set sysfs_initialized Kamal Mostafa
` (107 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Michel Dänzer, Alex Deucher, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
commit 96ea47c0ec8c012509116bee8c57414281428fc4 upstream.
They reportedly cause random GPU hangs.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91268
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon_object.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index 12ea1e5..826564d 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -221,6 +221,12 @@ int radeon_bo_create(struct radeon_device *rdev,
if (!(rdev->flags & RADEON_IS_PCIE))
bo->flags &= ~(RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC);
+ /* Write-combined CPU mappings of GTT cause GPU hangs with RV6xx
+ * See https://bugs.freedesktop.org/show_bug.cgi?id=91268
+ */
+ if (rdev->family >= CHIP_RV610 && rdev->family <= CHIP_RV635)
+ bo->flags &= ~(RADEON_GEM_GTT_WC | RADEON_GEM_GTT_UC);
+
#ifdef CONFIG_X86_32
/* XXX: Write-combined CPU mappings of GTT seem broken on 32-bit
* See https://bugs.freedesktop.org/show_bug.cgi?id=84627
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 021/128] drm/radeon: unconditionally set sysfs_initialized
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (19 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 020/128] drm/radeon: Disable uncacheable CPU mappings of GTT with RV6xx Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 022/128] USB: qcserial: Fix support for HP lt4112 LTE/HSPA+ Gobi 4G Modem Kamal Mostafa
` (106 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit 24dd2f64c5a877392925202321c7c2c46c2b0ddf upstream.
Avoids spew on resume for systems where sysfs may
fail even on init.
bug:
https://bugzilla.kernel.org/show_bug.cgi?id=106851
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon_pm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index fa537c0..5fc27e9 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -1404,8 +1404,7 @@ int radeon_pm_late_init(struct radeon_device *rdev)
ret = device_create_file(rdev->dev, &dev_attr_power_method);
if (ret)
DRM_ERROR("failed to create device file for power method\n");
- if (!ret)
- rdev->pm.sysfs_initialized = true;
+ rdev->pm.sysfs_initialized = true;
}
mutex_lock(&rdev->pm.mutex);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 022/128] USB: qcserial: Fix support for HP lt4112 LTE/HSPA+ Gobi 4G Modem
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (20 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 021/128] drm/radeon: unconditionally set sysfs_initialized Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 023/128] arm64: kernel: pause/unpause function graph tracer in cpu_suspend() Kamal Mostafa
` (105 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Bjørn Mork, Johan Hovold, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>
commit 59536da34513c594af2a6fd35ba65ea45b6960a1 upstream.
The DEVICE_HWI type was added under the faulty assumption that Huawei
devices based on Qualcomm chipsets and firmware use the static USB
interface numbering known from Gobi devices. But this model does
not apply to Huawei devices like the HP branded lt4112 (Huawei me906e).
Huawei firmwares will dynamically assign interface numbers. Functions
are renumbered when the firmware is reconfigured.
Fix by changing the DEVICE_HWI type to use a simplified version
of Huawei's subclass + protocol scheme: Blacklisting known network
interface combinations and assuming the rest are serial.
Reported-and-tested-by: Muri Nicanor <muri+libqmi@immerda.ch>
Tested-by: Martin Hauke <mardnh@gmx.de>
Fixes: e7181d005e84 ("USB: qcserial: Add support for HP lt4112 LTE/HSPA+ Gobi 4G Modem")
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/qcserial.c | 54 +++++++++++++++++++++++++++----------------
1 file changed, 34 insertions(+), 20 deletions(-)
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
index 1d7a2a4..514fa91 100644
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -212,6 +212,10 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
__u8 ifnum;
int altsetting = -1;
+ /* we only support vendor specific functions */
+ if (intf->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC)
+ goto done;
+
nintf = serial->dev->actconfig->desc.bNumInterfaces;
dev_dbg(dev, "Num Interfaces = %d\n", nintf);
ifnum = intf->desc.bInterfaceNumber;
@@ -337,29 +341,39 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
break;
case QCSERIAL_HWI:
/*
- * Huawei layout:
- * 0: AT-capable modem port
- * 1: DM/DIAG
- * 2: AT-capable modem port
- * 3: CCID-compatible PCSC interface
- * 4: QMI/net
- * 5: NMEA
+ * Huawei devices map functions by subclass + protocol
+ * instead of interface numbers. The protocol identify
+ * a specific function, while the subclass indicate a
+ * specific firmware source
+ *
+ * This is a blacklist of functions known to be
+ * non-serial. The rest are assumed to be serial and
+ * will be handled by this driver
*/
- switch (ifnum) {
- case 0:
- case 2:
- dev_dbg(dev, "Modem port found\n");
- break;
- case 1:
- dev_dbg(dev, "DM/DIAG interface found\n");
- break;
- case 5:
- dev_dbg(dev, "NMEA GPS interface found\n");
- break;
- default:
- /* don't claim any unsupported interface */
+ switch (intf->desc.bInterfaceProtocol) {
+ /* QMI combined (qmi_wwan) */
+ case 0x07:
+ case 0x37:
+ case 0x67:
+ /* QMI data (qmi_wwan) */
+ case 0x08:
+ case 0x38:
+ case 0x68:
+ /* QMI control (qmi_wwan) */
+ case 0x09:
+ case 0x39:
+ case 0x69:
+ /* NCM like (huawei_cdc_ncm) */
+ case 0x16:
+ case 0x46:
+ case 0x76:
altsetting = -1;
break;
+ default:
+ dev_dbg(dev, "Huawei type serial port found (%02x/%02x/%02x)\n",
+ intf->desc.bInterfaceClass,
+ intf->desc.bInterfaceSubClass,
+ intf->desc.bInterfaceProtocol);
}
break;
default:
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 023/128] arm64: kernel: pause/unpause function graph tracer in cpu_suspend()
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (21 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 022/128] USB: qcserial: Fix support for HP lt4112 LTE/HSPA+ Gobi 4G Modem Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 024/128] usb: dwc3: gadget: let us set lower max_speed Kamal Mostafa
` (104 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Lorenzo Pieralisi, Will Deacon, Catalin Marinas, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
commit de818bd4522c40ea02a81b387d2fa86f989c9623 upstream.
The function graph tracer adds instrumentation that is required to trace
both entry and exit of a function. In particular the function graph
tracer updates the "return address" of a function in order to insert
a trace callback on function exit.
Kernel power management functions like cpu_suspend() are called
upon power down entry with functions called "finishers" that are in turn
called to trigger the power down sequence but they may not return to the
kernel through the normal return path.
When the core resumes from low-power it returns to the cpu_suspend()
function through the cpu_resume path, which leaves the trace stack frame
set-up by the function tracer in an incosistent state upon return to the
kernel when tracing is enabled.
This patch fixes the issue by pausing/resuming the function graph
tracer on the thread executing cpu_suspend() (ie the function call that
subsequently triggers the "suspend finishers"), so that the function graph
tracer state is kept consistent across functions that enter power down
states and never return by effectively disabling graph tracer while they
are executing.
Fixes: 819e50e25d0c ("arm64: Add ftrace support")
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: 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/suspend.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c
index 2d6b606..23e35de 100644
--- a/arch/arm64/kernel/suspend.c
+++ b/arch/arm64/kernel/suspend.c
@@ -1,3 +1,4 @@
+#include <linux/ftrace.h>
#include <linux/percpu.h>
#include <linux/slab.h>
#include <asm/cacheflush.h>
@@ -92,6 +93,13 @@ int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
local_dbg_save(flags);
/*
+ * Function graph tracer state gets incosistent when the kernel
+ * calls functions that never return (aka suspend finishers) hence
+ * disable graph tracing during their execution.
+ */
+ pause_graph_tracing();
+
+ /*
* mm context saved on the stack, it will be restored when
* the cpu comes out of reset through the identity mapped
* page tables, so that the thread address space is properly
@@ -128,6 +136,8 @@ int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
hw_breakpoint_restore(NULL);
}
+ unpause_graph_tracing();
+
/*
* Restore pstate flags. OS lock and mdscr have been already
* restored, so from this point onwards, debugging is fully
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 024/128] usb: dwc3: gadget: let us set lower max_speed
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (22 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 023/128] arm64: kernel: pause/unpause function graph tracer in cpu_suspend() Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 025/128] usb: chipidea: debug: disable usb irq while role switch Kamal Mostafa
` (103 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ben McCauley, Felipe Balbi, Luis Henriques, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben McCauley <ben.mccauley@garmin.com>
commit b9e51b2b1fda19143f48d182ed7a2943f21e1ae4 upstream.
In some SoCs, dwc3 is implemented as a USB2.0 only
core, meaning that it can't ever achieve SuperSpeed.
Currect driver always sets gadget.max_speed to
USB_SPEED_SUPER unconditionally. This can causes
issues to some Host stacks where the host will issue
a GetBOS() request and we will reply with a BOS
containing Superspeed Capability Descriptor.
At least Windows seems to be upset by this fact and
prints a warning that we should connect $this device
to another port.
[ balbi@ti.com : rewrote entire commit, including
source code comment to make a lot clearer what the
problem is ]
Signed-off-by: Ben McCauley <ben.mccauley@garmin.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[ luis: backported to 3.16:
- used dev_vdbg() instead of dwc3_trace() ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/dwc3/gadget.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 5496218..65c8791 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2707,12 +2707,33 @@ int dwc3_gadget_init(struct dwc3 *dwc)
}
dwc->gadget.ops = &dwc3_gadget_ops;
- dwc->gadget.max_speed = USB_SPEED_SUPER;
dwc->gadget.speed = USB_SPEED_UNKNOWN;
dwc->gadget.sg_supported = true;
dwc->gadget.name = "dwc3-gadget";
/*
+ * FIXME We might be setting max_speed to <SUPER, however versions
+ * <2.20a of dwc3 have an issue with metastability (documented
+ * elsewhere in this driver) which tells us we can't set max speed to
+ * anything lower than SUPER.
+ *
+ * Because gadget.max_speed is only used by composite.c and function
+ * drivers (i.e. it won't go into dwc3's registers) we are allowing this
+ * to happen so we avoid sending SuperSpeed Capability descriptor
+ * together with our BOS descriptor as that could confuse host into
+ * thinking we can handle super speed.
+ *
+ * Note that, in fact, we won't even support GetBOS requests when speed
+ * is less than super speed because we don't have means, yet, to tell
+ * composite.c that we are USB 2.0 + LPM ECN.
+ */
+ if (dwc->revision < DWC3_REVISION_220A)
+ dev_vdbg(dwc->dev, "Changing max_speed on rev %08x\n",
+ dwc->revision);
+
+ dwc->gadget.max_speed = dwc->maximum_speed;
+
+ /*
* Per databook, DWC3 needs buffer size to be aligned to MaxPacketSize
* on ep out.
*/
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 025/128] usb: chipidea: debug: disable usb irq while role switch
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (23 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 024/128] usb: dwc3: gadget: let us set lower max_speed Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 026/128] xhci: Workaround to get Intel xHCI reset working more reliably Kamal Mostafa
` (102 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Li Jun, Peter Chen, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Jun <jun.li@freescale.com>
commit 251b3c8b57481bcecd3f753108e36e7389ce12ac upstream.
Since the ci->role will be set after the host role start is complete, there
will be nobody cared irq during start host if usb irq enabled. This error
can be reproduced on i.mx6 sololite EVK board by:
1. disable otg id irq(IDIE) and disable all real otg properties of usbotg1
in dts.
2. boot up the board with ID cable and usb device connected.
3. echo gadget > /sys/kernel/debug/ci_hdrc.0/role
4. echo host > /sys/kernel/debug/ci_hdrc.0/role
5. irq 212: nobody cared.
Signed-off-by: Li Jun <jun.li@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/chipidea/debug.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c
index 268e423..cc29dc2 100644
--- a/drivers/usb/chipidea/debug.c
+++ b/drivers/usb/chipidea/debug.c
@@ -312,8 +312,10 @@ static ssize_t ci_role_write(struct file *file, const char __user *ubuf,
if (role == CI_ROLE_END || role == ci->role)
return -EINVAL;
+ disable_irq(ci->irq);
ci_role_stop(ci);
ret = ci_role_start(ci, role);
+ enable_irq(ci->irq);
return ret ? ret : count;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 026/128] xhci: Workaround to get Intel xHCI reset working more reliably
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (24 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 025/128] usb: chipidea: debug: disable usb irq while role switch Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 027/128] xhci: Fix a race in usb2 LPM resume, blocking U3 for usb2 devices Kamal Mostafa
` (101 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Rajmohan Mani, Mathias Nyman, Greg Kroah-Hartman, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Rajmohan Mani <rajmohan.mani@intel.com>
commit a5964396190d0c40dd549c23848c282fffa5d1f2 upstream.
Existing Intel xHCI controllers require a delay of 1 mS,
after setting the CMD_RESET bit in command register, before
accessing any HC registers. This allows the HC to complete
the reset operation and be ready for HC register access.
Without this delay, the subsequent HC register access,
may result in a system hang, very rarely.
Verified CherryView / Braswell platforms go through over
5000 warm reboot cycles (which was not possible without
this patch), without any xHCI reset hang.
Signed-off-by: Rajmohan Mani <rajmohan.mani@intel.com>
Tested-by: Joe Lawrence <joe.lawrence@stratus.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/host/xhci.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 0612a5b..6358446 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -176,6 +176,16 @@ int xhci_reset(struct xhci_hcd *xhci)
command |= CMD_RESET;
writel(command, &xhci->op_regs->command);
+ /* Existing Intel xHCI controllers require a delay of 1 mS,
+ * after setting the CMD_RESET bit, and before accessing any
+ * HC registers. This allows the HC to complete the
+ * reset operation and be ready for HC register access.
+ * Without this delay, the subsequent HC register access,
+ * may result in a system hang very rarely.
+ */
+ if (xhci->quirks & XHCI_INTEL_HOST)
+ udelay(1000);
+
ret = xhci_handshake(xhci, &xhci->op_regs->command,
CMD_RESET, 0, 10 * 1000 * 1000);
if (ret)
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 027/128] xhci: Fix a race in usb2 LPM resume, blocking U3 for usb2 devices
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (25 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 026/128] xhci: Workaround to get Intel xHCI reset working more reliably Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 028/128] x86/cpu: Fix SMAP check in PVOPS environments Kamal Mostafa
` (100 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mathias Nyman, Greg Kroah-Hartman, Luis Henriques, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Nyman <mathias.nyman@linux.intel.com>
commit dad67d5f3d0efe01d38c6cebcb6698280e51927b upstream.
Clear device initiated resume variables once device is fully up and running
in U0 state.
Resume needs to be signaled for 20ms for usb2 devices before they can be
moved to U0 state.
An interrupt is triggered if a device initiates resume. As we handle the
event in interrupt context we can not sleep for 20ms, so we instead set
a resume flag, a timestamp, and start the roothub polling.
The roothub code will later move the port to U0 when it finds a port in
resume state with the resume flag set, and timestamp passed by 20ms.
A host initiated resume is however not done in interrupt context, and
host initiated resume code will directly signal resume, wait 20ms and then
move the port to U0.
These two codepaths can race, if we are in the middle of a host initated
resume, while sleeping for 20ms, we may handle a port event and find the
port in resume state. The port event handling code will assume the resume
was device initiated and set the resume flag and timestamp.
Root hub code will however not catch the port in resume state again as the
host initated resume code has already moved the port to U0.
The resume flag and timestamp will remain set for this port preventing port
from suspending again (LPM setting port to U3)
Fix this for now by always clearing the device initated resume parameters
once port is in U0
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/host/xhci-hub.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index ee07ba4..d8b7b11 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -665,12 +665,15 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd,
status |= USB_PORT_STAT_SUSPEND;
}
}
- if ((raw_port_status & PORT_PLS_MASK) == XDEV_U0
- && (raw_port_status & PORT_POWER)
- && (bus_state->suspended_ports & (1 << wIndex))) {
- bus_state->suspended_ports &= ~(1 << wIndex);
- if (hcd->speed != HCD_USB3)
- bus_state->port_c_suspend |= 1 << wIndex;
+ if ((raw_port_status & PORT_PLS_MASK) == XDEV_U0 &&
+ (raw_port_status & PORT_POWER)) {
+ if (bus_state->suspended_ports & (1 << wIndex)) {
+ bus_state->suspended_ports &= ~(1 << wIndex);
+ if (hcd->speed != HCD_USB3)
+ bus_state->port_c_suspend |= 1 << wIndex;
+ }
+ bus_state->resume_done[wIndex] = 0;
+ clear_bit(wIndex, &bus_state->resuming_ports);
}
if (raw_port_status & PORT_CONNECT) {
status |= USB_PORT_STAT_CONNECTION;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 028/128] x86/cpu: Fix SMAP check in PVOPS environments
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (26 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 027/128] xhci: Fix a race in usb2 LPM resume, blocking U3 for usb2 devices Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 029/128] arm64: restore bogomips information in /proc/cpuinfo Kamal Mostafa
` (99 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andrew Cooper, Rusty Russell, Konrad Rzeszutek Wilk,
Boris Ostrovsky, lguest, Xen-devel, Thomas Gleixner,
Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Cooper <andrew.cooper3@citrix.com>
commit 581b7f158fe0383b492acd1ce3fb4e99d4e57808 upstream.
There appears to be no formal statement of what pv_irq_ops.save_fl() is
supposed to return precisely. Native returns the full flags, while lguest and
Xen only return the Interrupt Flag, and both have comments by the
implementations stating that only the Interrupt Flag is looked at. This may
have been true when initially implemented, but no longer is.
To make matters worse, the Xen PVOP leaves the upper bits undefined, making
the BUG_ON() undefined behaviour. Experimentally, this now trips for 32bit PV
guests on Broadwell hardware. The BUG_ON() is consistent for an individual
build, but not consistent for all builds. It has also been a sitting timebomb
since SMAP support was introduced.
Use native_save_fl() instead, which will obtain an accurate view of the AC
flag.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Tested-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: <lguest@lists.ozlabs.org>
Cc: Xen-devel <xen-devel@lists.xen.org>
Link: http://lkml.kernel.org/r/1433323874-6927-1-git-send-email-andrew.cooper3@citrix.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kernel/cpu/common.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 382a097..547ba45 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -290,10 +290,9 @@ __setup("nosmap", setup_disable_smap);
static __always_inline void setup_smap(struct cpuinfo_x86 *c)
{
- unsigned long eflags;
+ unsigned long eflags = native_save_fl();
/* This should have been cleared long ago */
- raw_local_save_flags(eflags);
BUG_ON(eflags & X86_EFLAGS_AC);
if (cpu_has(c, X86_FEATURE_SMAP)) {
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 029/128] arm64: restore bogomips information in /proc/cpuinfo
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (27 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 028/128] x86/cpu: Fix SMAP check in PVOPS environments Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 030/128] USB: option: add XS Stick W100-2 from 4G Systems Kamal Mostafa
` (98 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Yang Shi, Catalin Marinas, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Shi <yang.shi@linaro.org>
commit 92e788b749862ebe9920360513a718e5dd4da7a9 upstream.
As previously reported, some userspace applications depend on bogomips
showed by /proc/cpuinfo. Although there is much less legacy impact on
aarch64 than arm, it does break libvirt.
This patch reverts commit 326b16db9f69 ("arm64: delay: don't bother
reporting bogomips in /proc/cpuinfo"), but with some tweak due to
context change and without the pr_info().
Fixes: 326b16db9f69 ("arm64: delay: don't bother reporting bogomips in /proc/cpuinfo")
Signed-off-by: Yang Shi <yang.shi@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
[ kamal: backport to 3.19-stable: applies to setup.c; context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm64/kernel/setup.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 79fedd8d..386acb8 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -520,6 +520,9 @@ static int c_show(struct seq_file *m, void *v)
#ifdef CONFIG_SMP
seq_printf(m, "processor\t: %d\n", i);
#endif
+ seq_printf(m, "BogoMIPS\t: %lu.%02lu\n\n",
+ loops_per_jiffy / (500000UL/HZ),
+ loops_per_jiffy / (5000UL/HZ) % 100);
/*
* Dump out the common processor features in a single line.
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 030/128] USB: option: add XS Stick W100-2 from 4G Systems
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (28 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 029/128] arm64: restore bogomips information in /proc/cpuinfo Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 031/128] usblp: do not set TASK_INTERRUPTIBLE before lock Kamal Mostafa
` (97 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Bjørn Mork, Greg Kroah-Hartman, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>
commit 638148e20c7f8f6e95017fdc13bce8549a6925e0 upstream.
Thomas reports
"
4gsystems sells two total different LTE-surfsticks under the same name.
..
The newer version of XS Stick W100 is from "omega"
..
Under windows the driver switches to the same ID, and uses MI03\6 for
network and MI01\6 for modem.
..
echo "1c9e 9b01" > /sys/bus/usb/drivers/qmi_wwan/new_id
echo "1c9e 9b01" > /sys/bus/usb-serial/drivers/option1/new_id
T: Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 4 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1c9e ProdID=9b01 Rev=02.32
S: Manufacturer=USB Modem
S: Product=USB Modem
S: SerialNumber=
C: #Ifs= 5 Cfg#= 1 Atr=80 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I: If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
I: If#= 4 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
Now all important things are there:
wwp0s29f7u2i3 (net), ttyUSB2 (at), cdc-wdm0 (qmi), ttyUSB1 (at)
There is also ttyUSB0, but it is not usable, at least not for at.
The device works well with qmi and ModemManager-NetworkManager.
"
Reported-by: Thomas Schäfer <tschaefer@t-online.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/serial/option.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index a7a0156..1d7f007 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -358,6 +358,7 @@ static void option_instat_callback(struct urb *urb);
/* This is the 4G XS Stick W14 a.k.a. Mobilcom Debitel Surf-Stick *
* It seems to contain a Qualcomm QSC6240/6290 chipset */
#define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603
+#define FOUR_G_SYSTEMS_PRODUCT_W100 0x9b01
/* iBall 3.5G connect wireless modem */
#define IBALL_3_5G_CONNECT 0x9605
@@ -531,6 +532,11 @@ static const struct option_blacklist_info four_g_w14_blacklist = {
.sendsetup = BIT(0) | BIT(1),
};
+static const struct option_blacklist_info four_g_w100_blacklist = {
+ .sendsetup = BIT(1) | BIT(2),
+ .reserved = BIT(3),
+};
+
static const struct option_blacklist_info alcatel_x200_blacklist = {
.sendsetup = BIT(0) | BIT(1),
.reserved = BIT(4),
@@ -1663,6 +1669,9 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14),
.driver_info = (kernel_ulong_t)&four_g_w14_blacklist
},
+ { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W100),
+ .driver_info = (kernel_ulong_t)&four_g_w100_blacklist
+ },
{ USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, SPEEDUP_PRODUCT_SU9800, 0xff) },
{ USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) },
{ USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) },
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 031/128] usblp: do not set TASK_INTERRUPTIBLE before lock
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (29 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 030/128] USB: option: add XS Stick W100-2 from 4G Systems Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 032/128] fat: fix fake_offset handling on error path Kamal Mostafa
` (96 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jiri Slaby, Greg Kroah-Hartman, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Slaby <jslaby@suse.cz>
commit 19cd80a214821f4b558560ebd76bfb2c38b4f3d8 upstream.
It is not permitted to set task state before lock. usblp_wwait sets
the state to TASK_INTERRUPTIBLE and calls mutex_lock_interruptible.
Upon return from that function, the state will be TASK_RUNNING again.
This is clearly a bug and a warning is generated with LOCKDEP too:
WARNING: CPU: 1 PID: 5109 at kernel/sched/core.c:7404 __might_sleep+0x7d/0x90()
do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffffa0c588d0>] usblp_wwait+0xa0/0x310 [usblp]
Modules linked in: ...
CPU: 1 PID: 5109 Comm: captmon Tainted: G W 4.2.5-0.gef2823b-default #1
Hardware name: LENOVO 23252SG/23252SG, BIOS G2ET33WW (1.13 ) 07/24/2012
ffffffff81a4edce ffff880236ec7ba8 ffffffff81716651 0000000000000000
ffff880236ec7bf8 ffff880236ec7be8 ffffffff8106e146 0000000000000282
ffffffff81a50119 000000000000028b 0000000000000000 ffff8802dab7c508
Call Trace:
...
[<ffffffff8106e1c6>] warn_slowpath_fmt+0x46/0x50
[<ffffffff8109a8bd>] __might_sleep+0x7d/0x90
[<ffffffff8171b20f>] mutex_lock_interruptible_nested+0x2f/0x4b0
[<ffffffffa0c588fc>] usblp_wwait+0xcc/0x310 [usblp]
[<ffffffffa0c58bb2>] usblp_write+0x72/0x350 [usblp]
[<ffffffff8121ed98>] __vfs_write+0x28/0xf0
...
Commit 7f477358e2384c54b190cc3b6ce28277050a041b (usblp: Implement the
ENOSPC convention) moved the set prior locking. So move it back after
the lock.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Fixes: 7f477358e2 ("usblp: Implement the ENOSPC convention")
Acked-By: Pete Zaitcev <zaitcev@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/class/usblp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 0924ee4..b9adc2e 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -869,11 +869,11 @@ static int usblp_wwait(struct usblp *usblp, int nonblock)
add_wait_queue(&usblp->wwait, &waita);
for (;;) {
- set_current_state(TASK_INTERRUPTIBLE);
if (mutex_lock_interruptible(&usblp->mut)) {
rc = -EINTR;
break;
}
+ set_current_state(TASK_INTERRUPTIBLE);
rc = usblp_wtest(usblp, nonblock);
mutex_unlock(&usblp->mut);
if (rc <= 0)
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 032/128] fat: fix fake_offset handling on error path
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (30 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 031/128] usblp: do not set TASK_INTERRUPTIBLE before lock Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 033/128] kernel/signal.c: unexport sigsuspend() Kamal Mostafa
` (95 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Richard Weinberger, OGAWA Hirofumi, Andrew Morton, Linus Torvalds,
Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
commit 928a477102c4fc6739883415b66987207e3502f4 upstream.
For the root directory, . and .. are faked (using dir_emit_dots()) and
ctx->pos is reset from 2 to 0.
A corrupted root directory could cause fat_get_entry() to fail, but
->iterate() (fat_readdir()) reports progress to the VFS (with ctx->pos
rewound to 0), so any following calls to ->iterate() continue to return
the same entries again and again.
The result is that userspace will never see the end of the directory,
causing e.g. 'ls' to hang in a getdents() loop.
[hirofumi@mail.parknet.co.jp: cleanup and make sure to correct fake_offset]
Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Tested-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Richard Weinberger <richard.weinberger@gmail.com>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/fat/dir.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/fs/fat/dir.c b/fs/fat/dir.c
index c5d6bb9..eeda31c 100644
--- a/fs/fat/dir.c
+++ b/fs/fat/dir.c
@@ -614,9 +614,9 @@ parse_record:
int status = fat_parse_long(inode, &cpos, &bh, &de,
&unicode, &nr_slots);
if (status < 0) {
- ctx->pos = cpos;
+ bh = NULL;
ret = status;
- goto out;
+ goto end_of_dir;
} else if (status == PARSE_INVALID)
goto record_end;
else if (status == PARSE_NOT_LONGNAME)
@@ -658,8 +658,9 @@ parse_record:
fill_len = short_len;
start_filldir:
- if (!fake_offset)
- ctx->pos = cpos - (nr_slots + 1) * sizeof(struct msdos_dir_entry);
+ ctx->pos = cpos - (nr_slots + 1) * sizeof(struct msdos_dir_entry);
+ if (fake_offset && ctx->pos < 2)
+ ctx->pos = 2;
if (!memcmp(de->name, MSDOS_DOT, MSDOS_NAME)) {
if (!dir_emit_dot(file, ctx))
@@ -685,14 +686,19 @@ record_end:
fake_offset = 0;
ctx->pos = cpos;
goto get_new;
+
end_of_dir:
- ctx->pos = cpos;
+ if (fake_offset && cpos < 2)
+ ctx->pos = 2;
+ else
+ ctx->pos = cpos;
fill_failed:
brelse(bh);
if (unicode)
__putname(unicode);
out:
mutex_unlock(&sbi->s_lock);
+
return ret;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 033/128] kernel/signal.c: unexport sigsuspend()
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (31 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 032/128] fat: fix fake_offset handling on error path Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 034/128] ocfs2: fix umask ignored issue Kamal Mostafa
` (94 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Richard Weinberger, Andrew Morton, Linus Torvalds, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Weinberger <richard@nod.at>
commit 9d8a765211335cfdad464b90fb19f546af5706ae upstream.
sigsuspend() is nowhere used except in signal.c itself, so we can mark it
static do not pollute the global namespace.
But this patch is more than a boring cleanup patch, it fixes a real issue
on UserModeLinux. UML has a special console driver to display ttys using
xterm, or other terminal emulators, on the host side. Vegard reported
that sometimes UML is unable to spawn a xterm and he's facing the
following warning:
WARNING: CPU: 0 PID: 908 at include/linux/thread_info.h:128 sigsuspend+0xab/0xc0()
It turned out that this warning makes absolutely no sense as the UML
xterm code calls sigsuspend() on the host side, at least it tries. But
as the kernel itself offers a sigsuspend() symbol the linker choose this
one instead of the glibc wrapper. Interestingly this code used to work
since ever but always blocked signals on the wrong side. Some recent
kernel change made the WARN_ON() trigger and uncovered the bug.
It is a wonderful example of how much works by chance on computers. :-)
Fixes: 68f3f16d9ad0f1 ("new helper: sigsuspend()")
Signed-off-by: Richard Weinberger <richard@nod.at>
Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Tested-by: Vegard Nossum <vegard.nossum@oracle.com>
Acked-by: Oleg Nesterov <oleg@redhat.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/signal.h | 1 -
kernel/signal.c | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/linux/signal.h b/include/linux/signal.h
index ab1e039..92557bb 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -239,7 +239,6 @@ extern int sigprocmask(int, sigset_t *, sigset_t *);
extern void set_current_blocked(sigset_t *);
extern void __set_current_blocked(const sigset_t *);
extern int show_unhandled_signals;
-extern int sigsuspend(sigset_t *);
struct sigaction {
#ifndef __ARCH_HAS_IRIX_SIGACTION
diff --git a/kernel/signal.c b/kernel/signal.c
index 16a3052..c4dc622 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -3558,7 +3558,7 @@ SYSCALL_DEFINE0(pause)
#endif
-int sigsuspend(sigset_t *set)
+static int sigsuspend(sigset_t *set)
{
current->saved_sigmask = current->blocked;
set_current_blocked(set);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 034/128] ocfs2: fix umask ignored issue
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (32 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 033/128] kernel/signal.c: unexport sigsuspend() Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 035/128] tty: Fix tty_send_xchar() lock order inversion Kamal Mostafa
` (93 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Junxiao Bi, Gang He, Mark Fasheh, Joel Becker, Andrew Morton,
Linus Torvalds, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Junxiao Bi <junxiao.bi@oracle.com>
commit 8f1eb48758aacf6c1ffce18179295adbf3bd7640 upstream.
New created file's mode is not masked with umask, and this makes umask not
work for ocfs2 volume.
Fixes: 702e5bc ("ocfs2: use generic posix ACL infrastructure")
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Gang He <ghe@suse.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/ocfs2/namei.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index 914c121..9fc1dae 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -361,6 +361,8 @@ static int ocfs2_mknod(struct inode *dir,
mlog_errno(status);
goto leave;
}
+ /* update inode->i_mode after mask with "umask". */
+ inode->i_mode = mode;
handle = ocfs2_start_trans(osb, ocfs2_mknod_credits(osb->sb,
S_ISDIR(mode),
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 035/128] tty: Fix tty_send_xchar() lock order inversion
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (33 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 034/128] ocfs2: fix umask ignored issue Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 036/128] parisc: Drop unused MADV_xxxK_PAGES flags from asm/mman.h Kamal Mostafa
` (92 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Peter Hurley, Greg Kroah-Hartman, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Hurley <peter@hurleysoftware.com>
commit ee0c1a65cf95230d5eb3d9de94fd2ead9a428c67 upstream.
The correct lock order is atomic_write_lock => termios_rwsem, as
established by tty_write() => n_tty_write().
Fixes: c274f6ef1c666 ("tty: Hold termios_rwsem for tcflow(TCIxxx)")
Reported-and-Tested-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/tty/tty_io.c | 4 ++++
drivers/tty/tty_ioctl.c | 4 ----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 27051e29..cc7b224 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1281,18 +1281,22 @@ int tty_send_xchar(struct tty_struct *tty, char ch)
int was_stopped = tty->stopped;
if (tty->ops->send_xchar) {
+ down_read(&tty->termios_rwsem);
tty->ops->send_xchar(tty, ch);
+ up_read(&tty->termios_rwsem);
return 0;
}
if (tty_write_lock(tty, 0) < 0)
return -ERESTARTSYS;
+ down_read(&tty->termios_rwsem);
if (was_stopped)
start_tty(tty);
tty->ops->write(tty, &ch, 1);
if (was_stopped)
stop_tty(tty);
+ up_read(&tty->termios_rwsem);
tty_write_unlock(tty);
return 0;
}
diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
index 552076b..a9fe807 100644
--- a/drivers/tty/tty_ioctl.c
+++ b/drivers/tty/tty_ioctl.c
@@ -1144,16 +1144,12 @@ int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
spin_unlock_irq(&tty->flow_lock);
break;
case TCIOFF:
- down_read(&tty->termios_rwsem);
if (STOP_CHAR(tty) != __DISABLED_CHAR)
retval = tty_send_xchar(tty, STOP_CHAR(tty));
- up_read(&tty->termios_rwsem);
break;
case TCION:
- down_read(&tty->termios_rwsem);
if (START_CHAR(tty) != __DISABLED_CHAR)
retval = tty_send_xchar(tty, START_CHAR(tty));
- up_read(&tty->termios_rwsem);
break;
default:
return -EINVAL;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 036/128] parisc: Drop unused MADV_xxxK_PAGES flags from asm/mman.h
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (34 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 035/128] tty: Fix tty_send_xchar() lock order inversion Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 037/128] mmc: remove bondage between REQ_META and reliable write Kamal Mostafa
` (91 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Helge Deller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <deller@gmx.de>
commit dcbf0d299c00ed4f82ea8d6e359ad88a5182f9b8 upstream.
Drop the MADV_xxK_PAGES flags, which were never used and were from a proposed
API which was never integrated into the generic Linux kernel code.
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/parisc/include/uapi/asm/mman.h | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/arch/parisc/include/uapi/asm/mman.h b/arch/parisc/include/uapi/asm/mman.h
index 294d251..2ae13ce5 100644
--- a/arch/parisc/include/uapi/asm/mman.h
+++ b/arch/parisc/include/uapi/asm/mman.h
@@ -46,16 +46,6 @@
#define MADV_DONTFORK 10 /* don't inherit across fork */
#define MADV_DOFORK 11 /* do inherit across fork */
-/* The range 12-64 is reserved for page size specification. */
-#define MADV_4K_PAGES 12 /* Use 4K pages */
-#define MADV_16K_PAGES 14 /* Use 16K pages */
-#define MADV_64K_PAGES 16 /* Use 64K pages */
-#define MADV_256K_PAGES 18 /* Use 256K pages */
-#define MADV_1M_PAGES 20 /* Use 1 Megabyte pages */
-#define MADV_4M_PAGES 22 /* Use 4 Megabyte pages */
-#define MADV_16M_PAGES 24 /* Use 16 Megabyte pages */
-#define MADV_64M_PAGES 26 /* Use 64 Megabyte pages */
-
#define MADV_MERGEABLE 65 /* KSM may merge identical pages */
#define MADV_UNMERGEABLE 66 /* KSM may not merge identical pages */
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 037/128] mmc: remove bondage between REQ_META and reliable write
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (35 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 036/128] parisc: Drop unused MADV_xxxK_PAGES flags from asm/mman.h Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 038/128] tools/net: Use include/uapi with __EXPORTED_HEADERS__ Kamal Mostafa
` (90 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Bruce Ford, Luca Porzio, Ulf Hansson, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Luca Porzio <lporzio@micron.com>
commit d3df0465db00cf4ed9f90d0bfc3b827d32b9c796 upstream.
Anytime a write operation is performed with Reliable Write flag enabled,
the eMMC device is enforced to bypass the cache and do a write to the
underling NVM device by Jedec specification; this causes a performance
penalty since write operations can't be optimized by the device cache.
In our tests, we replayed a typical mobile daily trace pattern and found
~9% overall time reduction in trace replay by using this patch. Also the
write ops within 4KB~64KB chunk size range get a 40~60% performance
improvement by using the patch (as this range of write chunks are the ones
affected by REQ_META).
This patch has been discussed in the Mobile & Embedded Linux Storage Forum
and it's the results of feedbacks from many people. We also checked with
fsdevl and f2fs mailing list developers that this change in the usage of
REQ_META is not affecting FS behavior and we got positive feedbacks.
Reporting here the feedbacks:
http://comments.gmane.org/gmane.linux.file-systems/97219
http://thread.gmane.org/gmane.linux.file-systems.f2fs/3178/focus=3183
Signed-off-by: Bruce Ford <bford@micron.com>
Signed-off-by: Luca Porzio <lporzio@micron.com>
Fixes: ce39f9d17c14 ("mmc: support packed write command for eMMC4.5 devices")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mmc/card/block.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 28fb2ed..d1e2d3b 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -62,8 +62,7 @@ MODULE_ALIAS("mmc:block");
#define MMC_SANITIZE_REQ_TIMEOUT 240000
#define MMC_EXTRACT_INDEX_FROM_ARG(x) ((x & 0x00FF0000) >> 16)
-#define mmc_req_rel_wr(req) (((req->cmd_flags & REQ_FUA) || \
- (req->cmd_flags & REQ_META)) && \
+#define mmc_req_rel_wr(req) ((req->cmd_flags & REQ_FUA) && \
(rq_data_dir(req) == WRITE))
#define PACKED_CMD_VER 0x01
#define PACKED_CMD_WR 0x02
@@ -1367,13 +1366,9 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
/*
* Reliable writes are used to implement Forced Unit Access and
- * REQ_META accesses, and are supported only on MMCs.
- *
- * XXX: this really needs a good explanation of why REQ_META
- * is treated special.
+ * are supported only on MMCs.
*/
- bool do_rel_wr = ((req->cmd_flags & REQ_FUA) ||
- (req->cmd_flags & REQ_META)) &&
+ bool do_rel_wr = (req->cmd_flags & REQ_FUA) &&
(rq_data_dir(req) == WRITE) &&
(md->flags & MMC_BLK_REL_WR);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 038/128] tools/net: Use include/uapi with __EXPORTED_HEADERS__
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (36 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 037/128] mmc: remove bondage between REQ_META and reliable write Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 039/128] packet: do skb_probe_transport_header when we actually have data Kamal Mostafa
` (89 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Kamal Mostafa <kamal@canonical.com>
commit d7475de58575c904818efa369c82e88c6648ce2e upstream.
Use the local uapi headers to keep in sync with "recently" added #define's
(e.g. SKF_AD_VLAN_TPID). Refactored CFLAGS, and bpf_asm doesn't need -I.
Fixes: 3f356385e8a4 ("filter: bpf_asm: add minimal bpf asm tool")
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
tools/net/Makefile | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tools/net/Makefile b/tools/net/Makefile
index ee577ea..ddf8880 100644
--- a/tools/net/Makefile
+++ b/tools/net/Makefile
@@ -4,6 +4,9 @@ CC = gcc
LEX = flex
YACC = bison
+CFLAGS += -Wall -O2
+CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include
+
%.yacc.c: %.y
$(YACC) -o $@ -d $<
@@ -12,15 +15,13 @@ YACC = bison
all : bpf_jit_disasm bpf_dbg bpf_asm
-bpf_jit_disasm : CFLAGS = -Wall -O2 -DPACKAGE='bpf_jit_disasm'
+bpf_jit_disasm : CFLAGS += -DPACKAGE='bpf_jit_disasm'
bpf_jit_disasm : LDLIBS = -lopcodes -lbfd -ldl
bpf_jit_disasm : bpf_jit_disasm.o
-bpf_dbg : CFLAGS = -Wall -O2
bpf_dbg : LDLIBS = -lreadline
bpf_dbg : bpf_dbg.o
-bpf_asm : CFLAGS = -Wall -O2 -I.
bpf_asm : LDLIBS =
bpf_asm : bpf_asm.o bpf_exp.yacc.o bpf_exp.lex.o
bpf_exp.lex.o : bpf_exp.yacc.c
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 039/128] packet: do skb_probe_transport_header when we actually have data
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (37 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 038/128] tools/net: Use include/uapi with __EXPORTED_HEADERS__ Kamal Mostafa
@ 2015-12-16 17:37 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 040/128] sctp: translate host order to network order when setting a hmacid Kamal Mostafa
` (88 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:37 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Daniel Borkmann, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <daniel@iogearbox.net>
commit efdfa2f7848f64517008136fb41f53c4a1faf93a upstream.
In tpacket_fill_skb() commit c1aad275b029 ("packet: set transport
header before doing xmit") and later on 40893fd0fd4e ("net: switch
to use skb_probe_transport_header()") was probing for a transport
header on the skb from a ring buffer slot, but at a time, where
the skb has _not even_ been filled with data yet. So that call into
the flow dissector is pretty useless. Lets do it after we've set
up the skb frags.
Fixes: c1aad275b029 ("packet: set transport header before doing xmit")
Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/packet/af_packet.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index ca5c040..aab5c0a 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2132,8 +2132,6 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
skb_reserve(skb, hlen);
skb_reset_network_header(skb);
- if (!packet_use_direct_xmit(po))
- skb_probe_transport_header(skb, 0);
if (unlikely(po->tp_tx_has_off)) {
int off_min, off_max, off;
off_min = po->tp_hdrlen - sizeof(struct sockaddr_ll);
@@ -2213,6 +2211,9 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
len = ((to_write > len_max) ? len_max : to_write);
}
+ if (!packet_use_direct_xmit(po))
+ skb_probe_transport_header(skb, 0);
+
return tp_len;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 040/128] sctp: translate host order to network order when setting a hmacid
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (38 preceding siblings ...)
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 039/128] packet: do skb_probe_transport_header when we actually have data Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 041/128] usb: musb: core: fix order of arguments to ulpi write callback Kamal Mostafa
` (87 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Xin Long, Marcelo Ricardo Leitner, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: lucien <lucien.xin@gmail.com>
commit ed5a377d87dc4c87fb3e1f7f698cba38cd893103 upstream.
now sctp auth cannot work well when setting a hmacid manually, which
is caused by that we didn't use the network order for hmacid, so fix
it by adding the transformation in sctp_auth_ep_set_hmacs.
even we set hmacid with the network order in userspace, it still
can't work, because of this condition in sctp_auth_ep_set_hmacs():
if (id > SCTP_AUTH_HMAC_ID_MAX)
return -EOPNOTSUPP;
so this wasn't working before and thus it won't break compatibility.
Fixes: 65b07e5d0d09 ("[SCTP]: API updates to suport SCTP-AUTH extensions.")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/sctp/auth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/sctp/auth.c b/net/sctp/auth.c
index fb7976a..603c3bb 100644
--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -800,8 +800,8 @@ int sctp_auth_ep_set_hmacs(struct sctp_endpoint *ep,
if (!has_sha1)
return -EINVAL;
- memcpy(ep->auth_hmacs_list->hmac_ids, &hmacs->shmac_idents[0],
- hmacs->shmac_num_idents * sizeof(__u16));
+ for (i = 0; i < hmacs->shmac_num_idents; i++)
+ ep->auth_hmacs_list->hmac_ids[i] = htons(hmacs->shmac_idents[i]);
ep->auth_hmacs_list->param_hdr.length = htons(sizeof(sctp_paramhdr_t) +
hmacs->shmac_num_idents * sizeof(__u16));
return 0;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 041/128] usb: musb: core: fix order of arguments to ulpi write callback
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (39 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 040/128] sctp: translate host order to network order when setting a hmacid Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 042/128] FS-Cache: Add missing initialization of ret in cachefiles_write_page() Kamal Mostafa
` (86 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Uwe Kleine-König, Felipe Balbi, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
commit 705e63d2b29c8bbf091119084544d353bda70393 upstream.
There is a bit of a mess in the order of arguments to the ulpi write
callback. There is
int ulpi_write(struct ulpi *ulpi, u8 addr, u8 val)
in drivers/usb/common/ulpi.c;
struct usb_phy_io_ops {
...
int (*write)(struct usb_phy *x, u32 val, u32 reg);
}
in include/linux/usb/phy.h.
The callback registered by the musb driver has to comply to the latter,
but up to now had "offset" first which effectively made the function
broken for correct users. So flip the order and while at it also
switch to the parameter names of struct usb_phy_io_ops's write.
Fixes: ffb865b1e460 ("usb: musb: add ulpi access operations")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/musb/musb_core.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index f6cd868..4dd0370 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -132,7 +132,7 @@ static inline struct musb *dev_to_musb(struct device *dev)
/*-------------------------------------------------------------------------*/
#ifndef CONFIG_BLACKFIN
-static int musb_ulpi_read(struct usb_phy *phy, u32 offset)
+static int musb_ulpi_read(struct usb_phy *phy, u32 reg)
{
void __iomem *addr = phy->io_priv;
int i = 0;
@@ -151,7 +151,7 @@ static int musb_ulpi_read(struct usb_phy *phy, u32 offset)
* ULPICarKitControlDisableUTMI after clearing POWER_SUSPENDM.
*/
- musb_writeb(addr, MUSB_ULPI_REG_ADDR, (u8)offset);
+ musb_writeb(addr, MUSB_ULPI_REG_ADDR, (u8)reg);
musb_writeb(addr, MUSB_ULPI_REG_CONTROL,
MUSB_ULPI_REG_REQ | MUSB_ULPI_RDN_WR);
@@ -176,7 +176,7 @@ out:
return ret;
}
-static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data)
+static int musb_ulpi_write(struct usb_phy *phy, u32 val, u32 reg)
{
void __iomem *addr = phy->io_priv;
int i = 0;
@@ -191,8 +191,8 @@ static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data)
power &= ~MUSB_POWER_SUSPENDM;
musb_writeb(addr, MUSB_POWER, power);
- musb_writeb(addr, MUSB_ULPI_REG_ADDR, (u8)offset);
- musb_writeb(addr, MUSB_ULPI_REG_DATA, (u8)data);
+ musb_writeb(addr, MUSB_ULPI_REG_ADDR, (u8)reg);
+ musb_writeb(addr, MUSB_ULPI_REG_DATA, (u8)val);
musb_writeb(addr, MUSB_ULPI_REG_CONTROL, MUSB_ULPI_REG_REQ);
while (!(musb_readb(addr, MUSB_ULPI_REG_CONTROL)
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 042/128] FS-Cache: Add missing initialization of ret in cachefiles_write_page()
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (40 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 041/128] usb: musb: core: fix order of arguments to ulpi write callback Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 043/128] ipvlan: fix leak in ipvlan_rcv_frame Kamal Mostafa
` (85 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Geert Uytterhoeven, David Howells, Al Viro, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <geert@linux-m68k.org>
commit cf89752645e47d86ba8a4157f4b121fcb33434c5 upstream.
fs/cachefiles/rdwr.c: In function ‘cachefiles_write_page’:
fs/cachefiles/rdwr.c:882: warning: ‘ret’ may be used uninitialized in
this function
If the jump to label "error" is taken, "ret" will indeed be
uninitialized, and random stack data may be printed by the debug code.
Fixes: 102f4d900c9c8f5e ("FS-Cache: Handle a write to the page immediately beyond the EOF marker")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/cachefiles/rdwr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
index 12e6206..e22584a 100644
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
@@ -885,7 +885,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
loff_t pos, eof;
size_t len;
void *data;
- int ret;
+ int ret = -ENOBUFS;
ASSERT(op != NULL);
ASSERT(page != NULL);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 043/128] ipvlan: fix leak in ipvlan_rcv_frame
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (41 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 042/128] FS-Cache: Add missing initialization of ret in cachefiles_write_page() Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 044/128] ipvlan: fix use after free of skb Kamal Mostafa
` (84 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sabrina Dubroca, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sabrina Dubroca <sd@queasysnail.net>
commit cf554ada0be7077906aa9a17faf151ff66e3cb8e upstream.
Pass a **skb to ipvlan_rcv_frame so that if skb_share_check returns a
new skb, we actually use it during further processing.
It's safe to ignore the new skb in the ipvlan_xmit_* functions, because
they call ipvlan_rcv_frame with local == true, so that dev_forward_skb
is called and always takes ownership of the skb.
Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/ipvlan/ipvlan_core.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index 8df3268..edf9ed8 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -237,7 +237,7 @@ mcast_acct:
}
}
-static int ipvlan_rcv_frame(struct ipvl_addr *addr, struct sk_buff *skb,
+static int ipvlan_rcv_frame(struct ipvl_addr *addr, struct sk_buff **pskb,
bool local)
{
struct ipvl_dev *ipvlan = addr->master;
@@ -245,6 +245,7 @@ static int ipvlan_rcv_frame(struct ipvl_addr *addr, struct sk_buff *skb,
unsigned int len;
rx_handler_result_t ret = RX_HANDLER_CONSUMED;
bool success = false;
+ struct sk_buff *skb = *pskb;
len = skb->len + ETH_HLEN;
if (unlikely(!(dev->flags & IFF_UP))) {
@@ -256,6 +257,7 @@ static int ipvlan_rcv_frame(struct ipvl_addr *addr, struct sk_buff *skb,
if (!skb)
goto out;
+ *pskb = skb;
skb->dev = dev;
skb->pkt_type = PACKET_HOST;
@@ -447,7 +449,7 @@ static int ipvlan_xmit_mode_l3(struct sk_buff *skb, struct net_device *dev)
addr = ipvlan_addr_lookup(ipvlan->port, lyr3h, addr_type, true);
if (addr)
- return ipvlan_rcv_frame(addr, skb, true);
+ return ipvlan_rcv_frame(addr, &skb, true);
out:
skb->dev = ipvlan->phy_dev;
@@ -467,7 +469,7 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)
if (lyr3h) {
addr = ipvlan_addr_lookup(ipvlan->port, lyr3h, addr_type, true);
if (addr)
- return ipvlan_rcv_frame(addr, skb, true);
+ return ipvlan_rcv_frame(addr, &skb, true);
}
skb = skb_share_check(skb, GFP_ATOMIC);
if (!skb)
@@ -553,7 +555,7 @@ static rx_handler_result_t ipvlan_handle_mode_l3(struct sk_buff **pskb,
addr = ipvlan_addr_lookup(port, lyr3h, addr_type, true);
if (addr)
- ret = ipvlan_rcv_frame(addr, skb, false);
+ ret = ipvlan_rcv_frame(addr, pskb, false);
out:
return ret;
@@ -580,7 +582,7 @@ static rx_handler_result_t ipvlan_handle_mode_l2(struct sk_buff **pskb,
addr = ipvlan_addr_lookup(port, lyr3h, addr_type, true);
if (addr)
- ret = ipvlan_rcv_frame(addr, skb, false);
+ ret = ipvlan_rcv_frame(addr, pskb, false);
}
return ret;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 044/128] ipvlan: fix use after free of skb
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (42 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 043/128] ipvlan: fix leak in ipvlan_rcv_frame Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 045/128] perf symbols: Fix dso lookup by long name and missing buildids Kamal Mostafa
` (83 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sabrina Dubroca, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sabrina Dubroca <sd@queasysnail.net>
commit a534dc529853c69e94994aa47c1d80a03ce2c11d upstream.
ipvlan_handle_frame is a rx_handler, and when it returns a value other
than RX_HANDLER_CONSUMED (here, NET_RX_DROP aka RX_HANDLER_ANOTHER),
__netif_receive_skb_core expects that the skb still exists and will
process it further, but we just freed it.
Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/ipvlan/ipvlan_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index edf9ed8..3665a0b 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -607,5 +607,5 @@ rx_handler_result_t ipvlan_handle_frame(struct sk_buff **pskb)
WARN_ONCE(true, "ipvlan_handle_frame() called for mode = [%hx]\n",
port->mode);
kfree_skb(skb);
- return NET_RX_DROP;
+ return RX_HANDLER_CONSUMED;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 045/128] perf symbols: Fix dso lookup by long name and missing buildids
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (43 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 044/128] ipvlan: fix use after free of skb Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 046/128] packet: only allow extra vlan len on ethernet devices Kamal Mostafa
` (82 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Adrian Hunter, Don Zickus, Douglas Hatch, Jiri Olsa, Namhyung Kim,
Peter Zijlstra, Scott J Norton, Waiman Long,
Arnaldo Carvalho de Melo, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <adrian.hunter@intel.com>
commit e266a753bf51b2c3b46d0d230349662c35ac5629 upstream.
Commit 4598a0a6d22f ("perf symbols: Improve DSO long names lookup speed
with rbtree") Added a tree to lookup dsos by long name. That tree gets
corrupted whenever a dso long name is changed because the tree is not
updated.
One effect of that is buildid-list does not work with the 'with-hits'
option because dso lookup fails and results in two structs for the same
dso. The first has the buildid but no hits, the second has hits but no
buildid. e.g.
Before:
$ tools/perf/perf record ls
arch certs CREDITS Documentation firmware include
ipc Kconfig lib Makefile net REPORTING-BUGS
scripts sound usr block COPYING crypto
drivers fs init Kbuild kernel MAINTAINERS
mm README samples security tools virt
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.012 MB perf.data (11 samples) ]
$ tools/perf/perf buildid-list
574da826c66538a8d9060d393a8866289bd06005 [kernel.kallsyms]
30c94dc66a1fe95180c3d68d2b89e576d5ae213c /lib/x86_64-linux-gnu/libc-2.19.so
$ tools/perf/perf buildid-list -H
574da826c66538a8d9060d393a8866289bd06005 [kernel.kallsyms]
0000000000000000000000000000000000000000 /lib/x86_64-linux-gnu/libc-2.19.so
After:
$ tools/perf/perf buildid-list -H
574da826c66538a8d9060d393a8866289bd06005 [kernel.kallsyms]
30c94dc66a1fe95180c3d68d2b89e576d5ae213c /lib/x86_64-linux-gnu/libc-2.19.so
The fix is to record the root of the tree on the dso so that
dso__set_long_name() can update the tree when the long name changes.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Douglas Hatch <doug.hatch@hp.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Scott J Norton <scott.norton@hp.com>
Cc: Waiman Long <Waiman.Long@hp.com>
Fixes: 4598a0a6d22f ("perf symbols: Improve DSO long names lookup speed with rbtree")
Link: http://lkml.kernel.org/r/1447408112-1920-2-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
tools/perf/util/dso.c | 17 +++++++++++++++++
tools/perf/util/dso.h | 1 +
tools/perf/util/machine.c | 1 +
3 files changed, 19 insertions(+)
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 45be944..1991ca7 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -773,6 +773,7 @@ static struct dso *dso__findlink_by_longname(struct rb_root *root,
/* Add new node and rebalance tree */
rb_link_node(&dso->rb_node, parent, p);
rb_insert_color(&dso->rb_node, root);
+ dso->root = root;
}
return NULL;
}
@@ -785,15 +786,30 @@ dso__find_by_longname(const struct rb_root *root, const char *name)
void dso__set_long_name(struct dso *dso, const char *name, bool name_allocated)
{
+ struct rb_root *root = dso->root;
+
if (name == NULL)
return;
if (dso->long_name_allocated)
free((char *)dso->long_name);
+ if (root) {
+ rb_erase(&dso->rb_node, root);
+ /*
+ * __dso__findlink_by_longname() isn't guaranteed to add it
+ * back, so a clean removal is required here.
+ */
+ RB_CLEAR_NODE(&dso->rb_node);
+ dso->root = NULL;
+ }
+
dso->long_name = name;
dso->long_name_len = strlen(name);
dso->long_name_allocated = name_allocated;
+
+ if (root)
+ __dso__findlink_by_longname(root, dso, NULL);
}
void dso__set_short_name(struct dso *dso, const char *name, bool name_allocated)
@@ -886,6 +902,7 @@ struct dso *dso__new(const char *name)
dso->kernel = DSO_TYPE_USER;
dso->needs_swap = DSO_SWAP__UNSET;
RB_CLEAR_NODE(&dso->rb_node);
+ dso->root = NULL;
INIT_LIST_HEAD(&dso->node);
INIT_LIST_HEAD(&dso->data.open_entry);
}
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index 3782c82..159848b 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -104,6 +104,7 @@ struct dsos {
struct dso {
struct list_head node;
struct rb_node rb_node; /* rbtree node sorted by long name */
+ struct rb_root *root; /* root of rbtree that rb_node is in */
struct rb_root symbols[MAP__NR_TYPES];
struct rb_root symbol_names[MAP__NR_TYPES];
void *a2l;
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 1bca3a9..7d6ca2f 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -84,6 +84,7 @@ static void dsos__delete(struct dsos *dsos)
list_for_each_entry_safe(pos, n, &dsos->head, node) {
RB_CLEAR_NODE(&pos->rb_node);
+ pos->root = NULL;
list_del(&pos->node);
dso__delete(pos);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 046/128] packet: only allow extra vlan len on ethernet devices
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (44 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 045/128] perf symbols: Fix dso lookup by long name and missing buildids Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 047/128] packet: fix tpacket_snd max frame len Kamal Mostafa
` (81 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Daniel Borkmann, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <daniel@iogearbox.net>
[ Upstream commit 3c70c132488794e2489ab045559b0ce0afcf17de ]
Packet sockets can be used by various net devices and are not
really restricted to ARPHRD_ETHER device types. However, when
currently checking for the extra 4 bytes that can be transmitted
in VLAN case, our assumption is that we generally probe on
ARPHRD_ETHER devices. Therefore, before looking into Ethernet
header, check the device type first.
This also fixes the issue where non-ARPHRD_ETHER devices could
have no dev->hard_header_len in TX_RING SOCK_RAW case, and thus
the check would test unfilled linear part of the skb (instead
of non-linear).
Fixes: 57f89bfa2140 ("network: Allow af_packet to transmit +4 bytes for VLAN packets.")
Fixes: 52f1454f629f ("packet: allow to transmit +4 byte in TX_RING slot for VLAN case")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/packet/af_packet.c | 60 +++++++++++++++++++++-----------------------------
1 file changed, 25 insertions(+), 35 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index aab5c0a..5eb9443 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1510,6 +1510,20 @@ static void fanout_release(struct sock *sk)
mutex_unlock(&fanout_mutex);
}
+static bool packet_extra_vlan_len_allowed(const struct net_device *dev,
+ struct sk_buff *skb)
+{
+ /* Earlier code assumed this would be a VLAN pkt, double-check
+ * this now that we have the actual packet in hand. We can only
+ * do this check on Ethernet devices.
+ */
+ if (unlikely(dev->type != ARPHRD_ETHER))
+ return false;
+
+ skb_reset_mac_header(skb);
+ return likely(eth_hdr(skb)->h_proto == htons(ETH_P_8021Q));
+}
+
static const struct proto_ops packet_ops;
static const struct proto_ops packet_ops_spkt;
@@ -1671,18 +1685,10 @@ retry:
goto retry;
}
- if (len > (dev->mtu + dev->hard_header_len + extra_len)) {
- /* Earlier code assumed this would be a VLAN pkt,
- * double-check this now that we have the actual
- * packet in hand.
- */
- struct ethhdr *ehdr;
- skb_reset_mac_header(skb);
- ehdr = eth_hdr(skb);
- if (ehdr->h_proto != htons(ETH_P_8021Q)) {
- err = -EMSGSIZE;
- goto out_unlock;
- }
+ if (len > (dev->mtu + dev->hard_header_len + extra_len) &&
+ !packet_extra_vlan_len_allowed(dev, skb)) {
+ err = -EMSGSIZE;
+ goto out_unlock;
}
skb->protocol = proto;
@@ -2287,18 +2293,10 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
tp_len = tpacket_fill_skb(po, skb, ph, dev, size_max, proto,
addr, hlen);
if (likely(tp_len >= 0) &&
- tp_len > dev->mtu + dev->hard_header_len) {
- struct ethhdr *ehdr;
- /* Earlier code assumed this would be a VLAN pkt,
- * double-check this now that we have the actual
- * packet in hand.
- */
+ tp_len > dev->mtu + dev->hard_header_len &&
+ !packet_extra_vlan_len_allowed(dev, skb))
+ tp_len = -EMSGSIZE;
- skb_reset_mac_header(skb);
- ehdr = eth_hdr(skb);
- if (ehdr->h_proto != htons(ETH_P_8021Q))
- tp_len = -EMSGSIZE;
- }
if (unlikely(tp_len < 0)) {
if (po->tp_loss) {
__packet_set_status(po, ph,
@@ -2519,18 +2517,10 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
sock_tx_timestamp(sk, &skb_shinfo(skb)->tx_flags);
- if (!gso_type && (len > dev->mtu + reserve + extra_len)) {
- /* Earlier code assumed this would be a VLAN pkt,
- * double-check this now that we have the actual
- * packet in hand.
- */
- struct ethhdr *ehdr;
- skb_reset_mac_header(skb);
- ehdr = eth_hdr(skb);
- if (ehdr->h_proto != htons(ETH_P_8021Q)) {
- err = -EMSGSIZE;
- goto out_free;
- }
+ if (!gso_type && (len > dev->mtu + reserve + extra_len) &&
+ !packet_extra_vlan_len_allowed(dev, skb)) {
+ err = -EMSGSIZE;
+ goto out_free;
}
skb->protocol = proto;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 047/128] packet: fix tpacket_snd max frame len
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (45 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 046/128] packet: only allow extra vlan len on ethernet devices Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 048/128] net/mlx4_core: Avoid returning success in case of an error flow Kamal Mostafa
` (80 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Daniel Borkmann, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <daniel@iogearbox.net>
[ Upstream commit 5cfb4c8d05b4409c4044cb9c05b19705c1d9818b ]
Since it's introduction in commit 69e3c75f4d54 ("net: TX_RING and
packet mmap"), TX_RING could be used from SOCK_DGRAM and SOCK_RAW
side. When used with SOCK_DGRAM only, the size_max > dev->mtu +
reserve check should have reserve as 0, but currently, this is
unconditionally set (in it's original form as dev->hard_header_len).
I think this is not correct since tpacket_fill_skb() would then
take dev->mtu and dev->hard_header_len into account for SOCK_DGRAM,
the extra VLAN_HLEN could be possible in both cases. Presumably, the
reserve code was copied from packet_snd(), but later on missed the
check. Make it similar as we have it in packet_snd().
Fixes: 69e3c75f4d54 ("net: TX_RING and packet mmap")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/packet/af_packet.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 5eb9443..fe3f86d 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2264,12 +2264,13 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
if (unlikely(!(dev->flags & IFF_UP)))
goto out_put;
- reserve = dev->hard_header_len + VLAN_HLEN;
+ if (po->sk.sk_socket->type == SOCK_RAW)
+ reserve = dev->hard_header_len;
size_max = po->tx_ring.frame_size
- (po->tp_hdrlen - sizeof(struct sockaddr_ll));
- if (size_max > dev->mtu + reserve)
- size_max = dev->mtu + reserve;
+ if (size_max > dev->mtu + reserve + VLAN_HLEN)
+ size_max = dev->mtu + reserve + VLAN_HLEN;
do {
ph = packet_current_frame(po, &po->tx_ring,
@@ -2293,7 +2294,7 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
tp_len = tpacket_fill_skb(po, skb, ph, dev, size_max, proto,
addr, hlen);
if (likely(tp_len >= 0) &&
- tp_len > dev->mtu + dev->hard_header_len &&
+ tp_len > dev->mtu + reserve &&
!packet_extra_vlan_len_allowed(dev, skb))
tp_len = -EMSGSIZE;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 048/128] net/mlx4_core: Avoid returning success in case of an error flow
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (46 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 047/128] packet: fix tpacket_snd max frame len Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 049/128] macvlan: fix leak in macvlan_handle_frame Kamal Mostafa
` (79 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Noa Osherovich, Or Gerlitz, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Noa Osherovich <noaos@mellanox.com>
commit d49c2197fd70c37d57982804465268440a33183a upstream.
The err variable wasn't set with the correct error value in some cases.
Fixes: 47605df95398 ('mlx4: Modify proxy/tunnel QP mechanism [..]')
Signed-off-by: Noa Osherovich <noaos@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/ethernet/mellanox/mlx4/main.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 6e08352..e5340b2 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -829,9 +829,10 @@ static int mlx4_slave_cap(struct mlx4_dev *dev)
dev->caps.qp1_proxy[i - 1] = func_cap.qp1_proxy_qpn;
dev->caps.port_mask[i] = dev->caps.port_type[i];
dev->caps.phys_port_id[i] = func_cap.phys_port_id;
- if (mlx4_get_slave_pkey_gid_tbl_len(dev, i,
- &dev->caps.gid_table_len[i],
- &dev->caps.pkey_table_len[i]))
+ err = mlx4_get_slave_pkey_gid_tbl_len(dev, i,
+ &dev->caps.gid_table_len[i],
+ &dev->caps.pkey_table_len[i]);
+ if (err)
goto err_mem;
}
@@ -841,6 +842,7 @@ static int mlx4_slave_cap(struct mlx4_dev *dev)
mlx4_err(dev, "HCA reported UAR region size of 0x%x bigger than PCI resource 2 size of 0x%llx, aborting\n",
dev->caps.uar_page_size * dev->caps.num_uars,
(unsigned long long) pci_resource_len(dev->pdev, 2));
+ err = -ENOMEM;
goto err_mem;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 049/128] macvlan: fix leak in macvlan_handle_frame
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (47 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 048/128] net/mlx4_core: Avoid returning success in case of an error flow Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 050/128] ALSA: usb-audio: add packet size quirk for the Medeli DD305 Kamal Mostafa
` (78 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sabrina Dubroca, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sabrina Dubroca <sd@queasysnail.net>
commit e639b8d8a7a728f0b05ef2df6cb6b45dc3d4e556 upstream.
Reset pskb in macvlan_handle_frame in case skb_share_check returned a
clone.
Fixes: 8a4eb5734e8d ("net: introduce rx_handler results and logic around that")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/macvlan.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 612e073..1d1511c 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -415,6 +415,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
skb = ip_check_defrag(skb, IP_DEFRAG_MACVLAN);
if (!skb)
return RX_HANDLER_CONSUMED;
+ *pskb = skb;
eth = eth_hdr(skb);
macvlan_forward_source(skb, port, eth->h_source);
src = macvlan_hash_lookup(port, eth->h_source);
@@ -456,6 +457,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
goto out;
}
+ *pskb = skb;
skb->dev = dev;
skb->pkt_type = PACKET_HOST;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 050/128] ALSA: usb-audio: add packet size quirk for the Medeli DD305
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (48 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 049/128] macvlan: fix leak in macvlan_handle_frame Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 051/128] ALSA: usb-audio: prevent CH345 multiport output SysEx corruption Kamal Mostafa
` (77 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Clemens Ladisch, Takashi Iwai, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Clemens Ladisch <clemens@ladisch.de>
commit 98d362becb6621bebdda7ed0eac7ad7ec6c37898 upstream.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/usb/midi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index 5bfb695..f5bcacc 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -1341,6 +1341,7 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi *umidi,
* Various chips declare a packet size larger than 4 bytes, but
* do not actually work with larger packets:
*/
+ case USB_ID(0x0a67, 0x5011): /* Medeli DD305 */
case USB_ID(0x0a92, 0x1020): /* ESI M4U */
case USB_ID(0x1430, 0x474b): /* RedOctane GH MIDI INTERFACE */
case USB_ID(0x15ca, 0x0101): /* Textech USB Midi Cable */
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 051/128] ALSA: usb-audio: prevent CH345 multiport output SysEx corruption
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (49 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 050/128] ALSA: usb-audio: add packet size quirk for the Medeli DD305 Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 052/128] ALSA: usb-audio: work around CH345 input " Kamal Mostafa
` (76 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Clemens Ladisch, Takashi Iwai, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Clemens Ladisch <clemens@ladisch.de>
commit 1ca8b201309d842642f221db7f02f71c0af5be2d upstream.
The CH345 USB MIDI chip has two output ports. However, they are
multiplexed through one pin, and the number of ports cannot be reduced
even for hardware that implements only one connector, so for those
devices, data sent to either port ends up on the same hardware output.
This becomes a problem when both ports are used at the same time, as
longer MIDI commands (such as SysEx messages) are likely to be
interrupted by messages from the other port, and thus to get lost.
It would not be possible for the driver to detect how many ports the
device actually has, except that in practice, _all_ devices built with
the CH345 have only one port. So we can just ignore the device's
descriptors, and hardcode one output port.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/usb/midi.c | 3 +++
sound/usb/quirks-table.h | 11 +++++++++++
sound/usb/quirks.c | 1 +
sound/usb/usbaudio.h | 1 +
4 files changed, 16 insertions(+)
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index f5bcacc..d968cc3 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -2377,6 +2377,9 @@ int snd_usbmidi_create(struct snd_card *card,
err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
break;
+ case QUIRK_MIDI_CH345:
+ err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
+ break;
default:
dev_err(&umidi->dev->dev, "invalid quirk type %d\n",
quirk->type);
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index b531993..f968c67 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -2824,6 +2824,17 @@ YAMAHA_DEVICE(0x7010, "UB99"),
.idProduct = 0x1020,
},
+/* QinHeng devices */
+{
+ USB_DEVICE(0x1a86, 0x752d),
+ .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
+ .vendor_name = "QinHeng",
+ .product_name = "CH345",
+ .ifnum = 1,
+ .type = QUIRK_MIDI_CH345
+ }
+},
+
/* KeithMcMillen Stringport */
{
USB_DEVICE(0x1f38, 0x0001),
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 449555c..9032510b 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -535,6 +535,7 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip,
[QUIRK_MIDI_CME] = create_any_midi_quirk,
[QUIRK_MIDI_AKAI] = create_any_midi_quirk,
[QUIRK_MIDI_FTDI] = create_any_midi_quirk,
+ [QUIRK_MIDI_CH345] = create_any_midi_quirk,
[QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk,
[QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk,
[QUIRK_AUDIO_EDIROL_UAXX] = create_uaxx_quirk,
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 91d0380..991aa84 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -94,6 +94,7 @@ enum quirk_type {
QUIRK_MIDI_AKAI,
QUIRK_MIDI_US122L,
QUIRK_MIDI_FTDI,
+ QUIRK_MIDI_CH345,
QUIRK_AUDIO_STANDARD_INTERFACE,
QUIRK_AUDIO_FIXED_ENDPOINT,
QUIRK_AUDIO_EDIROL_UAXX,
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 052/128] ALSA: usb-audio: work around CH345 input SysEx corruption
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (50 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 051/128] ALSA: usb-audio: prevent CH345 multiport output SysEx corruption Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 053/128] dm thin: restore requested 'error_if_no_space' setting on OODS to WRITE transition Kamal Mostafa
` (75 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Clemens Ladisch, Takashi Iwai, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Clemens Ladisch <clemens@ladisch.de>
commit a91e627e3f0ed820b11d86cdc04df38f65f33a70 upstream.
One of the many faults of the QinHeng CH345 USB MIDI interface chip is
that it does not handle received SysEx messages correctly -- every second
event packet has a wrong code index number, which is the one from the last
seen message, instead of 4. For example, the two messages "FE F0 01 02 03
04 05 06 07 08 09 0A 0B 0C 0D 0E F7" result in the following event
packets:
correct: CH345:
0F FE 00 00 0F FE 00 00
04 F0 01 02 04 F0 01 02
04 03 04 05 0F 03 04 05
04 06 07 08 04 06 07 08
04 09 0A 0B 0F 09 0A 0B
04 0C 0D 0E 04 0C 0D 0E
05 F7 00 00 05 F7 00 00
A class-compliant driver must interpret an event packet with CIN 15 as
having a single data byte, so the other two bytes would be ignored. The
message received by the host would then be missing two bytes out of six;
in this example, "F0 01 02 03 06 07 08 09 0C 0D 0E F7".
These corrupted SysEx event packages contain only data bytes, while the
CH345 uses event packets with a correct CIN value only for messages with
a status byte, so it is possible to distinguish between these two cases by
checking for the presence of this status byte.
(Other bugs in the CH345's input handling, such as the corruption resulting
from running status, cannot be worked around.)
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/usb/midi.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index d968cc3..a074f1c 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -174,6 +174,8 @@ struct snd_usb_midi_in_endpoint {
u8 running_status_length;
} ports[0x10];
u8 seen_f5;
+ bool in_sysex;
+ u8 last_cin;
u8 error_resubmit;
int current_port;
};
@@ -468,6 +470,39 @@ static void snd_usbmidi_maudio_broken_running_status_input(
}
/*
+ * QinHeng CH345 is buggy: every second packet inside a SysEx has not CIN 4
+ * but the previously seen CIN, but still with three data bytes.
+ */
+static void ch345_broken_sysex_input(struct snd_usb_midi_in_endpoint *ep,
+ uint8_t *buffer, int buffer_length)
+{
+ unsigned int i, cin, length;
+
+ for (i = 0; i + 3 < buffer_length; i += 4) {
+ if (buffer[i] == 0 && i > 0)
+ break;
+ cin = buffer[i] & 0x0f;
+ if (ep->in_sysex &&
+ cin == ep->last_cin &&
+ (buffer[i + 1 + (cin == 0x6)] & 0x80) == 0)
+ cin = 0x4;
+#if 0
+ if (buffer[i + 1] == 0x90) {
+ /*
+ * Either a corrupted running status or a real note-on
+ * message; impossible to detect reliably.
+ */
+ }
+#endif
+ length = snd_usbmidi_cin_length[cin];
+ snd_usbmidi_input_data(ep, 0, &buffer[i + 1], length);
+ ep->in_sysex = cin == 0x4;
+ if (!ep->in_sysex)
+ ep->last_cin = cin;
+ }
+}
+
+/*
* CME protocol: like the standard protocol, but SysEx commands are sent as a
* single USB packet preceded by a 0x0F byte.
*/
@@ -660,6 +695,12 @@ static struct usb_protocol_ops snd_usbmidi_cme_ops = {
.output_packet = snd_usbmidi_output_standard_packet,
};
+static struct usb_protocol_ops snd_usbmidi_ch345_broken_sysex_ops = {
+ .input = ch345_broken_sysex_input,
+ .output = snd_usbmidi_standard_output,
+ .output_packet = snd_usbmidi_output_standard_packet,
+};
+
/*
* AKAI MPD16 protocol:
*
@@ -2378,6 +2419,7 @@ int snd_usbmidi_create(struct snd_card *card,
err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
break;
case QUIRK_MIDI_CH345:
+ umidi->usb_protocol_ops = &snd_usbmidi_ch345_broken_sysex_ops;
err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
break;
default:
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 053/128] dm thin: restore requested 'error_if_no_space' setting on OODS to WRITE transition
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (51 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 052/128] ALSA: usb-audio: work around CH345 input " Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 054/128] dm: fix ioctl retry termination with signal Kamal Mostafa
` (74 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Mike Snitzer, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <snitzer@redhat.com>
commit 172c238612ebf81cabccc86b788c9209af591f61 upstream.
A thin-pool that is in out-of-data-space (OODS) mode may transition back
to write mode -- without the admin adding more space to the thin-pool --
if/when blocks are released (either by deleting thin devices or
discarding provisioned blocks).
But as part of the thin-pool's earlier transition to out-of-data-space
mode the thin-pool may have set the 'error_if_no_space' flag to true if
the no_space_timeout expires without more space having been made
available. That implementation detail, of changing the pool's
error_if_no_space setting, needs to be reset back to the default that
the user specified when the thin-pool's table was loaded.
Otherwise we'll drop the user requested behaviour on the floor when this
out-of-data-space to write mode transition occurs.
Reported-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Joe Thornber <ejt@redhat.com>
Fixes: 2c43fd26e4 ("dm thin: fix missing out-of-data-space to write mode transition if blocks are released")
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 734254f..4ada0cd 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -2183,6 +2183,7 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode)
case PM_WRITE:
if (old_mode != new_mode)
notify_of_pool_mode_change(pool, "write");
+ pool->pf.error_if_no_space = pt->requested_pf.error_if_no_space;
dm_pool_metadata_read_write(pool->pmd);
pool->process_bio = process_bio;
pool->process_discard = process_discard_bio;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 054/128] dm: fix ioctl retry termination with signal
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (52 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 053/128] dm thin: restore requested 'error_if_no_space' setting on OODS to WRITE transition Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 055/128] MIPS: KVM: Fix ASID restoration logic Kamal Mostafa
` (73 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jun'ichi Nomura, Hannes Reinecke, Mikulas Patocka,
Mike Snitzer, Luis Henriques, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Junichi Nomura <j-nomura@ce.jp.nec.com>
commit 5bbbfdf685657771fda05b926b28ca0f79163a28 upstream.
dm-mpath retries ioctl, when no path is readily available and the device
is configured to queue I/O in such a case. If you want to stop the retry
before multipathd decides to turn off queueing mode, you could send
signal for the process to exit from the loop.
However the check of fatal signal has not carried along when commit
6c182cd88d17 ("dm mpath: fix ioctl deadlock when no paths") moved the
loop from dm-mpath to dm core. As a result, we can't terminate such
a process in the retry loop.
Easy reproducer of the situation is:
# dmsetup create mp --table '0 1024 multipath 0 0 0 0'
# dmsetup message mp 0 'queue_if_no_path'
# sg_inq /dev/mapper/mp
then you should be able to terminate sg_inq by pressing Ctrl+C.
Fixes: 6c182cd88d17 ("dm mpath: fix ioctl deadlock when no paths")
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/dm-mpath.c | 2 +-
drivers/md/dm.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 7ed0e7b..35cbc2a 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1548,7 +1548,7 @@ static int multipath_ioctl(struct dm_target *ti, unsigned int cmd,
if (!r && ti->len != i_size_read(bdev->bd_inode) >> SECTOR_SHIFT)
r = scsi_verify_blk_ioctl(NULL, cmd);
- if (r == -ENOTCONN && !fatal_signal_pending(current)) {
+ if (r == -ENOTCONN) {
spin_lock_irqsave(&m->lock, flags);
if (!m->current_pg) {
/* Path status changed, redo selection */
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index df81bbd..b93f32d 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -543,7 +543,7 @@ retry:
out:
dm_put_live_table(md, srcu_idx);
- if (r == -ENOTCONN) {
+ if (r == -ENOTCONN && !fatal_signal_pending(current)) {
msleep(10);
goto retry;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 055/128] MIPS: KVM: Fix ASID restoration logic
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (53 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 054/128] dm: fix ioctl retry termination with signal Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 056/128] MIPS: KVM: Fix CACHE immediate offset sign extension Kamal Mostafa
` (72 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: James Hogan, Ralf Baechle, Paolo Bonzini, Gleb Natapov,
linux-mips, kvm, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hogan <james.hogan@imgtec.com>
commit 002374f371bd02df864cce1fe85d90dc5b292837 upstream.
ASID restoration on guest resume should determine the guest execution
mode based on the guest Status register rather than bit 30 of the guest
PC.
Fix the two places in locore.S that do this, loading the guest status
from the cop0 area. Note, this assembly is specific to the trap &
emulate implementation of KVM, so it doesn't need to check the
supervisor bit as that mode is not implemented in the guest.
Fixes: b680f70fc111 ("KVM/MIPS32: Entry point for trampolining to...")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/mips/kvm/locore.S | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/arch/mips/kvm/locore.S b/arch/mips/kvm/locore.S
index 4a68b17..c6b11ef 100644
--- a/arch/mips/kvm/locore.S
+++ b/arch/mips/kvm/locore.S
@@ -163,9 +163,11 @@ FEXPORT(__kvm_mips_vcpu_run)
FEXPORT(__kvm_mips_load_asid)
/* Set the ASID for the Guest Kernel */
- INT_SLL t0, t0, 1 /* with kseg0 @ 0x40000000, kernel */
- /* addresses shift to 0x80000000 */
- bltz t0, 1f /* If kernel */
+ PTR_L t0, VCPU_COP0(k1)
+ LONG_L t0, COP0_STATUS(t0)
+ andi t0, KSU_USER | ST0_ERL | ST0_EXL
+ xori t0, KSU_USER
+ bnez t0, 1f /* If kernel */
INT_ADDIU t1, k1, VCPU_GUEST_KERNEL_ASID /* (BD) */
INT_ADDIU t1, k1, VCPU_GUEST_USER_ASID /* else user */
1:
@@ -444,9 +446,11 @@ __kvm_mips_return_to_guest:
mtc0 t0, CP0_EPC
/* Set the ASID for the Guest Kernel */
- INT_SLL t0, t0, 1 /* with kseg0 @ 0x40000000, kernel */
- /* addresses shift to 0x80000000 */
- bltz t0, 1f /* If kernel */
+ PTR_L t0, VCPU_COP0(k1)
+ LONG_L t0, COP0_STATUS(t0)
+ andi t0, KSU_USER | ST0_ERL | ST0_EXL
+ xori t0, KSU_USER
+ bnez t0, 1f /* If kernel */
INT_ADDIU t1, k1, VCPU_GUEST_KERNEL_ASID /* (BD) */
INT_ADDIU t1, k1, VCPU_GUEST_USER_ASID /* else user */
1:
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 056/128] MIPS: KVM: Fix CACHE immediate offset sign extension
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (54 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 055/128] MIPS: KVM: Fix ASID restoration logic Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 057/128] MIPS: KVM: Uninit VCPU in vcpu_create error path Kamal Mostafa
` (71 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: James Hogan, Ralf Baechle, Paolo Bonzini, Gleb Natapov,
linux-mips, kvm, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hogan <james.hogan@imgtec.com>
commit c5c2a3b998f1ff5a586f9d37e154070b8d550d17 upstream.
The immediate field of the CACHE instruction is signed, so ensure that
it gets sign extended by casting it to an int16_t rather than just
masking the low 16 bits.
Fixes: e685c689f3a8 ("KVM/MIPS32: Privileged instruction/target branch emulation.")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/mips/kvm/emulate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/kvm/emulate.c b/arch/mips/kvm/emulate.c
index 838d3a6..3d44b2d 100644
--- a/arch/mips/kvm/emulate.c
+++ b/arch/mips/kvm/emulate.c
@@ -1407,7 +1407,7 @@ enum emulation_result kvm_mips_emulate_cache(uint32_t inst, uint32_t *opc,
base = (inst >> 21) & 0x1f;
op_inst = (inst >> 16) & 0x1f;
- offset = inst & 0xffff;
+ offset = (int16_t)inst;
cache = (inst >> 16) & 0x3;
op = (inst >> 18) & 0x7;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 057/128] MIPS: KVM: Uninit VCPU in vcpu_create error path
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (55 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 056/128] MIPS: KVM: Fix CACHE immediate offset sign extension Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 058/128] KVM: Provide function for VCPU lookup by id Kamal Mostafa
` (70 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: James Hogan, Ralf Baechle, Paolo Bonzini, Gleb Natapov,
linux-mips, kvm, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hogan <james.hogan@imgtec.com>
commit 585bb8f9a5e592f2ce7abbe5ed3112d5438d2754 upstream.
If either of the memory allocations in kvm_arch_vcpu_create() fail, the
vcpu which has been allocated and kvm_vcpu_init'd doesn't get uninit'd
in the error handling path. Add a call to kvm_vcpu_uninit() to fix this.
Fixes: 669e846e6c4e ("KVM/MIPS32: MIPS arch specific APIs for KVM")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/mips/kvm/mips.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c
index a53eaf5..b7f253f 100644
--- a/arch/mips/kvm/mips.c
+++ b/arch/mips/kvm/mips.c
@@ -271,7 +271,7 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
if (!gebase) {
err = -ENOMEM;
- goto out_free_cpu;
+ goto out_uninit_cpu;
}
kvm_debug("Allocated %d bytes for KVM Exception Handlers @ %p\n",
ALIGN(size, PAGE_SIZE), gebase);
@@ -335,6 +335,9 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
out_free_gebase:
kfree(gebase);
+out_uninit_cpu:
+ kvm_vcpu_uninit(vcpu);
+
out_free_cpu:
kfree(vcpu);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 058/128] KVM: Provide function for VCPU lookup by id
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (56 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 057/128] MIPS: KVM: Uninit VCPU in vcpu_create error path Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 059/128] KVM: s390: avoid memory overwrites on emergency signal injection Kamal Mostafa
` (69 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: David Hildenbrand, Christian Borntraeger, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand <dahi@linux.vnet.ibm.com>
commit db27a7a37aa0b1f8b373f8b0fb72a2ccaafb85b7 upstream.
Let's provide a function to lookup a VCPU by id.
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
[split patch from refactoring patch]
[ kamal: 3.19-stable prereq for
b85de33 KVM: s390: avoid memory overwrites on emergency signal injection ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/linux/kvm_host.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 26f1060..c3aa8f4 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -438,6 +438,17 @@ static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i)
(vcpup = kvm_get_vcpu(kvm, idx)) != NULL; \
idx++)
+static inline struct kvm_vcpu *kvm_get_vcpu_by_id(struct kvm *kvm, int id)
+{
+ struct kvm_vcpu *vcpu;
+ int i;
+
+ kvm_for_each_vcpu(i, vcpu, kvm)
+ if (vcpu->vcpu_id == id)
+ return vcpu;
+ return NULL;
+}
+
#define kvm_for_each_memslot(memslot, slots) \
for (memslot = &slots->memslots[0]; \
memslot < slots->memslots + KVM_MEM_SLOTS_NUM && memslot->npages;\
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 059/128] KVM: s390: avoid memory overwrites on emergency signal injection
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (57 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 058/128] KVM: Provide function for VCPU lookup by id Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 060/128] KVM: s390: fix wrong lookup of VCPUs by array index Kamal Mostafa
` (68 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: David Hildenbrand, Christian Borntraeger, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand <dahi@linux.vnet.ibm.com>
commit b85de33a1a3433487b6a721cfdce25ec8673e622 upstream.
Commit 383d0b050106 ("KVM: s390: handle pending local interrupts via
bitmap") introduced a possible memory overwrite from user space.
User space could pass an invalid emergency signal code (sending VCPU)
and therefore exceed the bitmap. Let's take care of this case and
check that the id is in the valid range.
Reviewed-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
[ kamal: backport to 3.19-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/s390/kvm/interrupt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 07da75c..befe999 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -1060,6 +1060,10 @@ static int __inject_sigp_emergency(struct kvm_vcpu *vcpu,
trace_kvm_s390_inject_vcpu(vcpu->vcpu_id, KVM_S390_INT_EMERGENCY,
emerg->code, 0, 2);
+ /* sending vcpu invalid */
+ if (kvm_get_vcpu_by_id(vcpu->kvm, emerg.code) == NULL)
+ return -EINVAL;
+
set_bit(emerg->code, li->sigp_emerg_pending);
set_bit(IRQ_PEND_EXT_EMERGENCY, &li->pending_irqs);
atomic_set_mask(CPUSTAT_EXT_INT, li->cpuflags);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 060/128] KVM: s390: fix wrong lookup of VCPUs by array index
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (58 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 059/128] KVM: s390: avoid memory overwrites on emergency signal injection Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 061/128] ALSA: hda - Add fixup for Acer Aspire One Cloudbook 14 Kamal Mostafa
` (67 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: David Hildenbrand, Christian Borntraeger, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand <dahi@linux.vnet.ibm.com>
commit 152e9f65d66f0a3891efc3869440becc0e7ff53f upstream.
For now, VCPUs were always created sequentially with incrementing
VCPU ids. Therefore, the index in the VCPUs array matched the id.
As sequential creation might change with cpu hotplug, let's use
the correct lookup function to find a VCPU by id, not array index.
Let's also use kvm_lookup_vcpu() for validation of the sending VCPU
on external call injection.
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
[ kamal: backport to 3.19-stable: dropped __inject_extcall validation change ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/s390/kvm/sigp.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
index 6651f9f..7ca07cb 100644
--- a/arch/s390/kvm/sigp.c
+++ b/arch/s390/kvm/sigp.c
@@ -317,12 +317,8 @@ static int handle_sigp_dst(struct kvm_vcpu *vcpu, u8 order_code,
u16 cpu_addr, u32 parameter, u64 *status_reg)
{
int rc;
- struct kvm_vcpu *dst_vcpu;
+ struct kvm_vcpu *dst_vcpu = kvm_get_vcpu_by_id(vcpu->kvm, cpu_addr);
- if (cpu_addr >= KVM_MAX_VCPUS)
- return SIGP_CC_NOT_OPERATIONAL;
-
- dst_vcpu = kvm_get_vcpu(vcpu->kvm, cpu_addr);
if (!dst_vcpu)
return SIGP_CC_NOT_OPERATIONAL;
@@ -452,7 +448,7 @@ int kvm_s390_handle_sigp_pei(struct kvm_vcpu *vcpu)
trace_kvm_s390_handle_sigp_pei(vcpu, order_code, cpu_addr);
if (order_code == SIGP_EXTERNAL_CALL) {
- dest_vcpu = kvm_get_vcpu(vcpu->kvm, cpu_addr);
+ dest_vcpu = kvm_get_vcpu_by_id(vcpu->kvm, cpu_addr);
BUG_ON(dest_vcpu == NULL);
kvm_s390_vcpu_wakeup(dest_vcpu);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 061/128] ALSA: hda - Add fixup for Acer Aspire One Cloudbook 14
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (59 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 060/128] KVM: s390: fix wrong lookup of VCPUs by array index Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 062/128] mac: validate mac_partition is within sector Kamal Mostafa
` (66 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit b9c2fa52135d49a931c56ed2bfc17d61f771b412 upstream.
For making the speakers on Acer Aspire One Cloudbook 14 to work, we
need the as same quirk as for another Chromebook. This patch adds the
corresponding fixup entry.
Reported-by: Patrick <epictetus@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/patch_realtek.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index e851832..8ab29ec 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4878,6 +4878,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
+ SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 062/128] mac: validate mac_partition is within sector
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (60 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 061/128] ALSA: hda - Add fixup for Acer Aspire One Cloudbook 14 Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 063/128] ALSA: hda - Apply HP headphone fixups more generically Kamal Mostafa
` (65 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Kees Cook, Jens Axboe, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <keescook@chromium.org>
commit 02e2a5bfebe99edcf9d694575a75032d53fe1b73 upstream.
If md->signature == MAC_DRIVER_MAGIC and md->block_size == 1023, a single
512 byte sector would be read (secsize / 512). However the partition
structure would be located past the end of the buffer (secsize % 512).
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
block/partitions/mac.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/block/partitions/mac.c b/block/partitions/mac.c
index c2c48ec..621317a 100644
--- a/block/partitions/mac.c
+++ b/block/partitions/mac.c
@@ -32,7 +32,7 @@ int mac_partition(struct parsed_partitions *state)
Sector sect;
unsigned char *data;
int slot, blocks_in_map;
- unsigned secsize;
+ unsigned secsize, datasize, partoffset;
#ifdef CONFIG_PPC_PMAC
int found_root = 0;
int found_root_goodness = 0;
@@ -50,10 +50,14 @@ int mac_partition(struct parsed_partitions *state)
}
secsize = be16_to_cpu(md->block_size);
put_dev_sector(sect);
- data = read_part_sector(state, secsize/512, §);
+ datasize = round_down(secsize, 512);
+ data = read_part_sector(state, datasize / 512, §);
if (!data)
return -1;
- part = (struct mac_partition *) (data + secsize%512);
+ partoffset = secsize % 512;
+ if (partoffset + sizeof(*part) > datasize)
+ return -1;
+ part = (struct mac_partition *) (data + partoffset);
if (be16_to_cpu(part->signature) != MAC_PARTITION_MAGIC) {
put_dev_sector(sect);
return 0; /* not a MacOS disk */
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 063/128] ALSA: hda - Apply HP headphone fixups more generically
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (61 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 062/128] mac: validate mac_partition is within sector Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 064/128] powerpc/tm: Block signal return setting invalid MSR state Kamal Mostafa
` (64 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 196543d54574f50e3fd04df4e3048181e006a9da upstream.
It turned out that many HP laptops suffer from the same problem as
fixed in commit [c932b98c1e47: ALSA: hda - Apply pin fixup for HP
ProBook 6550b]. But, it's tiresome to list up all such PCI SSIDs, as
there are really lots of HP machines.
Instead, we do a bit more clever, try to check the supposedly dock and
built-in headphone pins, and apply the fixup when both seem valid.
This rule can be applied generically to all models using the same
quirk, so we'll fix all in a shot.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107491
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ kamal: backport to 3.19-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/patch_sigmatel.c | 45 +++++++++++++++++++++++++++---------------
1 file changed, 29 insertions(+), 16 deletions(-)
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 7eb9705..4478d35 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -3109,6 +3109,29 @@ static void stac92hd71bxx_fixup_hp_hdx(struct hda_codec *codec,
spec->gpio_led = 0x08;
}
+static bool is_hp_output(struct hda_codec *codec, hda_nid_t pin)
+{
+ unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin);
+
+ /* count line-out, too, as BIOS sets often so */
+ return get_defcfg_connect(pin_cfg) != AC_JACK_PORT_NONE &&
+ (get_defcfg_device(pin_cfg) == AC_JACK_LINE_OUT ||
+ get_defcfg_device(pin_cfg) == AC_JACK_HP_OUT);
+}
+
+static void fixup_hp_headphone(struct hda_codec *codec, hda_nid_t pin)
+{
+ unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin);
+
+ /* It was changed in the BIOS to just satisfy MS DTM.
+ * Lets turn it back into slaved HP
+ */
+ pin_cfg = (pin_cfg & (~AC_DEFCFG_DEVICE)) |
+ (AC_JACK_HP_OUT << AC_DEFCFG_DEVICE_SHIFT);
+ pin_cfg = (pin_cfg & (~(AC_DEFCFG_DEF_ASSOC | AC_DEFCFG_SEQUENCE))) |
+ 0x1f;
+ snd_hda_codec_set_pincfg(codec, pin, pin_cfg);
+}
static void stac92hd71bxx_fixup_hp(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
@@ -3118,22 +3141,12 @@ static void stac92hd71bxx_fixup_hp(struct hda_codec *codec,
if (action != HDA_FIXUP_ACT_PRE_PROBE)
return;
- if (hp_blike_system(codec->subsystem_id)) {
- unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, 0x0f);
- if (get_defcfg_device(pin_cfg) == AC_JACK_LINE_OUT ||
- get_defcfg_device(pin_cfg) == AC_JACK_SPEAKER ||
- get_defcfg_device(pin_cfg) == AC_JACK_HP_OUT) {
- /* It was changed in the BIOS to just satisfy MS DTM.
- * Lets turn it back into slaved HP
- */
- pin_cfg = (pin_cfg & (~AC_DEFCFG_DEVICE))
- | (AC_JACK_HP_OUT <<
- AC_DEFCFG_DEVICE_SHIFT);
- pin_cfg = (pin_cfg & (~(AC_DEFCFG_DEF_ASSOC
- | AC_DEFCFG_SEQUENCE)))
- | 0x1f;
- snd_hda_codec_set_pincfg(codec, 0x0f, pin_cfg);
- }
+ /* when both output A and F are assigned, these are supposedly
+ * dock and built-in headphones; fix both pin configs
+ */
+ if (is_hp_output(codec, 0x0a) && is_hp_output(codec, 0x0f)) {
+ fixup_hp_headphone(codec, 0x0a);
+ fixup_hp_headphone(codec, 0x0f);
}
if (find_mute_led_cfg(codec, 1))
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 064/128] powerpc/tm: Block signal return setting invalid MSR state
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (62 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 063/128] ALSA: hda - Apply HP headphone fixups more generically Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 065/128] powerpc/tm: Check for already reclaimed tasks Kamal Mostafa
` (63 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Michael Neuling, Michael Ellerman, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Neuling <mikey@neuling.org>
commit d2b9d2a5ad5ef04ff978c9923d19730cb05efd55 upstream.
Currently we allow both the MSR T and S bits to be set by userspace on
a signal return. Unfortunately this is a reserved configuration and
will cause a TM Bad Thing exception if attempted (via rfid).
This patch checks for this case in both the 32 and 64 bit signals
code. If both T and S are set, we mark the context as invalid.
Found using a syscall fuzzer.
Fixes: 2b0a576d15e0 ("powerpc: Add new transactional memory state to the signal context")
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/powerpc/include/asm/reg.h | 1 +
arch/powerpc/kernel/signal_32.c | 14 +++++++++-----
arch/powerpc/kernel/signal_64.c | 4 ++++
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 1c874fb..f5d03cf 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -108,6 +108,7 @@
#define MSR_TS_T __MASK(MSR_TS_T_LG) /* Transaction Transactional */
#define MSR_TS_MASK (MSR_TS_T | MSR_TS_S) /* Transaction State bits */
#define MSR_TM_ACTIVE(x) (((x) & MSR_TS_MASK) != 0) /* Transaction active? */
+#define MSR_TM_RESV(x) (((x) & MSR_TS_MASK) == MSR_TS_MASK) /* Reserved */
#define MSR_TM_TRANSACTIONAL(x) (((x) & MSR_TS_MASK) == MSR_TS_T)
#define MSR_TM_SUSPENDED(x) (((x) & MSR_TS_MASK) == MSR_TS_S)
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index b171001..abad089 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -875,6 +875,15 @@ static long restore_tm_user_regs(struct pt_regs *regs,
return 1;
#endif /* CONFIG_SPE */
+ /* Get the top half of the MSR from the user context */
+ if (__get_user(msr_hi, &tm_sr->mc_gregs[PT_MSR]))
+ return 1;
+ msr_hi <<= 32;
+ /* If TM bits are set to the reserved value, it's an invalid context */
+ if (MSR_TM_RESV(msr_hi))
+ return 1;
+ /* Pull in the MSR TM bits from the user context */
+ regs->msr = (regs->msr & ~MSR_TS_MASK) | (msr_hi & MSR_TS_MASK);
/* Now, recheckpoint. This loads up all of the checkpointed (older)
* registers, including FP and V[S]Rs. After recheckpointing, the
* transactional versions should be loaded.
@@ -884,11 +893,6 @@ static long restore_tm_user_regs(struct pt_regs *regs,
current->thread.tm_texasr |= TEXASR_FS;
/* This loads the checkpointed FP/VEC state, if used */
tm_recheckpoint(¤t->thread, msr);
- /* Get the top half of the MSR */
- if (__get_user(msr_hi, &tm_sr->mc_gregs[PT_MSR]))
- return 1;
- /* Pull in MSR TM from user context */
- regs->msr = (regs->msr & ~MSR_TS_MASK) | ((msr_hi<<32) & MSR_TS_MASK);
/* This loads the speculative FP/VEC state, if used */
if (msr & MSR_FP) {
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 2cb0c94..98131b3 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -427,6 +427,10 @@ static long restore_tm_sigcontexts(struct pt_regs *regs,
/* get MSR separately, transfer the LE bit if doing signal return */
err |= __get_user(msr, &sc->gp_regs[PT_MSR]);
+ /* Don't allow reserved mode. */
+ if (MSR_TM_RESV(msr))
+ return -EINVAL;
+
/* pull in MSR TM from user context */
regs->msr = (regs->msr & ~MSR_TS_MASK) | (msr & MSR_TS_MASK);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 065/128] powerpc/tm: Check for already reclaimed tasks
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (63 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 064/128] powerpc/tm: Block signal return setting invalid MSR state Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 066/128] ARC: dw2 unwind: Remove falllback linear search thru FDE entries Kamal Mostafa
` (62 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Michael Neuling, Michael Ellerman, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Neuling <mikey@neuling.org>
commit 7f821fc9c77a9b01fe7b1d6e72717b33d8d64142 upstream.
Currently we can hit a scenario where we'll tm_reclaim() twice. This
results in a TM bad thing exception because the second reclaim occurs
when not in suspend mode.
The scenario in which this can happen is the following. We attempt to
deliver a signal to userspace. To do this we need obtain the stack
pointer to write the signal context. To get this stack pointer we
must tm_reclaim() in case we need to use the checkpointed stack
pointer (see get_tm_stackpointer()). Normally we'd then return
directly to userspace to deliver the signal without going through
__switch_to().
Unfortunatley, if at this point we get an error (such as a bad
userspace stack pointer), we need to exit the process. The exit will
result in a __switch_to(). __switch_to() will attempt to save the
process state which results in another tm_reclaim(). This
tm_reclaim() now causes a TM Bad Thing exception as this state has
already been saved and the processor is no longer in TM suspend mode.
Whee!
This patch checks the state of the MSR to ensure we are TM suspended
before we attempt the tm_reclaim(). If we've already saved the state
away, we should no longer be in TM suspend mode. This has the
additional advantage of checking for a potential TM Bad Thing
exception.
Found using syscall fuzzer.
Fixes: fb09692e71f1 ("powerpc: Add reclaim and recheckpoint functions for context switching transactional memory processes")
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/powerpc/kernel/process.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index b4cc7be..320c584 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -554,6 +554,24 @@ static void tm_reclaim_thread(struct thread_struct *thr,
msr_diff &= MSR_FP | MSR_VEC | MSR_VSX | MSR_FE0 | MSR_FE1;
}
+ /*
+ * Use the current MSR TM suspended bit to track if we have
+ * checkpointed state outstanding.
+ * On signal delivery, we'd normally reclaim the checkpointed
+ * state to obtain stack pointer (see:get_tm_stackpointer()).
+ * This will then directly return to userspace without going
+ * through __switch_to(). However, if the stack frame is bad,
+ * we need to exit this thread which calls __switch_to() which
+ * will again attempt to reclaim the already saved tm state.
+ * Hence we need to check that we've not already reclaimed
+ * this state.
+ * We do this using the current MSR, rather tracking it in
+ * some specific thread_struct bit, as it has the additional
+ * benifit of checking for a potential TM bad thing exception.
+ */
+ if (!MSR_TM_SUSPENDED(mfmsr()))
+ return;
+
tm_reclaim(thr, thr->regs->msr, cause);
/* Having done the reclaim, we now have the checkpointed
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 066/128] ARC: dw2 unwind: Remove falllback linear search thru FDE entries
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (64 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 065/128] powerpc/tm: Check for already reclaimed tasks Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 067/128] fix sysvfs symlinks Kamal Mostafa
` (61 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Vineet Gupta, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Vineet Gupta <vgupta@synopsys.com>
commit 2e22502c080f27afeab5e6f11e618fb7bc7aea53 upstream.
Fixes STAR 9000953410: "perf callgraph profiling causing RCU stalls"
| perf record -g -c 15000 -e cycles /sbin/hackbench
|
| INFO: rcu_preempt self-detected stall on CPU
| 1: (1 GPs behind) idle=609/140000000000002/0 softirq=2914/2915 fqs=603
| Task dump for CPU 1:
in-kernel dwarf unwinder has a fast binary lookup and a fallback linear
search (which iterates thru each of ~11K entries) thus takes 2 orders of
magnitude longer (~3 million cycles vs. 2000). Routines written in hand
assembler lack dwarf info (as we don't support assembler CFI pseudo-ops
yet) fail the unwinder binary lookup, hit linear search, failing
nevertheless in the end.
However the linear search is pointless as binary lookup tables are created
from it in first place. It is impossible to have binary lookup fail while
succeed the linear search. It is pure waste of cycles thus removed by
this patch.
This manifested as RCU stalls / NMI watchdog splat when running
hackbench under perf with callgraph profiling. The triggering condition
was perf counter overflowing in routine lacking dwarf info (like memset)
leading to patheic 3 million cycle unwinder slow path and by the time it
returned new interrupts were already pending (Timer, IPI) and taken
rightaway. The original memset didn't make forward progress, system kept
accruing more interrupts and more unwinder delayes in a vicious feedback
loop, ultimately triggering the NMI diagnostic.
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arc/kernel/unwind.c | 37 ++++---------------------------------
1 file changed, 4 insertions(+), 33 deletions(-)
diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c
index e550b11..2d6a36e 100644
--- a/arch/arc/kernel/unwind.c
+++ b/arch/arc/kernel/unwind.c
@@ -986,42 +986,13 @@ int arc_unwind(struct unwind_frame_info *frame)
(const u8 *)(fde +
1) +
*fde, ptrType);
- if (pc >= endLoc)
+ if (pc >= endLoc) {
fde = NULL;
- } else
- fde = NULL;
- }
- if (fde == NULL) {
- for (fde = table->address, tableSize = table->size;
- cie = NULL, tableSize > sizeof(*fde)
- && tableSize - sizeof(*fde) >= *fde;
- tableSize -= sizeof(*fde) + *fde,
- fde += 1 + *fde / sizeof(*fde)) {
- cie = cie_for_fde(fde, table);
- if (cie == &bad_cie) {
cie = NULL;
- break;
}
- if (cie == NULL
- || cie == ¬_fde
- || (ptrType = fde_pointer_type(cie)) < 0)
- continue;
- ptr = (const u8 *)(fde + 2);
- startLoc = read_pointer(&ptr,
- (const u8 *)(fde + 1) +
- *fde, ptrType);
- if (!startLoc)
- continue;
- if (!(ptrType & DW_EH_PE_indirect))
- ptrType &=
- DW_EH_PE_FORM | DW_EH_PE_signed;
- endLoc =
- startLoc + read_pointer(&ptr,
- (const u8 *)(fde +
- 1) +
- *fde, ptrType);
- if (pc >= startLoc && pc < endLoc)
- break;
+ } else {
+ fde = NULL;
+ cie = NULL;
}
}
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 067/128] fix sysvfs symlinks
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (65 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 066/128] ARC: dw2 unwind: Remove falllback linear search thru FDE entries Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 068/128] vfs: Make sendfile(2) killable even better Kamal Mostafa
` (60 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Al Viro, Luis Henriques, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <viro@zeniv.linux.org.uk>
commit 0ebf7f10d67a70e120f365018f1c5fce9ddc567d upstream.
The thing got broken back in 2002 - sysvfs does *not* have inline
symlinks; even short ones have bodies stored in the first block
of file. sysv_symlink() handles that correctly; unfortunately,
attempting to look an existing symlink up will end up confusing
them for inline symlinks, and interpret the block number containing
the body as the body itself.
Nobody has noticed until now, which says something about the level
of testing sysvfs gets ;-/
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/sysv/inode.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c
index 8895630..02fa1dc 100644
--- a/fs/sysv/inode.c
+++ b/fs/sysv/inode.c
@@ -162,14 +162,8 @@ void sysv_set_inode(struct inode *inode, dev_t rdev)
inode->i_fop = &sysv_dir_operations;
inode->i_mapping->a_ops = &sysv_aops;
} else if (S_ISLNK(inode->i_mode)) {
- if (inode->i_blocks) {
- inode->i_op = &sysv_symlink_inode_operations;
- inode->i_mapping->a_ops = &sysv_aops;
- } else {
- inode->i_op = &sysv_fast_symlink_inode_operations;
- nd_terminate_link(SYSV_I(inode)->i_data, inode->i_size,
- sizeof(SYSV_I(inode)->i_data) - 1);
- }
+ inode->i_op = &sysv_symlink_inode_operations;
+ inode->i_mapping->a_ops = &sysv_aops;
} else
init_special_inode(inode, inode->i_mode, rdev);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 068/128] vfs: Make sendfile(2) killable even better
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (66 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 067/128] fix sysvfs symlinks Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 069/128] vfs: Avoid softlockups with sendfile(2) Kamal Mostafa
` (59 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Jan Kara, Al Viro, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
commit c725bfce7968009756ed2836a8cd7ba4dc163011 upstream.
Commit 296291cdd162 (mm: make sendfile(2) killable) fixed an issue where
sendfile(2) was doing a lot of tiny writes into a filesystem and thus
was unkillable for a long time. However sendfile(2) can be (mis)used to
issue lots of writes into arbitrary file descriptor such as evenfd or
similar special file descriptors which never hit the standard filesystem
write path and thus are still unkillable. E.g. the following example
from Dmitry burns CPU for ~16s on my test system without possibility to
be killed:
int r1 = eventfd(0, 0);
int r2 = memfd_create("", 0);
unsigned long n = 1<<30;
fallocate(r2, 0, 0, n);
sendfile(r1, r2, 0, n);
There are actually quite a few tests for pending signals in sendfile
code however we data to write is always available none of them seems to
trigger. So fix the problem by adding a test for pending signal into
splice_from_pipe_next() also before the loop waiting for pipe buffers to
be available. This should fix all the lockup issues with sendfile of the
do-ton-of-tiny-writes nature.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/splice.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/splice.c b/fs/splice.c
index 75c6058..d934f8e4 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -806,6 +806,13 @@ static int splice_from_pipe_feed(struct pipe_inode_info *pipe, struct splice_des
*/
static int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_desc *sd)
{
+ /*
+ * Check for signal early to make process killable when there are
+ * always buffers available
+ */
+ if (signal_pending(current))
+ return -ERESTARTSYS;
+
while (!pipe->nrbufs) {
if (!pipe->writers)
return 0;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 069/128] vfs: Avoid softlockups with sendfile(2)
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (67 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 068/128] vfs: Make sendfile(2) killable even better Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 070/128] nfs4: start callback_ident at idr 1 Kamal Mostafa
` (58 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dmitry Vyukov, Jan Kara, Al Viro, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
commit c2489e07c0a71a56fb2c84bc0ee66cddfca7d068 upstream.
The following test program from Dmitry can cause softlockups or RCU
stalls as it copies 1GB from tmpfs into eventfd and we don't have any
scheduling point at that path in sendfile(2) implementation:
int r1 = eventfd(0, 0);
int r2 = memfd_create("", 0);
unsigned long n = 1<<30;
fallocate(r2, 0, 0, n);
sendfile(r1, r2, 0, n);
Add cond_resched() into __splice_from_pipe() to fix the problem.
CC: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/splice.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/splice.c b/fs/splice.c
index d934f8e4..c4b93e4 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -888,6 +888,7 @@ ssize_t __splice_from_pipe(struct pipe_inode_info *pipe, struct splice_desc *sd,
splice_from_pipe_begin(sd);
do {
+ cond_resched();
ret = splice_from_pipe_next(pipe, sd);
if (ret > 0)
ret = splice_from_pipe_feed(pipe, sd, actor);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 070/128] nfs4: start callback_ident at idr 1
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (68 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 069/128] vfs: Avoid softlockups with sendfile(2) Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 071/128] nfs4: limit callback decoding to received bytes Kamal Mostafa
` (57 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Benjamin Coddington, Trond Myklebust, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Coddington <bcodding@redhat.com>
commit c68a027c05709330fe5b2f50c50d5fa02124b5d8 upstream.
If clp->cl_cb_ident is zero, then nfs_cb_idr_remove_locked() skips removing
it when the nfs_client is freed. A decoding or server bug can then find
and try to put that first nfs_client which would lead to a crash.
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Fixes: d6870312659d ("nfs4client: convert to idr_alloc()")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/nfs4client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 706ad10..ca7527d 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -33,7 +33,7 @@ static int nfs_get_cb_ident_idr(struct nfs_client *clp, int minorversion)
return ret;
idr_preload(GFP_KERNEL);
spin_lock(&nn->nfs_client_lock);
- ret = idr_alloc(&nn->cb_ident_idr, clp, 0, 0, GFP_NOWAIT);
+ ret = idr_alloc(&nn->cb_ident_idr, clp, 1, 0, GFP_NOWAIT);
if (ret >= 0)
clp->cl_cb_ident = ret;
spin_unlock(&nn->nfs_client_lock);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 071/128] nfs4: limit callback decoding to received bytes
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (69 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 070/128] nfs4: start callback_ident at idr 1 Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 072/128] ALSA: hda - Fix headphone noise after Dell XPS 13 resume back from S3 Kamal Mostafa
` (56 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Benjamin Coddington, Trond Myklebust, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Coddington <bcodding@redhat.com>
commit 38b7631fbe42e6e247e9fc9879f961b14a687e3b upstream.
A truncated cb_compound request will cause the client to decode null or
data from a previous callback for nfs4.1 backchannel case, or uninitialized
data for the nfs4.0 case. This is because the path through
svc_process_common() advances the request's iov_base and decrements iov_len
without adjusting the overall xdr_buf's len field. That causes
xdr_init_decode() to set up the xdr_stream with an incorrect length in
nfs4_callback_compound().
Fixing this for the nfs4.1 backchannel case first requires setting the
correct iov_len and page_len based on the length of received data in the
same manner as the nfs4.0 case.
Then the request's xdr_buf length can be adjusted for both cases based upon
the remaining iov_len and page_len.
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/callback_xdr.c | 7 +++++--
net/sunrpc/backchannel_rqst.c | 8 ++++++++
net/sunrpc/svc.c | 1 +
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index 02f8d09..1e36635 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -76,7 +76,8 @@ static __be32 *read_buf(struct xdr_stream *xdr, int nbytes)
p = xdr_inline_decode(xdr, nbytes);
if (unlikely(p == NULL))
- printk(KERN_WARNING "NFS: NFSv4 callback reply buffer overflowed!\n");
+ printk(KERN_WARNING "NFS: NFSv4 callback reply buffer overflowed "
+ "or truncated request.\n");
return p;
}
@@ -892,6 +893,7 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *r
struct cb_compound_hdr_arg hdr_arg = { 0 };
struct cb_compound_hdr_res hdr_res = { NULL };
struct xdr_stream xdr_in, xdr_out;
+ struct xdr_buf *rq_arg = &rqstp->rq_arg;
__be32 *p, status;
struct cb_process_state cps = {
.drc_status = 0,
@@ -903,7 +905,8 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *r
dprintk("%s: start\n", __func__);
- xdr_init_decode(&xdr_in, &rqstp->rq_arg, rqstp->rq_arg.head[0].iov_base);
+ rq_arg->len = rq_arg->head[0].iov_len + rq_arg->page_len;
+ xdr_init_decode(&xdr_in, rq_arg, rq_arg->head[0].iov_base);
p = (__be32*)((char *)rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len);
xdr_init_encode(&xdr_out, &rqstp->rq_res, p);
diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
index 28504df..b57cee1 100644
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -308,11 +308,19 @@ void xprt_complete_bc_request(struct rpc_rqst *req, uint32_t copied)
{
struct rpc_xprt *xprt = req->rq_xprt;
struct svc_serv *bc_serv = xprt->bc_serv;
+ struct xdr_buf *rq_rcv_buf = &req->rq_rcv_buf;
spin_lock(&xprt->bc_pa_lock);
list_del(&req->rq_bc_pa_list);
spin_unlock(&xprt->bc_pa_lock);
+ if (copied <= rq_rcv_buf->head[0].iov_len) {
+ rq_rcv_buf->head[0].iov_len = copied;
+ rq_rcv_buf->page_len = 0;
+ } else {
+ rq_rcv_buf->page_len = copied - rq_rcv_buf->head[0].iov_len;
+ }
+
req->rq_private_buf.len = copied;
set_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state);
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 91eaef1..b59b6a7 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1361,6 +1361,7 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
memcpy(&rqstp->rq_addr, &req->rq_xprt->addr, rqstp->rq_addrlen);
memcpy(&rqstp->rq_arg, &req->rq_rcv_buf, sizeof(rqstp->rq_arg));
memcpy(&rqstp->rq_res, &req->rq_snd_buf, sizeof(rqstp->rq_res));
+ rqstp->rq_arg.len = req->rq_private_buf.len;
/* reset result send buffer "put" position */
resv->iov_len = 0;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 072/128] ALSA: hda - Fix headphone noise after Dell XPS 13 resume back from S3
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (70 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 071/128] nfs4: limit callback decoding to received bytes Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 073/128] ARM: dts: vfxxx: Fix dspi[01] spi-num-chipselects Kamal Mostafa
` (55 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Kailang Yang, Hui Wang, Takashi Iwai, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Wang <hui.wang@canonical.com>
commit 8c69729b4439bbda88c3073df7243f755cc418ed upstream.
We have a machine Dell XPS 13 with the codec alc256, after resume back
from S3, the headphone has noise when play sound.
Through comparing with the coeff vaule before and after S3, we found
restoring a coeff register will help remove noise.
BugLink: https://bugs.launchpad.net/bugs/1519168
Cc: Kailang Yang <kailang@realtek.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/patch_realtek.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 8ab29ec..454ada2 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4355,6 +4355,7 @@ enum {
ALC280_FIXUP_HP_GPIO4,
ALC286_FIXUP_HP_GPIO_LED,
ALC275_FIXUP_DELL_XPS,
+ ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE,
};
static const struct hda_fixup alc269_fixups[] = {
@@ -4865,6 +4866,17 @@ static const struct hda_fixup alc269_fixups[] = {
{}
}
},
+ [ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE] = {
+ .type = HDA_FIXUP_VERBS,
+ .v.verbs = (const struct hda_verb[]) {
+ /* Disable pass-through path for FRONT 14h */
+ {0x20, AC_VERB_SET_COEF_INDEX, 0x36},
+ {0x20, AC_VERB_SET_PROC_COEF, 0x1737},
+ {}
+ },
+ .chained = true,
+ .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
+ },
};
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -4894,6 +4906,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
+ SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 073/128] ARM: dts: vfxxx: Fix dspi[01] spi-num-chipselects.
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (71 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 072/128] ALSA: hda - Fix headphone noise after Dell XPS 13 resume back from S3 Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 074/128] ARM/arm64: KVM: test properly for a PTE's uncachedness Kamal Mostafa
` (54 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Cory Tusar, Shawn Guo, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Cory Tusar <cory.tusar@pid1solutions.com>
commit 897ed0ca5979f103b8de3c09bcca2ae4860eb5a5 upstream.
Per the Vybrid Reference Manual (section 3.8.6.1), dspi0 has 6 chip
select signals associated with it, while dspi1 has only 4.
Signed-off-by: Cory Tusar <cory.tusar@pid1solutions.com>
Acked-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
[ kamal: backport to 3.19-stable: only dspi0 in 3.19 ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/dts/vfxxx.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/vfxxx.dtsi b/arch/arm/boot/dts/vfxxx.dtsi
index 505969a..26efcd29 100644
--- a/arch/arm/boot/dts/vfxxx.dtsi
+++ b/arch/arm/boot/dts/vfxxx.dtsi
@@ -128,7 +128,7 @@
reg = <0x4002c000 0x1000>;
clocks = <&clks VF610_CLK_DSPI0>;
clock-names = "dspi";
- spi-num-chipselects = <5>;
+ spi-num-chipselects = <6>;
status = "disabled";
};
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 074/128] ARM/arm64: KVM: test properly for a PTE's uncachedness
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (72 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 073/128] ARM: dts: vfxxx: Fix dspi[01] spi-num-chipselects Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 075/128] arm64: KVM: Fix AArch32 to AArch64 register mapping Kamal Mostafa
` (53 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ard Biesheuvel, Christoffer Dall, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
commit e6fab54423450d699a09ec2b899473a541f61971 upstream.
The open coded tests for checking whether a PTE maps a page as
uncached use a flawed '(pte_val(xxx) & CONST) != CONST' pattern,
which is not guaranteed to work since the type of a mapping is
not a set of mutually exclusive bits
For HYP mappings, the type is an index into the MAIR table (i.e, the
index itself does not contain any information whatsoever about the
type of the mapping), and for stage-2 mappings it is a bit field where
normal memory and device types are defined as follows:
#define MT_S2_NORMAL 0xf
#define MT_S2_DEVICE_nGnRE 0x1
I.e., masking *and* comparing with the latter matches on the former,
and we have been getting lucky merely because the S2 device mappings
also have the PTE_UXN bit set, or we would misidentify memory mappings
as device mappings.
Since the unmap_range() code path (which contains one instance of the
flawed test) is used both for HYP mappings and stage-2 mappings, and
considering the difference between the two, it is non-trivial to fix
this by rewriting the tests in place, as it would involve passing
down the type of mapping through all the functions.
However, since HYP mappings and stage-2 mappings both deal with host
physical addresses, we can simply check whether the mapping is backed
by memory that is managed by the host kernel, and only perform the
D-cache maintenance if this is the case.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/kvm/mmu.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 0512ed4..a2c1ebf 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -78,6 +78,11 @@ static void kvm_flush_dcache_pud(pud_t pud)
__kvm_flush_dcache_pud(pud);
}
+static bool kvm_is_device_pfn(unsigned long pfn)
+{
+ return !pfn_valid(pfn);
+}
+
static int mmu_topup_memory_cache(struct kvm_mmu_memory_cache *cache,
int min, int max)
{
@@ -174,7 +179,7 @@ static void unmap_ptes(struct kvm *kvm, pmd_t *pmd,
kvm_tlb_flush_vmid_ipa(kvm, addr);
/* No need to invalidate the cache for device mappings */
- if ((pte_val(old_pte) & PAGE_S2_DEVICE) != PAGE_S2_DEVICE)
+ if (!kvm_is_device_pfn(__phys_to_pfn(addr)))
kvm_flush_dcache_pte(old_pte);
put_page(virt_to_page(pte));
@@ -266,8 +271,7 @@ static void stage2_flush_ptes(struct kvm *kvm, pmd_t *pmd,
pte = pte_offset_kernel(pmd, addr);
do {
- if (!pte_none(*pte) &&
- (pte_val(*pte) & PAGE_S2_DEVICE) != PAGE_S2_DEVICE)
+ if (!pte_none(*pte) && !kvm_is_device_pfn(__phys_to_pfn(addr)))
kvm_flush_dcache_pte(*pte);
} while (pte++, addr += PAGE_SIZE, addr != end);
}
@@ -983,11 +987,6 @@ static bool kvm_is_write_fault(struct kvm_vcpu *vcpu)
return kvm_vcpu_dabt_iswrite(vcpu);
}
-static bool kvm_is_device_pfn(unsigned long pfn)
-{
- return !pfn_valid(pfn);
-}
-
static void coherent_cache_guest_page(struct kvm_vcpu *vcpu, pfn_t pfn,
unsigned long size, bool uncached)
{
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 075/128] arm64: KVM: Fix AArch32 to AArch64 register mapping
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (73 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 074/128] ARM/arm64: KVM: test properly for a PTE's uncachedness Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 076/128] drm/radeon: make rv770_set_sw_state failures non-fatal Kamal Mostafa
` (52 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Marc Zyngier, Christoffer Dall, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <marc.zyngier@arm.com>
commit c0f0963464c24e034b858441205455bf2a5d93ad upstream.
When running a 32bit guest under a 64bit hypervisor, the ARMv8
architecture defines a mapping of the 32bit registers in the 64bit
space. This includes banked registers that are being demultiplexed
over the 64bit ones.
On exceptions caused by an operation involving a 32bit register, the
HW exposes the register number in the ESR_EL2 register. It was so
far understood that SW had to distinguish between AArch32 and AArch64
accesses (based on the current AArch32 mode and register number).
It turns out that I misinterpreted the ARM ARM, and the clue is in
D1.20.1: "For some exceptions, the exception syndrome given in the
ESR_ELx identifies one or more register numbers from the issued
instruction that generated the exception. Where the exception is
taken from an Exception level using AArch32 these register numbers
give the AArch64 view of the register."
Which means that the HW is already giving us the translated version,
and that we shouldn't try to interpret it at all (for example, doing
an MMIO operation from the IRQ mode using the LR register leads to
very unexpected behaviours).
The fix is thus not to perform a call to vcpu_reg32() at all from
vcpu_reg(), and use whatever register number is supplied directly.
The only case we need to find out about the mapping is when we
actively generate a register access, which only occurs when injecting
a fault in a guest.
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm64/include/asm/kvm_emulate.h | 8 +++++---
arch/arm64/kvm/inject_fault.c | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
index 3cb4c85..a1050f7 100644
--- a/arch/arm64/include/asm/kvm_emulate.h
+++ b/arch/arm64/include/asm/kvm_emulate.h
@@ -96,11 +96,13 @@ static inline void vcpu_set_thumb(struct kvm_vcpu *vcpu)
*vcpu_cpsr(vcpu) |= COMPAT_PSR_T_BIT;
}
+/*
+ * vcpu_reg should always be passed a register number coming from a
+ * read of ESR_EL2. Otherwise, it may give the wrong result on AArch32
+ * with banked registers.
+ */
static inline unsigned long *vcpu_reg(const struct kvm_vcpu *vcpu, u8 reg_num)
{
- if (vcpu_mode_is_32bit(vcpu))
- return vcpu_reg32(vcpu, reg_num);
-
return (unsigned long *)&vcpu_gp_regs(vcpu)->regs.regs[reg_num];
}
diff --git a/arch/arm64/kvm/inject_fault.c b/arch/arm64/kvm/inject_fault.c
index 86825f88..f527a37 100644
--- a/arch/arm64/kvm/inject_fault.c
+++ b/arch/arm64/kvm/inject_fault.c
@@ -48,7 +48,7 @@ static void prepare_fault32(struct kvm_vcpu *vcpu, u32 mode, u32 vect_offset)
/* Note: These now point to the banked copies */
*vcpu_spsr(vcpu) = new_spsr_value;
- *vcpu_reg(vcpu, 14) = *vcpu_pc(vcpu) + return_offset;
+ *vcpu_reg32(vcpu, 14) = *vcpu_pc(vcpu) + return_offset;
/* Branch to exception vector */
if (sctlr & (1 << 13))
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 076/128] drm/radeon: make rv770_set_sw_state failures non-fatal
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (74 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 075/128] arm64: KVM: Fix AArch32 to AArch64 register mapping Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 077/128] PCI: Prevent out of bounds access in numa_node override Kamal Mostafa
` (51 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit 4e7697ed79d0c0d5f869c87a6b3ce3d5cd1a07d6 upstream.
On some cards it takes a relatively long time for the change
to take place. Make a timeout non-fatal.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=76130
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/rv770_dpm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c b/drivers/gpu/drm/radeon/rv770_dpm.c
index 755a8f9..f1d2569 100644
--- a/drivers/gpu/drm/radeon/rv770_dpm.c
+++ b/drivers/gpu/drm/radeon/rv770_dpm.c
@@ -1416,7 +1416,7 @@ int rv770_resume_smc(struct radeon_device *rdev)
int rv770_set_sw_state(struct radeon_device *rdev)
{
if (rv770_send_msg_to_smc(rdev, PPSMC_MSG_SwitchToSwState) != PPSMC_Result_OK)
- return -EINVAL;
+ DRM_ERROR("rv770_set_sw_state failed\n");
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 077/128] PCI: Prevent out of bounds access in numa_node override
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (75 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 076/128] drm/radeon: make rv770_set_sw_state failures non-fatal Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 078/128] ALSA: hda - Fix noise on Gigabyte Z170X mobo Kamal Mostafa
` (50 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mathias Krause, Bjorn Helgaas, Sasha Levin, Prarit Bhargava,
Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <minipli@googlemail.com>
commit 3dcc8d39cf15fa3ceabedcffcbd3958fe953555a upstream.
Commit 1266963170f5 ("PCI: Prevent out of bounds access in numa_node
override") missed that the user-provided node could also be negative.
Handle this case as well to avoid out-of-bounds accesses to the
node_states[] array. However, allow the special value -1, i.e.
NUMA_NO_NODE, to be able to set the 'no specific node' configuration.
Fixes: 1266963170f5 ("PCI: Prevent out of bounds access in numa_node override")
Fixes: 63692df103e9 ("PCI: Allow numa_node override via sysfs")
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Sasha Levin <sasha.levin@oracle.com>
CC: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/pci/pci-sysfs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 9261868..eead54c 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -216,7 +216,10 @@ static ssize_t numa_node_store(struct device *dev,
if (ret)
return ret;
- if (node >= MAX_NUMNODES || !node_online(node))
+ if ((node < 0 && node != NUMA_NO_NODE) || node >= MAX_NUMNODES)
+ return -EINVAL;
+
+ if (node != NUMA_NO_NODE && !node_online(node))
return -EINVAL;
add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 078/128] ALSA: hda - Fix noise on Gigabyte Z170X mobo
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (76 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 077/128] PCI: Prevent out of bounds access in numa_node override Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 079/128] btrfs: fix signed overflows in btrfs_sync_file Kamal Mostafa
` (49 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 0c25ad80408e95e0a4fbaf0056950206e95f726f upstream.
Gigabyte Z710X mobo with ALC1150 codec gets significant noises from
the analog loopback routes even if their inputs are all muted.
Simply kill the aamix for fixing it.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=108301
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/patch_realtek.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 454ada2..d449979 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1768,6 +1768,7 @@ enum {
ALC882_FIXUP_NO_PRIMARY_HP,
ALC887_FIXUP_ASUS_BASS,
ALC887_FIXUP_BASS_CHMAP,
+ ALC882_FIXUP_DISABLE_AAMIX,
};
static void alc889_fixup_coef(struct hda_codec *codec,
@@ -1929,6 +1930,8 @@ static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
static void alc_fixup_bass_chmap(struct hda_codec *codec,
const struct hda_fixup *fix, int action);
+static void alc_fixup_disable_aamix(struct hda_codec *codec,
+ const struct hda_fixup *fix, int action);
static const struct hda_fixup alc882_fixups[] = {
[ALC882_FIXUP_ABIT_AW9D_MAX] = {
@@ -2160,6 +2163,10 @@ static const struct hda_fixup alc882_fixups[] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc_fixup_bass_chmap,
},
+ [ALC882_FIXUP_DISABLE_AAMIX] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc_fixup_disable_aamix,
+ },
};
static const struct snd_pci_quirk alc882_fixup_tbl[] = {
@@ -2227,6 +2234,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
+ SND_PCI_QUIRK(0x1458, 0xa182, "Gigabyte Z170X-UD3", ALC882_FIXUP_DISABLE_AAMIX),
SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 079/128] btrfs: fix signed overflows in btrfs_sync_file
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (77 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 078/128] ALSA: hda - Fix noise on Gigabyte Z170X mobo Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 080/128] ARM: dove: Fix legacy get_irqnr_and_base Kamal Mostafa
` (48 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: David Sterba, Chris Mason, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: David Sterba <dsterba@suse.com>
commit 9dcbeed4d7e11e1dcf5e55475de3754f0855d1c2 upstream.
The calculation of range length in btrfs_sync_file leads to signed
overflow. This was caught by PaX gcc SIZE_OVERFLOW plugin.
https://forums.grsecurity.net/viewtopic.php?f=1&t=4284
The fsync call passes 0 and LLONG_MAX, the range length does not fit to
loff_t and overflows, but the value is converted to u64 so it silently
works as expected.
The minimal fix is a typecast to u64, switching functions to take
(start, end) instead of (start, len) would be more intrusive.
Coccinelle script found that there's one more opencoded calculation of
the length.
<smpl>
@@
loff_t start, end;
@@
* end - start
</smpl>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
[ kamal: backport to 3.19-stable: use len in both btrfs_wait_ordered_range
calls, like
b659ef0 Btrfs: avoid syncing log in the fast fsync path when not necessary ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/btrfs/file.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 11ec6e5..1e54adf 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1884,7 +1884,13 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
struct btrfs_log_ctx ctx;
int ret = 0;
bool full_sync = 0;
+ u64 len;
+ /*
+ * The range length can be represented by u64, we have to do the typecasts
+ * to avoid signed overflow if it's [0, LLONG_MAX] eg. from fsync()
+ */
+ len = (u64)end - (u64)start + 1;
trace_btrfs_sync_file(file, datasync);
/*
@@ -1912,7 +1918,7 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
* all extents are persisted and the respective file extent
* items are in the fs/subvol btree.
*/
- ret = btrfs_wait_ordered_range(inode, start, end - start + 1);
+ ret = btrfs_wait_ordered_range(inode, start, len);
} else {
/*
* Start any new ordered operations before starting to log the
@@ -2070,8 +2076,7 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
}
}
if (!full_sync) {
- ret = btrfs_wait_ordered_range(inode, start,
- end - start + 1);
+ ret = btrfs_wait_ordered_range(inode, start, len);
if (ret) {
btrfs_end_transaction(trans, root);
goto out;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 080/128] ARM: dove: Fix legacy get_irqnr_and_base
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (78 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 079/128] btrfs: fix signed overflows in btrfs_sync_file Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 081/128] ARM: orion5x: " Kamal Mostafa
` (47 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Nicolas Pitre, Jason Cooper, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Pitre <nicolas.pitre@linaro.org>
commit c1c90728efa49eab81ae816718d84116a22b790e upstream.
Commit 5d6bed2a9c ("ARM: dove: fix legacy dove IRQ numbers") shifted
IRQ numbers by one but didn't update the get_irqnr_and_base macro
accordingly. This macro is involved when CONFIG_MULTI_IRQ_HANDLER
is not defined.
[jac: 5d6bed2a9c went in to v4.2, but was backported to v3.18]
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Fixes: 5d6bed2a9c ("ARM: dove: fix legacy dove IRQ numbers")
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/mach-dove/include/mach/entry-macro.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-dove/include/mach/entry-macro.S b/arch/arm/mach-dove/include/mach/entry-macro.S
index 72d622b..df1d44b 100644
--- a/arch/arm/mach-dove/include/mach/entry-macro.S
+++ b/arch/arm/mach-dove/include/mach/entry-macro.S
@@ -18,13 +18,13 @@
@ check low interrupts
ldr \irqstat, [\base, #IRQ_CAUSE_LOW_OFF]
ldr \tmp, [\base, #IRQ_MASK_LOW_OFF]
- mov \irqnr, #31
+ mov \irqnr, #32
ands \irqstat, \irqstat, \tmp
@ if no low interrupts set, check high interrupts
ldreq \irqstat, [\base, #IRQ_CAUSE_HIGH_OFF]
ldreq \tmp, [\base, #IRQ_MASK_HIGH_OFF]
- moveq \irqnr, #63
+ moveq \irqnr, #64
andeqs \irqstat, \irqstat, \tmp
@ find first active interrupt source
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 081/128] ARM: orion5x: Fix legacy get_irqnr_and_base
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (79 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 080/128] ARM: dove: Fix legacy get_irqnr_and_base Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 082/128] drm/radeon: make some dpm errors debug only Kamal Mostafa
` (46 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Nicolas Pitre, Jason Cooper, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Pitre <nicolas.pitre@linaro.org>
commit 4d2ec7e206ae03a51dfbdedc120ce88d403ec926 upstream.
Commit 5be9fc23cd ("ARM: orion5x: fix legacy orion5x IRQ numbers") shifted
IRQ numbers by one but didn't update the get_irqnr_and_base macro
accordingly. This macro is involved when CONFIG_MULTI_IRQ_HANDLER
is not defined.
[jac: 5d6bed2a9c went in to v4.2, but was backported to v3.18]
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Fixes: 5be9fc23cd ("ARM: orion5x: fix legacy orion5x IRQ numbers")
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/mach-orion5x/include/mach/entry-macro.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-orion5x/include/mach/entry-macro.S b/arch/arm/mach-orion5x/include/mach/entry-macro.S
index 79eb502..73919a3 100644
--- a/arch/arm/mach-orion5x/include/mach/entry-macro.S
+++ b/arch/arm/mach-orion5x/include/mach/entry-macro.S
@@ -21,5 +21,5 @@
@ find cause bits that are unmasked
ands \irqstat, \irqstat, \tmp @ clear Z flag if any
clzne \irqnr, \irqstat @ calc irqnr
- rsbne \irqnr, \irqnr, #31
+ rsbne \irqnr, \irqnr, #32
.endm
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 082/128] drm/radeon: make some dpm errors debug only
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (80 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 081/128] ARM: orion5x: " Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 083/128] nfs: if we have no valid attrs, then don't declare the attribute cache valid Kamal Mostafa
` (45 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit 9c565e3386fdc804a61f8c116efc2c5999ba46e1 upstream.
"Could not force DPM to low", etc. is usually harmless and
just confuses users.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/rv730_dpm.c | 2 +-
drivers/gpu/drm/radeon/rv770_dpm.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/radeon/rv730_dpm.c b/drivers/gpu/drm/radeon/rv730_dpm.c
index 3f5e1cf..d37ba2c 100644
--- a/drivers/gpu/drm/radeon/rv730_dpm.c
+++ b/drivers/gpu/drm/radeon/rv730_dpm.c
@@ -464,7 +464,7 @@ void rv730_stop_dpm(struct radeon_device *rdev)
result = rv770_send_msg_to_smc(rdev, PPSMC_MSG_TwoLevelsDisabled);
if (result != PPSMC_Result_OK)
- DRM_ERROR("Could not force DPM to low\n");
+ DRM_DEBUG("Could not force DPM to low\n");
WREG32_P(GENERAL_PWRMGT, 0, ~GLOBAL_PWRMGT_EN);
diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c b/drivers/gpu/drm/radeon/rv770_dpm.c
index f1d2569..24f85c6 100644
--- a/drivers/gpu/drm/radeon/rv770_dpm.c
+++ b/drivers/gpu/drm/radeon/rv770_dpm.c
@@ -193,7 +193,7 @@ void rv770_stop_dpm(struct radeon_device *rdev)
result = rv770_send_msg_to_smc(rdev, PPSMC_MSG_TwoLevelsDisabled);
if (result != PPSMC_Result_OK)
- DRM_ERROR("Could not force DPM to low.\n");
+ DRM_DEBUG("Could not force DPM to low.\n");
WREG32_P(GENERAL_PWRMGT, 0, ~GLOBAL_PWRMGT_EN);
@@ -1416,7 +1416,7 @@ int rv770_resume_smc(struct radeon_device *rdev)
int rv770_set_sw_state(struct radeon_device *rdev)
{
if (rv770_send_msg_to_smc(rdev, PPSMC_MSG_SwitchToSwState) != PPSMC_Result_OK)
- DRM_ERROR("rv770_set_sw_state failed\n");
+ DRM_DEBUG("rv770_set_sw_state failed\n");
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 083/128] nfs: if we have no valid attrs, then don't declare the attribute cache valid
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (81 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 082/128] drm/radeon: make some dpm errors debug only Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 084/128] xen/gntdev: Grant maps should not be subject to NUMA balancing Kamal Mostafa
` (44 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jeff Layton, Trond Myklebust, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <jlayton@poochiereds.net>
commit c812012f9ca7cf89c9e1a1cd512e6c3b5be04b85 upstream.
If we pass in an empty nfs_fattr struct to nfs_update_inode, it will
(correctly) not update any of the attributes, but it then clears the
NFS_INO_INVALID_ATTR flag, which indicates that the attributes are
up to date. Don't clear the flag if the fattr struct has no valid
attrs to apply.
Reviewed-by: Steve French <steve.french@primarydata.com>
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/inode.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 53e269e..18c22b8 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1719,7 +1719,11 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
nfsi->attrtimeo_timestamp = now;
}
}
- invalid &= ~NFS_INO_INVALID_ATTR;
+
+ /* Don't declare attrcache up to date if there were no attrs! */
+ if (fattr->valid != 0)
+ invalid &= ~NFS_INO_INVALID_ATTR;
+
/* Don't invalidate the data if we were to blame */
if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)
|| S_ISLNK(inode->i_mode)))
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 084/128] xen/gntdev: Grant maps should not be subject to NUMA balancing
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (82 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 083/128] nfs: if we have no valid attrs, then don't declare the attribute cache valid Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 085/128] iscsi-target: Fix rx_login_comp hang after login failure Kamal Mostafa
` (43 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Boris Ostrovsky, David Vrabel, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
commit 9c17d96500f78d7ecdb71ca6942830158bc75a2b upstream.
Doing so will cause the grant to be unmapped and then, during
fault handling, the fault to be mistakenly treated as NUMA hint
fault.
In addition, even if those maps could partcipate in NUMA
balancing, it wouldn't provide any benefit since we are unable
to determine physical page's node (even if/when VNUMA is
implemented).
Marking grant maps' VMAs as VM_IO will exclude them from being
part of NUMA balancing.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/xen/gntdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index 91cc446..7ffbb93 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -765,7 +765,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
vma->vm_ops = &gntdev_vmops;
- vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+ vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP | VM_IO;
if (use_ptemod)
vma->vm_flags |= VM_DONTCOPY;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 085/128] iscsi-target: Fix rx_login_comp hang after login failure
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (83 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 084/128] xen/gntdev: Grant maps should not be subject to NUMA balancing Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 086/128] target: Fix race for SCF_COMPARE_AND_WRITE_POST checking Kamal Mostafa
` (42 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sagi Grimberg, Nicholas Bellinger, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <nab@linux-iscsi.org>
commit ca82c2bded29b38d36140bfa1e76a7bbfcade390 upstream.
This patch addresses a case where iscsi_target_do_tx_login_io()
fails sending the last login response PDU, after the RX/TX
threads have already been started.
The case centers around iscsi_target_rx_thread() not invoking
allow_signal(SIGINT) before the send_sig(SIGINT, ...) occurs
from the failure path, resulting in RX thread hanging
indefinately on iscsi_conn->rx_login_comp.
Note this bug is a regression introduced by:
commit e54198657b65625085834847ab6271087323ffea
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date: Wed Jul 22 23:14:19 2015 -0700
iscsi-target: Fix iscsit_start_kthreads failure OOPs
To address this bug, complete ->rx_login_complete for good
measure in the failure path, and immediately return from
RX thread context if connection state did not actually reach
full feature phase (TARG_CONN_STATE_LOGGED_IN).
Cc: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/target/iscsi/iscsi_target.c | 13 ++++++++++++-
drivers/target/iscsi/iscsi_target_nego.c | 1 +
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 0c508a4..78dda5a 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -4052,6 +4052,17 @@ reject:
return iscsit_add_reject(conn, ISCSI_REASON_BOOKMARK_NO_RESOURCES, buf);
}
+static bool iscsi_target_check_conn_state(struct iscsi_conn *conn)
+{
+ bool ret;
+
+ spin_lock_bh(&conn->state_lock);
+ ret = (conn->conn_state != TARG_CONN_STATE_LOGGED_IN);
+ spin_unlock_bh(&conn->state_lock);
+
+ return ret;
+}
+
int iscsi_target_rx_thread(void *arg)
{
int ret, rc;
@@ -4069,7 +4080,7 @@ int iscsi_target_rx_thread(void *arg)
* incoming iscsi/tcp socket I/O, and/or failing the connection.
*/
rc = wait_for_completion_interruptible(&conn->rx_login_comp);
- if (rc < 0)
+ if (rc < 0 || iscsi_target_check_conn_state(conn))
return 0;
if (conn->conn_transport->transport_type == ISCSI_INFINIBAND) {
diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c
index 092112e..dcb6348 100644
--- a/drivers/target/iscsi/iscsi_target_nego.c
+++ b/drivers/target/iscsi/iscsi_target_nego.c
@@ -393,6 +393,7 @@ err:
if (login->login_complete) {
if (conn->rx_thread && conn->rx_thread_active) {
send_sig(SIGINT, conn->rx_thread, 1);
+ complete(&conn->rx_login_comp);
kthread_stop(conn->rx_thread);
}
if (conn->tx_thread && conn->tx_thread_active) {
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 086/128] target: Fix race for SCF_COMPARE_AND_WRITE_POST checking
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (84 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 085/128] iscsi-target: Fix rx_login_comp hang after login failure Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 087/128] target: fix COMPARE_AND_WRITE non zero SGL offset data corruption Kamal Mostafa
` (41 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sagi Grimberg, Nicholas Bellinger, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <nab@linux-iscsi.org>
commit 057085e522f8bf94c2e691a5b76880f68060f8ba upstream.
This patch addresses a race + use after free where the first
stage of COMPARE_AND_WRITE in compare_and_write_callback()
is rescheduled after the backend sends the secondary WRITE,
resulting in second stage compare_and_write_post() callback
completing in target_complete_ok_work() before the first
can return.
Because current code depends on checking se_cmd->se_cmd_flags
after return from se_cmd->transport_complete_callback(),
this results in first stage having SCF_COMPARE_AND_WRITE_POST
set, which incorrectly falls through into second stage CAW
processing code, eventually triggering a NULL pointer
dereference due to use after free.
To address this bug, pass in a new *post_ret parameter into
se_cmd->transport_complete_callback(), and depend upon this
value instead of ->se_cmd_flags to determine when to return
or fall through into ->queue_status() code for CAW.
Cc: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/target/target_core_sbc.c | 13 +++++++++----
drivers/target/target_core_transport.c | 14 ++++++++------
include/target/target_core_base.h | 2 +-
3 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c
index 48de053..384f20c 100644
--- a/drivers/target/target_core_sbc.c
+++ b/drivers/target/target_core_sbc.c
@@ -299,7 +299,8 @@ sbc_setup_write_same(struct se_cmd *cmd, unsigned char *flags, struct sbc_ops *o
return 0;
}
-static sense_reason_t xdreadwrite_callback(struct se_cmd *cmd, bool success)
+static sense_reason_t xdreadwrite_callback(struct se_cmd *cmd, bool success,
+ int *post_ret)
{
unsigned char *buf, *addr;
struct scatterlist *sg;
@@ -363,7 +364,8 @@ sbc_execute_rw(struct se_cmd *cmd)
cmd->data_direction);
}
-static sense_reason_t compare_and_write_post(struct se_cmd *cmd, bool success)
+static sense_reason_t compare_and_write_post(struct se_cmd *cmd, bool success,
+ int *post_ret)
{
struct se_device *dev = cmd->se_dev;
@@ -373,8 +375,10 @@ static sense_reason_t compare_and_write_post(struct se_cmd *cmd, bool success)
* sent to the backend driver.
*/
spin_lock_irq(&cmd->t_state_lock);
- if ((cmd->transport_state & CMD_T_SENT) && !cmd->scsi_status)
+ if ((cmd->transport_state & CMD_T_SENT) && !cmd->scsi_status) {
cmd->se_cmd_flags |= SCF_COMPARE_AND_WRITE_POST;
+ *post_ret = 1;
+ }
spin_unlock_irq(&cmd->t_state_lock);
/*
@@ -386,7 +390,8 @@ static sense_reason_t compare_and_write_post(struct se_cmd *cmd, bool success)
return TCM_NO_SENSE;
}
-static sense_reason_t compare_and_write_callback(struct se_cmd *cmd, bool success)
+static sense_reason_t compare_and_write_callback(struct se_cmd *cmd, bool success,
+ int *post_ret)
{
struct se_device *dev = cmd->se_dev;
struct scatterlist *write_sg = NULL, *sg;
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index f786de0..a738637 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1596,7 +1596,7 @@ bool target_stop_cmd(struct se_cmd *cmd, unsigned long *flags)
void transport_generic_request_failure(struct se_cmd *cmd,
sense_reason_t sense_reason)
{
- int ret = 0;
+ int ret = 0, post_ret = 0;
pr_debug("-----[ Storage Engine Exception for cmd: %p ITT: 0x%08x"
" CDB: 0x%02x\n", cmd, cmd->se_tfo->get_task_tag(cmd),
@@ -1619,7 +1619,7 @@ void transport_generic_request_failure(struct se_cmd *cmd,
*/
if ((cmd->se_cmd_flags & SCF_COMPARE_AND_WRITE) &&
cmd->transport_complete_callback)
- cmd->transport_complete_callback(cmd, false);
+ cmd->transport_complete_callback(cmd, false, &post_ret);
switch (sense_reason) {
case TCM_NON_EXISTENT_LUN:
@@ -1974,11 +1974,13 @@ static void target_complete_ok_work(struct work_struct *work)
*/
if (cmd->transport_complete_callback) {
sense_reason_t rc;
+ bool caw = (cmd->se_cmd_flags & SCF_COMPARE_AND_WRITE);
+ bool zero_dl = !(cmd->data_length);
+ int post_ret = 0;
- rc = cmd->transport_complete_callback(cmd, true);
- if (!rc && !(cmd->se_cmd_flags & SCF_COMPARE_AND_WRITE_POST)) {
- if ((cmd->se_cmd_flags & SCF_COMPARE_AND_WRITE) &&
- !cmd->data_length)
+ rc = cmd->transport_complete_callback(cmd, true, &post_ret);
+ if (!rc && !post_ret) {
+ if (caw && zero_dl)
goto queue_rsp;
return;
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 985ca4c..08f581b 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -524,7 +524,7 @@ struct se_cmd {
sense_reason_t (*execute_cmd)(struct se_cmd *);
sense_reason_t (*execute_rw)(struct se_cmd *, struct scatterlist *,
u32, enum dma_data_direction);
- sense_reason_t (*transport_complete_callback)(struct se_cmd *, bool);
+ sense_reason_t (*transport_complete_callback)(struct se_cmd *, bool, int *);
unsigned char *t_task_cdb;
unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE];
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 087/128] target: fix COMPARE_AND_WRITE non zero SGL offset data corruption
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (85 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 086/128] target: Fix race for SCF_COMPARE_AND_WRITE_POST checking Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 088/128] ARM: dts: Kirkwood: Fix QNAP TS219 power-off Kamal Mostafa
` (40 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jan Engelhardt, Nicholas Bellinger, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Engelhardt <jengelh@inai.de>
commit d94e5a61357a04938ce14d6033b4d33a3c5fd780 upstream.
target_core_sbc's compare_and_write functionality suffers from taking
data at the wrong memory location when writing a CAW request to disk
when a SGL offset is non-zero.
This can happen with loopback and vhost-scsi fabric drivers when
SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC is used to map existing user-space
SGL memory into COMPARE_AND_WRITE READ/WRITE payload buffers.
Given the following sample LIO subtopology,
% targetcli ls /loopback/
o- loopback ................................. [1 Target]
o- naa.6001405ebb8df14a ....... [naa.60014059143ed2b3]
o- luns ................................... [2 LUNs]
o- lun0 ................ [iblock/ram0 (/dev/ram0)]
o- lun1 ................ [iblock/ram1 (/dev/ram1)]
% lsscsi -g
[3:0:1:0] disk LIO-ORG IBLOCK 4.0 /dev/sdc /dev/sg3
[3:0:1:1] disk LIO-ORG IBLOCK 4.0 /dev/sdd /dev/sg4
the following bug can be observed in Linux 4.3 and 4.4~rc1:
% perl -e 'print chr$_ for 0..255,reverse 0..255' >rand
% perl -e 'print "\0" x 512' >zero
% cat rand >/dev/sdd
% sg_compare_and_write -i rand -D zero --lba 0 /dev/sdd
% sg_compare_and_write -i zero -D rand --lba 0 /dev/sdd
Miscompare reported
% hexdump -Cn 512 /dev/sdd
00000000 0f 0e 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
00000200
Rather than writing all-zeroes as instructed with the -D file, it
corrupts the data in the sector by splicing some of the original
bytes in. The page of the first entry of cmd->t_data_sg includes the
CDB, and sg->offset is set to a position past the CDB. I presume that
sg->offset is also the right choice to use for subsequent sglist
members.
Signed-off-by: Jan Engelhardt <jengelh@netitwork.de>
Tested-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/target/target_core_sbc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c
index 384f20c..973fd98 100644
--- a/drivers/target/target_core_sbc.c
+++ b/drivers/target/target_core_sbc.c
@@ -487,11 +487,11 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd, bool succes
if (block_size < PAGE_SIZE) {
sg_set_page(&write_sg[i], m.page, block_size,
- block_size);
+ m.piter.sg->offset + block_size);
} else {
sg_miter_next(&m);
sg_set_page(&write_sg[i], m.page, block_size,
- 0);
+ m.piter.sg->offset);
}
len -= block_size;
i++;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 088/128] ARM: dts: Kirkwood: Fix QNAP TS219 power-off
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (86 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 087/128] target: fix COMPARE_AND_WRITE non zero SGL offset data corruption Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 089/128] ath10k: fix invalid NSS for 4x4 devices Kamal Mostafa
` (39 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Helmut Klein, Andrew Lunn, Gregory CLEMENT, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Helmut Klein <hgkr.klein@gmail.com>
commit 5442f0eadf2885453d5b2ed8c8592f32a3744f8e upstream.
The "reg" entry in the "poweroff" section of "kirkwood-ts219.dtsi"
addressed the wrong uart (0 = console). This patch changes the address
to select uart 1, which is the uart connected to the pic
microcontroller, which can switch the device off.
Signed-off-by: Helmut Klein <hgkr.klein@gmail.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Fixes: 4350a47bbac3 ("ARM: Kirkwood: Make use of the QNAP Power off driver.")
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/dts/kirkwood-ts219.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/kirkwood-ts219.dtsi b/arch/arm/boot/dts/kirkwood-ts219.dtsi
index df7f152..8e15b36 100644
--- a/arch/arm/boot/dts/kirkwood-ts219.dtsi
+++ b/arch/arm/boot/dts/kirkwood-ts219.dtsi
@@ -40,7 +40,7 @@
};
poweroff@12100 {
compatible = "qnap,power-off";
- reg = <0x12000 0x100>;
+ reg = <0x12100 0x100>;
clocks = <&gate_clk 7>;
};
spi@10600 {
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 089/128] ath10k: fix invalid NSS for 4x4 devices
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (87 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 088/128] ARM: dts: Kirkwood: Fix QNAP TS219 power-off Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 090/128] Bluetooth: Fix l2cap_chan leak in SMP Kamal Mostafa
` (38 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Rajkumar Manoharan, Kalle Valo, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
commit f680f70adbeab28b35f849016b964dd645db6237 upstream.
The number of spatial streams that are derived from chain mask
for 4x4 devices is using wrong bitmask and conditional check.
This is affecting downlink throughput for QCA99x0 devices. Earlier
cfg_tx_chainmask is not filled by default until user configured it
and so get_nss_from_chainmask never be called. This issue is exposed
by recent commit 166de3f1895d ("ath10k: remove supported chain mask").
By default maximum supported chain mask is filled in cfg_tx_chainmask.
Fixes: 5572a95b4b ("ath10k: apply chainmask settings to vdev on creation")
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wireless/ath/ath10k/mac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 05597cb..bbee156 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2845,7 +2845,7 @@ static int ath10k_config(struct ieee80211_hw *hw, u32 changed)
static u32 get_nss_from_chainmask(u16 chain_mask)
{
- if ((chain_mask & 0x15) == 0x15)
+ if ((chain_mask & 0xf) == 0xf)
return 4;
else if ((chain_mask & 0x7) == 0x7)
return 3;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 090/128] Bluetooth: Fix l2cap_chan leak in SMP
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (88 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 089/128] ath10k: fix invalid NSS for 4x4 devices Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 091/128] crypto: nx - Fix timing leak in GCM and CCM decryption Kamal Mostafa
` (37 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Johan Hedberg, Marcel Holtmann, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hedberg <johan.hedberg@intel.com>
commit 7883746bc663150e8acd7a57397fc889698b0b33 upstream.
The L2CAP core expects channel implementations to manage the reference
returned by the new_connection callback. With sockets this is already
handled with each channel being tied to the corresponding socket. With
SMP however there's no context to tie the pointer to in the
smp_new_conn_cb function. The function can also not just drop the
reference since it's the only one at that point.
For fixed channels (like SMP) the code path inside the L2CAP core from
new_connection() to ready() is short and straight-forwards. The
crucial difference is that in ready() the implementation has access to
the l2cap_conn that SMP needs associate its l2cap_chan. Instead of
taking a new reference in smp_ready_cb() we can simply assume to
already own the reference created in smp_new_conn_cb(), i.e. there is
no need to call l2cap_chan_hold().
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/bluetooth/smp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 757ae32..e7162a4 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -2812,8 +2812,13 @@ static void smp_ready_cb(struct l2cap_chan *chan)
BT_DBG("chan %p", chan);
+ /* No need to call l2cap_chan_hold() here since we already own
+ * the reference taken in smp_new_conn_cb(). This is just the
+ * first time that we tie it to a specific pointer. The code in
+ * l2cap_core.c ensures that there's no risk this function wont
+ * get called if smp_new_conn_cb was previously called.
+ */
conn->smp = chan;
- l2cap_chan_hold(chan);
if (hcon->type == ACL_LINK && test_bit(HCI_CONN_ENCRYPT, &hcon->flags))
bredr_pairing(chan);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 091/128] crypto: nx - Fix timing leak in GCM and CCM decryption
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (89 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 090/128] Bluetooth: Fix l2cap_chan leak in SMP Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 092/128] crypto: talitos - Fix timing leak in ESP ICV verification Kamal Mostafa
` (36 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: David Gstir, Herbert Xu, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: David Gstir <david@sigma-star.at>
commit cb8affb55c7e64816f3effcd9b2fc3268c016fac upstream.
Using non-constant time memcmp() makes the verification of the authentication
tag in the decrypt path vulnerable to timing attacks. Fix this by using
crypto_memneq() instead.
Signed-off-by: David Gstir <david@sigma-star.at>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/crypto/nx/nx-aes-ccm.c | 2 +-
drivers/crypto/nx/nx-aes-gcm.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/nx/nx-aes-ccm.c b/drivers/crypto/nx/nx-aes-ccm.c
index 67f8081..40992a2 100644
--- a/drivers/crypto/nx/nx-aes-ccm.c
+++ b/drivers/crypto/nx/nx-aes-ccm.c
@@ -412,7 +412,7 @@ static int ccm_nx_decrypt(struct aead_request *req,
processed += to_process;
} while (processed < nbytes);
- rc = memcmp(csbcpb->cpb.aes_ccm.out_pat_or_mac, priv->oauth_tag,
+ rc = crypto_memneq(csbcpb->cpb.aes_ccm.out_pat_or_mac, priv->oauth_tag,
authsize) ? -EBADMSG : 0;
out:
spin_unlock_irqrestore(&nx_ctx->lock, irq_flags);
diff --git a/drivers/crypto/nx/nx-aes-gcm.c b/drivers/crypto/nx/nx-aes-gcm.c
index 88c5624..ae4561d 100644
--- a/drivers/crypto/nx/nx-aes-gcm.c
+++ b/drivers/crypto/nx/nx-aes-gcm.c
@@ -423,7 +423,7 @@ mac:
scatterwalk_map_and_copy(itag, req->src, nbytes,
crypto_aead_authsize(crypto_aead_reqtfm(req)),
SCATTERWALK_FROM_SG);
- rc = memcmp(itag, otag,
+ rc = crypto_memneq(itag, otag,
crypto_aead_authsize(crypto_aead_reqtfm(req))) ?
-EBADMSG : 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 092/128] crypto: talitos - Fix timing leak in ESP ICV verification
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (90 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 091/128] crypto: nx - Fix timing leak in GCM and CCM decryption Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 093/128] ASoC: wm8962: correct addresses for HPF_C_0/1 Kamal Mostafa
` (35 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: David Gstir, Herbert Xu, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: David Gstir <david@sigma-star.at>
commit 79960943fdc114fd4583c9ab164b5c89da7aa601 upstream.
Using non-constant time memcmp() makes the verification of the authentication
tag in the decrypt path vulnerable to timing attacks. Fix this by using
crypto_memneq() instead.
Signed-off-by: David Gstir <david@sigma-star.at>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ kamal: backport to 3.19-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/crypto/talitos.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 0584c4e..181167f 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -870,7 +870,7 @@ static void ipsec_esp_decrypt_swauth_done(struct device *dev,
icvdata = &edesc->link_tbl[0];
sg = sg_last(req->dst, edesc->dst_nents ? : 1);
- err = memcmp(icvdata, (char *)sg_virt(sg) + sg->length -
+ err = crypto_memneq(icvdata, (char *)sg_virt(sg) + sg->length -
ctx->authsize, ctx->authsize) ? -EBADMSG : 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 093/128] ASoC: wm8962: correct addresses for HPF_C_0/1
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (91 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 092/128] crypto: talitos - Fix timing leak in ESP ICV verification Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 094/128] mac80211: mesh: fix call_rcu() usage Kamal Mostafa
` (34 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sachin Pandhare, Mark Brown, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sachin Pandhare <sachinpandhare@gmail.com>
commit e9f96bc53c1b959859599cb30ce6fd4fbb4448c2 upstream.
>From datasheet:
R17408 (4400h) HPF_C_1
R17409 (4401h) HPF_C_0
17048 -> 17408 (0x4400)
17049 -> 17409 (0x4401)
Signed-off-by: Sachin Pandhare <sachinpandhare@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/codecs/wm8962.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index d32d554..89bc952 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -365,8 +365,8 @@ static struct reg_default wm8962_reg[] = {
{ 16924, 0x0059 }, /* R16924 - HDBASS_PG_1 */
{ 16925, 0x999A }, /* R16925 - HDBASS_PG_0 */
- { 17048, 0x0083 }, /* R17408 - HPF_C_1 */
- { 17049, 0x98AD }, /* R17409 - HPF_C_0 */
+ { 17408, 0x0083 }, /* R17408 - HPF_C_1 */
+ { 17409, 0x98AD }, /* R17409 - HPF_C_0 */
{ 17920, 0x007F }, /* R17920 - ADCL_RETUNE_C1_1 */
{ 17921, 0xFFFF }, /* R17921 - ADCL_RETUNE_C1_0 */
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 094/128] mac80211: mesh: fix call_rcu() usage
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (92 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 093/128] ASoC: wm8962: correct addresses for HPF_C_0/1 Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 095/128] can: sja1000: clear interrupts on start Kamal Mostafa
` (33 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Johannes Berg, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
commit c2e703a55245bfff3db53b1f7cbe59f1ee8a4339 upstream.
When using call_rcu(), the called function may be delayed quite
significantly, and without a matching rcu_barrier() there's no
way to be sure it has finished.
Therefore, global state that could be gone/freed/reused should
never be touched in the callback.
Fix this in mesh by moving the atomic_dec() into the caller;
that's not really a problem since we already unlinked the path
and it will be destroyed anyway.
This fixes a crash Jouni observed when running certain tests in
a certain order, in which the mesh interface was torn down, the
memory reused for a function pointer (work struct) and running
that then crashed since the pointer had been decremented by 1,
resulting in an invalid instruction byte stream.
Fixes: eb2b9311fd00 ("mac80211: mesh path table implementation")
Reported-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/mac80211/mesh_pathtbl.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index b890e22..b3b44a5 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -779,10 +779,8 @@ void mesh_plink_broken(struct sta_info *sta)
static void mesh_path_node_reclaim(struct rcu_head *rp)
{
struct mpath_node *node = container_of(rp, struct mpath_node, rcu);
- struct ieee80211_sub_if_data *sdata = node->mpath->sdata;
del_timer_sync(&node->mpath->timer);
- atomic_dec(&sdata->u.mesh.mpaths);
kfree(node->mpath);
kfree(node);
}
@@ -790,8 +788,9 @@ static void mesh_path_node_reclaim(struct rcu_head *rp)
/* needs to be called with the corresponding hashwlock taken */
static void __mesh_path_del(struct mesh_table *tbl, struct mpath_node *node)
{
- struct mesh_path *mpath;
- mpath = node->mpath;
+ struct mesh_path *mpath = node->mpath;
+ struct ieee80211_sub_if_data *sdata = node->mpath->sdata;
+
spin_lock(&mpath->state_lock);
mpath->flags |= MESH_PATH_RESOLVING;
if (mpath->is_gate)
@@ -799,6 +798,7 @@ static void __mesh_path_del(struct mesh_table *tbl, struct mpath_node *node)
hlist_del_rcu(&node->list);
call_rcu(&node->rcu, mesh_path_node_reclaim);
spin_unlock(&mpath->state_lock);
+ atomic_dec(&sdata->u.mesh.mpaths);
atomic_dec(&tbl->entries);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 095/128] can: sja1000: clear interrupts on start
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (93 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 094/128] mac80211: mesh: fix call_rcu() usage Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 096/128] ring-buffer: Update read stamp with first real commit on page Kamal Mostafa
` (32 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mirza Krak, Marc Kleine-Budde, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mirza Krak <mirza.krak@hostmobility.com>
commit 7cecd9ab80f43972c056dc068338f7bcc407b71c upstream.
According to SJA1000 data sheet error-warning (EI) interrupt is not
cleared by setting the controller in to reset-mode.
Then if we have the following case:
- system is suspended (echo mem > /sys/power/state) and SJA1000 is left
in operating state
- A bus error condition occurs which activates EI interrupt, system is
still suspended which means EI interrupt will be not be handled nor
cleared.
If the above two events occur, on resume there is no way to return the
SJA1000 to operating state, except to cycle power to it.
By simply reading the IR register on start we will clear any previous
conditions that could be present.
Signed-off-by: Mirza Krak <mirza.krak@hostmobility.com>
Reported-by: Christian Magnusson <Christian.Magnusson@semcon.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/can/sja1000/sja1000.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
index 32bd7f4..0c048e2 100644
--- a/drivers/net/can/sja1000/sja1000.c
+++ b/drivers/net/can/sja1000/sja1000.c
@@ -218,6 +218,9 @@ static void sja1000_start(struct net_device *dev)
priv->write_reg(priv, SJA1000_RXERR, 0x0);
priv->read_reg(priv, SJA1000_ECC);
+ /* clear interrupt flags */
+ priv->read_reg(priv, SJA1000_IR);
+
/* leave reset mode */
set_normal_mode(dev);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 096/128] ring-buffer: Update read stamp with first real commit on page
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (94 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 095/128] can: sja1000: clear interrupts on start Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 097/128] RDS: fix race condition when sending a message on unbound socket Kamal Mostafa
` (31 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Steven Rostedt, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
commit b81f472a208d3e2b4392faa6d17037a89442f4ce upstream.
Do not update the read stamp after swapping out the reader page from the
write buffer. If the reader page is swapped out of the buffer before an
event is written to it, then the read_stamp may get an out of date
timestamp, as the page timestamp is updated on the first commit to that
page.
rb_get_reader_page() only returns a page if it has an event on it, otherwise
it will return NULL. At that point, check if the page being returned has
events and has not been read yet. Then at that point update the read_stamp
to match the time stamp of the reader page.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/trace/ring_buffer.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index e896a58..3dd43de 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -1979,12 +1979,6 @@ rb_set_commit_to_write(struct ring_buffer_per_cpu *cpu_buffer)
goto again;
}
-static void rb_reset_reader_page(struct ring_buffer_per_cpu *cpu_buffer)
-{
- cpu_buffer->read_stamp = cpu_buffer->reader_page->page->time_stamp;
- cpu_buffer->reader_page->read = 0;
-}
-
static void rb_inc_iter(struct ring_buffer_iter *iter)
{
struct ring_buffer_per_cpu *cpu_buffer = iter->cpu_buffer;
@@ -3633,7 +3627,7 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer)
/* Finally update the reader page to the new head */
cpu_buffer->reader_page = reader;
- rb_reset_reader_page(cpu_buffer);
+ cpu_buffer->reader_page->read = 0;
if (overwrite != cpu_buffer->last_overrun) {
cpu_buffer->lost_events = overwrite - cpu_buffer->last_overrun;
@@ -3643,6 +3637,10 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer)
goto again;
out:
+ /* Update the read_stamp on the first event */
+ if (reader && reader->read == 0)
+ cpu_buffer->read_stamp = reader->page->time_stamp;
+
arch_spin_unlock(&cpu_buffer->lock);
local_irq_restore(flags);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 097/128] RDS: fix race condition when sending a message on unbound socket
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (95 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 096/128] ring-buffer: Update read stamp with first real commit on page Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 098/128] drm/i915: Don't override output type for DDI HDMI Kamal Mostafa
` (30 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: David S. Miller, Quentin Casasnovas, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Quentin Casasnovas <quentin.casasnovas@oracle.com>
commit 8c7188b23474cca017b3ef354c4a58456f68303a upstream.
Sasha's found a NULL pointer dereference in the RDS connection code when
sending a message to an apparently unbound socket. The problem is caused
by the code checking if the socket is bound in rds_sendmsg(), which checks
the rs_bound_addr field without taking a lock on the socket. This opens a
race where rs_bound_addr is temporarily set but where the transport is not
in rds_bind(), leading to a NULL pointer dereference when trying to
dereference 'trans' in __rds_conn_create().
Vegard wrote a reproducer for this issue, so kindly ask him to share if
you're interested.
I cannot reproduce the NULL pointer dereference using Vegard's reproducer
with this patch, whereas I could without.
Complete earlier incomplete fix to CVE-2015-6937:
74e98eb08588 ("RDS: verify the underlying transport exists before creating a connection")
Cc: David S. Miller <davem@davemloft.net>
Reviewed-by: Vegard Nossum <vegard.nossum@oracle.com>
Reviewed-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/rds/connection.c | 6 ------
net/rds/send.c | 4 +++-
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/net/rds/connection.c b/net/rds/connection.c
index f5fb7d6..378c3a6 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -183,12 +183,6 @@ static struct rds_connection *__rds_conn_create(__be32 laddr, __be32 faddr,
}
}
- if (trans == NULL) {
- kmem_cache_free(rds_conn_slab, conn);
- conn = ERR_PTR(-ENODEV);
- goto out;
- }
-
conn->c_trans = trans;
ret = trans->conn_alloc(conn, gfp);
diff --git a/net/rds/send.c b/net/rds/send.c
index 42f65d4..e1937d35 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -958,11 +958,13 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
release_sock(sk);
}
- /* racing with another thread binding seems ok here */
+ lock_sock(sk);
if (daddr == 0 || rs->rs_bound_addr == 0) {
+ release_sock(sk);
ret = -ENOTCONN; /* XXX not a great errno */
goto out;
}
+ release_sock(sk);
/* size of rm including all sgs */
ret = rds_rm_size(msg, payload_len);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 098/128] drm/i915: Don't override output type for DDI HDMI
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (96 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 097/128] RDS: fix race condition when sending a message on unbound socket Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 099/128] block: Always check queue limits for cloned requests Kamal Mostafa
` (29 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Takashi Iwai, Jani Nikula, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 2540058f7a9d9a843b4d9a28d4f8168dd034d030 upstream.
Currently a DDI port may register the DP hotplug handler even though
it's used with HDMI, and the DP HPD handler overrides the encoder
type forcibly to DP. This caused the inconsistency on a machine
connected with a HDMI monitor; upon a hotplug event, the DDI port is
suddenly switched to be handled as a DP although the same monitor is
kept connected, and this leads to the erroneous blank output.
This patch papers over the bug by excluding the previous HDMI encoder
type from this override. This should be fixed more fundamentally,
e.g. by moving the encoder type reset from the HPD or by having
individual encoder objects for HDMI and DP. But since the bug has
been present for a long time (3.17), it's better to have a
quick-n-dirty fix for now, and keep working on a cleaner fix.
Bugzilla: http://bugzilla.opensuse.org/show_bug.cgi?id=955190
Fixes: 0e32b39ceed6 ('drm/i915: add DP 1.2 MST support (v0.7)')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1447931396-19147-1-git-send-email-tiwai@suse.de
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/intel_dp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 887f2e4..fec89eb 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4410,7 +4410,8 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
enum intel_display_power_domain power_domain;
bool ret = true;
- if (intel_dig_port->base.type != INTEL_OUTPUT_EDP)
+ if (intel_dig_port->base.type != INTEL_OUTPUT_EDP &&
+ intel_dig_port->base.type != INTEL_OUTPUT_HDMI)
intel_dig_port->base.type = INTEL_OUTPUT_DISPLAYPORT;
if (long_hpd && intel_dig_port->base.type == INTEL_OUTPUT_EDP) {
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 099/128] block: Always check queue limits for cloned requests
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (97 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 098/128] drm/i915: Don't override output type for DDI HDMI Kamal Mostafa
@ 2015-12-16 17:38 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 100/128] Fix a memory leak in scsi_host_dev_release() Kamal Mostafa
` (28 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:38 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mike Snitzer, Ewan Milne, Jeff Moyer, Hannes Reinecke, Jens Axboe,
Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Hannes Reinecke <hare@suse.de>
commit bf4e6b4e757488dee1b6a581f49c7ac34cd217f8 upstream.
When a cloned request is retried on other queues it always needs
to be checked against the queue limits of that queue.
Otherwise the calculations for nr_phys_segments might be wrong,
leading to a crash in scsi_init_sgtable().
To clarify this the patch renames blk_rq_check_limits()
to blk_cloned_rq_check_limits() and removes the symbol
export, as the new function should only be used for
cloned requests and never exported.
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Ewan Milne <emilne@redhat.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Fixes: e2a60da74 ("block: Clean up special command handling logic")
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
block/blk-core.c | 21 +++++++--------------
include/linux/blkdev.h | 1 -
2 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index 3ad4055..adb49b4 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1985,7 +1985,8 @@ void submit_bio(int rw, struct bio *bio)
EXPORT_SYMBOL(submit_bio);
/**
- * blk_rq_check_limits - Helper function to check a request for the queue limit
+ * blk_cloned_rq_check_limits - Helper function to check a cloned request
+ * for new the queue limits
* @q: the queue
* @rq: the request being checked
*
@@ -1996,20 +1997,13 @@ EXPORT_SYMBOL(submit_bio);
* after it is inserted to @q, it should be checked against @q before
* the insertion using this generic function.
*
- * This function should also be useful for request stacking drivers
- * in some cases below, so export this function.
* Request stacking drivers like request-based dm may change the queue
- * limits while requests are in the queue (e.g. dm's table swapping).
- * Such request stacking drivers should check those requests against
- * the new queue limits again when they dispatch those requests,
- * although such checkings are also done against the old queue limits
- * when submitting requests.
+ * limits when retrying requests on other queues. Those requests need
+ * to be checked against the new queue limits again during dispatch.
*/
-int blk_rq_check_limits(struct request_queue *q, struct request *rq)
+static int blk_cloned_rq_check_limits(struct request_queue *q,
+ struct request *rq)
{
- if (!rq_mergeable(rq))
- return 0;
-
if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, rq->cmd_flags)) {
printk(KERN_ERR "%s: over max size limit.\n", __func__);
return -EIO;
@@ -2029,7 +2023,6 @@ int blk_rq_check_limits(struct request_queue *q, struct request *rq)
return 0;
}
-EXPORT_SYMBOL_GPL(blk_rq_check_limits);
/**
* blk_insert_cloned_request - Helper for stacking drivers to submit a request
@@ -2041,7 +2034,7 @@ int blk_insert_cloned_request(struct request_queue *q, struct request *rq)
unsigned long flags;
int where = ELEVATOR_INSERT_BACK;
- if (blk_rq_check_limits(q, rq))
+ if (blk_cloned_rq_check_limits(q, rq))
return -EIO;
if (rq->rq_disk &&
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 92f4b4b..25ac915 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -797,7 +797,6 @@ extern void blk_rq_set_block_pc(struct request *);
extern void blk_requeue_request(struct request_queue *, struct request *);
extern void blk_add_request_payload(struct request *rq, struct page *page,
unsigned int len);
-extern int blk_rq_check_limits(struct request_queue *q, struct request *rq);
extern int blk_lld_busy(struct request_queue *q);
extern int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
struct bio_set *bs, gfp_t gfp_mask,
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 100/128] Fix a memory leak in scsi_host_dev_release()
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (98 preceding siblings ...)
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 099/128] block: Always check queue limits for cloned requests Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 101/128] wan/x25: Fix use-after-free in x25_asy_open_tty() Kamal Mostafa
` (27 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Bart Van Assche, Christoph Hellwig, Hannes Reinecke,
Martin K. Petersen, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <bart.vanassche@sandisk.com>
commit b49493f99690c8eaacfbc635bafaad629ea2c036 upstream.
Avoid that kmemleak reports the following memory leak if a
SCSI LLD calls scsi_host_alloc() and scsi_host_put() but neither
scsi_host_add() nor scsi_host_remove(). The following shell
command triggers that scenario:
for ((i=0; i<2; i++)); do
srp_daemon -oac |
while read line; do
echo $line >/sys/class/infiniband_srp/srp-mlx4_0-1/add_target
done
done
unreferenced object 0xffff88021b24a220 (size 8):
comm "srp_daemon", pid 56421, jiffies 4295006762 (age 4240.750s)
hex dump (first 8 bytes):
68 6f 73 74 35 38 00 a5 host58..
backtrace:
[<ffffffff8151014a>] kmemleak_alloc+0x7a/0xc0
[<ffffffff81165c1e>] __kmalloc_track_caller+0xfe/0x160
[<ffffffff81260d2b>] kvasprintf+0x5b/0x90
[<ffffffff81260e2d>] kvasprintf_const+0x8d/0xb0
[<ffffffff81254b0c>] kobject_set_name_vargs+0x3c/0xa0
[<ffffffff81337e3c>] dev_set_name+0x3c/0x40
[<ffffffff81355757>] scsi_host_alloc+0x327/0x4b0
[<ffffffffa03edc8e>] srp_create_target+0x4e/0x8a0 [ib_srp]
[<ffffffff8133778b>] dev_attr_store+0x1b/0x20
[<ffffffff811f27fa>] sysfs_kf_write+0x4a/0x60
[<ffffffff811f1e8e>] kernfs_fop_write+0x14e/0x180
[<ffffffff81176eef>] __vfs_write+0x2f/0xf0
[<ffffffff811771e4>] vfs_write+0xa4/0x100
[<ffffffff81177c64>] SyS_write+0x54/0xc0
[<ffffffff8151b257>] entry_SYSCALL_64_fastpath+0x12/0x6f
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/scsi/hosts.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 8bb173e..7d647a3 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -326,6 +326,17 @@ static void scsi_host_dev_release(struct device *dev)
kfree(queuedata);
}
+ if (shost->shost_state == SHOST_CREATED) {
+ /*
+ * Free the shost_dev device name here if scsi_host_alloc()
+ * and scsi_host_put() have been called but neither
+ * scsi_host_add() nor scsi_host_remove() has been called.
+ * This avoids that the memory allocated for the shost_dev
+ * name is leaked.
+ */
+ kfree(dev_name(&shost->shost_dev));
+ }
+
scsi_destroy_command_freelist(shost);
if (shost_use_blk_mq(shost)) {
if (shost->tag_set.tags)
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 101/128] wan/x25: Fix use-after-free in x25_asy_open_tty()
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (99 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 100/128] Fix a memory leak in scsi_host_dev_release() Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 102/128] mac80211: do not actively scan DFS channels Kamal Mostafa
` (26 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Peter Hurley, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Hurley <peter@hurleysoftware.com>
commit ee9159ddce14bc1dec9435ae4e3bd3153e783706 upstream.
The N_X25 line discipline may access the previous line discipline's closed
and already-freed private data on open [1].
The tty->disc_data field _never_ refers to valid data on entry to the
line discipline's open() method. Rather, the ldisc is expected to
initialize that field for its own use for the lifetime of the instance
(ie. from open() to close() only).
[1]
[ 634.336761] ==================================================================
[ 634.338226] BUG: KASAN: use-after-free in x25_asy_open_tty+0x13d/0x490 at addr ffff8800a743efd0
[ 634.339558] Read of size 4 by task syzkaller_execu/8981
[ 634.340359] =============================================================================
[ 634.341598] BUG kmalloc-512 (Not tainted): kasan: bad access detected
...
[ 634.405018] Call Trace:
[ 634.405277] dump_stack (lib/dump_stack.c:52)
[ 634.405775] print_trailer (mm/slub.c:655)
[ 634.406361] object_err (mm/slub.c:662)
[ 634.406824] kasan_report_error (mm/kasan/report.c:138 mm/kasan/report.c:236)
[ 634.409581] __asan_report_load4_noabort (mm/kasan/report.c:279)
[ 634.411355] x25_asy_open_tty (drivers/net/wan/x25_asy.c:559 (discriminator 1))
[ 634.413997] tty_ldisc_open.isra.2 (drivers/tty/tty_ldisc.c:447)
[ 634.414549] tty_set_ldisc (drivers/tty/tty_ldisc.c:567)
[ 634.415057] tty_ioctl (drivers/tty/tty_io.c:2646 drivers/tty/tty_io.c:2879)
[ 634.423524] do_vfs_ioctl (fs/ioctl.c:43 fs/ioctl.c:607)
[ 634.427491] SyS_ioctl (fs/ioctl.c:622 fs/ioctl.c:613)
[ 634.427945] entry_SYSCALL_64_fastpath (arch/x86/entry/entry_64.S:188)
Reported-and-tested-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/wan/x25_asy.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index 5c47b01..cd39025 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -549,16 +549,12 @@ static void x25_asy_receive_buf(struct tty_struct *tty,
static int x25_asy_open_tty(struct tty_struct *tty)
{
- struct x25_asy *sl = tty->disc_data;
+ struct x25_asy *sl;
int err;
if (tty->ops->write == NULL)
return -EOPNOTSUPP;
- /* First make sure we're not already connected. */
- if (sl && sl->magic == X25_ASY_MAGIC)
- return -EEXIST;
-
/* OK. Find a free X.25 channel to use. */
sl = x25_asy_alloc();
if (sl == NULL)
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 102/128] mac80211: do not actively scan DFS channels
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (100 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 101/128] wan/x25: Fix use-after-free in x25_asy_open_tty() Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 103/128] PM / Domains: Fix bad of_node_put() in failure paths of genpd_dev_pm_attach() Kamal Mostafa
` (25 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Antonio Quartulli, Johannes Berg, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Antonio Quartulli <antonio@meshcoding.com>
commit 4e39ccac0d678eacb5dd6ffc5057531af33c12d6 upstream.
DFS channels should not be actively scanned as we can't be sure
if we are allowed or not.
If the current channel is in the DFS band, active scan might be
performed after CSA, but we have no guarantee about other channels,
therefore it is safer to prevent active scanning at all.
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/mac80211/scan.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index ae84267..34b4050 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -593,8 +593,8 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
/* We need to ensure power level is at max for scanning. */
ieee80211_hw_config(local, 0);
- if ((req->channels[0]->flags &
- IEEE80211_CHAN_NO_IR) ||
+ if ((req->channels[0]->flags & (IEEE80211_CHAN_NO_IR |
+ IEEE80211_CHAN_RADAR)) ||
!req->n_ssids) {
next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
} else {
@@ -641,7 +641,7 @@ ieee80211_scan_get_channel_time(struct ieee80211_channel *chan)
* TODO: channel switching also consumes quite some time,
* add that delay as well to get a better estimation
*/
- if (chan->flags & IEEE80211_CHAN_NO_IR)
+ if (chan->flags & (IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR))
return IEEE80211_PASSIVE_CHANNEL_TIME;
return IEEE80211_PROBE_DELAY + IEEE80211_CHANNEL_TIME;
}
@@ -773,7 +773,8 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
*
* In any case, it is not necessary for a passive scan.
*/
- if (chan->flags & IEEE80211_CHAN_NO_IR || !scan_req->n_ssids) {
+ if ((chan->flags & (IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR)) ||
+ !scan_req->n_ssids) {
*next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
local->next_scan_state = SCAN_DECISION;
return;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 103/128] PM / Domains: Fix bad of_node_put() in failure paths of genpd_dev_pm_attach()
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (101 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 102/128] mac80211: do not actively scan DFS channels Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 104/128] drm: Fix an unwanted master inheritance v2 Kamal Mostafa
` (24 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Eric Anholt, Rafael J. Wysocki, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Anholt <eric@anholt.net>
commit 265e2cf672aaa9421e7012b4aa30c0ed80f1a447 upstream.
It looks like these meant to be unreffing the
of_parse_phandle_with_args() node, since the error paths above it
don't do of_node_put. That function returns a new ref in pd_args.np,
though, not a new ref on dev->of_node. Also, it would have leaked the
ref in the success case.
Fixes "ERROR: Bad of_node_put()" on bcm2835 in the -EPROBE_DEFER case.
Fixes: aa42240ab254 (PM / Domains: Add generic OF-based PM domain look-up)
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/base/power/domain.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 0d8780c..1401e6c 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -2199,10 +2199,10 @@ int genpd_dev_pm_attach(struct device *dev)
}
pd = of_genpd_get_from_provider(&pd_args);
+ of_node_put(pd_args.np);
if (IS_ERR(pd)) {
dev_dbg(dev, "%s() failed to find PM domain: %ld\n",
__func__, PTR_ERR(pd));
- of_node_put(dev->of_node);
return PTR_ERR(pd);
}
@@ -2218,7 +2218,6 @@ int genpd_dev_pm_attach(struct device *dev)
if (ret < 0) {
dev_err(dev, "failed to add to PM domain %s: %d",
pd->name, ret);
- of_node_put(dev->of_node);
return ret;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 104/128] drm: Fix an unwanted master inheritance v2
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (102 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 103/128] PM / Domains: Fix bad of_node_put() in failure paths of genpd_dev_pm_attach() Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 105/128] sched/core: Clear the root_domain cpumasks in init_rootdomain() Kamal Mostafa
` (23 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Thomas Hellstrom, Dave Airlie, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Hellstrom <thellstrom@vmware.com>
commit a0af2e538c80f3e47f1d6ddf120a153ad909e8ad upstream.
A client calling drmSetMaster() using a file descriptor that was opened
when another client was master would inherit the latter client's master
object and all its authenticated clients.
This is unwanted behaviour, and when this happens, instead allocate a
brand new master object for the client calling drmSetMaster().
Fixes a BUG() throw in vmw_master_set().
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/drm_drv.c | 5 +++
drivers/gpu/drm/drm_fops.c | 84 ++++++++++++++++++++++++++++++----------------
include/drm/drmP.h | 6 ++++
3 files changed, 67 insertions(+), 28 deletions(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 4f41377..0cb617d 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -173,6 +173,11 @@ int drm_setmaster_ioctl(struct drm_device *dev, void *data,
goto out_unlock;
}
+ if (!file_priv->allowed_master) {
+ ret = drm_new_set_master(dev, file_priv);
+ goto out_unlock;
+ }
+
file_priv->minor->master = drm_master_get(file_priv->master);
file_priv->is_master = 1;
if (dev->driver->master_set) {
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
index 0b9514b..5b91066 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
@@ -126,6 +126,60 @@ static int drm_cpu_valid(void)
}
/**
+ * drm_new_set_master - Allocate a new master object and become master for the
+ * associated master realm.
+ *
+ * @dev: The associated device.
+ * @fpriv: File private identifying the client.
+ *
+ * This function must be called with dev::struct_mutex held.
+ * Returns negative error code on failure. Zero on success.
+ */
+int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv)
+{
+ struct drm_master *old_master;
+ int ret;
+
+ lockdep_assert_held_once(&dev->master_mutex);
+
+ /* create a new master */
+ fpriv->minor->master = drm_master_create(fpriv->minor);
+ if (!fpriv->minor->master)
+ return -ENOMEM;
+
+ /* take another reference for the copy in the local file priv */
+ old_master = fpriv->master;
+ fpriv->master = drm_master_get(fpriv->minor->master);
+
+ if (dev->driver->master_create) {
+ ret = dev->driver->master_create(dev, fpriv->master);
+ if (ret)
+ goto out_err;
+ }
+ if (dev->driver->master_set) {
+ ret = dev->driver->master_set(dev, fpriv, true);
+ if (ret)
+ goto out_err;
+ }
+
+ fpriv->is_master = 1;
+ fpriv->allowed_master = 1;
+ fpriv->authenticated = 1;
+ if (old_master)
+ drm_master_put(&old_master);
+
+ return 0;
+
+out_err:
+ /* drop both references and restore old master on failure */
+ drm_master_put(&fpriv->minor->master);
+ drm_master_put(&fpriv->master);
+ fpriv->master = old_master;
+
+ return ret;
+}
+
+/**
* Called whenever a process opens /dev/drm.
*
* \param filp file pointer.
@@ -188,35 +242,9 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor)
mutex_lock(&dev->master_mutex);
if (drm_is_primary_client(priv) && !priv->minor->master) {
/* create a new master */
- priv->minor->master = drm_master_create(priv->minor);
- if (!priv->minor->master) {
- ret = -ENOMEM;
+ ret = drm_new_set_master(dev, priv);
+ if (ret)
goto out_close;
- }
-
- priv->is_master = 1;
- /* take another reference for the copy in the local file priv */
- priv->master = drm_master_get(priv->minor->master);
- priv->authenticated = 1;
-
- if (dev->driver->master_create) {
- ret = dev->driver->master_create(dev, priv->master);
- if (ret) {
- /* drop both references if this fails */
- drm_master_put(&priv->minor->master);
- drm_master_put(&priv->master);
- goto out_close;
- }
- }
- if (dev->driver->master_set) {
- ret = dev->driver->master_set(dev, priv, true);
- if (ret) {
- /* drop both references if this fails */
- drm_master_put(&priv->minor->master);
- drm_master_put(&priv->master);
- goto out_close;
- }
- }
} else if (drm_is_primary_client(priv)) {
/* get a reference to the master */
priv->master = drm_master_get(priv->minor->master);
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index e1b2e8b..1da05f7 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -283,6 +283,11 @@ struct drm_file {
* in the plane list
*/
unsigned universal_planes:1;
+ /*
+ * This client is allowed to gain master privileges for @master.
+ * Protected by struct drm_device::master_mutex.
+ */
+ unsigned allowed_master:1;
struct pid *pid;
kuid_t uid;
@@ -875,6 +880,7 @@ extern int drm_open(struct inode *inode, struct file *filp);
extern ssize_t drm_read(struct file *filp, char __user *buffer,
size_t count, loff_t *offset);
extern int drm_release(struct inode *inode, struct file *filp);
+extern int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv);
/* Mapping support (drm_vm.h) */
extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 105/128] sched/core: Clear the root_domain cpumasks in init_rootdomain()
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (103 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 104/128] drm: Fix an unwanted master inheritance v2 Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 106/128] rbd: don't put snap_context twice in rbd_queue_workfn() Kamal Mostafa
` (22 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Xunlei Pang, Peter Zijlstra (Intel), Linus Torvalds,
Mike Galbraith, Steven Rostedt, Thomas Gleixner, Ingo Molnar,
Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Xunlei Pang <xlpang@redhat.com>
commit 8295c69925ad53ec32ca54ac9fc194ff21bc40e2 upstream.
root_domain::rto_mask allocated through alloc_cpumask_var()
contains garbage data, this may cause problems. For instance,
When doing pull_rt_task(), it may do useless iterations if
rto_mask retains some extra garbage bits. Worse still, this
violates the isolated domain rule for clustered scheduling
using cpuset, because the tasks(with all the cpus allowed)
belongs to one root domain can be pulled away into another
root domain.
The patch cleans the garbage by using zalloc_cpumask_var()
instead of alloc_cpumask_var() for root_domain::rto_mask
allocation, thereby addressing the issues.
Do the same thing for root_domain's other cpumask memembers:
dlo_mask, span, and online.
Signed-off-by: Xunlei Pang <xlpang@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1449057179-29321-1-git-send-email-xlpang@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/sched/core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 7ee38f6..2006f4f 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5694,13 +5694,13 @@ static int init_rootdomain(struct root_domain *rd)
{
memset(rd, 0, sizeof(*rd));
- if (!alloc_cpumask_var(&rd->span, GFP_KERNEL))
+ if (!zalloc_cpumask_var(&rd->span, GFP_KERNEL))
goto out;
- if (!alloc_cpumask_var(&rd->online, GFP_KERNEL))
+ if (!zalloc_cpumask_var(&rd->online, GFP_KERNEL))
goto free_span;
- if (!alloc_cpumask_var(&rd->dlo_mask, GFP_KERNEL))
+ if (!zalloc_cpumask_var(&rd->dlo_mask, GFP_KERNEL))
goto free_online;
- if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL))
+ if (!zalloc_cpumask_var(&rd->rto_mask, GFP_KERNEL))
goto free_dlo_mask;
init_dl_bw(&rd->dl_bw);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 106/128] rbd: don't put snap_context twice in rbd_queue_workfn()
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (104 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 105/128] sched/core: Clear the root_domain cpumasks in init_rootdomain() Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 107/128] ARM/arm64: KVM: correct PTE uncachedness check Kamal Mostafa
` (21 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Ilya Dryomov, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <idryomov@gmail.com>
commit 70b16db86f564977df074072143284aec2cb1162 upstream.
Commit 4e752f0ab0e8 ("rbd: access snapshot context and mapping size
safely") moved ceph_get_snap_context() out of rbd_img_request_create()
and into rbd_queue_workfn(), adding a ceph_put_snap_context() to the
error path in rbd_queue_workfn(). However, rbd_img_request_create()
consumes a ref on snapc, so calling ceph_put_snap_context() after
a successful rbd_img_request_create() leads to an extra put. Fix it.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/block/rbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index d72954b..9e6960f 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3400,6 +3400,7 @@ static void rbd_handle_request(struct rbd_device *rbd_dev, struct request *rq)
goto err_rq;
}
img_request->rq = rq;
+ snapc = NULL; /* img_request consumes a ref */
if (op_type == OBJ_OP_DISCARD)
result = rbd_img_request_fill(img_request, OBJ_REQUEST_NODATA,
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 107/128] ARM/arm64: KVM: correct PTE uncachedness check
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (105 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 106/128] rbd: don't put snap_context twice in rbd_queue_workfn() Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 108/128] x86/mpx: Fix instruction decoder condition Kamal Mostafa
` (20 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ard Biesheuvel, Marc Zyngier, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
commit 0de58f852875a0f0dcfb120bb8433e4e73c7803b upstream.
Commit e6fab5442345 ("ARM/arm64: KVM: test properly for a PTE's
uncachedness") modified the logic to test whether a HYP or stage-2
mapping needs flushing, from [incorrectly] interpreting the page table
attributes to [incorrectly] checking whether the PFN that backs the
mapping is covered by host system RAM. The PFN number is part of the
output of the translation, not the input, so we have to use pte_pfn()
on the contents of the PTE, not __phys_to_pfn() on the HYP virtual
address or stage-2 intermediate physical address.
Fixes: e6fab5442345 ("ARM/arm64: KVM: test properly for a PTE's uncachedness")
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/kvm/mmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index a2c1ebf..966f8d2 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -179,7 +179,7 @@ static void unmap_ptes(struct kvm *kvm, pmd_t *pmd,
kvm_tlb_flush_vmid_ipa(kvm, addr);
/* No need to invalidate the cache for device mappings */
- if (!kvm_is_device_pfn(__phys_to_pfn(addr)))
+ if (!kvm_is_device_pfn(pte_pfn(old_pte)))
kvm_flush_dcache_pte(old_pte);
put_page(virt_to_page(pte));
@@ -271,7 +271,7 @@ static void stage2_flush_ptes(struct kvm *kvm, pmd_t *pmd,
pte = pte_offset_kernel(pmd, addr);
do {
- if (!pte_none(*pte) && !kvm_is_device_pfn(__phys_to_pfn(addr)))
+ if (!pte_none(*pte) && !kvm_is_device_pfn(pte_pfn(*pte)))
kvm_flush_dcache_pte(*pte);
} while (pte++, addr += PAGE_SIZE, addr != end);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 108/128] x86/mpx: Fix instruction decoder condition
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (106 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 107/128] ARM/arm64: KVM: correct PTE uncachedness check Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 109/128] x86/signal: Fix restart_syscall number for x32 tasks Kamal Mostafa
` (19 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dave Hansen, x86, Dave Hansen, Thomas Gleixner, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Hansen <dave.hansen@linux.intel.com>
commit 8e8efe0379bd93e8219ca0fc6fa80b5dd85b09cb upstream.
MPX decodes instructions in order to tell which bounds register
was violated. Part of this decoding involves looking at the "REX
prefix" which is a special instrucion prefix used to retrofit
support for new registers in to old instructions.
The X86_REX_*() macros are defined to return actual bit values:
#define X86_REX_R(rex) ((rex) & 4)
*not* boolean values. However, the MPX code was checking for
them like they were booleans. This might have led to us
mis-decoding the "REX prefix" and giving false information out to
userspace about bounds violations. X86_REX_B() actually is bit 1,
so this is really only broken for the X86_REX_X() case.
Fix the conditionals up to tolerate the non-boolean values.
Fixes: fcc7ffd67991 "x86, mpx: Decode MPX instruction to get bound violation information"
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: x86@kernel.org
Cc: Dave Hansen <dave@sr71.net>
Link: http://lkml.kernel.org/r/20151201003113.D800C1E0@viggo.jf.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/mm/mpx.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
index 3df5f1a..feda8ca 100644
--- a/arch/x86/mm/mpx.c
+++ b/arch/x86/mm/mpx.c
@@ -120,19 +120,19 @@ static int get_reg_offset(struct insn *insn, struct pt_regs *regs,
switch (type) {
case REG_TYPE_RM:
regno = X86_MODRM_RM(insn->modrm.value);
- if (X86_REX_B(insn->rex_prefix.value) == 1)
+ if (X86_REX_B(insn->rex_prefix.value))
regno += 8;
break;
case REG_TYPE_INDEX:
regno = X86_SIB_INDEX(insn->sib.value);
- if (X86_REX_X(insn->rex_prefix.value) == 1)
+ if (X86_REX_X(insn->rex_prefix.value))
regno += 8;
break;
case REG_TYPE_BASE:
regno = X86_SIB_BASE(insn->sib.value);
- if (X86_REX_B(insn->rex_prefix.value) == 1)
+ if (X86_REX_B(insn->rex_prefix.value))
regno += 8;
break;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 109/128] x86/signal: Fix restart_syscall number for x32 tasks
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (107 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 108/128] x86/mpx: Fix instruction decoder condition Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 110/128] ovl: fix permission checking for setattr Kamal Mostafa
` (18 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dmitry V. Levin, Elvira Khabirova, Thomas Gleixner, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: "Dmitry V. Levin" <ldv@altlinux.org>
commit 22eab1108781eff09961ae7001704f7bd8fb1dce upstream.
When restarting a syscall with regs->ax == -ERESTART_RESTARTBLOCK,
regs->ax is assigned to a restart_syscall number. For x32 tasks, this
syscall number must have __X32_SYSCALL_BIT set, otherwise it will be
an x86_64 syscall number instead of a valid x32 syscall number. This
issue has been there since the introduction of x32.
Reported-by: strace/tests/restart_syscall.test
Reported-and-tested-by: Elvira Khabirova <lineprinter0@gmail.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Cc: Elvira Khabirova <lineprinter0@gmail.com>
Link: http://lkml.kernel.org/r/20151130215436.GA25996@altlinux.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kernel/signal.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index ed37a76..11577f5 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -684,12 +684,15 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs)
signal_setup_done(failed, ksig, test_thread_flag(TIF_SINGLESTEP));
}
-#ifdef CONFIG_X86_32
-#define NR_restart_syscall __NR_restart_syscall
-#else /* !CONFIG_X86_32 */
-#define NR_restart_syscall \
- test_thread_flag(TIF_IA32) ? __NR_ia32_restart_syscall : __NR_restart_syscall
-#endif /* CONFIG_X86_32 */
+static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs)
+{
+#if defined(CONFIG_X86_32) || !defined(CONFIG_X86_64)
+ return __NR_restart_syscall;
+#else /* !CONFIG_X86_32 && CONFIG_X86_64 */
+ return test_thread_flag(TIF_IA32) ? __NR_ia32_restart_syscall :
+ __NR_restart_syscall | (regs->orig_ax & __X32_SYSCALL_BIT);
+#endif /* CONFIG_X86_32 || !CONFIG_X86_64 */
+}
/*
* Note that 'init' is a special process: it doesn't get signals it doesn't
@@ -718,7 +721,7 @@ static void do_signal(struct pt_regs *regs)
break;
case -ERESTART_RESTARTBLOCK:
- regs->ax = NR_restart_syscall;
+ regs->ax = get_nr_restart_syscall(regs);
regs->ip -= 2;
break;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 110/128] ovl: fix permission checking for setattr
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (108 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 109/128] x86/signal: Fix restart_syscall number for x32 tasks Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 111/128] SUNRPC: Fix callback channel Kamal Mostafa
` (17 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Miklos Szeredi, Al Viro, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Miklos Szeredi <miklos@szeredi.hu>
commit acff81ec2c79492b180fade3c2894425cd35a545 upstream.
[Al Viro] The bug is in being too enthusiastic about optimizing ->setattr()
away - instead of "copy verbatim with metadata" + "chmod/chown/utimes"
(with the former being always safe and the latter failing in case of
insufficient permissions) it tries to combine these two. Note that copyup
itself will have to do ->setattr() anyway; _that_ is where the elevated
capabilities are right. Having these two ->setattr() (one to set verbatim
copy of metadata, another to do what overlayfs ->setattr() had been asked
to do in the first place) combined is where it breaks.
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/overlayfs/inode.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index 07d74b2..8525e67 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -49,13 +49,13 @@ int ovl_setattr(struct dentry *dentry, struct iattr *attr)
if (err)
goto out;
- upperdentry = ovl_dentry_upper(dentry);
- if (upperdentry) {
+ err = ovl_copy_up(dentry);
+ if (!err) {
+ upperdentry = ovl_dentry_upper(dentry);
+
mutex_lock(&upperdentry->d_inode->i_mutex);
err = notify_change(upperdentry, attr, NULL);
mutex_unlock(&upperdentry->d_inode->i_mutex);
- } else {
- err = ovl_copy_up_last(dentry, attr, false);
}
ovl_drop_write(dentry);
out:
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 111/128] SUNRPC: Fix callback channel
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (109 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 110/128] ovl: fix permission checking for setattr Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 112/128] tcp: md5: fix lockdep annotation Kamal Mostafa
` (16 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Benjamin Coddington, Trond Myklebust, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <trond.myklebust@primarydata.com>
commit 756b9b37cfb2e3dc76b2e43a8c097402ac736e07 upstream.
The NFSv4.1 callback channel is currently broken because the receive
message will keep shrinking because the backchannel receive buffer size
never gets reset.
The easiest solution to this problem is instead of changing the receive
buffer, to rather adjust the copied request.
Fixes: 38b7631fbe42 ("nfs4: limit callback decoding to received bytes")
Cc: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/callback_xdr.c | 7 ++-----
net/sunrpc/backchannel_rqst.c | 8 --------
net/sunrpc/svc.c | 12 ++++++++++++
3 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index 1e36635..02f8d09 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -76,8 +76,7 @@ static __be32 *read_buf(struct xdr_stream *xdr, int nbytes)
p = xdr_inline_decode(xdr, nbytes);
if (unlikely(p == NULL))
- printk(KERN_WARNING "NFS: NFSv4 callback reply buffer overflowed "
- "or truncated request.\n");
+ printk(KERN_WARNING "NFS: NFSv4 callback reply buffer overflowed!\n");
return p;
}
@@ -893,7 +892,6 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *r
struct cb_compound_hdr_arg hdr_arg = { 0 };
struct cb_compound_hdr_res hdr_res = { NULL };
struct xdr_stream xdr_in, xdr_out;
- struct xdr_buf *rq_arg = &rqstp->rq_arg;
__be32 *p, status;
struct cb_process_state cps = {
.drc_status = 0,
@@ -905,8 +903,7 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *r
dprintk("%s: start\n", __func__);
- rq_arg->len = rq_arg->head[0].iov_len + rq_arg->page_len;
- xdr_init_decode(&xdr_in, rq_arg, rq_arg->head[0].iov_base);
+ xdr_init_decode(&xdr_in, &rqstp->rq_arg, rqstp->rq_arg.head[0].iov_base);
p = (__be32*)((char *)rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len);
xdr_init_encode(&xdr_out, &rqstp->rq_res, p);
diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
index b57cee1..28504df 100644
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -308,19 +308,11 @@ void xprt_complete_bc_request(struct rpc_rqst *req, uint32_t copied)
{
struct rpc_xprt *xprt = req->rq_xprt;
struct svc_serv *bc_serv = xprt->bc_serv;
- struct xdr_buf *rq_rcv_buf = &req->rq_rcv_buf;
spin_lock(&xprt->bc_pa_lock);
list_del(&req->rq_bc_pa_list);
spin_unlock(&xprt->bc_pa_lock);
- if (copied <= rq_rcv_buf->head[0].iov_len) {
- rq_rcv_buf->head[0].iov_len = copied;
- rq_rcv_buf->page_len = 0;
- } else {
- rq_rcv_buf->page_len = copied - rq_rcv_buf->head[0].iov_len;
- }
-
req->rq_private_buf.len = copied;
set_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state);
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index b59b6a7..afb732a 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1361,7 +1361,19 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
memcpy(&rqstp->rq_addr, &req->rq_xprt->addr, rqstp->rq_addrlen);
memcpy(&rqstp->rq_arg, &req->rq_rcv_buf, sizeof(rqstp->rq_arg));
memcpy(&rqstp->rq_res, &req->rq_snd_buf, sizeof(rqstp->rq_res));
+
+ /* Adjust the argument buffer length */
rqstp->rq_arg.len = req->rq_private_buf.len;
+ if (rqstp->rq_arg.len <= rqstp->rq_arg.head[0].iov_len) {
+ rqstp->rq_arg.head[0].iov_len = rqstp->rq_arg.len;
+ rqstp->rq_arg.page_len = 0;
+ } else if (rqstp->rq_arg.len <= rqstp->rq_arg.head[0].iov_len +
+ rqstp->rq_arg.page_len)
+ rqstp->rq_arg.page_len = rqstp->rq_arg.len -
+ rqstp->rq_arg.head[0].iov_len;
+ else
+ rqstp->rq_arg.len = rqstp->rq_arg.head[0].iov_len +
+ rqstp->rq_arg.page_len;
/* reset result send buffer "put" position */
resv->iov_len = 0;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 112/128] tcp: md5: fix lockdep annotation
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (110 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 111/128] SUNRPC: Fix callback channel Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 113/128] tcp: fix potential huge kmalloc() calls in TCP_REPAIR Kamal Mostafa
` (15 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Eric Dumazet, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
commit 1b8e6a01e19f001e9f93b39c32387961c91ed3cc upstream.
When a passive TCP is created, we eventually call tcp_md5_do_add()
with sk pointing to the child. It is not owner by the user yet (we
will add this socket into listener accept queue a bit later anyway)
But we do own the spinlock, so amend the lockdep annotation to avoid
following splat :
[ 8451.090932] net/ipv4/tcp_ipv4.c:923 suspicious rcu_dereference_protected() usage!
[ 8451.090932]
[ 8451.090932] other info that might help us debug this:
[ 8451.090932]
[ 8451.090934]
[ 8451.090934] rcu_scheduler_active = 1, debug_locks = 1
[ 8451.090936] 3 locks held by socket_sockopt_/214795:
[ 8451.090936] #0: (rcu_read_lock){.+.+..}, at: [<ffffffff855c6ac1>] __netif_receive_skb_core+0x151/0xe90
[ 8451.090947] #1: (rcu_read_lock){.+.+..}, at: [<ffffffff85618143>] ip_local_deliver_finish+0x43/0x2b0
[ 8451.090952] #2: (slock-AF_INET){+.-...}, at: [<ffffffff855acda5>] sk_clone_lock+0x1c5/0x500
[ 8451.090958]
[ 8451.090958] stack backtrace:
[ 8451.090960] CPU: 7 PID: 214795 Comm: socket_sockopt_
[ 8451.091215] Call Trace:
[ 8451.091216] <IRQ> [<ffffffff856fb29c>] dump_stack+0x55/0x76
[ 8451.091229] [<ffffffff85123b5b>] lockdep_rcu_suspicious+0xeb/0x110
[ 8451.091235] [<ffffffff8564544f>] tcp_md5_do_add+0x1bf/0x1e0
[ 8451.091239] [<ffffffff85645751>] tcp_v4_syn_recv_sock+0x1f1/0x4c0
[ 8451.091242] [<ffffffff85642b27>] ? tcp_v4_md5_hash_skb+0x167/0x190
[ 8451.091246] [<ffffffff85647c78>] tcp_check_req+0x3c8/0x500
[ 8451.091249] [<ffffffff856451ae>] ? tcp_v4_inbound_md5_hash+0x11e/0x190
[ 8451.091253] [<ffffffff85647170>] tcp_v4_rcv+0x3c0/0x9f0
[ 8451.091256] [<ffffffff85618143>] ? ip_local_deliver_finish+0x43/0x2b0
[ 8451.091260] [<ffffffff856181b6>] ip_local_deliver_finish+0xb6/0x2b0
[ 8451.091263] [<ffffffff85618143>] ? ip_local_deliver_finish+0x43/0x2b0
[ 8451.091267] [<ffffffff85618d38>] ip_local_deliver+0x48/0x80
[ 8451.091270] [<ffffffff85618510>] ip_rcv_finish+0x160/0x700
[ 8451.091273] [<ffffffff8561900e>] ip_rcv+0x29e/0x3d0
[ 8451.091277] [<ffffffff855c74b7>] __netif_receive_skb_core+0xb47/0xe90
Fixes: a8afca0329988 ("tcp: md5: protects md5sig_info with RCU")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/ipv4/tcp_ipv4.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 4441dd9..1f3943f 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -959,7 +959,8 @@ int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr,
}
md5sig = rcu_dereference_protected(tp->md5sig_info,
- sock_owned_by_user(sk));
+ sock_owned_by_user(sk) ||
+ lockdep_is_held(&sk->sk_lock.slock));
if (!md5sig) {
md5sig = kmalloc(sizeof(*md5sig), gfp);
if (!md5sig)
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 113/128] tcp: fix potential huge kmalloc() calls in TCP_REPAIR
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (111 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 112/128] tcp: md5: fix lockdep annotation Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 114/128] drm: imx: convert to drm_crtc_send_vblank_event() Kamal Mostafa
` (14 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Eric Dumazet, Pavel Emelyanov, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
commit 5d4c9bfbabdb1d497f21afd81501e5c54b0c85d9 upstream.
tcp_send_rcvq() is used for re-injecting data into tcp receive queue.
Problems :
- No check against size is performed, allowed user to fool kernel in
attempting very large memory allocations, eventually triggering
OOM when memory is fragmented.
- In case of fault during the copy we do not return correct errno.
Lets use alloc_skb_with_frags() to cook optimal skbs.
Fixes: 292e8d8c8538 ("tcp: Move rcvq sending to tcp_input.c")
Fixes: c0e88ff0f256 ("tcp: Repair socket queues")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Pavel Emelyanov <xemul@parallels.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>
---
net/ipv4/tcp_input.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 8e967ef..a2782c1 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4354,19 +4354,34 @@ static int __must_check tcp_queue_rcv(struct sock *sk, struct sk_buff *skb, int
int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size)
{
struct sk_buff *skb;
+ int err = -ENOMEM;
+ int data_len = 0;
bool fragstolen;
if (size == 0)
return 0;
- skb = alloc_skb(size, sk->sk_allocation);
+ if (size > PAGE_SIZE) {
+ int npages = min_t(size_t, size >> PAGE_SHIFT, MAX_SKB_FRAGS);
+
+ data_len = npages << PAGE_SHIFT;
+ size = data_len + (size & ~PAGE_MASK);
+ }
+ skb = alloc_skb_with_frags(size - data_len, data_len,
+ PAGE_ALLOC_COSTLY_ORDER,
+ &err, sk->sk_allocation);
if (!skb)
goto err;
+ skb_put(skb, size - data_len);
+ skb->data_len = data_len;
+ skb->len = size;
+
if (tcp_try_rmem_schedule(sk, skb, skb->truesize))
goto err_free;
- if (memcpy_from_msg(skb_put(skb, size), msg, size))
+ err = skb_copy_datagram_from_iter(skb, 0, &msg->msg_iter, size);
+ if (err)
goto err_free;
TCP_SKB_CB(skb)->seq = tcp_sk(sk)->rcv_nxt;
@@ -4382,7 +4397,8 @@ int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size)
err_free:
kfree_skb(skb);
err:
- return -ENOMEM;
+ return err;
+
}
static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 114/128] drm: imx: convert to drm_crtc_send_vblank_event()
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (112 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 113/128] tcp: fix potential huge kmalloc() calls in TCP_REPAIR Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 115/128] isdn: Partially revert debug format string usage clean up Kamal Mostafa
` (13 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Russell King, Philipp Zabel, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell King <rmk+kernel@arm.linux.org.uk>
commit 69d21fc0a21196e9c5b259505c0135a88002f9d2 upstream.
ipu_crtc_handle_pageflip() was calling drm_send_vblank_event() with
a pipe argument of -1. Commit cc1ef118fc09 ("drm/irq: Make pipe
unsigned and name consistent") now makes this error obvious, as we
now may get a warning from:
if (WARN_ON(pipe >= dev->num_crtcs))
in drm_vblank_count_and_time(). Prior to this change, we would end
up making out-of-bounds array accesses via:
struct drm_vblank_crtc *vblank = &dev->vblank[crtc];
and
*vblanktime = vblanktimestamp(dev, pipe, cur_vblank);
So, this has been broken for a very long time, and is not a result
of the above commit. Since we don't care about the staging versions,
I've tagged this with the earliest mainline commit where we do care,
even though this commit did not introduce the bug.
Fixes: 6556f7f82b9c ("drm: imx: Move imx-drm driver out of staging")
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/imx/ipuv3-crtc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
index ebee59c..5352998 100644
--- a/drivers/gpu/drm/imx/ipuv3-crtc.c
+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
@@ -209,7 +209,8 @@ static void ipu_crtc_handle_pageflip(struct ipu_crtc *ipu_crtc)
spin_lock_irqsave(&drm->event_lock, flags);
if (ipu_crtc->page_flip_event)
- drm_send_vblank_event(drm, -1, ipu_crtc->page_flip_event);
+ drm_crtc_send_vblank_event(&ipu_crtc->base,
+ ipu_crtc->page_flip_event);
ipu_crtc->page_flip_event = NULL;
imx_drm_crtc_vblank_put(ipu_crtc->imx_crtc);
spin_unlock_irqrestore(&drm->event_lock, flags);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 115/128] isdn: Partially revert debug format string usage clean up
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (113 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 114/128] drm: imx: convert to drm_crtc_send_vblank_event() Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 116/128] remoteproc: avoid stack overflow in debugfs file Kamal Mostafa
` (12 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Kees Cook, Karsten Keil, Christoph Biedl, David S. Miller,
Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
commit 19cebbcb04c8277bb8a7905957c8af11967c4e28 upstream.
Commit 35a4a57 ("isdn: clean up debug format string usage") introduced
a safeguard to avoid accidential format string interpolation of data
when calling debugl1 or HiSax_putstatus. This did however not take into
account VHiSax_putstatus (called by HiSax_putstatus) does *not* call
vsprintf if the head parameter is NULL - the format string is treated
as plain text then instead. As a result, the string "%s" is processed
literally, and the actual information is lost. This affects the isdnlog
userspace program which stopped logging information since that commit.
So revert the HiSax_putstatus invocations to the previous state.
Fixes: 35a4a5733b0a ("isdn: clean up debug format string usage")
Cc: Kees Cook <keescook@chromium.org>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/isdn/hisax/config.c | 2 +-
drivers/isdn/hisax/hfc_pci.c | 2 +-
drivers/isdn/hisax/hfc_sx.c | 2 +-
drivers/isdn/hisax/q931.c | 6 +++---
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index b33f53b..bf04d2a 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -1896,7 +1896,7 @@ static void EChannel_proc_rcv(struct hisax_d_if *d_if)
ptr--;
*ptr++ = '\n';
*ptr = 0;
- HiSax_putstatus(cs, NULL, "%s", cs->dlog);
+ HiSax_putstatus(cs, NULL, cs->dlog);
} else
HiSax_putstatus(cs, "LogEcho: ",
"warning Frame too big (%d)",
diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
index 4a48255..90449e1 100644
--- a/drivers/isdn/hisax/hfc_pci.c
+++ b/drivers/isdn/hisax/hfc_pci.c
@@ -901,7 +901,7 @@ Begin:
ptr--;
*ptr++ = '\n';
*ptr = 0;
- HiSax_putstatus(cs, NULL, "%s", cs->dlog);
+ HiSax_putstatus(cs, NULL, cs->dlog);
} else
HiSax_putstatus(cs, "LogEcho: ", "warning Frame too big (%d)", total - 3);
}
diff --git a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c
index b1fad81..13b2151 100644
--- a/drivers/isdn/hisax/hfc_sx.c
+++ b/drivers/isdn/hisax/hfc_sx.c
@@ -674,7 +674,7 @@ receive_emsg(struct IsdnCardState *cs)
ptr--;
*ptr++ = '\n';
*ptr = 0;
- HiSax_putstatus(cs, NULL, "%s", cs->dlog);
+ HiSax_putstatus(cs, NULL, cs->dlog);
} else
HiSax_putstatus(cs, "LogEcho: ", "warning Frame too big (%d)", skb->len);
}
diff --git a/drivers/isdn/hisax/q931.c b/drivers/isdn/hisax/q931.c
index b420f8b..ba4beb2 100644
--- a/drivers/isdn/hisax/q931.c
+++ b/drivers/isdn/hisax/q931.c
@@ -1179,7 +1179,7 @@ LogFrame(struct IsdnCardState *cs, u_char *buf, int size)
dp--;
*dp++ = '\n';
*dp = 0;
- HiSax_putstatus(cs, NULL, "%s", cs->dlog);
+ HiSax_putstatus(cs, NULL, cs->dlog);
} else
HiSax_putstatus(cs, "LogFrame: ", "warning Frame too big (%d)", size);
}
@@ -1246,7 +1246,7 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir)
}
if (finish) {
*dp = 0;
- HiSax_putstatus(cs, NULL, "%s", cs->dlog);
+ HiSax_putstatus(cs, NULL, cs->dlog);
return;
}
if ((0xfe & buf[0]) == PROTO_DIS_N0) { /* 1TR6 */
@@ -1509,5 +1509,5 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir)
dp += sprintf(dp, "Unknown protocol %x!", buf[0]);
}
*dp = 0;
- HiSax_putstatus(cs, NULL, "%s", cs->dlog);
+ HiSax_putstatus(cs, NULL, cs->dlog);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 116/128] remoteproc: avoid stack overflow in debugfs file
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (114 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 115/128] isdn: Partially revert debug format string usage clean up Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 117/128] drm/rockchip: unset pgoff when mmap'ing gems Kamal Mostafa
` (11 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Arnd Bergmann, Ohad Ben-Cohen, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <arnd@arndb.de>
commit 92792e48e2ae6051af30468a87994b5432da2f06 upstream.
Recent gcc versions warn about reading from a negative offset of
an on-stack array:
drivers/remoteproc/remoteproc_debugfs.c: In function 'rproc_recovery_write':
drivers/remoteproc/remoteproc_debugfs.c:167:9: warning: 'buf[4294967295u]' may be used uninitialized in this function [-Wmaybe-uninitialized]
I don't see anything in sys_write() that prevents us from
being called with a zero 'count' argument, so we should
add an extra check in rproc_recovery_write() to prevent the
access and avoid the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 2e37abb89a2e ("remoteproc: create a 'recovery' debugfs entry")
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/remoteproc/remoteproc_debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c
index 9d30809..916af50 100644
--- a/drivers/remoteproc/remoteproc_debugfs.c
+++ b/drivers/remoteproc/remoteproc_debugfs.c
@@ -156,7 +156,7 @@ rproc_recovery_write(struct file *filp, const char __user *user_buf,
char buf[10];
int ret;
- if (count > sizeof(buf))
+ if (count < 1 || count > sizeof(buf))
return count;
ret = copy_from_user(buf, user_buf, count);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 117/128] drm/rockchip: unset pgoff when mmap'ing gems
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (115 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 116/128] remoteproc: avoid stack overflow in debugfs file Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 118/128] bpf, array: fix heap out-of-bounds access when updating elements Kamal Mostafa
` (10 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Heiko Stuebner, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Stuebner <heiko@sntech.de>
commit a8594f20cafadb6ba58f915dea5f2c94a9333b1a upstream.
Commit 371f0f085f629 ("ARM: 8426/1: dma-mapping: add missing range check
in dma_mmap()") introduced offset-checking for mappings, which collides
with the fake-offset the drm sets for gems.
Other drm-drivers set this offset to 0 before doing the mapping, so
this looks like the correct way to go for rockchip as well.
Fixes: 371f0f085f629 ("ARM: 8426/1: dma-mapping: add missing range check in dma_mmap()")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
index b79dc98..02007f0 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
@@ -67,6 +67,7 @@ static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj,
* VM_PFNMAP flag that was set by drm_gem_mmap_obj()/drm_gem_mmap().
*/
vma->vm_flags &= ~VM_PFNMAP;
+ vma->vm_pgoff = 0;
ret = dma_mmap_attrs(drm->dev, vma, rk_obj->kvaddr, rk_obj->dma_addr,
obj->size, &rk_obj->dma_attrs);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 118/128] bpf, array: fix heap out-of-bounds access when updating elements
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (116 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 117/128] drm/rockchip: unset pgoff when mmap'ing gems Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 119/128] net: mvneta: add configuration for MBUS windows access protection Kamal Mostafa
` (9 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Daniel Borkmann, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <daniel@iogearbox.net>
commit fbca9d2d35c6ef1b323fae75cc9545005ba25097 upstream.
During own review but also reported by Dmitry's syzkaller [1] it has been
noticed that we trigger a heap out-of-bounds access on eBPF array maps
when updating elements. This happens with each map whose map->value_size
(specified during map creation time) is not multiple of 8 bytes.
In array_map_alloc(), elem_size is round_up(attr->value_size, 8) and
used to align array map slots for faster access. However, in function
array_map_update_elem(), we update the element as ...
memcpy(array->value + array->elem_size * index, value, array->elem_size);
... where we access 'value' out-of-bounds, since it was allocated from
map_update_elem() from syscall side as kmalloc(map->value_size, GFP_USER)
and later on copied through copy_from_user(value, uvalue, map->value_size).
Thus, up to 7 bytes, we can access out-of-bounds.
Same could happen from within an eBPF program, where in worst case we
access beyond an eBPF program's designated stack.
Since 1be7f75d1668 ("bpf: enable non-root eBPF programs") didn't hit an
official release yet, it only affects priviledged users.
In case of array_map_lookup_elem(), the verifier prevents eBPF programs
from accessing beyond map->value_size through check_map_access(). Also
from syscall side map_lookup_elem() only copies map->value_size back to
user, so nothing could leak.
[1] http://github.com/google/syzkaller
Fixes: 28fbcfa08d8e ("bpf: add array type of eBPF maps")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/bpf/arraymap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
index 9eb4d8a..264073e 100644
--- a/kernel/bpf/arraymap.c
+++ b/kernel/bpf/arraymap.c
@@ -109,7 +109,7 @@ static int array_map_update_elem(struct bpf_map *map, void *key, void *value,
/* all elements already exist */
return -EEXIST;
- memcpy(array->value + array->elem_size * index, value, array->elem_size);
+ memcpy(array->value + array->elem_size * index, value, map->value_size);
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 119/128] net: mvneta: add configuration for MBUS windows access protection
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (117 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 118/128] bpf, array: fix heap out-of-bounds access when updating elements Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 120/128] net: mvneta: fix bit assignment in MVNETA_RXQ_CONFIG_REG Kamal Mostafa
` (8 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Marcin Wojtas, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcin Wojtas <mw@semihalf.com>
commit db6ba9a5371f173489df126739d0a1c2a50f347b upstream.
This commit adds missing configuration of MBUS windows access protection
in mvneta_conf_mbus_windows function - a dedicated variable for that
purpose remained there unused since v3.8 initial mvneta support. Because
of that the register contents were inherited from the bootloader.
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Fixes: c5aff18204da ("net: mvneta: driver for Marvell Armada 370/XP network
unit")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/ethernet/marvell/mvneta.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 5ff18c1..21b4550 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -61,6 +61,7 @@
#define MVNETA_WIN_SIZE(w) (0x2204 + ((w) << 3))
#define MVNETA_WIN_REMAP(w) (0x2280 + ((w) << 2))
#define MVNETA_BASE_ADDR_ENABLE 0x2290
+#define MVNETA_ACCESS_PROTECT_ENABLE 0x2294
#define MVNETA_PORT_CONFIG 0x2400
#define MVNETA_UNI_PROMISC_MODE BIT(0)
#define MVNETA_DEF_RXQ(q) ((q) << 1)
@@ -2899,6 +2900,7 @@ static void mvneta_conf_mbus_windows(struct mvneta_port *pp,
}
mvreg_write(pp, MVNETA_BASE_ADDR_ENABLE, win_enable);
+ mvreg_write(pp, MVNETA_ACCESS_PROTECT_ENABLE, win_protect);
}
/* Power up the port */
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 120/128] net: mvneta: fix bit assignment in MVNETA_RXQ_CONFIG_REG
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (118 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 119/128] net: mvneta: add configuration for MBUS windows access protection Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 121/128] net: mvneta: fix bit assignment for RX packet irq enable Kamal Mostafa
` (7 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Marcin Wojtas, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcin Wojtas <mw@semihalf.com>
commit e5bdf689d32fcf3aaf548c71e715b303ba20b5d1 upstream.
MVNETA_RXQ_HW_BUF_ALLOC bit which controls enabling hardware buffer
allocation was mistakenly set as BIT(1). This commit fixes the assignment.
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Fixes: c5aff18204da ("net: mvneta: driver for Marvell Armada 370/XP network
unit")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/ethernet/marvell/mvneta.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 21b4550..4c715ff 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -35,7 +35,7 @@
/* Registers */
#define MVNETA_RXQ_CONFIG_REG(q) (0x1400 + ((q) << 2))
-#define MVNETA_RXQ_HW_BUF_ALLOC BIT(1)
+#define MVNETA_RXQ_HW_BUF_ALLOC BIT(0)
#define MVNETA_RXQ_PKT_OFFSET_ALL_MASK (0xf << 8)
#define MVNETA_RXQ_PKT_OFFSET_MASK(offs) ((offs) << 8)
#define MVNETA_RXQ_THRESHOLD_REG(q) (0x14c0 + ((q) << 2))
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 121/128] net: mvneta: fix bit assignment for RX packet irq enable
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (119 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 120/128] net: mvneta: fix bit assignment in MVNETA_RXQ_CONFIG_REG Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 122/128] net/neighbour: fix crash at dumping device-agnostic proxy entries Kamal Mostafa
` (6 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Marcin Wojtas, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcin Wojtas <mw@semihalf.com>
commit dc1aadf6f1e7609590fadf7a0252413732289b2e upstream.
A value originally defined in the driver was inappropriate. Even though
the ingress was somehow working, writing MVNETA_RXQ_INTR_ENABLE_ALL_MASK
to MVNETA_INTR_ENABLE didn't make any effect, because the bits [31:16]
are reserved and read-only.
This commit updates MVNETA_RXQ_INTR_ENABLE_ALL_MASK to be compliant with
the controller's documentation.
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Fixes: c5aff18204da ("net: mvneta: driver for Marvell Armada 370/XP network
unit")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/ethernet/marvell/mvneta.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 4c715ff..3832570 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -154,7 +154,7 @@
#define MVNETA_INTR_ENABLE 0x25b8
#define MVNETA_TXQ_INTR_ENABLE_ALL_MASK 0x0000ff00
-#define MVNETA_RXQ_INTR_ENABLE_ALL_MASK 0xff000000 // note: neta says it's 0x000000FF
+#define MVNETA_RXQ_INTR_ENABLE_ALL_MASK 0x000000ff
#define MVNETA_RXQ_CMD 0x2680
#define MVNETA_RXQ_DISABLE_SHIFT 8
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 122/128] net/neighbour: fix crash at dumping device-agnostic proxy entries
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (120 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 121/128] net: mvneta: fix bit assignment for RX packet irq enable Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 123/128] sched/core: Remove false-positive warning from wake_up_process() Kamal Mostafa
` (5 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Konstantin Khlebnikov, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Khlebnikov <koct9i@gmail.com>
commit 6adc5fd6a142c6e2c80574c1db0c7c17dedaa42e upstream.
Proxy entries could have null pointer to net-device.
Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Fixes: 84920c1420e2 ("net: Allow ipv6 proxies and arp proxies be shown with iproute2")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/core/neighbour.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 0385351..9b1870d 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2239,7 +2239,7 @@ static int pneigh_fill_info(struct sk_buff *skb, struct pneigh_entry *pn,
ndm->ndm_pad2 = 0;
ndm->ndm_flags = pn->flags | NTF_PROXY;
ndm->ndm_type = RTN_UNICAST;
- ndm->ndm_ifindex = pn->dev->ifindex;
+ ndm->ndm_ifindex = pn->dev ? pn->dev->ifindex : 0;
ndm->ndm_state = NUD_NONE;
if (nla_put(skb, NDA_DST, tbl->key_len, pn->key))
@@ -2313,7 +2313,7 @@ static int pneigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb,
if (h > s_h)
s_idx = 0;
for (n = tbl->phash_buckets[h], idx = 0; n; n = n->next) {
- if (dev_net(n->dev) != net)
+ if (pneigh_net(n) != net)
continue;
if (idx < s_idx)
goto next;
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 123/128] sched/core: Remove false-positive warning from wake_up_process()
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (121 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 122/128] net/neighbour: fix crash at dumping device-agnostic proxy entries Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 124/128] net: ip6mr: fix static mfc/dev leaks on table destruction Kamal Mostafa
` (4 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sasha Levin, Peter Zijlstra (Intel), Mike Galbraith,
Thomas Gleixner, oleg, Ingo Molnar, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <sasha.levin@oracle.com>
commit 119d6f6a3be8b424b200dcee56e74484d5445f7e upstream.
Because wakeups can (fundamentally) be late, a task might not be in
the expected state. Therefore testing against a task's state is racy,
and can yield false positives.
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: oleg@redhat.com
Fixes: 9067ac85d533 ("wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED task")
Link: http://lkml.kernel.org/r/1448933660-23082-1-git-send-email-sasha.levin@oracle.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/sched/core.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 2006f4f..6b5909b 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1812,7 +1812,6 @@ out:
*/
int wake_up_process(struct task_struct *p)
{
- WARN_ON(task_is_stopped_or_traced(p));
return try_to_wake_up(p, TASK_NORMAL, 0);
}
EXPORT_SYMBOL(wake_up_process);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 124/128] net: ip6mr: fix static mfc/dev leaks on table destruction
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (122 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 123/128] sched/core: Remove false-positive warning from wake_up_process() Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 125/128] unix: avoid use-after-free in ep_remove_wait_queue Kamal Mostafa
` (3 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Benjamin Thery, Nikolay Aleksandrov, David S. Miller,
Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
[ Upstream commit 4c6980462f32b4f282c5d8e5f7ea8070e2937725 ]
Similar to ipv4, when destroying an mrt table the static mfc entries and
the static devices are kept, which leads to devices that can never be
destroyed (because of refcnt taken) and leaked memory. Make sure that
everything is cleaned up on netns destruction.
Fixes: 8229efdaef1e ("netns: ip6mr: enable namespace support in ipv6 multicast forwarding code")
CC: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Reviewed-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/ipv6/ip6mr.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index c7a69e8..b301606 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -120,7 +120,7 @@ static void mr6_netlink_event(struct mr6_table *mrt, struct mfc6_cache *mfc,
int cmd);
static int ip6mr_rtm_dumproute(struct sk_buff *skb,
struct netlink_callback *cb);
-static void mroute_clean_tables(struct mr6_table *mrt);
+static void mroute_clean_tables(struct mr6_table *mrt, bool all);
static void ipmr_expire_process(unsigned long arg);
#ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
@@ -337,7 +337,7 @@ static struct mr6_table *ip6mr_new_table(struct net *net, u32 id)
static void ip6mr_free_table(struct mr6_table *mrt)
{
del_timer(&mrt->ipmr_expire_timer);
- mroute_clean_tables(mrt);
+ mroute_clean_tables(mrt, true);
kfree(mrt);
}
@@ -1540,7 +1540,7 @@ static int ip6mr_mfc_add(struct net *net, struct mr6_table *mrt,
* Close the multicast socket, and clear the vif tables etc
*/
-static void mroute_clean_tables(struct mr6_table *mrt)
+static void mroute_clean_tables(struct mr6_table *mrt, bool all)
{
int i;
LIST_HEAD(list);
@@ -1550,8 +1550,9 @@ static void mroute_clean_tables(struct mr6_table *mrt)
* Shut down all active vif entries
*/
for (i = 0; i < mrt->maxvif; i++) {
- if (!(mrt->vif6_table[i].flags & VIFF_STATIC))
- mif6_delete(mrt, i, &list);
+ if (!all && (mrt->vif6_table[i].flags & VIFF_STATIC))
+ continue;
+ mif6_delete(mrt, i, &list);
}
unregister_netdevice_many(&list);
@@ -1560,7 +1561,7 @@ static void mroute_clean_tables(struct mr6_table *mrt)
*/
for (i = 0; i < MFC6_LINES; i++) {
list_for_each_entry_safe(c, next, &mrt->mfc6_cache_array[i], list) {
- if (c->mfc_flags & MFC_STATIC)
+ if (!all && (c->mfc_flags & MFC_STATIC))
continue;
write_lock_bh(&mrt_lock);
list_del(&c->list);
@@ -1623,7 +1624,7 @@ int ip6mr_sk_done(struct sock *sk)
net->ipv6.devconf_all);
write_unlock_bh(&mrt_lock);
- mroute_clean_tables(mrt);
+ mroute_clean_tables(mrt, false);
err = 0;
break;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 125/128] unix: avoid use-after-free in ep_remove_wait_queue
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (123 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 124/128] net: ip6mr: fix static mfc/dev leaks on table destruction Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 126/128] broadcom: fix PHY_ID_BCM5481 entry in the id table Kamal Mostafa
` (2 subsequent siblings)
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Rainer Weikusat, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
[ Upstream commit 7d267278a9ece963d77eefec61630223fce08c6c ]
Rainer Weikusat <rweikusat@mobileactivedefense.com> writes:
An AF_UNIX datagram socket being the client in an n:1 association with
some server socket is only allowed to send messages to the server if the
receive queue of this socket contains at most sk_max_ack_backlog
datagrams. This implies that prospective writers might be forced to go
to sleep despite none of the message presently enqueued on the server
receive queue were sent by them. In order to ensure that these will be
woken up once space becomes again available, the present unix_dgram_poll
routine does a second sock_poll_wait call with the peer_wait wait queue
of the server socket as queue argument (unix_dgram_recvmsg does a wake
up on this queue after a datagram was received). This is inherently
problematic because the server socket is only guaranteed to remain alive
for as long as the client still holds a reference to it. In case the
connection is dissolved via connect or by the dead peer detection logic
in unix_dgram_sendmsg, the server socket may be freed despite "the
polling mechanism" (in particular, epoll) still has a pointer to the
corresponding peer_wait queue. There's no way to forcibly deregister a
wait queue with epoll.
Based on an idea by Jason Baron, the patch below changes the code such
that a wait_queue_t belonging to the client socket is enqueued on the
peer_wait queue of the server whenever the peer receive queue full
condition is detected by either a sendmsg or a poll. A wake up on the
peer queue is then relayed to the ordinary wait queue of the client
socket via wake function. The connection to the peer wait queue is again
dissolved if either a wake up is about to be relayed or the client
socket reconnects or a dead peer is detected or the client socket is
itself closed. This enables removing the second sock_poll_wait from
unix_dgram_poll, thus avoiding the use-after-free, while still ensuring
that no blocked writer sleeps forever.
Signed-off-by: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Fixes: ec0d215f9420 ("af_unix: fix 'poll for write'/connected DGRAM sockets")
Reviewed-by: Jason Baron <jbaron@akamai.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/net/af_unix.h | 1 +
net/unix/af_unix.c | 183 ++++++++++++++++++++++++++++++++++++++++++++------
2 files changed, 165 insertions(+), 19 deletions(-)
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index dfe4ddf..e830c3d 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -63,6 +63,7 @@ struct unix_sock {
#define UNIX_GC_CANDIDATE 0
#define UNIX_GC_MAYBE_CYCLE 1
struct socket_wq peer_wq;
+ wait_queue_t peer_wake;
};
static inline struct unix_sock *unix_sk(struct sock *sk)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 6fab713..d02f3dc 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -316,6 +316,118 @@ found:
return s;
}
+/* Support code for asymmetrically connected dgram sockets
+ *
+ * If a datagram socket is connected to a socket not itself connected
+ * to the first socket (eg, /dev/log), clients may only enqueue more
+ * messages if the present receive queue of the server socket is not
+ * "too large". This means there's a second writeability condition
+ * poll and sendmsg need to test. The dgram recv code will do a wake
+ * up on the peer_wait wait queue of a socket upon reception of a
+ * datagram which needs to be propagated to sleeping would-be writers
+ * since these might not have sent anything so far. This can't be
+ * accomplished via poll_wait because the lifetime of the server
+ * socket might be less than that of its clients if these break their
+ * association with it or if the server socket is closed while clients
+ * are still connected to it and there's no way to inform "a polling
+ * implementation" that it should let go of a certain wait queue
+ *
+ * In order to propagate a wake up, a wait_queue_t of the client
+ * socket is enqueued on the peer_wait queue of the server socket
+ * whose wake function does a wake_up on the ordinary client socket
+ * wait queue. This connection is established whenever a write (or
+ * poll for write) hit the flow control condition and broken when the
+ * association to the server socket is dissolved or after a wake up
+ * was relayed.
+ */
+
+static int unix_dgram_peer_wake_relay(wait_queue_t *q, unsigned mode, int flags,
+ void *key)
+{
+ struct unix_sock *u;
+ wait_queue_head_t *u_sleep;
+
+ u = container_of(q, struct unix_sock, peer_wake);
+
+ __remove_wait_queue(&unix_sk(u->peer_wake.private)->peer_wait,
+ q);
+ u->peer_wake.private = NULL;
+
+ /* relaying can only happen while the wq still exists */
+ u_sleep = sk_sleep(&u->sk);
+ if (u_sleep)
+ wake_up_interruptible_poll(u_sleep, key);
+
+ return 0;
+}
+
+static int unix_dgram_peer_wake_connect(struct sock *sk, struct sock *other)
+{
+ struct unix_sock *u, *u_other;
+ int rc;
+
+ u = unix_sk(sk);
+ u_other = unix_sk(other);
+ rc = 0;
+ spin_lock(&u_other->peer_wait.lock);
+
+ if (!u->peer_wake.private) {
+ u->peer_wake.private = other;
+ __add_wait_queue(&u_other->peer_wait, &u->peer_wake);
+
+ rc = 1;
+ }
+
+ spin_unlock(&u_other->peer_wait.lock);
+ return rc;
+}
+
+static void unix_dgram_peer_wake_disconnect(struct sock *sk,
+ struct sock *other)
+{
+ struct unix_sock *u, *u_other;
+
+ u = unix_sk(sk);
+ u_other = unix_sk(other);
+ spin_lock(&u_other->peer_wait.lock);
+
+ if (u->peer_wake.private == other) {
+ __remove_wait_queue(&u_other->peer_wait, &u->peer_wake);
+ u->peer_wake.private = NULL;
+ }
+
+ spin_unlock(&u_other->peer_wait.lock);
+}
+
+static void unix_dgram_peer_wake_disconnect_wakeup(struct sock *sk,
+ struct sock *other)
+{
+ unix_dgram_peer_wake_disconnect(sk, other);
+ wake_up_interruptible_poll(sk_sleep(sk),
+ POLLOUT |
+ POLLWRNORM |
+ POLLWRBAND);
+}
+
+/* preconditions:
+ * - unix_peer(sk) == other
+ * - association is stable
+ */
+static int unix_dgram_peer_wake_me(struct sock *sk, struct sock *other)
+{
+ int connected;
+
+ connected = unix_dgram_peer_wake_connect(sk, other);
+
+ if (unix_recvq_full(other))
+ return 1;
+
+ if (connected)
+ unix_dgram_peer_wake_disconnect(sk, other);
+
+ return 0;
+}
+
static inline int unix_writable(struct sock *sk)
{
return (atomic_read(&sk->sk_wmem_alloc) << 2) <= sk->sk_sndbuf;
@@ -420,6 +532,8 @@ static void unix_release_sock(struct sock *sk, int embrion)
skpair->sk_state_change(skpair);
sk_wake_async(skpair, SOCK_WAKE_WAITD, POLL_HUP);
}
+
+ unix_dgram_peer_wake_disconnect(sk, skpair);
sock_put(skpair); /* It may now die */
unix_peer(sk) = NULL;
}
@@ -653,6 +767,7 @@ static struct sock *unix_create1(struct net *net, struct socket *sock)
INIT_LIST_HEAD(&u->link);
mutex_init(&u->readlock); /* single task reading lock */
init_waitqueue_head(&u->peer_wait);
+ init_waitqueue_func_entry(&u->peer_wake, unix_dgram_peer_wake_relay);
unix_insert_socket(unix_sockets_unbound(sk), sk);
out:
if (sk == NULL)
@@ -1020,6 +1135,8 @@ restart:
if (unix_peer(sk)) {
struct sock *old_peer = unix_peer(sk);
unix_peer(sk) = other;
+ unix_dgram_peer_wake_disconnect_wakeup(sk, old_peer);
+
unix_state_double_unlock(sk, other);
if (other != old_peer)
@@ -1459,6 +1576,7 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
struct scm_cookie tmp_scm;
int max_level;
int data_len = 0;
+ int sk_locked;
if (NULL == siocb->scm)
siocb->scm = &tmp_scm;
@@ -1540,12 +1658,14 @@ restart:
goto out_free;
}
+ sk_locked = 0;
unix_state_lock(other);
+restart_locked:
err = -EPERM;
if (!unix_may_send(sk, other))
goto out_unlock;
- if (sock_flag(other, SOCK_DEAD)) {
+ if (unlikely(sock_flag(other, SOCK_DEAD))) {
/*
* Check with 1003.1g - what should
* datagram error
@@ -1553,10 +1673,14 @@ restart:
unix_state_unlock(other);
sock_put(other);
+ if (!sk_locked)
+ unix_state_lock(sk);
+
err = 0;
- unix_state_lock(sk);
if (unix_peer(sk) == other) {
unix_peer(sk) = NULL;
+ unix_dgram_peer_wake_disconnect_wakeup(sk, other);
+
unix_state_unlock(sk);
unix_dgram_disconnected(sk, other);
@@ -1582,21 +1706,38 @@ restart:
goto out_unlock;
}
- if (unix_peer(other) != sk && unix_recvq_full(other)) {
- if (!timeo) {
- err = -EAGAIN;
- goto out_unlock;
+ if (unlikely(unix_peer(other) != sk && unix_recvq_full(other))) {
+ if (timeo) {
+ timeo = unix_wait_for_peer(other, timeo);
+
+ err = sock_intr_errno(timeo);
+ if (signal_pending(current))
+ goto out_free;
+
+ goto restart;
}
- timeo = unix_wait_for_peer(other, timeo);
+ if (!sk_locked) {
+ unix_state_unlock(other);
+ unix_state_double_lock(sk, other);
+ }
- err = sock_intr_errno(timeo);
- if (signal_pending(current))
- goto out_free;
+ if (unix_peer(sk) != other ||
+ unix_dgram_peer_wake_me(sk, other)) {
+ err = -EAGAIN;
+ sk_locked = 1;
+ goto out_unlock;
+ }
- goto restart;
+ if (!sk_locked) {
+ sk_locked = 1;
+ goto restart_locked;
+ }
}
+ if (unlikely(sk_locked))
+ unix_state_unlock(sk);
+
if (sock_flag(other, SOCK_RCVTSTAMP))
__net_timestamp(skb);
maybe_add_creds(skb, sock, other);
@@ -1610,6 +1751,8 @@ restart:
return len;
out_unlock:
+ if (sk_locked)
+ unix_state_unlock(sk);
unix_state_unlock(other);
out_free:
kfree_skb(skb);
@@ -2268,14 +2411,16 @@ static unsigned int unix_dgram_poll(struct file *file, struct socket *sock,
return mask;
writable = unix_writable(sk);
- other = unix_peer_get(sk);
- if (other) {
- if (unix_peer(other) != sk) {
- sock_poll_wait(file, &unix_sk(other)->peer_wait, wait);
- if (unix_recvq_full(other))
- writable = 0;
- }
- sock_put(other);
+ if (writable) {
+ unix_state_lock(sk);
+
+ other = unix_peer(sk);
+ if (other && unix_peer(other) != sk &&
+ unix_recvq_full(other) &&
+ unix_dgram_peer_wake_me(sk, other))
+ writable = 0;
+
+ unix_state_unlock(sk);
}
if (writable)
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 126/128] broadcom: fix PHY_ID_BCM5481 entry in the id table
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (124 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 125/128] unix: avoid use-after-free in ep_remove_wait_queue Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 127/128] ipv4: igmp: Allow removing groups from a removed interface Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 128/128] sched/wait: Fix signal handling in bit wait helpers Kamal Mostafa
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Aaro Koskinen, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaro Koskinen <aaro.koskinen@iki.fi>
commit 3c25a860d17b7378822f35d8c9141db9507e3beb upstream.
Commit fcb26ec5b18d ("broadcom: move all PHY_ID's to header")
updated broadcom_tbl to use PHY_IDs, but incorrectly replaced 0x0143bca0
with PHY_ID_BCM5482 (making a duplicate entry, and completely omitting
the original). Fix that.
Fixes: fcb26ec5b18d ("broadcom: move all PHY_ID's to header")
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/phy/broadcom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index a52afb2..ca5db60 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -661,7 +661,7 @@ static struct mdio_device_id __maybe_unused broadcom_tbl[] = {
{ PHY_ID_BCM5421, 0xfffffff0 },
{ PHY_ID_BCM5461, 0xfffffff0 },
{ PHY_ID_BCM5464, 0xfffffff0 },
- { PHY_ID_BCM5482, 0xfffffff0 },
+ { PHY_ID_BCM5481, 0xfffffff0 },
{ PHY_ID_BCM5482, 0xfffffff0 },
{ PHY_ID_BCM50610, 0xfffffff0 },
{ PHY_ID_BCM50610M, 0xfffffff0 },
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 127/128] ipv4: igmp: Allow removing groups from a removed interface
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (125 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 126/128] broadcom: fix PHY_ID_BCM5481 entry in the id table Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 128/128] sched/wait: Fix signal handling in bit wait helpers Kamal Mostafa
127 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Andrew Lunn, David S. Miller, Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Lunn <andrew@lunn.ch>
commit 4eba7bb1d72d9bde67d810d09bf62dc207b63c5c upstream.
When a multicast group is joined on a socket, a struct ip_mc_socklist
is appended to the sockets mc_list containing information about the
joined group.
If the interface is hot unplugged, this entry becomes stale. Prior to
commit 52ad353a5344f ("igmp: fix the problem when mc leave group") it
was possible to remove the stale entry by performing a
IP_DROP_MEMBERSHIP, passing either the old ifindex or ip address on
the interface. However, this fix enforces that the interface must
still exist. Thus with time, the number of stale entries grows, until
sysctl_igmp_max_memberships is reached and then it is not possible to
join and more groups.
The previous patch fixes an issue where a IP_DROP_MEMBERSHIP is
performed without specifying the interface, either by ifindex or ip
address. However here we do supply one of these. So loosen the
restriction on device existence to only apply when the interface has
not been specified. This then restores the ability to clean up the
stale entries.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Fixes: 52ad353a5344f "(igmp: fix the problem when mc leave group")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
net/ipv4/igmp.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 666cf36..9ffa231 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1942,7 +1942,7 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr)
rtnl_lock();
in_dev = ip_mc_find_dev(net, imr);
- if (!in_dev) {
+ if (!imr->imr_ifindex && !imr->imr_address.s_addr && !in_dev) {
ret = -ENODEV;
goto out;
}
@@ -1963,7 +1963,8 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr)
*imlp = iml->next_rcu;
- ip_mc_dec_group(in_dev, group);
+ if (in_dev)
+ ip_mc_dec_group(in_dev, group);
rtnl_unlock();
/* decrease mem now to avoid the memleak warning */
atomic_sub(sizeof(*iml), &sk->sk_omem_alloc);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* [PATCH 3.19.y-ckt 128/128] sched/wait: Fix signal handling in bit wait helpers
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
` (126 preceding siblings ...)
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 127/128] ipv4: igmp: Allow removing groups from a removed interface Kamal Mostafa
@ 2015-12-16 17:39 ` Kamal Mostafa
2015-12-16 17:57 ` Oleg Nesterov
127 siblings, 1 reply; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 17:39 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Peter Zijlstra (Intel), Linus Torvalds, Mike Galbraith,
Thomas Gleixner, mark.rutland, neilb, oleg, Ingo Molnar,
Kamal Mostafa
3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <peterz@infradead.org>
commit 68985633bccb6066bf1803e316fbc6c1f5b796d6 upstream.
Vladimir reported getting RCU stall warnings and bisected it back to
commit:
743162013d40 ("sched: Remove proliferation of wait_on_bit() action functions")
That commit inadvertently reversed the calls to schedule() and signal_pending(),
thereby not handling the case where the signal receives while we sleep.
Reported-by: Vladimir Murzin <vladimir.murzin@arm.com>
Tested-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: mark.rutland@arm.com
Cc: neilb@suse.de
Cc: oleg@redhat.com
Fixes: 743162013d40 ("sched: Remove proliferation of wait_on_bit() action functions")
Fixes: cbbce8220949 ("SCHED: add some "wait..on_bit...timeout()" interfaces.")
Link: http://lkml.kernel.org/r/20151201130404.GL3816@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
kernel/sched/wait.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c
index 852143a..e0bb7e6 100644
--- a/kernel/sched/wait.c
+++ b/kernel/sched/wait.c
@@ -583,18 +583,18 @@ EXPORT_SYMBOL(wake_up_atomic_t);
__sched int bit_wait(struct wait_bit_key *word)
{
- if (signal_pending_state(current->state, current))
- return 1;
schedule();
+ if (signal_pending(current))
+ return -EINTR;
return 0;
}
EXPORT_SYMBOL(bit_wait);
__sched int bit_wait_io(struct wait_bit_key *word)
{
- if (signal_pending_state(current->state, current))
- return 1;
io_schedule();
+ if (signal_pending(current))
+ return -EINTR;
return 0;
}
EXPORT_SYMBOL(bit_wait_io);
@@ -602,11 +602,11 @@ EXPORT_SYMBOL(bit_wait_io);
__sched int bit_wait_timeout(struct wait_bit_key *word)
{
unsigned long now = ACCESS_ONCE(jiffies);
- if (signal_pending_state(current->state, current))
- return 1;
if (time_after_eq(now, word->timeout))
return -EAGAIN;
schedule_timeout(word->timeout - now);
+ if (signal_pending(current))
+ return -EINTR;
return 0;
}
EXPORT_SYMBOL_GPL(bit_wait_timeout);
@@ -614,11 +614,11 @@ EXPORT_SYMBOL_GPL(bit_wait_timeout);
__sched int bit_wait_io_timeout(struct wait_bit_key *word)
{
unsigned long now = ACCESS_ONCE(jiffies);
- if (signal_pending_state(current->state, current))
- return 1;
if (time_after_eq(now, word->timeout))
return -EAGAIN;
io_schedule_timeout(word->timeout - now);
+ if (signal_pending(current))
+ return -EINTR;
return 0;
}
EXPORT_SYMBOL_GPL(bit_wait_io_timeout);
--
1.9.1
^ permalink raw reply related [flat|nested] 131+ messages in thread
* Re: [PATCH 3.19.y-ckt 128/128] sched/wait: Fix signal handling in bit wait helpers
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 128/128] sched/wait: Fix signal handling in bit wait helpers Kamal Mostafa
@ 2015-12-16 17:57 ` Oleg Nesterov
2015-12-16 18:07 ` Kamal Mostafa
0 siblings, 1 reply; 131+ messages in thread
From: Oleg Nesterov @ 2015-12-16 17:57 UTC (permalink / raw)
To: Kamal Mostafa
Cc: linux-kernel, stable, kernel-team, Peter Zijlstra (Intel),
Linus Torvalds, Mike Galbraith, Thomas Gleixner, mark.rutland,
neilb, Ingo Molnar
On 12/16, Kamal Mostafa wrote:
>
> 3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
>
>
> commit 68985633bccb6066bf1803e316fbc6c1f5b796d6 upstream.
Please note that this patch is wrong without the next fix from Peter.
And in fact to me it is still not clear whether we really want to do
this, this probably needs more investigation.
Oleg.
^ permalink raw reply [flat|nested] 131+ messages in thread
* Re: [PATCH 3.19.y-ckt 128/128] sched/wait: Fix signal handling in bit wait helpers
2015-12-16 17:57 ` Oleg Nesterov
@ 2015-12-16 18:07 ` Kamal Mostafa
0 siblings, 0 replies; 131+ messages in thread
From: Kamal Mostafa @ 2015-12-16 18:07 UTC (permalink / raw)
To: Oleg Nesterov, Linus Torvalds
Cc: linux-kernel, stable, kernel-team, Peter Zijlstra (Intel),
Linus Torvalds, Mike Galbraith, Thomas Gleixner, mark.rutland,
neilb, Ingo Molnar
On Wed, 2015-12-16 at 18:57 +0100, Oleg Nesterov wrote:
> On 12/16, Kamal Mostafa wrote:
> >
> > 3.19.8-ckt12 -stable review patch. If anyone has any objections, please let me know.
> >
> >
> > commit 68985633bccb6066bf1803e316fbc6c1f5b796d6 upstream.
>
> Please note that this patch is wrong without the next fix from Peter.
>
> And in fact to me it is still not clear whether we really want to do
> this, this probably needs more investigation.
>
> Oleg.
>
Thanks for the heads-up, Linus and Oleg. I'll just hold both of them
out of 3.19-stable until the dust settles.
Deferred until next 3.19 cycle:
6898563 sched/wait: Fix signal handling in bit wait helpers
dfd01f0 sched/wait: Fix the signal handling fix
-Kamal
^ permalink raw reply [flat|nested] 131+ messages in thread
end of thread, other threads:[~2015-12-16 18:07 UTC | newest]
Thread overview: 131+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-16 17:37 [3.19.y-ckt stable] Linux 3.19.8-ckt12 stable review Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 001/128] vf610_adc: Fix internal temperature calculation Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 002/128] iio: lpc32xx_adc: fix warnings caused by enabling unprepared clock Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 003/128] iio:ad5064: Make sure ad5064_i2c_write() returns 0 on success Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 004/128] iio: ad5064: Fix ad5629/ad5669 shift Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 005/128] iio:ad7793: Fix ad7785 product ID Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 006/128] x86/mpx: Add temporary variable to reduce masking Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 007/128] x86: Make is_64bit_mm() widely available Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 008/128] x86/mpx: Introduce new 'directory entry' to 'addr' helper function Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 009/128] x86/mpx: Do proper get_user() when running 32-bit binaries on 64-bit kernels Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 010/128] x86/fpu: Fix 32-bit signal frame handling Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 011/128] crypto: qat - don't use userspace pointer Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 012/128] iio: si7020: Swap data byte order Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 013/128] iio: adc: xilinx: Fix VREFN scale Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 014/128] ipmi: Start the timer and thread on internal msgs Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 015/128] drm/i915: quirk backlight present on Macbook 4, 1 Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 016/128] USB: qcserial: Add support for Quectel EC20 Mini PCIe module Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 017/128] USB: serial: option: add support for Novatel MiFi USB620L Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 018/128] USB: ti_usb_3410_5052: Add Honeywell HGI80 ID Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 019/128] drm/i915: get runtime PM reference around GEM set_caching IOCTL Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 020/128] drm/radeon: Disable uncacheable CPU mappings of GTT with RV6xx Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 021/128] drm/radeon: unconditionally set sysfs_initialized Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 022/128] USB: qcserial: Fix support for HP lt4112 LTE/HSPA+ Gobi 4G Modem Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 023/128] arm64: kernel: pause/unpause function graph tracer in cpu_suspend() Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 024/128] usb: dwc3: gadget: let us set lower max_speed Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 025/128] usb: chipidea: debug: disable usb irq while role switch Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 026/128] xhci: Workaround to get Intel xHCI reset working more reliably Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 027/128] xhci: Fix a race in usb2 LPM resume, blocking U3 for usb2 devices Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 028/128] x86/cpu: Fix SMAP check in PVOPS environments Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 029/128] arm64: restore bogomips information in /proc/cpuinfo Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 030/128] USB: option: add XS Stick W100-2 from 4G Systems Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 031/128] usblp: do not set TASK_INTERRUPTIBLE before lock Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 032/128] fat: fix fake_offset handling on error path Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 033/128] kernel/signal.c: unexport sigsuspend() Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 034/128] ocfs2: fix umask ignored issue Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 035/128] tty: Fix tty_send_xchar() lock order inversion Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 036/128] parisc: Drop unused MADV_xxxK_PAGES flags from asm/mman.h Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 037/128] mmc: remove bondage between REQ_META and reliable write Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 038/128] tools/net: Use include/uapi with __EXPORTED_HEADERS__ Kamal Mostafa
2015-12-16 17:37 ` [PATCH 3.19.y-ckt 039/128] packet: do skb_probe_transport_header when we actually have data Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 040/128] sctp: translate host order to network order when setting a hmacid Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 041/128] usb: musb: core: fix order of arguments to ulpi write callback Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 042/128] FS-Cache: Add missing initialization of ret in cachefiles_write_page() Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 043/128] ipvlan: fix leak in ipvlan_rcv_frame Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 044/128] ipvlan: fix use after free of skb Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 045/128] perf symbols: Fix dso lookup by long name and missing buildids Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 046/128] packet: only allow extra vlan len on ethernet devices Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 047/128] packet: fix tpacket_snd max frame len Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 048/128] net/mlx4_core: Avoid returning success in case of an error flow Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 049/128] macvlan: fix leak in macvlan_handle_frame Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 050/128] ALSA: usb-audio: add packet size quirk for the Medeli DD305 Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 051/128] ALSA: usb-audio: prevent CH345 multiport output SysEx corruption Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 052/128] ALSA: usb-audio: work around CH345 input " Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 053/128] dm thin: restore requested 'error_if_no_space' setting on OODS to WRITE transition Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 054/128] dm: fix ioctl retry termination with signal Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 055/128] MIPS: KVM: Fix ASID restoration logic Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 056/128] MIPS: KVM: Fix CACHE immediate offset sign extension Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 057/128] MIPS: KVM: Uninit VCPU in vcpu_create error path Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 058/128] KVM: Provide function for VCPU lookup by id Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 059/128] KVM: s390: avoid memory overwrites on emergency signal injection Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 060/128] KVM: s390: fix wrong lookup of VCPUs by array index Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 061/128] ALSA: hda - Add fixup for Acer Aspire One Cloudbook 14 Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 062/128] mac: validate mac_partition is within sector Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 063/128] ALSA: hda - Apply HP headphone fixups more generically Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 064/128] powerpc/tm: Block signal return setting invalid MSR state Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 065/128] powerpc/tm: Check for already reclaimed tasks Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 066/128] ARC: dw2 unwind: Remove falllback linear search thru FDE entries Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 067/128] fix sysvfs symlinks Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 068/128] vfs: Make sendfile(2) killable even better Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 069/128] vfs: Avoid softlockups with sendfile(2) Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 070/128] nfs4: start callback_ident at idr 1 Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 071/128] nfs4: limit callback decoding to received bytes Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 072/128] ALSA: hda - Fix headphone noise after Dell XPS 13 resume back from S3 Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 073/128] ARM: dts: vfxxx: Fix dspi[01] spi-num-chipselects Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 074/128] ARM/arm64: KVM: test properly for a PTE's uncachedness Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 075/128] arm64: KVM: Fix AArch32 to AArch64 register mapping Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 076/128] drm/radeon: make rv770_set_sw_state failures non-fatal Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 077/128] PCI: Prevent out of bounds access in numa_node override Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 078/128] ALSA: hda - Fix noise on Gigabyte Z170X mobo Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 079/128] btrfs: fix signed overflows in btrfs_sync_file Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 080/128] ARM: dove: Fix legacy get_irqnr_and_base Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 081/128] ARM: orion5x: " Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 082/128] drm/radeon: make some dpm errors debug only Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 083/128] nfs: if we have no valid attrs, then don't declare the attribute cache valid Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 084/128] xen/gntdev: Grant maps should not be subject to NUMA balancing Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 085/128] iscsi-target: Fix rx_login_comp hang after login failure Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 086/128] target: Fix race for SCF_COMPARE_AND_WRITE_POST checking Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 087/128] target: fix COMPARE_AND_WRITE non zero SGL offset data corruption Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 088/128] ARM: dts: Kirkwood: Fix QNAP TS219 power-off Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 089/128] ath10k: fix invalid NSS for 4x4 devices Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 090/128] Bluetooth: Fix l2cap_chan leak in SMP Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 091/128] crypto: nx - Fix timing leak in GCM and CCM decryption Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 092/128] crypto: talitos - Fix timing leak in ESP ICV verification Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 093/128] ASoC: wm8962: correct addresses for HPF_C_0/1 Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 094/128] mac80211: mesh: fix call_rcu() usage Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 095/128] can: sja1000: clear interrupts on start Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 096/128] ring-buffer: Update read stamp with first real commit on page Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 097/128] RDS: fix race condition when sending a message on unbound socket Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 098/128] drm/i915: Don't override output type for DDI HDMI Kamal Mostafa
2015-12-16 17:38 ` [PATCH 3.19.y-ckt 099/128] block: Always check queue limits for cloned requests Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 100/128] Fix a memory leak in scsi_host_dev_release() Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 101/128] wan/x25: Fix use-after-free in x25_asy_open_tty() Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 102/128] mac80211: do not actively scan DFS channels Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 103/128] PM / Domains: Fix bad of_node_put() in failure paths of genpd_dev_pm_attach() Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 104/128] drm: Fix an unwanted master inheritance v2 Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 105/128] sched/core: Clear the root_domain cpumasks in init_rootdomain() Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 106/128] rbd: don't put snap_context twice in rbd_queue_workfn() Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 107/128] ARM/arm64: KVM: correct PTE uncachedness check Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 108/128] x86/mpx: Fix instruction decoder condition Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 109/128] x86/signal: Fix restart_syscall number for x32 tasks Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 110/128] ovl: fix permission checking for setattr Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 111/128] SUNRPC: Fix callback channel Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 112/128] tcp: md5: fix lockdep annotation Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 113/128] tcp: fix potential huge kmalloc() calls in TCP_REPAIR Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 114/128] drm: imx: convert to drm_crtc_send_vblank_event() Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 115/128] isdn: Partially revert debug format string usage clean up Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 116/128] remoteproc: avoid stack overflow in debugfs file Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 117/128] drm/rockchip: unset pgoff when mmap'ing gems Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 118/128] bpf, array: fix heap out-of-bounds access when updating elements Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 119/128] net: mvneta: add configuration for MBUS windows access protection Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 120/128] net: mvneta: fix bit assignment in MVNETA_RXQ_CONFIG_REG Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 121/128] net: mvneta: fix bit assignment for RX packet irq enable Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 122/128] net/neighbour: fix crash at dumping device-agnostic proxy entries Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 123/128] sched/core: Remove false-positive warning from wake_up_process() Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 124/128] net: ip6mr: fix static mfc/dev leaks on table destruction Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 125/128] unix: avoid use-after-free in ep_remove_wait_queue Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 126/128] broadcom: fix PHY_ID_BCM5481 entry in the id table Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 127/128] ipv4: igmp: Allow removing groups from a removed interface Kamal Mostafa
2015-12-16 17:39 ` [PATCH 3.19.y-ckt 128/128] sched/wait: Fix signal handling in bit wait helpers Kamal Mostafa
2015-12-16 17:57 ` Oleg Nesterov
2015-12-16 18:07 ` Kamal Mostafa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).