Changing the port type and closing_wait parameter are privileged
operations so make sure to return -EPERM if a regular user tries to
change them.
Note that the closing_wait parameter would not actually have been
changed but the return value did not indicate that.
Cc: stable(a)vger.kernel.org
Signed-off-by: Johan Hovold <johan(a)kernel.org>
---
drivers/tty/mxser.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index 914b23071961..2d8e76263a25 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -1270,6 +1270,7 @@ static int mxser_set_serial_info(struct tty_struct *tty,
if (!capable(CAP_SYS_ADMIN)) {
if ((ss->baud_base != info->baud_base) ||
(close_delay != info->port.close_delay) ||
+ (closing_wait != info->port.closing_wait) ||
((ss->flags & ~ASYNC_USR_MASK) != (info->port.flags & ~ASYNC_USR_MASK))) {
mutex_unlock(&port->mutex);
return -EPERM;
@@ -1296,11 +1297,11 @@ static int mxser_set_serial_info(struct tty_struct *tty,
baud = ss->baud_base / ss->custom_divisor;
tty_encode_baud_rate(tty, baud, baud);
}
- }
- info->type = ss->type;
+ info->type = ss->type;
- process_txrx_fifo(info);
+ process_txrx_fifo(info);
+ }
if (tty_port_initialized(port)) {
if (flags != (port->flags & ASYNC_SPD_MASK)) {
--
2.26.3
Changing the port closing_wait parameter is a privileged operation.
Add the missing check to TIOCSSERIAL so that -EPERM is returned in case
an unprivileged user tries to change the closing-wait setting.
Cc: stable(a)vger.kernel.org
Signed-off-by: Johan Hovold <johan(a)kernel.org>
---
drivers/tty/amiserial.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
index 0c8157fab17f..ec6802ba2bf8 100644
--- a/drivers/tty/amiserial.c
+++ b/drivers/tty/amiserial.c
@@ -970,6 +970,7 @@ static int set_serial_info(struct tty_struct *tty, struct serial_struct *ss)
if (!serial_isroot()) {
if ((ss->baud_base != state->baud_base) ||
(ss->close_delay != port->close_delay) ||
+ (ss->closing_wait != port->closing_wait) ||
(ss->xmit_fifo_size != state->xmit_fifo_size) ||
((ss->flags & ~ASYNC_USR_MASK) !=
(port->flags & ~ASYNC_USR_MASK))) {
--
2.26.3
This is the start of the stable review cycle for the 4.9.265 release.
There are 35 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, 07 Apr 2021 08:50: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.265-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.265-rc1
Paul Moore <paul(a)paul-moore.com>
audit: fix a net reference leak in audit_list_rules_send()
Paul Moore <paul(a)paul-moore.com>
audit: fix a net reference leak in audit_send_reply()
Atul Gopinathan <atulgopinathan(a)gmail.com>
staging: rtl8192e: Change state information from u16 to u8
Atul Gopinathan <atulgopinathan(a)gmail.com>
staging: rtl8192e: Fix incorrect source in memcpy()
Johan Hovold <johan(a)kernel.org>
USB: cdc-acm: fix use-after-free after probe failure
Oliver Neukum <oneukum(a)suse.com>
USB: cdc-acm: downgrade message to debug
Oliver Neukum <oneukum(a)suse.com>
cdc-acm: fix BREAK rx code path adding necessary calls
Chunfeng Yun <chunfeng.yun(a)mediatek.com>
usb: xhci-mtk: fix broken streams issue on 0.96 xHCI
Vincent Palatin <vpalatin(a)chromium.org>
USB: quirks: ignore remote wake-up on Fibocom L850-GL LTE modem
Zheyu Ma <zheyuma97(a)gmail.com>
firewire: nosy: Fix a use-after-free bug in nosy_ioctl()
Dinghao Liu <dinghao.liu(a)zju.edu.cn>
extcon: Fix error handling in extcon_dev_register
Wang Panzhenzhuan <randy.wang(a)rock-chips.com>
pinctrl: rockchip: fix restore error in resume
Tetsuo Handa <penguin-kernel(a)i-love.sakura.ne.jp>
reiserfs: update reiserfs_xattrs_initialized() condition
Ilya Lipnitskiy <ilya.lipnitskiy(a)gmail.com>
mm: fix race by making init_zero_pfn() early_initcall
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing: Fix stack trace event size
Hui Wang <hui.wang(a)canonical.com>
ALSA: hda/realtek: call alc_update_headset_mode() in hp_automute_hook
Ikjoon Jang <ikjn(a)chromium.org>
ALSA: usb-audio: Apply sample rate quirk to Logitech Connect
Jesper Dangaard Brouer <brouer(a)redhat.com>
bpf: Remove MTU check in __bpf_skb_max_len
Tong Zhang <ztong0001(a)gmail.com>
net: wan/lmc: unregister device when no matching device is found
Doug Brown <doug(a)schmorgal.com>
appletalk: Fix skb allocation size in loopback case
zhangyi (F) <yi.zhang(a)huawei.com>
ext4: do not iput inode under running transaction in ext4_rename()
Sameer Pujar <spujar(a)nvidia.com>
ASoC: rt5659: Update MCLK rate in set_sysclk()
Tong Zhang <ztong0001(a)gmail.com>
staging: comedi: cb_pcidas64: fix request_irq() warn
Tong Zhang <ztong0001(a)gmail.com>
staging: comedi: cb_pcidas: fix request_irq() warn
Alexey Dobriyan <adobriyan(a)gmail.com>
scsi: qla2xxx: Fix broken #endif placement
Lv Yunlong <lyl2019(a)mail.ustc.edu.cn>
scsi: st: Fix a use after free in st_open()
Laurent Vivier <lvivier(a)redhat.com>
vhost: Fix vhost_vq_reset()
Christophe Leroy <christophe.leroy(a)csgroup.eu>
powerpc: Force inlining of cpu_has_feature() to avoid build failure
Benjamin Rood <benjaminjrood(a)gmail.com>
ASoC: sgtl5000: set DAP_AVC_CTRL register to correct default value on probe
Hans de Goede <hdegoede(a)redhat.com>
ASoC: rt5651: Fix dac- and adc- vol-tlv values being off by a factor of 10
Hans de Goede <hdegoede(a)redhat.com>
ASoC: rt5640: Fix dac- and adc- vol-tlv values being off by a factor of 10
J. Bruce Fields <bfields(a)redhat.com>
rpc: fix NULL dereference on kmalloc failure
Zhaolong Zhang <zhangzl2013(a)126.com>
ext4: fix bh ref count on error paths
Jakub Kicinski <kuba(a)kernel.org>
ipv6: weaken the v4mapped source check
David Brazdil <dbrazdil(a)google.com>
selinux: vsock: Set SID for socket returned by accept()
-------------
Diffstat:
Makefile | 4 +--
arch/powerpc/include/asm/cpu_has_feature.h | 4 +--
drivers/extcon/extcon.c | 1 +
drivers/firewire/nosy.c | 9 ++++--
drivers/net/wan/lmc/lmc_main.c | 2 ++
drivers/pinctrl/pinctrl-rockchip.c | 13 +++++---
drivers/scsi/qla2xxx/qla_target.h | 2 +-
drivers/scsi/st.c | 2 +-
drivers/staging/comedi/drivers/cb_pcidas.c | 2 +-
drivers/staging/comedi/drivers/cb_pcidas64.c | 2 +-
drivers/staging/rtl8192e/rtllib.h | 2 +-
drivers/staging/rtl8192e/rtllib_rx.c | 2 +-
drivers/usb/class/cdc-acm.c | 12 +++++--
drivers/usb/core/quirks.c | 4 +++
drivers/usb/host/xhci-mtk.c | 10 +++++-
drivers/vhost/vhost.c | 2 +-
fs/ext4/inode.c | 6 ++--
fs/ext4/namei.c | 18 +++++------
fs/reiserfs/xattr.h | 2 +-
kernel/audit.c | 48 +++++++++++++++++-----------
kernel/audit.h | 2 +-
kernel/auditfilter.c | 13 ++++----
kernel/trace/trace.c | 3 +-
mm/memory.c | 2 +-
net/appletalk/ddp.c | 33 ++++++++++++-------
net/core/filter.c | 7 ++--
net/dccp/ipv6.c | 5 +++
net/ipv6/ip6_input.c | 10 ------
net/ipv6/tcp_ipv6.c | 5 +++
net/sunrpc/auth_gss/svcauth_gss.c | 11 ++++---
net/vmw_vsock/af_vsock.c | 1 +
sound/pci/hda/patch_realtek.c | 1 +
sound/soc/codecs/rt5640.c | 4 +--
sound/soc/codecs/rt5651.c | 4 +--
sound/soc/codecs/rt5659.c | 5 +++
sound/soc/codecs/sgtl5000.c | 2 +-
sound/usb/quirks.c | 1 +
37 files changed, 157 insertions(+), 99 deletions(-)