HID: uhid: Over-ride the default maximum data buffer value with our own
Subsystems (9)
Sasha Levin
maintainerPATCH 1/9 HID: uhid: Over-ride the default maximum data buffer value with our own
From: Lee Jones <[email protected]>
[ Upstream commit 1c5d4221240a233df2440fe75c881465cdf8da07 ]
The default maximum data buffer size for this interface is UHID_DATA_MAX (4k). When data buffers are being processed, ensure this value is used when ensuring the sanity, rather than a value between the user provided value and HID_MAX_BUFFER_SIZE (16k).
--- drivers/hid/uhid.c | 1 + 1 file changed, 1 insertion(+)
drivers/hid/uhid.c +1 -0
@@ -399,6 +399,7 @@ struct hid_ll_driver uhid_hid_driver = { .parse = uhid_hid_parse, .raw_request = uhid_hid_raw_request, .output_report = uhid_hid_output_report, + .max_buffer_size = UHID_DATA_MAX, };EXPORT_SYMBOL_GPL (uhid_hid_driver);
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 2/9 ca8210: fix mac_len negative array access
From: Alexander Aring <[email protected]>
[ Upstream commit 6c993779ea1d0cccdb3a5d7d45446dd229e610a3 ]
This patch fixes a buffer overflow access of skb->data if ieee802154_hdr_peek_addrs() fails.
--- drivers/net/ieee802154/ca8210.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ieee802154/ca8210.c +2 -0
@@ -1955,6 +1955,8 @@ static int ca8210_skb_tx(* packet */ mac_len =ieee802154_hdr_peek_addrs (skb, &header); +if (mac_len <0 ) +return mac_len; secspec.security_level = header.sec.level; secspec.key_id_mode = header.sec.key_id_mode;
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 3/9 HID: intel-ish-hid: ipc: Fix potential use-after-free in work function
In reply to Sasha LevinFrom: Reka Norman <[email protected]>
[ Upstream commit 8ae2f2b0a28416ed2f6d8478ac8b9f7862f36785 ]
When a reset notify IPC message is received, the ISR schedules a work function and passes the ISHTP device to it via a global pointer ishtp_dev. If ish_probe() fails, the devm-managed device resources including ishtp_dev are freed, but the work is not cancelled, causing a use-after-free when the work function tries to access ishtp_dev. Use devm_work_autocancel() instead, so that the work is automatically cancelled if probe fails.
--- drivers/hid/intel-ish-hid/ipc/ipc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/hid/intel-ish-hid/ipc/ipc.c +8 -1
@@ -13,6 +13,7 @@* more details. */ +#include <linux/devm-helpers.h> #include <linux/sched.h> #include <linux/spinlock.h> #include <linux/delay.h>
@@ -618,7 +619,6 @@ static void recv_ipc(struct ishtp_device *dev, uint32_t doorbell_val)case MNG_RESET_NOTIFY :if (!ishtp_dev) { ishtp_dev = dev; -INIT_WORK (&fw_reset_work, fw_reset_work_fn); }schedule_work (&fw_reset_work);break ;
@@ -909,6 +909,7 @@ struct ishtp_device *ish_dev_init(struct pci_dev *pdev) {struct ishtp_device *dev;int i; +int ret; dev =kzalloc (sizeof (struct ishtp_device ) +sizeof (struct ish_hw ),GFP_KERNEL );
@@ -942,6 +943,12 @@ struct ishtp_device *ish_dev_init(struct pci_dev *pdev)list_add_tail (&tx_buf->link, &dev->wr_free_list_head.link); } + ret =devm_work_autocancel (&pdev->dev, &fw_reset_work, fw_reset_work_fn); +if (ret) { +dev_err (dev->devc,"Failed to initialise FW reset work\n" ); +return NULL ; + } + dev->ops = &ish_hw_ops; dev->devc = &pdev->dev; dev->mtu =IPC_PAYLOAD_SIZE -sizeof (struct ishtp_msg_hdr );
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 4/9 m68k: Only force 030 bus error if PC not in exception table
In reply to Sasha LevinFrom: Michael Schmitz <[email protected]>
[ Upstream commit e36a82bebbf7da814530d5a179bef9df5934b717 ]
__get_kernel_nofault() does copy data in supervisor mode when forcing a task backtrace log through /proc/sysrq_trigger. This is expected cause a bus error exception on e.g. NULL pointer dereferencing when logging a kernel task has no workqueue associated. This bus error ought to be ignored.
Our 030 bus error handler is ill equipped to deal with this:
Whenever ssw indicates a kernel mode access on a data fault, we don't even attempt to handle the fault and instead always send a SEGV signal (or panic). As a result, the check for exception handling at the fault PC (buried in send_sig_fault() which gets called from do_page_fault() eventually) is never used.
In contrast, both 040 and 060 access error handlers do not care whether a fault happened on supervisor mode access, and will call do_page_fault() on those, ultimately honoring the exception table.
Add a check in bus_error030 to call do_page_fault() in case we do have an entry for the fault PC in our exception table.
I had attempted a fix for this earlier in 2019 that did rely on testing pagefault_disabled() (see link below) to achieve the same thing, but this patch should be more generic.
Tested on 030 Atari Falcon.
--- arch/m68k/kernel/traps.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/m68k/kernel/traps.c +3 -1
@@ -30,6 +30,7 @@#include <linux/init.h> #include <linux/ptrace.h> #include <linux/kallsyms.h> +#include <linux/extable.h> #include <asm/setup.h> #include <asm/fpu.h>
@@ -550,7 +551,8 @@ static inline void bus_error030 (struct frame *fp) errorcode |=2 ;if (mmusr & (MMU_I |MMU_WP )) { -if (ssw &4 ) { +/* We might have an exception table for this PC */ +if (ssw &4 && !search_exception_tables (fp->ptregs.pc)) { pr_err("Data %s fault at %#010lx in %s (pc=%#lx)\n", ssw & RW ? "read" : "write", fp->un.fmtb.daddr,
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 5/9 scsi: target: iscsi: Fix an error message in iscsi_check_key()
In reply to Sasha LevinFrom: Maurizio Lombardi <[email protected]>
[ Upstream commit 6cc55c969b7ce8d85e09a636693d4126c3676c11 ]
The first half of the error message is printed by pr_err(), the second half is printed by pr_debug(). The user will therefore see only the first part of the message and will miss some useful information.
--- drivers/target/iscsi/iscsi_target_parameters.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/target/iscsi/iscsi_target_parameters.c +7 -5
@@ -1270,18 +1270,20 @@ static struct iscsi_param *iscsi_check_key(return param;if (!(param->phase & phase)) { -pr_err ("Key \"%s\" may not be negotiated during " , - param->name); +char *phase_name; +switch (phase) {case PHASE_SECURITY : -pr_debug ("Security phase.\n" ); + phase_name ="Security" ;break ;case PHASE_OPERATIONAL : -pr_debug ("Operational phase.\n" ); + phase_name ="Operational" ;break ;default : -pr_debug ("Unknown phase.\n" ); + phase_name ="Unknown" ; } +pr_err ("Key \"%s\" may not be negotiated during %s phase.\n" , + param->name, phase_name);return NULL ; }
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 6/9 scsi: ufs: core: Add soft dependency on governor_simpleondemand
In reply to Sasha LevinFrom: Adrien Thierry <[email protected]>
[ Upstream commit 2ebe16155dc8bd4e602cad5b5f65458d2eaa1a75 ]
The ufshcd driver uses simpleondemand governor for devfreq. Add it to the list of ufshcd softdeps to allow userspace initramfs tools like dracut to automatically pull the governor module into the initramfs together with UFS drivers.
--- drivers/scsi/ufs/ufshcd.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/ufs/ufshcd.c +1 -0
@@ -8087,5 +8087,6 @@ EXPORT_SYMBOL_GPL(ufshcd_init);MODULE_AUTHOR ("Santosh Yaragnavi <[email protected]>" );MODULE_AUTHOR ("Vinayak Holikatti <[email protected]>" );MODULE_DESCRIPTION ("Generic UFS host controller driver Core" ); +MODULE_SOFTDEP ("pre: governor_simpleondemand" );MODULE_LICENSE ("GPL" );MODULE_VERSION (UFSHCD_DRIVER_VERSION );
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 7/9 net: usb: cdc_mbim: avoid altsetting toggling for Telit FE990
In reply to Sasha LevinFrom: Enrico Sau <[email protected]>
[ Upstream commit 418383e6ed6b4624a54ec05c535f13d184fbf33b ]
Add quirk CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE for Telit FE990 0x1081 composition in order to avoid bind error.
--- drivers/net/usb/cdc_mbim.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/usb/cdc_mbim.c +5 -0
@@ -665,6 +665,11 @@ static const struct usb_device_id mbim_devs[] = { .driver_info = (unsigned long)&cdc_mbim_info_avoid_altsetting_toggle, }, +/* Telit FE990 */ + { USB_DEVICE_AND_INTERFACE_INFO(0x1bc7, 0x1081, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), + .driver_info = (unsigned long )&cdc_mbim_info_avoid_altsetting_toggle, + }, + /* default entry */ { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), .driver_info = (unsigned long)&cdc_mbim_info_zlp,
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 8/9 net: usb: qmi_wwan: add Telit 0x1080 composition
In reply to Sasha LevinFrom: Enrico Sau <[email protected]>
[ Upstream commit 382e363d5bed0cec5807b35761d14e55955eee63 ]
Add the following Telit FE990 composition:
0x1080: tty, adb, rmnet, tty, tty, tty, tty
--- drivers/net/usb/qmi_wwan.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/usb/qmi_wwan.c +1 -0
@@ -1311,6 +1311,7 @@ static const struct usb_device_id products[] = { {QMI_QUIRK_SET_DTR(0x1bc7, 0x1050, 2)}, /* Telit FN980 */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1060, 2)}, /* Telit LN920 */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1070, 2)}, /* Telit FN990 */ + {QMI_QUIRK_SET_DTR(0x1bc7, 0x1080, 2)}, /* Telit FE990 */ {QMI_FIXED_INTF(0x1bc7, 0x1100, 3)}, /* Telit ME910 */ {QMI_FIXED_INTF(0x1bc7, 0x1101, 3)}, /* Telit ME910 dual modem */ {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 9/9 sh: sanitize the flags on sigreturn
In reply to Sasha LevinFrom: Al Viro <[email protected]>
[ Upstream commit 573b22ccb7ce9ab7f0539a2e11a9d3609a8783f5 ]
We fetch %SR value from sigframe; it might have been modified by signal handler, so we can't trust it with any bits that are not modifiable in user mode.
--- arch/sh/include/asm/processor_32.h | 1 + arch/sh/kernel/signal_32.c | 3 +++ 2 files changed, 4 insertions(+)
arch/sh/include/asm/processor_32.h +1 -0
@@ -57,6 +57,7 @@#define SR_FD 0x00008000#define SR_MD 0x40000000 +#define SR_USER_MASK 0x00000303 // M, Q, S, T bits/* * DSP structure and data */
arch/sh/kernel/signal_32.c +3 -0
@@ -116,6 +116,7 @@ static int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *r0_p) { unsigned int err = 0; +unsigned int sr = regs->sr & ~SR_USER_MASK ;#define COPY (x) err |= __get_user(regs->x, &sc->sc_##x)COPY (regs[1 ]);
@@ -131,6 +132,8 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *r0_pCOPY (sr);COPY (pc);#undef COPY + regs->sr = (regs->sr &SR_USER_MASK ) | sr; +#ifdef CONFIG_SH_FPU if (boot_cpu_data.flags &CPU_HAS_FPU ) {int owned_fp;
Signature · 1 line
2.39.2