summaryrefslogtreecommitdiffstats
path: root/drivers/tty/vt/selection.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-10-03 08:59:37 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-10-03 08:59:37 -0700
commit9a32e0754d637c1d386a533ae36e41c8f4be8b10 (patch)
tree4a60136eb86c3b4f27344c276159b148fa4ac7c0 /drivers/tty/vt/selection.c
parent903e23eda5af2a5491e698838645f84a8f90379b (diff)
parent6c95ca52f27855dd2fb74131c8d4e8325d2af7de (diff)
downloadlinux-stable-9a32e0754d637c1d386a533ae36e41c8f4be8b10.tar.gz
linux-stable-9a32e0754d637c1d386a533ae36e41c8f4be8b10.zip
Merge tag 'tty-7.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial fixes from Greg KH: "Here are some small tty/serial driver fixes for 7.3-rc6. Nothing major here, just lots of small fixes for reported issues, some of them very long-standing: - tty hangup fixes that have been there since the BKL days and kept tripping people up over time. - vt selection bugfix - other vt bugfixes (memory leaks and screen update fixes) - n_gsm bugfix - qcom-geni serial driver bugfix - 8250 serial driver bugfixes - other tiny serial driver fixes All of these have been in linux-next, the last few only a few days but testing here seems solid (this pull request was generated on that tree)" * tag 'tty-7.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (37 commits) tty: add missing driver flag kernel-doc colon vt: selection: Fix unsigned underflow and slab-out-of-bounds read in paste_selection() vt: skip screen update for DEC alignment test on backgroup consoles vc_screen: reload vc pointer before if (ret) in vcs_write() to avoid UAF serial: sc16is7xx: reduce TX refill rate with half-FIFO trigger serial: sc16is7xx: refill TX FIFO below trigger using fresh TXLVL serial: tegra: don't clear the Tx FIFO on an Rx-only reset serial: sc16is7xx: fix TX gap caused by kfifo circular buffer wrap-around tty: fix saved termios reset race tty: serial: mpc52xx_uart: move static declarations up. tty: serial: max3100: shut down timer before freeing port tty: add break_wait kernel-doc serial: qcom-geni: keep registered console runtime active serial: qcom-geni: Fix unbalanced runtime PM resume for no_console_suspend serial: qcom-geni: avoid unused-function warning tty: serial: qcom_geni_serial: Keep console RX functional after deep idle soc: qcom: geni-se: Correct QUP Core ICC vote constants serial: 8250_bcm7271: fix use-after-free in brcmuart_remove() serial: vt8500: Fix clock reference leak in vt8500_serial_probe() kgdboc: Fix tty driver reference leak in configure_kgdboc() ...
Diffstat (limited to 'drivers/tty/vt/selection.c')
-rw-r--r--drivers/tty/vt/selection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/vt/selection.c b/drivers/tty/vt/selection.c
index 13f4e48b4..f1a3bc5b5 100644
--- a/drivers/tty/vt/selection.c
+++ b/drivers/tty/vt/selection.c
@@ -434,8 +434,8 @@ int paste_selection(struct tty_struct *tty)
bps = NULL;
}
- count = vc_sel.buf_len - pasted;
- if (count) {
+ if (vc_sel.buf_len > pasted) {
+ count = vc_sel.buf_len - pasted;
pasted += tty_ldisc_receive_buf(ld, vc_sel.buffer + pasted,
NULL, count);
if (vc_sel.buf_len > pasted)