Skip to contentSkip to conversation

mkiss: fix scribble on freed memory

PATCH In review Alan 3 participants 3 messages Jan 6, 2016

Subsystems (2)
lore
Share & tools
lore

Alan

author
#0 lore raw

PATCH 1/1 mkiss: fix scribble on freed memory

commit d79f16c046086f4fe0d42184a458e187464eb83e fixed a user triggerable scribble on free memory but added a new one which allows the user to scribble even more and user controlled data into freed space.

As with 6pack we need to halt the queue before we free the buffers, because the transmit logic is not protected by the semaphore.

---
 drivers/net/hamradio/mkiss.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/net/hamradio/mkiss.c +5 -0
index 0b72b9d..85828f1 100644
@@ -797,6 +797,11 @@ static void mkiss_close(struct tty_struct *tty)
 	 */
 	if (!atomic_dec_and_test(&ax->refcnt))
 		down(&ax->dead_sem);
+	/*
+	 * Halt the transmit queue so that a new transmit cannot scribble
+	 * on our buffers
+	 */
+	netif_stop_queue(ax->dev);
 
 	/* Free all AX25 frame buffers. */
 	kfree(ax->rbuff);
maintainer
#1 lore raw

From: Alan <[email protected]>
Date: Wed, 06 Jan 2016 14:55:02 +0000

Quoted 8 lines

commit d79f16c046086f4fe0d42184a458e187464eb83e fixed a user triggerable scribble on free memory but added a new one which allows the user to scribble even more and user controlled data into freed space.

As with 6pack we need to halt the queue before we free the buffers, because the transmit logic is not protected by the semaphore.

Applied and queued up for -stable, thanks Alan.

#2 lore raw
In reply to Alan

Hello.

Quoted 1 line · Alan

commit d79f16c046086f4fe0d42184a458e187464eb83e fixed a user triggerable

scripts/checkpatch.pl now enforces certain format of the commit citing.

Quoted 7 lines

scribble on free memory but added a new one which allows the user to scribble even more and user controlled data into freed space.

As with 6pack we need to halt the queue before we free the buffers, because the transmit logic is not protected by the semaphore.

[...]

MBR, Sergei