Skip to contentSkip to conversation

patch "staging: speakup: fix tty-operation NULL derefs" added to tty-linus

PATCH [email protected] 1 participant 1 message Jan 30, 2019

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

staging: speakup: fix tty-operation NULL derefs

to my tty git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
in the tty-linus 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 hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From a1960e0f1639cb1f7a3d94521760fc73091f6640 Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Wed, 30 Jan 2019 10:49:34 +0100
Subject: staging: speakup: fix tty-operation NULL derefs

The send_xchar() and tiocmset() tty operations are optional. Add the missing sanity checks to prevent user-space triggerable NULL-pointer dereferences.

Fixes 6b9ad1c742bf ("staging: speakup: add send_xchar, tiocmset and input functionality for tty")
Cc stable <[email protected]> # 4.13
Cc Okash Khawaja <[email protected]>
Cc Samuel Thibault <[email protected]>
---
 drivers/staging/speakup/spk_ttyio.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/speakup/spk_ttyio.c +4 -2
index c92bbd05516e..005de0024dd4 100644
@@ -265,7 +265,8 @@ static void spk_ttyio_send_xchar(char ch)
 		return;
 	}
 
-	speakup_tty->ops->send_xchar(speakup_tty, ch);
+	if (speakup_tty->ops->send_xchar)
+		speakup_tty->ops->send_xchar(speakup_tty, ch);
 	mutex_unlock(&speakup_tty_mutex);
 }
 
@@ -277,7 +278,8 @@ static void spk_ttyio_tiocmset(unsigned int set, unsigned int clear)
 		return;
 	}
 
-	speakup_tty->ops->tiocmset(speakup_tty, set, clear);
+	if (speakup_tty->ops->tiocmset)
+		speakup_tty->ops->tiocmset(speakup_tty, set, clear);
 	mutex_unlock(&speakup_tty_mutex);
 }
 
Signature · 1 line
2.20.1