patch "n_tty: Fix auditing support for cannonical mode" added to tty-linus
Subsystems (2)
This is a note to let you know that I've just added the patch titled
n_tty: Fix auditing support for cannonical mode
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.
Quoted 1 line
From
72586c6061ab8c23ffd9f301ed19782a44ff5f04Mon Sep 17 00:00:00 2001
From: Laura Abbott <[email protected]>
Date: Thu, 14 May 2015 11:42:17 -0700
Subject: n_tty: Fix auditing support for cannonical mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Commit 32f13521ca68bc624ff6effc77f308a52b038bf0 ("n_tty: Line copy to user buffer in canonical mode") changed cannonical mode copying to use copy_to_user but missed adding the call to the audit framework. Add in the appropriate functions to get audit support.
--- drivers/tty/n_tty.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/tty/n_tty.c +14 -3
@@ -162,6 +162,17 @@ static inline int tty_put_user(struct tty_struct *tty, unsigned char x,return put_user (x, ptr); } +static inline int tty_copy_to_user (struct tty_struct *tty, +void __user *to, +const void *from, +unsigned long n) +{ +struct n_tty_data *ldata = tty->disc_data; + +tty_audit_add_data (tty, to, n, ldata->icanon); +return copy_to_user (to, from, n); +} +/** * n_tty_kick_worker - start input worker (if required) * @tty: terminal
@@ -2084,12 +2095,12 @@ static int canon_copy_from_read_buf(struct tty_struct *tty, __func__, eol, found, n, c, size, more);if (n > size) { - ret =copy_to_user (*b,read_buf_addr (ldata, tail), size); + ret =tty_copy_to_user (tty, *b,read_buf_addr (ldata, tail), size);if (ret)return -EFAULT ; - ret =copy_to_user (*b + size, ldata->read_buf, n - size); + ret =tty_copy_to_user (tty, *b + size, ldata->read_buf, n - size); }else - ret =copy_to_user (*b,read_buf_addr (ldata, tail), n); + ret =tty_copy_to_user (tty, *b,read_buf_addr (ldata, tail), n);if (ret)return -EFAULT ;
Signature · 1 line
2.4.2