Skip to content

Commit

Permalink
mkiss: fix scribble on freed memory
Browse files Browse the repository at this point in the history
commit d79f16c 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.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alan authored and David S. Miller committed Jan 6, 2016
1 parent 07a5d38 commit fde55c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/hamradio/mkiss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fde55c4

Please sign in to comment.