lkml.org 
[lkml]   [2014]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sysctl: terminate strings also on \r
On Tue, 21 Oct 2014 13:21:37 -0700 Kees Cook <keescook@chromium.org> wrote:

> From: Paul Wise <pabs3@bonedaddy.net>
>
> This partially mitigates a common strategy used by attackers for hiding
> the full contents of strings in procfs from naive sysadmins who use cat,
> more or sysctl to inspect the contents of strings in procfs.
>
> ...
>
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -1739,7 +1739,7 @@ static int _proc_do_string(char *data, int maxlen, int write,
> while ((p - buffer) < *lenp && len < maxlen - 1) {
> if (get_user(c, p++))
> return -EFAULT;
> - if (c == 0 || c == '\n')
> + if (c == 0 || c == '\n' || c == '\r')
> break;
> data[len++] = c;
> }

There are no valid uses of \r in a procfs write?


\
 
 \ /
  Last update: 2014-10-23 02:01    [W:0.094 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site