LWN.net Logo

Re: [PATCH] Use kzfree in tty buffer management to enforce data sanitization

From:  Linus Torvalds <torvalds-AT-linux-foundation.org>
To:  "Larry H." <research-AT-subreption.com>
Subject:  Re: [PATCH] Use kzfree in tty buffer management to enforce data sanitization
Date:  Sat, 30 May 2009 19:04:43 -0700 (PDT)
Message-ID:  <alpine.LFD.2.01.0905301902530.3435@localhost.localdomain>
Cc:  linux-kernel-AT-vger.kernel.org, linux-mm-AT-kvack.org, Rik van Riel <riel-AT-redhat.com>, Alan Cox <alan-AT-lxorguk.ukuu.org.uk>
Archive-link:  Article, Thread



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

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'm also not in the least convinced about how you just dismiss everybodys 
concerns.

		Linus

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>



(Log in to post comments)

Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds