This is a note to let you know that I've just added the patch titled
drivers: video: fbcon: fix NULL dereference in fbcon_cursor()
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-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 01faae5193d6190b7b3aa93dae43f514e866d652 Mon Sep 17 00:00:00 2001
From: Du Cheng <ducheng2(a)gmail.com>
Date: Fri, 12 Mar 2021 16:14:21 +0800
Subject: drivers: video: fbcon: fix NULL dereference in fbcon_cursor()
add null-check on function pointer before dereference on ops->cursor
Reported-by: syzbot+b67aaae8d3a927f68d20(a)syzkaller.appspotmail.com
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Du Cheng <ducheng2(a)gmail.com>
Link: https://lore.kernel.org/r/20210312081421.452405-1-ducheng2@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/video/fbdev/core/fbcon.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 44a5cd2f54cc..3406067985b1 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -1333,6 +1333,9 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
ops->cursor_flash = (mode == CM_ERASE) ? 0 : 1;
+ if (!ops->cursor)
+ return;
+
ops->cursor(vc, info, mode, get_color(vc, info, c, 1),
get_color(vc, info, c, 0));
}
--
2.31.0
This is a note to let you know that I've just added the patch titled
mei: allow map and unmap of client dma buffer only for disconnected
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-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 ce068bc7da473e39b64d130101e178406023df0c Mon Sep 17 00:00:00 2001
From: Tomas Winkler <tomas.winkler(a)intel.com>
Date: Thu, 18 Mar 2021 07:59:59 +0200
Subject: mei: allow map and unmap of client dma buffer only for disconnected
client
Allow map and unmap of the client dma buffer only when the client is not
connected. The functions return -EPROTO if the client is already connected.
This is to fix the race when traffic may start or stop when buffer
is not available.
Cc: <stable(a)vger.kernel.org> #v5.11+
Signed-off-by: Tomas Winkler <tomas.winkler(a)intel.com>
Link: https://lore.kernel.org/r/20210318055959.305627-1-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/misc/mei/client.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index 4378a9b25848..2cc370adb238 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -2286,8 +2286,8 @@ int mei_cl_dma_alloc_and_map(struct mei_cl *cl, const struct file *fp,
if (buffer_id == 0)
return -EINVAL;
- if (!mei_cl_is_connected(cl))
- return -ENODEV;
+ if (mei_cl_is_connected(cl))
+ return -EPROTO;
if (cl->dma_mapped)
return -EPROTO;
@@ -2327,9 +2327,7 @@ int mei_cl_dma_alloc_and_map(struct mei_cl *cl, const struct file *fp,
mutex_unlock(&dev->device_lock);
wait_event_timeout(cl->wait,
- cl->dma_mapped ||
- cl->status ||
- !mei_cl_is_connected(cl),
+ cl->dma_mapped || cl->status,
mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT));
mutex_lock(&dev->device_lock);
@@ -2376,8 +2374,9 @@ int mei_cl_dma_unmap(struct mei_cl *cl, const struct file *fp)
return -EOPNOTSUPP;
}
- if (!mei_cl_is_connected(cl))
- return -ENODEV;
+ /* do not allow unmap for connected client */
+ if (mei_cl_is_connected(cl))
+ return -EPROTO;
if (!cl->dma_mapped)
return -EPROTO;
@@ -2405,9 +2404,7 @@ int mei_cl_dma_unmap(struct mei_cl *cl, const struct file *fp)
mutex_unlock(&dev->device_lock);
wait_event_timeout(cl->wait,
- !cl->dma_mapped ||
- cl->status ||
- !mei_cl_is_connected(cl),
+ !cl->dma_mapped || cl->status,
mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT));
mutex_lock(&dev->device_lock);
--
2.31.0
This is a note to let you know that I've just added the patch titled
driver core: clear deferred probe reason on probe retry
to my driver-core git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
in the driver-core-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 f0acf637d60ffcef3ccb6e279f743e587b3c7359 Mon Sep 17 00:00:00 2001
From: Ahmad Fatoum <a.fatoum(a)pengutronix.de>
Date: Fri, 19 Mar 2021 12:04:57 +0100
Subject: driver core: clear deferred probe reason on probe retry
When retrying a deferred probe, any old defer reason string should be
discarded. Otherwise, if the probe is deferred again at a different spot,
but without setting a message, the now incorrect probe reason will remain.
This was observed with the i.MX I2C driver, which ultimately failed
to probe due to lack of the GPIO driver. The probe defer for GPIO
doesn't record a message, but a previous probe defer to clock_get did.
This had the effect that /sys/kernel/debug/devices_deferred listed
a misleading probe deferral reason.
Cc: stable <stable(a)vger.kernel.org>
Fixes: d090b70ede02 ("driver core: add deferring probe reason to devices_deferred property")
Reviewed-by: Andy Shevchenko <andy.shevchenko(a)gmail.com>
Reviewed-by: Andrzej Hajda <a.hajda(a)samsung.com>
Signed-off-by: Ahmad Fatoum <a.fatoum(a)pengutronix.de>
Link: https://lore.kernel.org/r/20210319110459.19966-1-a.fatoum@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/base/dd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 9179825ff646..e2cf3b29123e 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -97,6 +97,9 @@ static void deferred_probe_work_func(struct work_struct *work)
get_device(dev);
+ kfree(dev->p->deferred_probe_reason);
+ dev->p->deferred_probe_reason = NULL;
+
/*
* Drop the mutex while probing each device; the probe path may
* manipulate the deferred list
--
2.31.0
This is the start of the stable review cycle for the 4.4.263 release.
There are 14 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, 24 Mar 2021 12:19:09 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.263-rc…
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.263-rc1
Thomas Gleixner <tglx(a)linutronix.de>
genirq: Disable interrupts for force threaded handlers
Shijie Luo <luoshijie1(a)huawei.com>
ext4: fix potential error in ext4_do_update_inode
zhangyi (F) <yi.zhang(a)huawei.com>
ext4: find old entry again if failed to rename whiteout
Thomas Gleixner <tglx(a)linutronix.de>
x86/ioapic: Ignore IRQ2 again
Tyrel Datwyler <tyreld(a)linux.ibm.com>
PCI: rpadlpar: Fix potential drc_name corruption in store functions
Jim Lin <jilin(a)nvidia.com>
usb: gadget: configfs: Fix KASAN use-after-free
Macpaul Lin <macpaul.lin(a)mediatek.com>
USB: replace hardcode maximum usb string length by definition
Dan Carpenter <dan.carpenter(a)oracle.com>
scsi: lpfc: Fix some error codes in debugfs
Joe Korty <joe.korty(a)concurrent-rt.com>
NFSD: Repair misuse of sv_lock in 5.10.16-rt30.
Filipe Manana <fdmanana(a)suse.com>
btrfs: fix race when cloning extent buffer during rewind of an old root
Gwendal Grignou <gwendal(a)chromium.org>
platform/chrome: cros_ec_dev - Fix security issue
Jan Kara <jack(a)suse.cz>
ext4: check journal inode extents more carefully
Jan Kara <jack(a)suse.cz>
ext4: don't allow overlapping system zones
Jan Kara <jack(a)suse.cz>
ext4: handle error of ext4_setup_system_zone() on remount
-------------
Diffstat:
Makefile | 4 +-
arch/x86/kernel/apic/io_apic.c | 10 +++++
drivers/pci/hotplug/rpadlpar_sysfs.c | 14 +++----
drivers/platform/chrome/cros_ec_dev.c | 4 ++
drivers/platform/chrome/cros_ec_proto.c | 4 +-
drivers/scsi/lpfc/lpfc_debugfs.c | 4 +-
drivers/usb/gadget/composite.c | 4 +-
drivers/usb/gadget/configfs.c | 16 +++++---
drivers/usb/gadget/usbstring.c | 4 +-
fs/btrfs/ctree.c | 2 +
fs/ext4/block_validity.c | 71 +++++++++++++++------------------
fs/ext4/ext4.h | 6 +--
fs/ext4/extents.c | 16 +++-----
fs/ext4/indirect.c | 6 +--
fs/ext4/inode.c | 13 +++---
fs/ext4/mballoc.c | 4 +-
fs/ext4/namei.c | 29 +++++++++++++-
fs/ext4/super.c | 5 ++-
include/linux/mfd/cros_ec.h | 6 ++-
include/uapi/linux/usb/ch9.h | 3 ++
kernel/irq/manage.c | 4 ++
net/sunrpc/svc_xprt.c | 4 +-
22 files changed, 139 insertions(+), 94 deletions(-)
This is the start of the stable review cycle for the 4.9.263 release.
There are 25 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, 24 Mar 2021 12:19:09 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.263-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.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.9.263-rc1
Thomas Gleixner <tglx(a)linutronix.de>
genirq: Disable interrupts for force threaded handlers
Shijie Luo <luoshijie1(a)huawei.com>
ext4: fix potential error in ext4_do_update_inode
zhangyi (F) <yi.zhang(a)huawei.com>
ext4: find old entry again if failed to rename whiteout
Oleg Nesterov <oleg(a)redhat.com>
x86: Introduce TS_COMPAT_RESTART to fix get_nr_restart_syscall()
Oleg Nesterov <oleg(a)redhat.com>
x86: Move TS_COMPAT back to asm/thread_info.h
Oleg Nesterov <oleg(a)redhat.com>
kernel, fs: Introduce and use set_restart_fn() and arch_set_restart_data()
Thomas Gleixner <tglx(a)linutronix.de>
x86/ioapic: Ignore IRQ2 again
Kan Liang <kan.liang(a)linux.intel.com>
perf/x86/intel: Fix a crash caused by zero PEBS status
Tyrel Datwyler <tyreld(a)linux.ibm.com>
PCI: rpadlpar: Fix potential drc_name corruption in store functions
Dan Carpenter <dan.carpenter(a)oracle.com>
iio: adis16400: Fix an error code in adis16400_initial_setup()
Jim Lin <jilin(a)nvidia.com>
usb: gadget: configfs: Fix KASAN use-after-free
Macpaul Lin <macpaul.lin(a)mediatek.com>
USB: replace hardcode maximum usb string length by definition
Dan Carpenter <dan.carpenter(a)oracle.com>
scsi: lpfc: Fix some error codes in debugfs
Pavel Skripkin <paskripkin(a)gmail.com>
net/qrtr: fix __netdev_alloc_skb call
Daniel Kobras <kobras(a)puzzle-itc.de>
sunrpc: fix refcount leak for rpc auth modules
Timo Rothenpieler <timo(a)rothenpieler.org>
svcrdma: disable timeouts on rdma backchannel
Joe Korty <joe.korty(a)concurrent-rt.com>
NFSD: Repair misuse of sv_lock in 5.10.16-rt30.
Sagi Grimberg <sagi(a)grimberg.me>
nvmet: don't check iosqes,iocqes for discovery controllers
Filipe Manana <fdmanana(a)suse.com>
btrfs: fix race when cloning extent buffer during rewind of an old root
Jacob Keller <jacob.e.keller(a)intel.com>
ixgbe: prevent ptp_rx_hang from running when in FILTER_ALL mode
Jacob Keller <jacob.e.keller(a)intel.com>
ixgbe: check for Tx timestamp timeouts during watchdog
Florian Fainelli <f.fainelli(a)gmail.com>
net: dsa: b53: Support setting learning on port
Jan Kara <jack(a)suse.cz>
ext4: check journal inode extents more carefully
Jan Kara <jack(a)suse.cz>
ext4: don't allow overlapping system zones
Jan Kara <jack(a)suse.cz>
ext4: handle error of ext4_setup_system_zone() on remount
-------------
Diffstat:
Makefile | 4 +-
arch/x86/events/intel/ds.c | 2 +-
arch/x86/include/asm/processor.h | 9 ----
arch/x86/include/asm/thread_info.h | 23 ++++++++-
arch/x86/kernel/apic/io_apic.c | 10 ++++
arch/x86/kernel/signal.c | 24 +--------
drivers/iio/imu/adis16400_core.c | 3 +-
drivers/net/dsa/b53/b53_common.c | 20 ++++++++
drivers/net/dsa/b53/b53_regs.h | 1 +
drivers/net/dsa/bcm_sf2.c | 5 ++
drivers/net/dsa/bcm_sf2_regs.h | 2 +
drivers/net/ethernet/intel/ixgbe/ixgbe.h | 1 +
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 27 ++++++++++
drivers/nvme/target/core.c | 17 +++++--
drivers/pci/hotplug/rpadlpar_sysfs.c | 14 +++---
drivers/scsi/lpfc/lpfc_debugfs.c | 4 +-
drivers/usb/gadget/composite.c | 4 +-
drivers/usb/gadget/configfs.c | 16 ++++--
drivers/usb/gadget/usbstring.c | 4 +-
fs/btrfs/ctree.c | 2 +
fs/ext4/block_validity.c | 71 +++++++++++++--------------
fs/ext4/ext4.h | 6 +--
fs/ext4/extents.c | 16 +++---
fs/ext4/indirect.c | 6 +--
fs/ext4/inode.c | 13 +++--
fs/ext4/mballoc.c | 4 +-
fs/ext4/namei.c | 29 ++++++++++-
fs/ext4/super.c | 5 +-
fs/select.c | 10 ++--
include/linux/thread_info.h | 13 +++++
include/uapi/linux/usb/ch9.h | 3 ++
kernel/futex.c | 3 +-
kernel/irq/manage.c | 4 ++
kernel/time/alarmtimer.c | 2 +-
kernel/time/hrtimer.c | 2 +-
kernel/time/posix-cpu-timers.c | 2 +-
net/qrtr/qrtr.c | 2 +-
net/sunrpc/svc.c | 6 ++-
net/sunrpc/svc_xprt.c | 4 +-
net/sunrpc/xprtrdma/svc_rdma_backchannel.c | 6 +--
41 files changed, 256 insertions(+), 147 deletions(-)
This is a note to let you know that I've just added the patch titled
USB: quirks: ignore remote wake-up on Fibocom L850-GL LTE modem
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 0bd860493f81eb2a46173f6f5e44cc38331c8dbd Mon Sep 17 00:00:00 2001
From: Vincent Palatin <vpalatin(a)chromium.org>
Date: Fri, 19 Mar 2021 13:48:02 +0100
Subject: USB: quirks: ignore remote wake-up on Fibocom L850-GL LTE modem
This LTE modem (M.2 card) has a bug in its power management:
there is some kind of race condition for U3 wake-up between the host and
the device. The modem firmware sometimes crashes/locks when both events
happen at the same time and the modem fully drops off the USB bus (and
sometimes re-enumerates, sometimes just gets stuck until the next
reboot).
Tested with the modem wired to the XHCI controller on an AMD 3015Ce
platform. Without the patch, the modem dropped of the USB bus 5 times in
3 days. With the quirk, it stayed connected for a week while the
'runtime_suspended_time' counter incremented as excepted.
Signed-off-by: Vincent Palatin <vpalatin(a)chromium.org>
Link: https://lore.kernel.org/r/20210319124802.2315195-1-vpalatin@chromium.org
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/core/quirks.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 6ade3daf7858..76ac5d6555ae 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -498,6 +498,10 @@ static const struct usb_device_id usb_quirk_list[] = {
/* DJI CineSSD */
{ USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM },
+ /* Fibocom L850-GL LTE Modem */
+ { USB_DEVICE(0x2cb7, 0x0007), .driver_info =
+ USB_QUIRK_IGNORE_REMOTE_WAKEUP },
+
/* INTEL VALUE SSD */
{ USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
--
2.31.0
This is a note to let you know that I've just added the patch titled
USB: cdc-acm: downgrade message to debug
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 e4c77070ad45fc940af1d7fb1e637c349e848951 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum(a)suse.com>
Date: Thu, 11 Mar 2021 14:01:26 +0100
Subject: USB: cdc-acm: downgrade message to debug
This failure is so common that logging an error here amounts
to spamming log files.
Reviewed-by: Bruno Thomsen <bruno.thomsen(a)gmail.com>
Signed-off-by: Oliver Neukum <oneukum(a)suse.com>
Cc: stable <stable(a)vger.kernel.org>
Link: https://lore.kernel.org/r/20210311130126.15972-2-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/class/cdc-acm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index d684cf94b1c0..fd2fce072985 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -659,7 +659,8 @@ static void acm_port_dtr_rts(struct tty_port *port, int raise)
res = acm_set_control(acm, val);
if (res && (acm->ctrl_caps & USB_CDC_CAP_LINE))
- dev_err(&acm->control->dev, "failed to set dtr/rts\n");
+ /* This is broken in too many devices to spam the logs */
+ dev_dbg(&acm->control->dev, "failed to set dtr/rts\n");
}
static int acm_port_activate(struct tty_port *port, struct tty_struct *tty)
--
2.31.0
This is a note to let you know that I've just added the patch titled
cdc-acm: fix BREAK rx code path adding necessary calls
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 08dff274edda54310d6f1cf27b62fddf0f8d146e Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum(a)suse.com>
Date: Thu, 11 Mar 2021 14:37:14 +0100
Subject: cdc-acm: fix BREAK rx code path adding necessary calls
Counting break events is nice but we should actually report them to
the tty layer.
Fixes: 5a6a62bdb9257 ("cdc-acm: add TIOCMIWAIT")
Signed-off-by: Oliver Neukum <oneukum(a)suse.com>
Link: https://lore.kernel.org/r/20210311133714.31881-1-oneukum@suse.com
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/class/cdc-acm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 39ddb5585ded..b013671261a2 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -313,8 +313,10 @@ static void acm_process_notification(struct acm *acm, unsigned char *buf)
acm->iocount.dsr++;
if (difference & ACM_CTRL_DCD)
acm->iocount.dcd++;
- if (newctrl & ACM_CTRL_BRK)
+ if (newctrl & ACM_CTRL_BRK) {
acm->iocount.brk++;
+ tty_insert_flip_char(&acm->port, 0, TTY_BREAK);
+ }
if (newctrl & ACM_CTRL_RI)
acm->iocount.rng++;
if (newctrl & ACM_CTRL_FRAMING)
--
2.31.0
This is a note to let you know that I've just added the patch titled
usb: gadget: udc: amd5536udc_pci fix null-ptr-dereference
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 72035f4954f0bca2d8c47cf31b3629c42116f5b7 Mon Sep 17 00:00:00 2001
From: Tong Zhang <ztong0001(a)gmail.com>
Date: Wed, 17 Mar 2021 19:04:00 -0400
Subject: usb: gadget: udc: amd5536udc_pci fix null-ptr-dereference
init_dma_pools() calls dma_pool_create(...dev->dev) to create dma pool.
however, dev->dev is actually set after calling init_dma_pools(), which
effectively makes dma_pool_create(..NULL) and cause crash.
To fix this issue, init dma only after dev->dev is set.
[ 1.317993] RIP: 0010:dma_pool_create+0x83/0x290
[ 1.323257] Call Trace:
[ 1.323390] ? pci_write_config_word+0x27/0x30
[ 1.323626] init_dma_pools+0x41/0x1a0 [snps_udc_core]
[ 1.323899] udc_pci_probe+0x202/0x2b1 [amd5536udc_pci]
Fixes: 7c51247a1f62 (usb: gadget: udc: Provide correct arguments for 'dma_pool_create')
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Tong Zhang <ztong0001(a)gmail.com>
Link: https://lore.kernel.org/r/20210317230400.357756-1-ztong0001@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/gadget/udc/amd5536udc_pci.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/gadget/udc/amd5536udc_pci.c b/drivers/usb/gadget/udc/amd5536udc_pci.c
index 8d387e0e4d91..c80f9bd51b75 100644
--- a/drivers/usb/gadget/udc/amd5536udc_pci.c
+++ b/drivers/usb/gadget/udc/amd5536udc_pci.c
@@ -153,6 +153,11 @@ static int udc_pci_probe(
pci_set_master(pdev);
pci_try_set_mwi(pdev);
+ dev->phys_addr = resource;
+ dev->irq = pdev->irq;
+ dev->pdev = pdev;
+ dev->dev = &pdev->dev;
+
/* init dma pools */
if (use_dma) {
retval = init_dma_pools(dev);
@@ -160,11 +165,6 @@ static int udc_pci_probe(
goto err_dma;
}
- dev->phys_addr = resource;
- dev->irq = pdev->irq;
- dev->pdev = pdev;
- dev->dev = &pdev->dev;
-
/* general probing */
if (udc_probe(dev)) {
retval = -ENODEV;
--
2.31.0