This is the start of the stable review cycle for the 4.4.103 release.
There are 96 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Thu Nov 30 10:04:41 UTC 2017.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.103-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.4.103-rc1
Juergen Gross <jgross(a)suse.com>
xen: xenbus driver must not accept invalid transaction ids
Heiko Carstens <heiko.carstens(a)de.ibm.com>
s390/kbuild: enable modversions for symbols exported from asm
Richard Fitzgerald <rf(a)opensource.wolfsonmicro.com>
ASoC: wm_adsp: Don't overrun firmware file buffer when reading region data
Pan Bian <bianpan2016(a)163.com>
btrfs: return the actual error value from from btrfs_uuid_tree_iterate
Colin Ian King <colin.king(a)canonical.com>
ASoC: rsnd: don't double free kctrl
Florian Westphal <fw(a)strlen.de>
netfilter: nf_tables: fix oob access
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_queue: use raw_smp_processor_id()
Geert Uytterhoeven <geert(a)linux-m68k.org>
spi: SPI_FSL_DSPI should depend on HAS_DMA
Pan Bian <bianpan2016(a)163.com>
staging: iio: cdc: fix improper return value
Pan Bian <bianpan2016(a)163.com>
iio: light: fix improper return value
Masashi Honma <masashi.honma(a)gmail.com>
mac80211: Suppress NEW_PEER_CANDIDATE event if no room
Masashi Honma <masashi.honma(a)gmail.com>
mac80211: Remove invalid flag operations in mesh TSF synchronization
Chris Wilson <chris(a)chris-wilson.co.uk>
drm: Apply range restriction after color adjustment when allocation
Gabriele Mazzotta <gabriele.mzt(a)gmail.com>
ALSA: hda - Apply ALC269_FIXUP_NO_SHUTUP on HDA_FIXUP_ACT_PROBE
Bartosz Markowski <bartosz.markowski(a)tieto.com>
ath10k: set CTS protection VDEV param only if VDEV is up
Christian Lamparter <chunkeey(a)googlemail.com>
ath10k: fix potential memory leak in ath10k_wmi_tlv_op_pull_fw_stats()
Ryan Hsu <ryanhsu(a)qca.qualcomm.com>
ath10k: ignore configuring the incorrect board_id
Ryan Hsu <ryanhsu(a)qca.qualcomm.com>
ath10k: fix incorrect txpower set by P2P_DEVICE interface
Daniel Vetter <daniel.vetter(a)ffwll.ch>
drm/armada: Fix compile fail
Thomas Preisner <thomas.preisner+linux(a)fau.de>
net: 3com: typhoon: typhoon_init_one: fix incorrect return values
Thomas Preisner <thomas.preisner+linux(a)fau.de>
net: 3com: typhoon: typhoon_init_one: make return values more specific
David Ahern <dsa(a)cumulusnetworks.com>
net: Allow IP_MULTICAST_IF to set index to L3 slave
Shawn Guo <shawn.guo(a)linaro.org>
dmaengine: zx: set DMA_CYCLIC cap_mask bit
Bjorn Helgaas <bhelgaas(a)google.com>
PCI: Apply _HPX settings only to relevant devices
Santosh Shilimkar <santosh.shilimkar(a)oracle.com>
RDS: RDMA: return appropriate error on rdma map failures
Benjamin Poirier <bpoirier(a)suse.com>
e1000e: Separate signaling for link check/link up
Benjamin Poirier <bpoirier(a)suse.com>
e1000e: Fix return value test
Benjamin Poirier <bpoirier(a)suse.com>
e1000e: Fix error path in link detection
Tobias Jordan <Tobias.Jordan(a)elektrobit.com>
PM / OPP: Add missing of_node_put(np)
Tuomas Tynkkynen <tuomas(a)tuxera.com>
net/9p: Switch to wait_event_killable()
Eric Biggers <ebiggers(a)google.com>
fscrypt: lock mutex before checking for bounce page pool
Steven Rostedt (Red Hat) <rostedt(a)goodmis.org>
sched/rt: Simplify the IPI based RT balancing logic
Ricardo Ribalda Delgado <ricardo.ribalda(a)gmail.com>
media: v4l2-ctrl: Fix flags field on Control events
Johan Hovold <johan(a)kernel.org>
cx231xx-cards: fix NULL-deref on missing association descriptor
Sean Young <sean(a)mess.org>
media: rc: check for integer overflow
Michele Baldessari <michele(a)acksyn.org>
media: Don't do DMA on stack for firmware upload in the AS102 driver
Naveen N. Rao <naveen.n.rao(a)linux.vnet.ibm.com>
powerpc/signal: Properly handle return value from uprobe_deny_signal()
John David Anglin <dave.anglin(a)bell.net>
parisc: Fix validity check of pointer size argument in new CAS implementation
Brian King <brking(a)linux.vnet.ibm.com>
ixgbe: Fix skb list corruption on Power systems
Brian King <brking(a)linux.vnet.ibm.com>
fm10k: Use smp_rmb rather than read_barrier_depends
Brian King <brking(a)linux.vnet.ibm.com>
i40evf: Use smp_rmb rather than read_barrier_depends
Brian King <brking(a)linux.vnet.ibm.com>
ixgbevf: Use smp_rmb rather than read_barrier_depends
Brian King <brking(a)linux.vnet.ibm.com>
igbvf: Use smp_rmb rather than read_barrier_depends
Brian King <brking(a)linux.vnet.ibm.com>
igb: Use smp_rmb rather than read_barrier_depends
Brian King <brking(a)linux.vnet.ibm.com>
i40e: Use smp_rmb rather than read_barrier_depends
Johan Hovold <johan(a)kernel.org>
NFC: fix device-allocation error return
Bart Van Assche <bart.vanassche(a)wdc.com>
IB/srp: Avoid that a cable pull can trigger a kernel crash
Bart Van Assche <bart.vanassche(a)wdc.com>
IB/srpt: Do not accept invalid initiator port names
Dan Williams <dan.j.williams(a)intel.com>
libnvdimm, namespace: make 'resource' attribute only readable by root
Dan Williams <dan.j.williams(a)intel.com>
libnvdimm, namespace: fix label initialization to use valid seq numbers
Johan Hovold <johan(a)kernel.org>
clk: ti: dra7-atl-clock: fix child-node lookups
Peter Ujfalusi <peter.ujfalusi(a)ti.com>
clk: ti: dra7-atl-clock: Fix of_node reference counting
Trond Myklebust <trond.myklebust(a)primarydata.com>
SUNRPC: Fix tracepoint storage issues with svc_recv and svc_rqst_status
Paolo Bonzini <pbonzini(a)redhat.com>
KVM: SVM: obey guest PAT
Ladi Prosek <lprosek(a)redhat.com>
KVM: nVMX: set IDTR and GDTR limits when loading L1 host state
Nicholas Bellinger <nab(a)linux-iscsi.org>
target: Fix QUEUE_FULL + SCSI task attribute handling
Nicholas Bellinger <nab(a)linux-iscsi.org>
iscsi-target: Fix non-immediate TMR reference leak
Tuomas Tynkkynen <tuomas(a)tuxera.com>
fs/9p: Compare qid.path in v9fs_test_inode
Al Viro <viro(a)zeniv.linux.org.uk>
fix a page leak in vhost_scsi_iov_to_sgl() error recovery
Kailang Yang <kailang(a)realtek.com>
ALSA: hda/realtek - Fix ALC700 family no sound issue
Takashi Iwai <tiwai(a)suse.de>
ALSA: timer: Remove kernel warning at compat ioctl error paths
Takashi Iwai <tiwai(a)suse.de>
ALSA: usb-audio: Add sanity checks in v2 clock parsers
Takashi Iwai <tiwai(a)suse.de>
ALSA: usb-audio: Fix potential out-of-bound access at parsing SU
Takashi Iwai <tiwai(a)suse.de>
ALSA: usb-audio: Add sanity checks to FE parser
Henrik Eriksson <henrik.eriksson(a)axis.com>
ALSA: pcm: update tstamp only if audio_tstamp changed
Theodore Ts'o <tytso(a)mit.edu>
ext4: fix interaction between i_size, fallocate, and delalloc after a crash
Rameshwar Prasad Sahu <rsahu(a)apm.com>
ata: fixes kernel crash while tracing ata_eh_link_autopsy event
Arnd Bergmann <arnd(a)arndb.de>
rtlwifi: fix uninitialized rtlhal->last_suspend_sec time
Larry Finger <Larry.Finger(a)lwfinger.net>
rtlwifi: rtl8192ee: Fix memory leak when loading firmware
Andrew Elble <aweits(a)rit.edu>
nfsd: deal with revoked delegations appropriately
Chuck Lever <chuck.lever(a)oracle.com>
nfs: Fix ugly referral attributes
Joshua Watt <jpewhacker(a)gmail.com>
NFS: Fix typo in nomigration mount option
Arnd Bergmann <arnd(a)arndb.de>
isofs: fix timestamps beyond 2027
Coly Li <colyli(a)suse.de>
bcache: check ca->alloc_thread initialized before wake up it
Dan Carpenter <dan.carpenter(a)oracle.com>
eCryptfs: use after free in ecryptfs_release_messaging()
Andreas Rohner <andreas.rohner(a)gmx.net>
nilfs2: fix race condition that causes file system corruption
NeilBrown <neilb(a)suse.com>
autofs: don't fail mount for transient error
Mirko Parthey <mirko.parthey(a)web.de>
MIPS: BCM47XX: Fix LED inversion for WRT54GSv1
Maciej W. Rozycki <macro(a)mips.com>
MIPS: Fix an n32 core file generation regset support regression
Hou Tao <houtao1(a)huawei.com>
dm: fix race between dm_get_from_kobject() and __dm_destroy()
Eric Biggers <ebiggers(a)google.com>
dm bufio: fix integer overflow when limiting maximum cache size
Vijendar Mukunda <Vijendar.Mukunda(a)amd.com>
ALSA: hda: Add Raven PCI ID
Mathias Kresin <dev(a)kresin.me>
MIPS: ralink: Fix typo in mt7628 pinmux function
Mathias Kresin <dev(a)kresin.me>
MIPS: ralink: Fix MT7628 pinmux
Philip Derrin <philip(a)cog.systems>
ARM: 8721/1: mm: dump: check hardware RO bit for LPAE
Philip Derrin <philip(a)cog.systems>
ARM: 8722/1: mm: make STRICT_KERNEL_RWX effective for LPAE
Masami Hiramatsu <mhiramat(a)kernel.org>
x86/decoder: Add new TEST instruction pattern
Eric Biggers <ebiggers(a)google.com>
lib/mpi: call cond_resched() from mpi_powm() loop
Paul E. McKenney <paulmck(a)linux.vnet.ibm.com>
sched: Make resched_cpu() unconditional
WANG Cong <xiyou.wangcong(a)gmail.com>
vsock: use new wait API for vsock_stream_sendmsg()
Claudio Imbrenda <imbrenda(a)linux.vnet.ibm.com>
AF_VSOCK: Shrink the area influenced by prepare_to_wait
WANG Cong <xiyou.wangcong(a)gmail.com>
ipv6: only call ip6_route_dev_notify() once for NETDEV_UNREGISTER
Vasily Gorbik <gor(a)linux.vnet.ibm.com>
s390/disassembler: increase show_code buffer size
Heiko Carstens <heiko.carstens(a)de.ibm.com>
s390/disassembler: add missing end marker for e7 table
Heiko Carstens <heiko.carstens(a)de.ibm.com>
s390/runtime instrumention: fix possible memory corruption
Heiko Carstens <heiko.carstens(a)de.ibm.com>
s390: fix transactional execution control register handling
-------------
Diffstat:
Makefile | 4 +-
arch/arm/mm/dump.c | 4 +-
arch/arm/mm/init.c | 4 +-
arch/mips/bcm47xx/leds.c | 2 +-
arch/mips/kernel/ptrace.c | 17 ++
arch/mips/ralink/mt7620.c | 4 +-
arch/parisc/kernel/syscall.S | 6 +-
arch/powerpc/kernel/signal.c | 2 +-
arch/s390/include/asm/asm-prototypes.h | 8 +
arch/s390/include/asm/switch_to.h | 2 +-
arch/s390/kernel/dis.c | 5 +-
arch/s390/kernel/early.c | 4 +-
arch/s390/kernel/process.c | 1 +
arch/s390/kernel/runtime_instr.c | 4 +-
arch/x86/kvm/svm.c | 7 +
arch/x86/kvm/vmx.c | 2 +
arch/x86/lib/x86-opcode-map.txt | 2 +-
drivers/ata/libata-eh.c | 2 +-
drivers/base/power/opp/core.c | 1 +
drivers/clk/ti/clk-dra7-atl.c | 3 +-
drivers/dma/zx296702_dma.c | 1 +
drivers/gpu/drm/armada/Makefile | 2 +
drivers/gpu/drm/drm_mm.c | 16 +-
drivers/iio/light/cm3232.c | 2 +-
drivers/infiniband/ulp/srp/ib_srp.c | 25 ++-
drivers/infiniband/ulp/srpt/ib_srpt.c | 9 +-
drivers/md/bcache/alloc.c | 3 +-
drivers/md/dm-bufio.c | 15 +-
drivers/md/dm.c | 12 +-
drivers/media/rc/ir-lirc-codec.c | 9 +-
drivers/media/usb/as102/as102_fw.c | 28 ++-
drivers/media/usb/cx231xx/cx231xx-cards.c | 2 +-
drivers/media/v4l2-core/v4l2-ctrls.c | 16 +-
drivers/net/ethernet/3com/typhoon.c | 25 ++-
drivers/net/ethernet/intel/e1000e/mac.c | 11 +-
drivers/net/ethernet/intel/e1000e/netdev.c | 4 +-
drivers/net/ethernet/intel/e1000e/phy.c | 7 +-
drivers/net/ethernet/intel/fm10k/fm10k_main.c | 2 +-
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +-
drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 2 +-
drivers/net/ethernet/intel/igb/igb_main.c | 2 +-
drivers/net/ethernet/intel/igbvf/netdev.c | 2 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +-
drivers/net/wireless/ath/ath10k/core.c | 5 +-
drivers/net/wireless/ath/ath10k/mac.c | 58 ++++-
drivers/net/wireless/ath/ath10k/wmi-tlv.c | 12 +-
.../net/wireless/realtek/rtlwifi/rtl8192ee/fw.c | 6 +-
.../net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 1 +
drivers/nvdimm/label.c | 2 +-
drivers/nvdimm/namespace_devs.c | 2 +-
drivers/pci/probe.c | 15 +-
drivers/spi/Kconfig | 1 +
drivers/staging/iio/cdc/ad7150.c | 2 +-
drivers/target/iscsi/iscsi_target.c | 8 +-
drivers/target/target_core_transport.c | 4 +
drivers/vhost/scsi.c | 5 +-
drivers/xen/xenbus/xenbus_dev_frontend.c | 2 +-
fs/9p/vfs_inode.c | 3 +
fs/9p/vfs_inode_dotl.c | 3 +
fs/autofs4/waitq.c | 15 +-
fs/btrfs/uuid-tree.c | 4 +-
fs/ecryptfs/messaging.c | 7 +-
fs/ext4/crypto_key.c | 8 +-
fs/ext4/extents.c | 6 +-
fs/isofs/isofs.h | 2 +-
fs/isofs/rock.h | 2 +-
fs/isofs/util.c | 2 +-
fs/nfs/nfs4proc.c | 18 +-
fs/nfs/super.c | 2 +-
fs/nfsd/nfs4state.c | 25 ++-
fs/nilfs2/segment.c | 6 +-
include/trace/events/sunrpc.h | 17 +-
kernel/sched/core.c | 9 +-
kernel/sched/rt.c | 235 ++++++++++-----------
kernel/sched/sched.h | 24 ++-
lib/mpi/mpi-pow.c | 2 +
net/9p/client.c | 3 +-
net/9p/trans_virtio.c | 13 +-
net/ipv4/ip_sockglue.c | 7 +-
net/ipv6/ipv6_sockglue.c | 16 +-
net/ipv6/route.c | 6 +-
net/mac80211/ieee80211_i.h | 1 -
net/mac80211/mesh.c | 3 -
net/mac80211/mesh_plink.c | 14 +-
net/mac80211/mesh_sync.c | 11 -
net/netfilter/nf_tables_api.c | 2 +-
net/netfilter/nft_queue.c | 2 +-
net/nfc/core.c | 2 +-
net/rds/send.c | 11 +-
net/vmw_vsock/af_vsock.c | 167 ++++++++-------
sound/core/pcm_lib.c | 6 +-
sound/core/timer_compat.c | 12 +-
sound/pci/hda/hda_intel.c | 3 +
sound/pci/hda/patch_realtek.c | 4 +-
sound/soc/codecs/wm_adsp.c | 25 ++-
sound/soc/sh/rcar/core.c | 4 +-
sound/usb/clock.c | 9 +-
sound/usb/mixer.c | 15 +-
100 files changed, 699 insertions(+), 437 deletions(-)
Integration testing with a BIOS that generates injected health event
notifications fails to communicate those events to userspace. The nfit
driver neglects to link the ACPI DIMM device with the necessary driver
data so acpi_nvdimm_notify() fails this lookup:
nfit_mem = dev_get_drvdata(dev);
if (nfit_mem && nfit_mem->flags_attr)
sysfs_notify_dirent(nfit_mem->flags_attr);
Add the necessary linkage when installing the notification handler and
clean it up when the nfit driver instance is torn down.
Cc: <stable(a)vger.kernel.org>
Cc: Toshi Kani <toshi.kani(a)hpe.com>
Cc: Vishal Verma <vishal.l.verma(a)intel.com>
Fixes: ba9c8dd3c222 ("acpi, nfit: add dimm device notification support")
Reported-by: Daniel Osawa <daniel.k.osawa(a)intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
drivers/acpi/nfit/core.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index ff2580e7611d..947ea8a92761 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -1670,6 +1670,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
dev_name(&adev_dimm->dev));
return -ENXIO;
}
+ /*
+ * Record nfit_mem for the notification path to track back to
+ * the nfit sysfs attributes for this dimm device object.
+ */
+ dev_set_drvdata(&adev_dimm->dev, nfit_mem);
/*
* Until standardization materializes we need to consider 4
@@ -1755,6 +1760,7 @@ static void shutdown_dimm_notify(void *data)
if (adev_dimm)
acpi_remove_notify_handler(adev_dimm->handle,
ACPI_DEVICE_NOTIFY, acpi_nvdimm_notify);
+ dev_set_drvdata(&adev_dimm->dev, NULL);
}
mutex_unlock(&acpi_desc->init_mutex);
}
From: Eric Biggers <ebiggers(a)google.com>
keyctl_restrict_keyring() allows through a NULL restriction when the
"type" is non-NULL, which causes a NULL pointer dereference in
asymmetric_lookup_restriction() when it calls strcmp() on the
restriction string.
But no key types actually use a "NULL restriction" to mean anything, so
update keyctl_restrict_keyring() to reject it with EINVAL.
Reported-by: syzbot <syzkaller(a)googlegroups.com>
Fixes: 97d3aa0f3134 ("KEYS: Add a lookup_restriction function for the asymmetric key type")
Cc: <stable(a)vger.kernel.org> # v4.12+
Signed-off-by: Eric Biggers <ebiggers(a)google.com>
---
security/keys/keyctl.c | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index 76d22f726ae4..1ffe60bb2845 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -1588,9 +1588,8 @@ long keyctl_session_to_parent(void)
* The caller must have Setattr permission to change keyring restrictions.
*
* The requested type name may be a NULL pointer to reject all attempts
- * to link to the keyring. If _type is non-NULL, _restriction can be
- * NULL or a pointer to a string describing the restriction. If _type is
- * NULL, _restriction must also be NULL.
+ * to link to the keyring. In this case, _restriction must also be NULL.
+ * Otherwise, both _type and _restriction must be non-NULL.
*
* Returns 0 if successful.
*/
@@ -1598,7 +1597,6 @@ long keyctl_restrict_keyring(key_serial_t id, const char __user *_type,
const char __user *_restriction)
{
key_ref_t key_ref;
- bool link_reject = !_type;
char type[32];
char *restriction = NULL;
long ret;
@@ -1607,31 +1605,29 @@ long keyctl_restrict_keyring(key_serial_t id, const char __user *_type,
if (IS_ERR(key_ref))
return PTR_ERR(key_ref);
+ ret = -EINVAL;
if (_type) {
- ret = key_get_type_from_user(type, _type, sizeof(type));
- if (ret < 0)
+ if (!_restriction)
goto error;
- }
- if (_restriction) {
- if (!_type) {
- ret = -EINVAL;
+ ret = key_get_type_from_user(type, _type, sizeof(type));
+ if (ret < 0)
goto error;
- }
restriction = strndup_user(_restriction, PAGE_SIZE);
if (IS_ERR(restriction)) {
ret = PTR_ERR(restriction);
goto error;
}
+ } else {
+ if (_restriction)
+ goto error;
}
- ret = keyring_restrict(key_ref, link_reject ? NULL : type, restriction);
+ ret = keyring_restrict(key_ref, _type ? type : NULL, restriction);
kfree(restriction);
-
error:
key_ref_put(key_ref);
-
return ret;
}
--
2.15.0.531.g2ccb3012c9-goog
This is a note to let you know that I've just added the patch titled
usb: xhci: fix TDS for MTK xHCI1.1
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 72b663a99c074a8d073e7ecdae446cfb024ef551 Mon Sep 17 00:00:00 2001
From: Chunfeng Yun <chunfeng.yun(a)mediatek.com>
Date: Fri, 8 Dec 2017 18:10:06 +0200
Subject: usb: xhci: fix TDS for MTK xHCI1.1
For MTK's xHCI 1.0 or latter, TD size is the number of max
packet sized packets remaining in the TD, not including
this TRB (following spec).
For MTK's xHCI 0.96 and older, TD size is the number of max
packet sized packets remaining in the TD, including this TRB
(not following spec).
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun(a)mediatek.com>
Signed-off-by: Mathias Nyman <mathias.nyman(a)linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/host/xhci-ring.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 6eb87c6e4d24..c5cbc685c691 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3112,7 +3112,7 @@ static u32 xhci_td_remainder(struct xhci_hcd *xhci, int transferred,
{
u32 maxp, total_packet_count;
- /* MTK xHCI is mostly 0.97 but contains some features from 1.0 */
+ /* MTK xHCI 0.96 contains some features from 1.0 */
if (xhci->hci_version < 0x100 && !(xhci->quirks & XHCI_MTK_HOST))
return ((td_total_len - transferred) >> 10);
@@ -3121,8 +3121,8 @@ static u32 xhci_td_remainder(struct xhci_hcd *xhci, int transferred,
trb_buff_len == td_total_len)
return 0;
- /* for MTK xHCI, TD size doesn't include this TRB */
- if (xhci->quirks & XHCI_MTK_HOST)
+ /* for MTK xHCI 0.96, TD size include this TRB, but not in 1.x */
+ if ((xhci->quirks & XHCI_MTK_HOST) && (xhci->hci_version < 0x100))
trb_buff_len = 0;
maxp = usb_endpoint_maxp(&urb->ep->desc);
--
2.15.1
This is a note to let you know that I've just added the patch titled
xhci: Don't add a virt_dev to the devs array before it's fully
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 5d9b70f7d52eb14bb37861c663bae44de9521c35 Mon Sep 17 00:00:00 2001
From: Mathias Nyman <mathias.nyman(a)linux.intel.com>
Date: Fri, 8 Dec 2017 18:10:05 +0200
Subject: xhci: Don't add a virt_dev to the devs array before it's fully
allocated
Avoid null pointer dereference if some function is walking through the
devs array accessing members of a new virt_dev that is mid allocation.
Add the virt_dev to xhci->devs[i] _after_ the virt_device and all its
members are properly allocated.
issue found by KASAN: null-ptr-deref in xhci_find_slot_id_by_port
"Quick analysis suggests that xhci_alloc_virt_device() is not mutex
protected. If so, there is a time frame where xhci->devs[slot_id] is set
but not fully initialized. Specifically, xhci->devs[i]->udev can be NULL."
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman(a)linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/host/xhci-mem.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 15f7d422885f..3a29b32a3bd0 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -971,10 +971,9 @@ int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,
return 0;
}
- xhci->devs[slot_id] = kzalloc(sizeof(*xhci->devs[slot_id]), flags);
- if (!xhci->devs[slot_id])
+ dev = kzalloc(sizeof(*dev), flags);
+ if (!dev)
return 0;
- dev = xhci->devs[slot_id];
/* Allocate the (output) device context that will be used in the HC. */
dev->out_ctx = xhci_alloc_container_ctx(xhci, XHCI_CTX_TYPE_DEVICE, flags);
@@ -1015,9 +1014,17 @@ int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,
trace_xhci_alloc_virt_device(dev);
+ xhci->devs[slot_id] = dev;
+
return 1;
fail:
- xhci_free_virt_device(xhci, slot_id);
+
+ if (dev->in_ctx)
+ xhci_free_container_ctx(xhci, dev->in_ctx);
+ if (dev->out_ctx)
+ xhci_free_container_ctx(xhci, dev->out_ctx);
+ kfree(dev);
+
return 0;
}
--
2.15.1
The checks for whether another region/block header could be present
are subtracting the size from the current offset. Obviously we should
instead subtract the offset from the size.
The checks for whether the region/block data fit in the file are
adding the data size to the current offset and header size, without
checking for integer overflow. Rearrange these so that overflow is
impossible.
Cc: stable(a)vger.kernel.org
Signed-off-by: Ben Hutchings <ben.hutchings(a)codethink.co.uk>
---
sound/soc/codecs/wm_adsp.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 65c059b5ffd7..66e32f5d2917 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -1733,7 +1733,7 @@ static int wm_adsp_load(struct wm_adsp *dsp)
le64_to_cpu(footer->timestamp));
while (pos < firmware->size &&
- pos - firmware->size > sizeof(*region)) {
+ sizeof(*region) < firmware->size - pos) {
region = (void *)&(firmware->data[pos]);
region_name = "Unknown";
reg = 0;
@@ -1782,8 +1782,8 @@ static int wm_adsp_load(struct wm_adsp *dsp)
regions, le32_to_cpu(region->len), offset,
region_name);
- if ((pos + le32_to_cpu(region->len) + sizeof(*region)) >
- firmware->size) {
+ if (le32_to_cpu(region->len) >
+ firmware->size - pos - sizeof(*region)) {
adsp_err(dsp,
"%s.%d: %s region len %d bytes exceeds file length %zu\n",
file, regions, region_name,
@@ -2253,7 +2253,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
blocks = 0;
while (pos < firmware->size &&
- pos - firmware->size > sizeof(*blk)) {
+ sizeof(*blk) < firmware->size - pos) {
blk = (void *)(&firmware->data[pos]);
type = le16_to_cpu(blk->type);
@@ -2327,8 +2327,8 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
}
if (reg) {
- if ((pos + le32_to_cpu(blk->len) + sizeof(*blk)) >
- firmware->size) {
+ if (le32_to_cpu(blk->len) >
+ firmware->size - pos - sizeof(*blk)) {
adsp_err(dsp,
"%s.%d: %s region len %d bytes exceeds file length %zu\n",
file, blocks, region_name,
--
2.15.0.rc0
On 12/08/2017 05:36 AM, Mark Brown wrote:
> On Thu, Dec 07, 2017 at 09:03:01PM +0000, alexander.levin(a)verizon.com wrote:
>> On Thu, Dec 07, 2017 at 05:25:02PM +0000, Mark Brown wrote:
>
>>> We shouldn't be getting into adding completely new DT properties in
>>> stable backports like this. Old kernels have the bindings they have.
>
>> I thought that this one just adjust the example to match the code, and
>> doesn't actually change anything?
>
> No, there's a corresponding code change - the changelog is badly written.
>
Not this patch, this one was just the example was wrong, the driver
looks for, and always did look for, the "cirrus,gpio-nreset".
Only the tlv* drivers looked for the other property and needed code
changing, and those are separate patches.
This is a note to let you know that I've just added the patch titled
usbip: prevent vhci_hcd driver from leaking a socket pointer address
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 2f2d0088eb93db5c649d2a5e34a3800a8a935fc5 Mon Sep 17 00:00:00 2001
From: Shuah Khan <shuahkh(a)osg.samsung.com>
Date: Thu, 7 Dec 2017 14:16:49 -0700
Subject: usbip: prevent vhci_hcd driver from leaking a socket pointer address
When a client has a USB device attached over IP, the vhci_hcd driver is
locally leaking a socket pointer address via the
/sys/devices/platform/vhci_hcd/status file (world-readable) and in debug
output when "usbip --debug port" is run.
Fix it to not leak. The socket pointer address is not used at the moment
and it was made visible as a convenient way to find IP address from socket
pointer address by looking up /proc/net/{tcp,tcp6}.
As this opens a security hole, the fix replaces socket pointer address with
sockfd.
Reported-by: Secunia Research <vuln(a)secunia.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Shuah Khan <shuahkh(a)osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/usbip/usbip_common.h | 1 +
drivers/usb/usbip/vhci_sysfs.c | 25 ++++++++++++++++---------
tools/usb/usbip/libsrc/vhci_driver.c | 8 ++++----
3 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/drivers/usb/usbip/usbip_common.h b/drivers/usb/usbip/usbip_common.h
index e5de35c8c505..473fb8a87289 100644
--- a/drivers/usb/usbip/usbip_common.h
+++ b/drivers/usb/usbip/usbip_common.h
@@ -256,6 +256,7 @@ struct usbip_device {
/* lock for status */
spinlock_t lock;
+ int sockfd;
struct socket *tcp_socket;
struct task_struct *tcp_rx;
diff --git a/drivers/usb/usbip/vhci_sysfs.c b/drivers/usb/usbip/vhci_sysfs.c
index e78f7472cac4..091f76b7196d 100644
--- a/drivers/usb/usbip/vhci_sysfs.c
+++ b/drivers/usb/usbip/vhci_sysfs.c
@@ -17,15 +17,20 @@
/*
* output example:
- * hub port sta spd dev socket local_busid
- * hs 0000 004 000 00000000 c5a7bb80 1-2.3
+ * hub port sta spd dev sockfd local_busid
+ * hs 0000 004 000 00000000 3 1-2.3
* ................................................
- * ss 0008 004 000 00000000 d8cee980 2-3.4
+ * ss 0008 004 000 00000000 4 2-3.4
* ................................................
*
- * IP address can be retrieved from a socket pointer address by looking
- * up /proc/net/{tcp,tcp6}. Also, a userland program may remember a
- * port number and its peer IP address.
+ * Output includes socket fd instead of socket pointer address to avoid
+ * leaking kernel memory address in:
+ * /sys/devices/platform/vhci_hcd.0/status and in debug output.
+ * The socket pointer address is not used at the moment and it was made
+ * visible as a convenient way to find IP address from socket pointer
+ * address by looking up /proc/net/{tcp,tcp6}. As this opens a security
+ * hole, the change is made to use sockfd instead.
+ *
*/
static void port_show_vhci(char **out, int hub, int port, struct vhci_device *vdev)
{
@@ -39,8 +44,8 @@ static void port_show_vhci(char **out, int hub, int port, struct vhci_device *vd
if (vdev->ud.status == VDEV_ST_USED) {
*out += sprintf(*out, "%03u %08x ",
vdev->speed, vdev->devid);
- *out += sprintf(*out, "%16p %s",
- vdev->ud.tcp_socket,
+ *out += sprintf(*out, "%u %s",
+ vdev->ud.sockfd,
dev_name(&vdev->udev->dev));
} else {
@@ -160,7 +165,8 @@ static ssize_t nports_show(struct device *dev, struct device_attribute *attr,
char *s = out;
/*
- * Half the ports are for SPEED_HIGH and half for SPEED_SUPER, thus the * 2.
+ * Half the ports are for SPEED_HIGH and half for SPEED_SUPER,
+ * thus the * 2.
*/
out += sprintf(out, "%d\n", VHCI_PORTS * vhci_num_controllers);
return out - s;
@@ -366,6 +372,7 @@ static ssize_t store_attach(struct device *dev, struct device_attribute *attr,
vdev->devid = devid;
vdev->speed = speed;
+ vdev->ud.sockfd = sockfd;
vdev->ud.tcp_socket = socket;
vdev->ud.status = VDEV_ST_NOTASSIGNED;
diff --git a/tools/usb/usbip/libsrc/vhci_driver.c b/tools/usb/usbip/libsrc/vhci_driver.c
index 627d1dfc332b..c9c81614a66a 100644
--- a/tools/usb/usbip/libsrc/vhci_driver.c
+++ b/tools/usb/usbip/libsrc/vhci_driver.c
@@ -50,14 +50,14 @@ static int parse_status(const char *value)
while (*c != '\0') {
int port, status, speed, devid;
- unsigned long socket;
+ int sockfd;
char lbusid[SYSFS_BUS_ID_SIZE];
struct usbip_imported_device *idev;
char hub[3];
- ret = sscanf(c, "%2s %d %d %d %x %lx %31s\n",
+ ret = sscanf(c, "%2s %d %d %d %x %u %31s\n",
hub, &port, &status, &speed,
- &devid, &socket, lbusid);
+ &devid, &sockfd, lbusid);
if (ret < 5) {
dbg("sscanf failed: %d", ret);
@@ -66,7 +66,7 @@ static int parse_status(const char *value)
dbg("hub %s port %d status %d speed %d devid %x",
hub, port, status, speed, devid);
- dbg("socket %lx lbusid %s", socket, lbusid);
+ dbg("sockfd %u lbusid %s", sockfd, lbusid);
/* if a device is connected, look at it */
idev = &vhci_driver->idev[port];
--
2.15.1
This is a note to let you know that I've just added the patch titled
usbip: fix stub_send_ret_submit() vulnerability to null
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From be6123df1ea8f01ee2f896a16c2b7be3e4557a5a Mon Sep 17 00:00:00 2001
From: Shuah Khan <shuahkh(a)osg.samsung.com>
Date: Thu, 7 Dec 2017 14:16:50 -0700
Subject: usbip: fix stub_send_ret_submit() vulnerability to null
transfer_buffer
stub_send_ret_submit() handles urb with a potential null transfer_buffer,
when it replays a packet with potential malicious data that could contain
a null buffer. Add a check for the condition when actual_length > 0 and
transfer_buffer is null.
Reported-by: Secunia Research <vuln(a)secunia.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Shuah Khan <shuahkh(a)osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/usbip/stub_tx.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/usb/usbip/stub_tx.c b/drivers/usb/usbip/stub_tx.c
index b18bce96c212..53172b1f6257 100644
--- a/drivers/usb/usbip/stub_tx.c
+++ b/drivers/usb/usbip/stub_tx.c
@@ -167,6 +167,13 @@ static int stub_send_ret_submit(struct stub_device *sdev)
memset(&pdu_header, 0, sizeof(pdu_header));
memset(&msg, 0, sizeof(msg));
+ if (urb->actual_length > 0 && !urb->transfer_buffer) {
+ dev_err(&sdev->udev->dev,
+ "urb: actual_length %d transfer_buffer null\n",
+ urb->actual_length);
+ return -1;
+ }
+
if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS)
iovnum = 2 + urb->number_of_packets;
else
--
2.15.1