patch "USB: cdc-acm: restore capability check order" added to usb-next
Subsystems (3)
This is a note to let you know that I've just added the patch titled
USB: cdc-acm: restore capability check order
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-next 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 also be merged in the next major kernel release during the merge window.
If you have any questions about this process, please let me know.
From 62d65bdd9d05158aa2547f8ef72375535f3bc6e3 Mon Sep 17 00:00:00 2001
From: Matthias Reichl <[email protected]>
Date: Fri, 27 Mar 2020 16:03:50 +0100
Subject: USB: cdc-acm: restore capability check order
commit b401f8c4f492c ("USB: cdc-acm: fix rounding error in TIOCSSERIAL") introduced a regression by changing the order of capability and close settings change checks. When running with CAP_SYS_ADMIN setting the close settings to the values already set resulted in -EOPNOTSUPP.
Fix this by changing the check order back to how it was before.
--- drivers/usb/class/cdc-acm.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/usb/class/cdc-acm.c +9 -9
@@ -923,16 +923,16 @@ static int set_serial_info(struct tty_struct *tty, struct serial_struct *ss)mutex_lock (&acm->port.mutex); -if ((ss->close_delay != old_close_delay) || - (ss->closing_wait != old_closing_wait)) { -if (!capable (CAP_SYS_ADMIN )) +if (!capable (CAP_SYS_ADMIN )) { +if ((ss->close_delay != old_close_delay) || + (ss->closing_wait != old_closing_wait)) retval = -EPERM ; -else { - acm->port.close_delay = close_delay; - acm->port.closing_wait = closing_wait; - } - }else - retval = -EOPNOTSUPP ; +else + retval = -EOPNOTSUPP ; + }else { + acm->port.close_delay = close_delay; + acm->port.closing_wait = closing_wait; + }mutex_unlock (&acm->port.mutex);return retval;
Signature · 1 line
2.26.0