diff options
author | Laura Abbott <labbott@fedoraproject.org> | 2015-05-14 11:42:17 -0700 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-07-03 12:34:34 -0400 |
commit | a8492bea3106aebffe1ecf85d2582bfd6649d87e (patch) | |
tree | 8b2db554dde9b5f81533cd019100cae2bc3b50c0 /drivers/tty | |
parent | cea5254f9ea577360765b808f23703a865154243 (diff) | |
download | linux-stable-a8492bea3106aebffe1ecf85d2582bfd6649d87e.tar.gz linux-stable-a8492bea3106aebffe1ecf85d2582bfd6649d87e.tar.bz2 linux-stable-a8492bea3106aebffe1ecf85d2582bfd6649d87e.zip |
n_tty: Fix auditing support for cannonical mode
[ Upstream commit 72586c6061ab8c23ffd9f301ed19782a44ff5f04 ]
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.
Fixes: 32f13521ca68 ("n_tty: Line copy to user buffer in canonical mode")
Reported-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Laura Abbott <labbott@fedoraproject.org>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/n_tty.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 72824659f628..e3ebb674a693 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -186,6 +186,17 @@ static int receive_room(struct tty_struct *tty) return left; } +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_set_room - receive space * @tty: terminal @@ -2081,12 +2092,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; |