* [PATCH] n_tty: Fix auditing support for cannonical mode
@ 2015-05-14 18:42 Laura Abbott
2015-05-26 18:11 ` Peter Hurley
0 siblings, 1 reply; 2+ messages in thread
From: Laura Abbott @ 2015-05-14 18:42 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Peter Hurley, Andy Lutomirski
Cc: Laura Abbott, linux-kernel
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>
---
drivers/tty/n_tty.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index cf6e0f2..1a3d39b 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -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
@@ -2072,12 +2083,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;
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] n_tty: Fix auditing support for cannonical mode
2015-05-14 18:42 [PATCH] n_tty: Fix auditing support for cannonical mode Laura Abbott
@ 2015-05-26 18:11 ` Peter Hurley
0 siblings, 0 replies; 2+ messages in thread
From: Peter Hurley @ 2015-05-26 18:11 UTC (permalink / raw)
To: Laura Abbott, Greg Kroah-Hartman
Cc: Jiri Slaby, Andy Lutomirski, linux-kernel
Hi Laura,
On 05/14/2015 02:42 PM, Laura Abbott wrote:
> 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.
Right, thanks. Not sure how I missed that.
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-26 18:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-14 18:42 [PATCH] n_tty: Fix auditing support for cannonical mode Laura Abbott
2015-05-26 18:11 ` Peter Hurley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox