This fixes a hang issue seen when changing the MTU size from 1500 MTU
to 9000 MTU on both 5717 and 5719 chips. In discussion with Broadcom,
they've indicated that these chipsets have the same phy as the 57766
chipset, so the same workarounds apply. This has been tested by IBM
on both Power 8 and Power 9 systems as well as by Broadcom on x86
hardware and has been confirmed to resolve the hang issue.
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Brian King <brking(a)linux.vnet.ibm.com>
---
drivers/net/ethernet/broadcom/tg3.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index de51c21..d09c5a9 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -14225,7 +14225,9 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu)
/* Reset PHY, otherwise the read DMA engine will be in a mode that
* breaks all requests to 256 bytes.
*/
- if (tg3_asic_rev(tp) == ASIC_REV_57766)
+ if (tg3_asic_rev(tp) == ASIC_REV_57766 ||
+ tg3_asic_rev(tp) == ASIC_REV_5717 ||
+ tg3_asic_rev(tp) == ASIC_REV_5719)
reset_phy = true;
err = tg3_restart_hw(tp, reset_phy);
--
1.8.3.1
This is a note to let you know that I've just added the patch titled
USB: chipidea: msm: fix ulpi-node lookup
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 964728f9f407eca0b417fdf8e784b7a76979490c Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan(a)kernel.org>
Date: Mon, 13 Nov 2017 11:12:58 +0100
Subject: USB: chipidea: msm: fix ulpi-node lookup
Fix child-node lookup during probe, which ended up searching the whole
device tree depth-first starting at the parent rather than just matching
on its children.
Note that the original premature free of the parent node has already
been fixed separately, but that fix was apparently never backported to
stable.
Fixes: 47654a162081 ("usb: chipidea: msm: Restore wrapper settings after reset")
Fixes: b74c43156c0c ("usb: chipidea: msm: ci_hdrc_msm_probe() missing of_node_get()")
Cc: stable <stable(a)vger.kernel.org> # 4.10: b74c43156c0c
Cc: Stephen Boyd <stephen.boyd(a)linaro.org>
Cc: Frank Rowand <frank.rowand(a)sony.com>
Signed-off-by: Johan Hovold <johan(a)kernel.org>
Signed-off-by: Peter Chen <peter.chen(a)nxp.com>
---
drivers/usb/chipidea/ci_hdrc_msm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c
index 3593ce0ec641..880009987460 100644
--- a/drivers/usb/chipidea/ci_hdrc_msm.c
+++ b/drivers/usb/chipidea/ci_hdrc_msm.c
@@ -247,7 +247,7 @@ static int ci_hdrc_msm_probe(struct platform_device *pdev)
if (ret)
goto err_mux;
- ulpi_node = of_find_node_by_name(of_node_get(pdev->dev.of_node), "ulpi");
+ ulpi_node = of_get_child_by_name(pdev->dev.of_node, "ulpi");
if (ulpi_node) {
phy_node = of_get_next_available_child(ulpi_node, NULL);
ci->hsic = of_device_is_compatible(phy_node, "qcom,usb-hsic-phy");
--
2.15.1
This is a note to let you know that I've just added the patch titled
staging: android: ion: Fix dma direction for
to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-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 d6b246bb7a29703f53aa4c050b8b3205d749caee Mon Sep 17 00:00:00 2001
From: Sushmita Susheelendra <ssusheel(a)codeaurora.org>
Date: Fri, 15 Dec 2017 13:59:13 -0700
Subject: staging: android: ion: Fix dma direction for
dma_sync_sg_for_cpu/device
Use the direction argument passed into begin_cpu_access
and end_cpu_access when calling the dma_sync_sg_for_cpu/device.
The actual cache primitive called depends on the direction
passed in.
Signed-off-by: Sushmita Susheelendra <ssusheel(a)codeaurora.org>
Cc: stable <stable(a)vger.kernel.org>
Acked-by: Laura Abbott <labbott(a)redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/staging/android/ion/ion.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index a7d9b0e98572..f480885e346b 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -346,7 +346,7 @@ static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
mutex_lock(&buffer->lock);
list_for_each_entry(a, &buffer->attachments, list) {
dma_sync_sg_for_cpu(a->dev, a->table->sgl, a->table->nents,
- DMA_BIDIRECTIONAL);
+ direction);
}
mutex_unlock(&buffer->lock);
@@ -368,7 +368,7 @@ static int ion_dma_buf_end_cpu_access(struct dma_buf *dmabuf,
mutex_lock(&buffer->lock);
list_for_each_entry(a, &buffer->attachments, list) {
dma_sync_sg_for_device(a->dev, a->table->sgl, a->table->nents,
- DMA_BIDIRECTIONAL);
+ direction);
}
mutex_unlock(&buffer->lock);
--
2.15.1
This is the start of the stable review cycle for the 3.18.89 release.
There are 69 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 Wed Dec 20 15:26:44 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/v3.x/stable-review/patch-3.18.89-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-3.18.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 3.18.89-rc1
Bin Liu <b-liu(a)ti.com>
usb: musb: da8xx: fix babble condition handling
Miaoqing Pan <miaoqing(a)codeaurora.org>
ath9k: fix tx99 potential info leak
Alexander Duyck <alexander.h.duyck(a)intel.com>
macvlan: Only deliver one copy of the frame to the macvlan interface
Jan Kara <jack(a)suse.cz>
udf: Avoid overflow when session starts at large offset
Dan Carpenter <dan.carpenter(a)oracle.com>
scsi: bfa: integer overflow in debugfs
Kurt Garloff <garloff(a)suse.de>
scsi: scsi_devinfo: Add REPORTLUN2 to EMC SYMMETRIX blacklist entry
NeilBrown <neilb(a)suse.com>
raid5: Set R5_Expanded on parity devices as well as data.
Linus Walleij <linus.walleij(a)linaro.org>
pinctrl: adi2: Fix Kconfig build problem
nixiaoming <nixiaoming(a)huawei.com>
tty fix oops when rmmod 8250
Alex Williamson <alex.williamson(a)redhat.com>
PCI: Detach driver before procfs & sysfs teardown on device remove
Brian Foster <bfoster(a)redhat.com>
xfs: fix log block underflow during recovery cycle verification
tang.junhui <tang.junhui(a)zte.com.cn>
bcache: fix wrong cache_misses statistics
Liang Chen <liangchen.linux(a)gmail.com>
bcache: explicitly destroy mutex while exiting
Bob Peterson <rpeterso(a)redhat.com>
GFS2: Take inode off order_write list when setting jdata flag
Daniel Lezcano <daniel.lezcano(a)linaro.org>
thermal/drivers/step_wise: Fix temperature regulation misbehavior
Gao Feng <gfree.wind(a)vip.163.com>
ppp: Destroy the mutex when cleanup
Michał Mirosław <mirq-linux(a)rere.qmqm.pl>
clk: tegra: Fix cclk_lp divisor register
Jan Kara <jack(a)suse.cz>
mm: Handle 0 flags in _calc_vm_trans() macro
Suzuki K Poulose <suzuki.poulose(a)arm.com>
arm-ccn: perf: Prevent module unload while PMU is in use
Jiang Yi <jiangyilism(a)gmail.com>
target/file: Do not return error for UNMAP if length is zero
tangwenji <tang.wenji(a)zte.com.cn>
target:fix condition return in core_pr_dump_initiator_port()
tangwenji <tang.wenji(a)zte.com.cn>
iscsi-target: fix memory leak in lio_target_tiqn_addtpg()
Bart Van Assche <bart.vanassche(a)wdc.com>
target/iscsi: Fix a race condition in iscsit_add_reject_from_cmd()
Markus Elfring <elfring(a)users.sourceforge.net>
platform/x86: sony-laptop: Fix error handling in sony_nc_setup_rfkill()
Christophe Leroy <christophe.leroy(a)c-s.fr>
powerpc/ipic: Fix status get and status clear
William A. Kennington III <wak(a)google.com>
powerpc/opal: Fix EBUSY bug in acquiring tokens
Shriya <shriyak(a)linux.vnet.ibm.com>
powerpc/powernv/cpufreq: Fix the frequency read by /proc/cpuinfo
Qiang <zhengqiang10(a)huawei.com>
PCI/PME: Handle invalid data when reading Root Status
Christophe JAILLET <christophe.jaillet(a)wanadoo.fr>
video: fbdev: au1200fb: Return an error code if a memory allocation fails
Christophe JAILLET <christophe.jaillet(a)wanadoo.fr>
video: fbdev: au1200fb: Release some resources if a memory allocation fails
Ladislav Michl <ladis(a)linux-mips.org>
video: udlfb: Fix read EDID timeout
Geert Uytterhoeven <geert(a)linux-m68k.org>
fbdev: controlfb: Add missing modes to fix out of bounds access
Mike Christie <mchristi(a)redhat.com>
target: Use system workqueue for ALUA transitions
Zygo Blaxell <ce3g8jdj(a)umail.furryterror.org>
btrfs: add missing memset while reading compressed inline extents
Olga Kornievskaia <kolga(a)netapp.com>
NFSv4.1 respect server's max size in CREATE_SESSION
Daniel Borkmann <daniel(a)iogearbox.net>
perf symbols: Fix symbols__fixup_end heuristic for corner cases
David Howells <dhowells(a)redhat.com>
afs: Fix afs_kill_pages()
David Howells <dhowells(a)redhat.com>
afs: Fix page leak in afs_write_begin()
Marc Dionne <marc.dionne(a)auristor.com>
afs: Populate and use client modification time
David Howells <dhowells(a)redhat.com>
afs: Fix the maths in afs_fs_store_data()
David Howells <dhowells(a)redhat.com>
afs: Flush outstanding writes when an fd is closed
Marc Dionne <marc.dionne(a)auristor.com>
afs: Adjust mode bits processing
Marc Dionne <marc.dionne(a)auristor.com>
afs: Populate group ID from vnode status
David Howells <dhowells(a)redhat.com>
afs: Fix missing put_page()
Alex Deucher <alexander.deucher(a)amd.com>
drm/radeon: reinstate oland workaround for sclk
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
sched/deadline: Use deadline instead of period when calculating overflow
Alex Deucher <alexander.deucher(a)amd.com>
drm/radeon/si: add dpm quirk for Oland
Stafford Horne <shorne(a)gmail.com>
openrisc: fix issue handling 8 byte get_user calls
Vlad Yasevich <vyasevich(a)gmail.com>
net: Resend IGMP memberships upon peer notification.
Matthias Kaehlcke <mka(a)chromium.org>
dmaengine: Fix array index out of bounds warning in __get_unmap_pool()
Johan Hovold <johan(a)kernel.org>
net: wimax/i2400m: fix NULL-deref at probe
Dmitry Torokhov <dmitry.torokhov(a)gmail.com>
Input: i8042 - add TUXEDO BU1406 (N24_25BU) to the nomux list
NeilBrown <neilb(a)suse.com>
NFSD: fix nfsd_reset_versions for NFSv4.
NeilBrown <neilb(a)suse.com>
NFSD: fix nfsd_minorversion(.., NFSD_AVAIL)
Doug Berger <opendmb(a)gmail.com>
net: bcmgenet: Power up the internal PHY before probing the MII
Doug Berger <opendmb(a)gmail.com>
net: bcmgenet: correct MIB access of UniMAC RUNT counters
Doug Berger <opendmb(a)gmail.com>
net: bcmgenet: correct the RBUF_OVFL_CNT and RBUF_ERR_CNT MIB values
Javier Martinez Canillas <javier(a)osg.samsung.com>
usb: phy: isp1301: Add OF device ID table
Ilan peer <ilan.peer(a)intel.com>
mac80211: Fix addition of mesh configuration element
David Howells <dhowells(a)redhat.com>
KEYS: Don't permit request_key() to construct a new keyring
David Jeffery <djeffery(a)redhat.com>
Don't leak a key reference if request_key() tries to use a revoked keyring
Chandan Rajendra <chandan(a)linux.vnet.ibm.com>
ext4: fix crash when a directory's i_size is too small
Mathias Nyman <mathias.nyman(a)linux.intel.com>
xhci: Don't add a virt_dev to the devs array before it's fully allocated
Shuah Khan <shuahkh(a)osg.samsung.com>
usbip: fix stub_send_ret_submit() vulnerability to null transfer_buffer
Alan Stern <stern(a)rowland.harvard.edu>
USB: core: prevent malicious bNumInterfaces overflow
David Kozub <zub(a)linux.fjfi.cvut.cz>
USB: uas and storage: Add US_FL_BROKEN_FUA for another JMicron JMS567 ID
NeilBrown <neilb(a)suse.com>
autofs: fix careless error in recent commit
Eric Biggers <ebiggers(a)google.com>
crypto: salsa20 - fix blkcipher_walk API usage
Eric Biggers <ebiggers(a)google.com>
crypto: hmac - require that the underlying hash algorithm is unkeyed
-------------
Diffstat:
Makefile | 4 +-
arch/blackfin/Kconfig | 7 ++-
arch/blackfin/Kconfig.debug | 1 +
arch/openrisc/include/asm/uaccess.h | 2 +-
arch/powerpc/platforms/powernv/opal-async.c | 6 +-
arch/powerpc/platforms/powernv/setup.c | 2 +-
arch/powerpc/sysdev/ipic.c | 4 +-
arch/x86/crypto/salsa20_glue.c | 7 ---
crypto/hmac.c | 6 +-
crypto/salsa20_generic.c | 7 ---
crypto/shash.c | 5 +-
drivers/bus/arm-ccn.c | 1 +
drivers/clk/tegra/clk-tegra30.c | 2 +-
drivers/dma/dmaengine.c | 2 +
drivers/gpu/drm/radeon/si_dpm.c | 10 ++++
drivers/input/serio/i8042-x86ia64io.h | 7 +++
drivers/md/bcache/request.c | 6 +-
drivers/md/bcache/super.c | 6 +-
drivers/md/raid5.c | 5 +-
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 79 ++++++++++++++++++++++----
drivers/net/ethernet/broadcom/genet/bcmgenet.h | 10 +++-
drivers/net/macvlan.c | 2 +-
drivers/net/ppp/ppp_generic.c | 1 +
drivers/net/wimax/i2400m/usb.c | 3 +
drivers/net/wireless/ath/ath9k/tx99.c | 5 ++
drivers/pci/pcie/pme.c | 5 +-
drivers/pci/remove.c | 2 +-
drivers/pinctrl/Kconfig | 3 +-
drivers/platform/x86/sony-laptop.c | 14 +++--
drivers/scsi/bfa/bfad_debugfs.c | 5 +-
drivers/scsi/scsi_devinfo.c | 2 +-
drivers/target/iscsi/iscsi_target.c | 3 +-
drivers/target/iscsi/iscsi_target_configfs.c | 3 +-
drivers/target/target_core_alua.c | 8 +--
drivers/target/target_core_file.c | 4 ++
drivers/target/target_core_pr.c | 4 +-
drivers/thermal/step_wise.c | 11 ++--
drivers/usb/core/config.c | 4 +-
drivers/usb/host/xhci-mem.c | 15 +++--
drivers/usb/musb/da8xx.c | 10 +++-
drivers/usb/phy/phy-isp1301.c | 7 +++
drivers/usb/storage/unusual_devs.h | 7 +++
drivers/usb/storage/unusual_uas.h | 7 +++
drivers/usb/usbip/stub_tx.c | 7 +++
drivers/video/fbdev/au1200fb.c | 7 ++-
drivers/video/fbdev/controlfb.h | 2 +
drivers/video/fbdev/udlfb.c | 10 ++--
fs/afs/file.c | 1 +
fs/afs/fsclient.c | 20 +++----
fs/afs/inode.c | 4 +-
fs/afs/internal.h | 1 +
fs/afs/security.c | 7 ++-
fs/afs/write.c | 32 +++++++++--
fs/autofs4/waitq.c | 1 -
fs/btrfs/inode.c | 14 +++++
fs/ext4/namei.c | 4 ++
fs/gfs2/file.c | 4 +-
fs/nfs/nfs4client.c | 4 +-
fs/nfsd/nfssvc.c | 30 +++++-----
fs/proc/proc_tty.c | 3 +-
fs/udf/super.c | 2 +-
fs/xfs/xfs_log_recover.c | 2 +-
include/crypto/internal/hash.h | 8 +++
include/linux/mman.h | 3 +-
kernel/sched/deadline.c | 8 +--
net/core/dev.c | 1 +
net/mac80211/mesh.c | 2 -
security/keys/request_key.c | 4 ++
tools/perf/util/symbol.c | 2 +-
69 files changed, 352 insertions(+), 135 deletions(-)
This is a note to let you know that I've just added the patch titled
usb: Add device quirk for Logitech HD Pro Webcam C925e
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 7f038d256c723dd390d2fca942919573995f4cfd Mon Sep 17 00:00:00 2001
From: Dmitry Fleytman Dmitry Fleytman <dmitry.fleytman(a)gmail.com>
Date: Tue, 19 Dec 2017 06:02:04 +0200
Subject: usb: Add device quirk for Logitech HD Pro Webcam C925e
Commit e0429362ab15
("usb: Add device quirk for Logitech HD Pro Webcams C920 and C930e")
introduced quirk to workaround an issue with some Logitech webcams.
There is one more model that has the same issue - C925e, so applying
the same quirk as well.
See aforementioned commit message for detailed explanation of the problem.
Signed-off-by: Dmitry Fleytman <dmitry.fleytman(a)gmail.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/core/quirks.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 95812656d9b9..4024926c1d68 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -52,10 +52,11 @@ static const struct usb_device_id usb_quirk_list[] = {
/* Microsoft LifeCam-VX700 v2.0 */
{ USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME },
- /* Logitech HD Pro Webcams C920, C920-C and C930e */
+ /* Logitech HD Pro Webcams C920, C920-C, C925e and C930e */
{ USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT },
{ USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT },
{ USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT },
+ { USB_DEVICE(0x046d, 0x085b), .driver_info = USB_QUIRK_DELAY_INIT },
/* Logitech ConferenceCam CC3000e */
{ USB_DEVICE(0x046d, 0x0847), .driver_info = USB_QUIRK_DELAY_INIT },
--
2.15.1
This is a note to let you know that I've just added the patch titled
usbip: fix usbip bind writing random string after command in
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 544c4605acc5ae4afe7dd5914147947db182f2fb Mon Sep 17 00:00:00 2001
From: Juan Zea <juan.zea(a)qindel.com>
Date: Fri, 15 Dec 2017 10:21:20 +0100
Subject: usbip: fix usbip bind writing random string after command in
match_busid
usbip bind writes commands followed by random string when writing to
match_busid attribute in sysfs, caused by using full variable size
instead of string length.
Signed-off-by: Juan Zea <juan.zea(a)qindel.com>
Acked-by: Shuah Khan <shuahkh(a)osg.samsung.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
tools/usb/usbip/src/utils.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/usb/usbip/src/utils.c b/tools/usb/usbip/src/utils.c
index 2b3d6d235015..3d7b42e77299 100644
--- a/tools/usb/usbip/src/utils.c
+++ b/tools/usb/usbip/src/utils.c
@@ -30,6 +30,7 @@ int modify_match_busid(char *busid, int add)
char command[SYSFS_BUS_ID_SIZE + 4];
char match_busid_attr_path[SYSFS_PATH_MAX];
int rc;
+ int cmd_size;
snprintf(match_busid_attr_path, sizeof(match_busid_attr_path),
"%s/%s/%s/%s/%s/%s", SYSFS_MNT_PATH, SYSFS_BUS_NAME,
@@ -37,12 +38,14 @@ int modify_match_busid(char *busid, int add)
attr_name);
if (add)
- snprintf(command, SYSFS_BUS_ID_SIZE + 4, "add %s", busid);
+ cmd_size = snprintf(command, SYSFS_BUS_ID_SIZE + 4, "add %s",
+ busid);
else
- snprintf(command, SYSFS_BUS_ID_SIZE + 4, "del %s", busid);
+ cmd_size = snprintf(command, SYSFS_BUS_ID_SIZE + 4, "del %s",
+ busid);
rc = write_sysfs_attribute(match_busid_attr_path, command,
- sizeof(command));
+ cmd_size);
if (rc < 0) {
dbg("failed to write match_busid: %s", strerror(errno));
return -1;
--
2.15.1
This is a note to let you know that I've just added the patch titled
usbip: prevent leaking socket pointer address in messages
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 90120d15f4c397272aaf41077960a157fc4212bf Mon Sep 17 00:00:00 2001
From: Shuah Khan <shuahkh(a)osg.samsung.com>
Date: Fri, 15 Dec 2017 10:50:09 -0700
Subject: usbip: prevent leaking socket pointer address in messages
usbip driver is leaking socket pointer address in messages. Remove
the messages that aren't useful and print sockfd in the ones that
are useful for debugging.
Signed-off-by: Shuah Khan <shuahkh(a)osg.samsung.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/usbip/stub_dev.c | 3 +--
drivers/usb/usbip/usbip_common.c | 16 +++++-----------
drivers/usb/usbip/vhci_hcd.c | 2 +-
3 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c
index a3df8ee82faf..e31a6f204397 100644
--- a/drivers/usb/usbip/stub_dev.c
+++ b/drivers/usb/usbip/stub_dev.c
@@ -149,8 +149,7 @@ static void stub_shutdown_connection(struct usbip_device *ud)
* step 1?
*/
if (ud->tcp_socket) {
- dev_dbg(&sdev->udev->dev, "shutdown tcp_socket %p\n",
- ud->tcp_socket);
+ dev_dbg(&sdev->udev->dev, "shutdown sockfd %d\n", ud->sockfd);
kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR);
}
diff --git a/drivers/usb/usbip/usbip_common.c b/drivers/usb/usbip/usbip_common.c
index f7978933b402..7b219d9109b4 100644
--- a/drivers/usb/usbip/usbip_common.c
+++ b/drivers/usb/usbip/usbip_common.c
@@ -317,26 +317,20 @@ int usbip_recv(struct socket *sock, void *buf, int size)
struct msghdr msg = {.msg_flags = MSG_NOSIGNAL};
int total = 0;
+ if (!sock || !buf || !size)
+ return -EINVAL;
+
iov_iter_kvec(&msg.msg_iter, READ|ITER_KVEC, &iov, 1, size);
usbip_dbg_xmit("enter\n");
- if (!sock || !buf || !size) {
- pr_err("invalid arg, sock %p buff %p size %d\n", sock, buf,
- size);
- return -EINVAL;
- }
-
do {
- int sz = msg_data_left(&msg);
+ msg_data_left(&msg);
sock->sk->sk_allocation = GFP_NOIO;
result = sock_recvmsg(sock, &msg, MSG_WAITALL);
- if (result <= 0) {
- pr_debug("receive sock %p buf %p size %u ret %d total %d\n",
- sock, buf + total, sz, result, total);
+ if (result <= 0)
goto err;
- }
total += result;
} while (msg_data_left(&msg));
diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
index 9efab3dc3734..c3e1008aa491 100644
--- a/drivers/usb/usbip/vhci_hcd.c
+++ b/drivers/usb/usbip/vhci_hcd.c
@@ -965,7 +965,7 @@ static void vhci_shutdown_connection(struct usbip_device *ud)
/* need this? see stub_dev.c */
if (ud->tcp_socket) {
- pr_debug("shutdown tcp_socket %p\n", ud->tcp_socket);
+ pr_debug("shutdown tcp_socket %d\n", ud->sockfd);
kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR);
}
--
2.15.1
This is a note to let you know that I've just added the patch titled
usbip: stub: stop printing kernel pointer addresses in messages
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 248a22044366f588d46754c54dfe29ffe4f8b4df Mon Sep 17 00:00:00 2001
From: Shuah Khan <shuahkh(a)osg.samsung.com>
Date: Mon, 18 Dec 2017 17:23:37 -0700
Subject: usbip: stub: stop printing kernel pointer addresses in messages
Remove and/or change debug, info. and error messages to not print
kernel pointer addresses.
Signed-off-by: Shuah Khan <shuahkh(a)osg.samsung.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/usbip/stub_main.c | 5 +++--
drivers/usb/usbip/stub_rx.c | 7 ++-----
drivers/usb/usbip/stub_tx.c | 6 +++---
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/usbip/stub_main.c b/drivers/usb/usbip/stub_main.c
index 4f48b306713f..c31c8402a0c5 100644
--- a/drivers/usb/usbip/stub_main.c
+++ b/drivers/usb/usbip/stub_main.c
@@ -237,11 +237,12 @@ void stub_device_cleanup_urbs(struct stub_device *sdev)
struct stub_priv *priv;
struct urb *urb;
- dev_dbg(&sdev->udev->dev, "free sdev %p\n", sdev);
+ dev_dbg(&sdev->udev->dev, "Stub device cleaning up urbs\n");
while ((priv = stub_priv_pop(sdev))) {
urb = priv->urb;
- dev_dbg(&sdev->udev->dev, "free urb %p\n", urb);
+ dev_dbg(&sdev->udev->dev, "free urb seqnum %lu\n",
+ priv->seqnum);
usb_kill_urb(urb);
kmem_cache_free(stub_priv_cache, priv);
diff --git a/drivers/usb/usbip/stub_rx.c b/drivers/usb/usbip/stub_rx.c
index 493ac2928391..2f29be474098 100644
--- a/drivers/usb/usbip/stub_rx.c
+++ b/drivers/usb/usbip/stub_rx.c
@@ -211,9 +211,6 @@ static int stub_recv_cmd_unlink(struct stub_device *sdev,
if (priv->seqnum != pdu->u.cmd_unlink.seqnum)
continue;
- dev_info(&priv->urb->dev->dev, "unlink urb %p\n",
- priv->urb);
-
/*
* This matched urb is not completed yet (i.e., be in
* flight in usb hcd hardware/driver). Now we are
@@ -252,8 +249,8 @@ static int stub_recv_cmd_unlink(struct stub_device *sdev,
ret = usb_unlink_urb(priv->urb);
if (ret != -EINPROGRESS)
dev_err(&priv->urb->dev->dev,
- "failed to unlink a urb %p, ret %d\n",
- priv->urb, ret);
+ "failed to unlink a urb # %lu, ret %d\n",
+ priv->seqnum, ret);
return 0;
}
diff --git a/drivers/usb/usbip/stub_tx.c b/drivers/usb/usbip/stub_tx.c
index 53172b1f6257..f0ec41a50cbc 100644
--- a/drivers/usb/usbip/stub_tx.c
+++ b/drivers/usb/usbip/stub_tx.c
@@ -88,7 +88,7 @@ void stub_complete(struct urb *urb)
/* link a urb to the queue of tx. */
spin_lock_irqsave(&sdev->priv_lock, flags);
if (sdev->ud.tcp_socket == NULL) {
- usbip_dbg_stub_tx("ignore urb for closed connection %p", urb);
+ usbip_dbg_stub_tx("ignore urb for closed connection\n");
/* It will be freed in stub_device_cleanup_urbs(). */
} else if (priv->unlinking) {
stub_enqueue_ret_unlink(sdev, priv->seqnum, urb->status);
@@ -190,8 +190,8 @@ static int stub_send_ret_submit(struct stub_device *sdev)
/* 1. setup usbip_header */
setup_ret_submit_pdu(&pdu_header, urb);
- usbip_dbg_stub_tx("setup txdata seqnum: %d urb: %p\n",
- pdu_header.base.seqnum, urb);
+ usbip_dbg_stub_tx("setup txdata seqnum: %d\n",
+ pdu_header.base.seqnum);
usbip_header_correct_endian(&pdu_header, 1);
iov[iovnum].iov_base = &pdu_header;
--
2.15.1
This is a note to let you know that I've just added the patch titled
USB: Fix off by one in type-specific length check of BOS SSP
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 07b9f12864d16c3a861aef4817eb1efccbc5d0e6 Mon Sep 17 00:00:00 2001
From: Mathias Nyman <mathias.nyman(a)linux.intel.com>
Date: Tue, 19 Dec 2017 11:14:42 +0200
Subject: USB: Fix off by one in type-specific length check of BOS SSP
capability
USB 3.1 devices are not detected as 3.1 capable since 4.15-rc3 due to a
off by one in commit 81cf4a45360f ("USB: core: Add type-specific length
check of BOS descriptors")
It uses USB_DT_USB_SSP_CAP_SIZE() to get SSP capability size which takes
the zero based SSAC as argument, not the actual count of sublink speed
attributes.
USB3 spec 9.6.2.5 says "The number of Sublink Speed Attributes = SSAC + 1."
The type-specific length check patch was added to stable and needs to be
fixed there as well
Fixes: 81cf4a45360f ("USB: core: Add type-specific length check of BOS descriptors")
Cc: linux-stable <stable(a)vger.kernel.org>
CC: Masakazu Mokuno <masakazu.mokuno(a)gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman(a)linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/core/config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 78e92d29f8d9..c821b4b9647e 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -1007,7 +1007,7 @@ int usb_get_bos_descriptor(struct usb_device *dev)
case USB_SSP_CAP_TYPE:
ssp_cap = (struct usb_ssp_cap_descriptor *)buffer;
ssac = (le32_to_cpu(ssp_cap->bmAttributes) &
- USB_SSP_SUBLINK_SPEED_ATTRIBS) + 1;
+ USB_SSP_SUBLINK_SPEED_ATTRIBS);
if (length >= USB_DT_USB_SSP_CAP_SIZE(ssac))
dev->bos->ssp_cap = ssp_cap;
break;
--
2.15.1