Skip to content

Commit e6d34ce

Browse files
committed
Merge tag 'tty-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial fixes from Greg KH: "Here are some small TTY and serial driver fixes for 6.5-rc4 for some reported problems. Included in here is: - TIOCSTI fix for braille readers - documentation fix for minor numbers - MAINTAINERS update for new serial files in -rc1 - minor serial driver fixes for reported problems All of these have been in linux-next with no reported problems" * tag 'tty-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: 8250_dw: Preserve original value of DLF register tty: serial: sh-sci: Fix sleeping in atomic context serial: sifive: Fix sifive_serial_console_setup() section Documentation: devices.txt: reconcile serial/ucc_uart minor numers MAINTAINERS: Update TTY layer for lists and recently added files tty: n_gsm: fix UAF in gsm_cleanup_mux TIOCSTI: always enable for CAP_SYS_ADMIN
2 parents 3d6b77a + 748c5ea commit e6d34ce

File tree

8 files changed

+18
-8
lines changed

8 files changed

+18
-8
lines changed

Documentation/admin-guide/devices.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2691,7 +2691,7 @@
26912691
45 = /dev/ttyMM1 Marvell MPSC - port 1 (obsolete unused)
26922692
46 = /dev/ttyCPM0 PPC CPM (SCC or SMC) - port 0
26932693
...
2694-
47 = /dev/ttyCPM5 PPC CPM (SCC or SMC) - port 5
2694+
49 = /dev/ttyCPM5 PPC CPM (SCC or SMC) - port 3
26952695
50 = /dev/ttyIOC0 Altix serial card
26962696
...
26972697
81 = /dev/ttyIOC31 Altix serial card

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21643,11 +21643,17 @@ F: Documentation/translations/zh_TW/
2164321643
TTY LAYER
2164421644
M: Greg Kroah-Hartman <[email protected]>
2164521645
M: Jiri Slaby <[email protected]>
21646+
21647+
2164621648
S: Supported
2164721649
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
2164821650
F: Documentation/driver-api/serial/
2164921651
F: drivers/tty/
21652+
F: drivers/tty/serial/serial_base.h
21653+
F: drivers/tty/serial/serial_base_bus.c
2165021654
F: drivers/tty/serial/serial_core.c
21655+
F: drivers/tty/serial/serial_ctrl.c
21656+
F: drivers/tty/serial/serial_port.c
2165121657
F: include/linux/selection.h
2165221658
F: include/linux/serial.h
2165321659
F: include/linux/serial_core.h

drivers/tty/n_gsm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3070,8 +3070,10 @@ static void gsm_cleanup_mux(struct gsm_mux *gsm, bool disc)
30703070
gsm->has_devices = false;
30713071
}
30723072
for (i = NUM_DLCI - 1; i >= 0; i--)
3073-
if (gsm->dlci[i])
3073+
if (gsm->dlci[i]) {
30743074
gsm_dlci_release(gsm->dlci[i]);
3075+
gsm->dlci[i] = NULL;
3076+
}
30753077
mutex_unlock(&gsm->mutex);
30763078
/* Now wipe the queues */
30773079
tty_ldisc_flush(gsm->tty);

drivers/tty/serial/8250/8250_dwlib.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ void dw8250_setup_port(struct uart_port *p)
244244
struct dw8250_port_data *pd = p->private_data;
245245
struct dw8250_data *data = to_dw8250_data(pd);
246246
struct uart_8250_port *up = up_to_u8250p(p);
247-
u32 reg;
247+
u32 reg, old_dlf;
248248

249249
pd->hw_rs485_support = dw8250_detect_rs485_hw(p);
250250
if (pd->hw_rs485_support) {
@@ -270,9 +270,11 @@ void dw8250_setup_port(struct uart_port *p)
270270
dev_dbg(p->dev, "Designware UART version %c.%c%c\n",
271271
(reg >> 24) & 0xff, (reg >> 16) & 0xff, (reg >> 8) & 0xff);
272272

273+
/* Preserve value written by firmware or bootloader */
274+
old_dlf = dw8250_readl_ext(p, DW_UART_DLF);
273275
dw8250_writel_ext(p, DW_UART_DLF, ~0U);
274276
reg = dw8250_readl_ext(p, DW_UART_DLF);
275-
dw8250_writel_ext(p, DW_UART_DLF, 0);
277+
dw8250_writel_ext(p, DW_UART_DLF, old_dlf);
276278

277279
if (reg) {
278280
pd->dlf_size = fls(reg);

drivers/tty/serial/sh-sci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ static void sci_start_tx(struct uart_port *port)
590590
dma_submit_error(s->cookie_tx)) {
591591
if (s->cfg->regtype == SCIx_RZ_SCIFA_REGTYPE)
592592
/* Switch irq from SCIF to DMA */
593-
disable_irq(s->irqs[SCIx_TXI_IRQ]);
593+
disable_irq_nosync(s->irqs[SCIx_TXI_IRQ]);
594594

595595
s->cookie_tx = 0;
596596
schedule_work(&s->work_tx);

drivers/tty/serial/sifive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ static void sifive_serial_console_write(struct console *co, const char *s,
811811
local_irq_restore(flags);
812812
}
813813

814-
static int __init sifive_serial_console_setup(struct console *co, char *options)
814+
static int sifive_serial_console_setup(struct console *co, char *options)
815815
{
816816
struct sifive_serial_port *ssp;
817817
int baud = SIFIVE_DEFAULT_BAUD_RATE;

drivers/tty/serial/ucc_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static int firmware_loaded;
5959
/* #define LOOPBACK */
6060

6161
/* The major and minor device numbers are defined in
62-
* http://www.lanana.org/docs/device-list/devices-2.6+.txt. For the QE
62+
* Documentation/admin-guide/devices.txt. For the QE
6363
* UART, we have major number 204 and minor numbers 46 - 49, which are the
6464
* same as for the CPM2. This decision was made because no Freescale part
6565
* has both a CPM and a QE.

drivers/tty/tty_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,7 @@ static int tiocsti(struct tty_struct *tty, char __user *p)
22852285
char ch, mbz = 0;
22862286
struct tty_ldisc *ld;
22872287

2288-
if (!tty_legacy_tiocsti)
2288+
if (!tty_legacy_tiocsti && !capable(CAP_SYS_ADMIN))
22892289
return -EIO;
22902290

22912291
if ((current->signal->tty != tty) && !capable(CAP_SYS_ADMIN))

0 commit comments

Comments
 (0)