lkml.org 
[lkml]   [2009]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] Use kzfree in tty buffer management to enforce data sanitization
From
Hi Linus,

On Sat, 30 May 2009, Larry H. wrote:
>>
>> This patch doesn't affect fastpaths.

On Sun, May 31, 2009 at 5:04 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> This patch is ugly as hell.
>
> You already know the size of the data to clear.
>
> If we actually wanted this (and I am in _no_way_ saying we do), the only
> sane thing to do is to just do
>
>        memset(buf->data, 0, N_TTY_BUF_SIZE);
>        if (PAGE_SIZE != N_TTY_BUF_SIZE)
>                kfree(...)
>        else
>                free_page(...)
>
>
> but quite frankly, I'm not convinced about these patches at all.

I wonder why the tty code has that N_TTY_BUF_SIZE special casing in
the first place? I think we can probably just get rid of it and thus
we can use kzfree() here if we want to.

Pekka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-05-31 08:27    [W:0.091 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site