linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@cs.helsinki.fi>
To: "Larry H." <research@subreption.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Rik van Riel <riel@redhat.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH] Use kzfree in tty buffer management to enforce data sanitization
Date: Sun, 31 May 2009 09:27:09 +0300	[thread overview]
Message-ID: <84144f020905302327t36966003ufce87cf646d649a6@mail.gmail.com> (raw)
In-Reply-To: <20090531023556.GB9033@oblivion.subreption.com>

Hi Larry,

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

On 19:04 Sat 30 May, Linus Torvalds 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(...)
>>

On Sun, May 31, 2009 at 5:35 AM, Larry H. <research@subreption.com> wrote:
> It wasn't me who proposed using kzfree in these places. Ask Ingo and
> Peter or refer to the entire thread about my previous patches.

Nobody suggested using kzfree() in this _specific_place_. It's obvious
that memset() is a better solution here given the current constraints
of the code as demonstrated by Linus' patch.

                                       Pekka

--
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>

  reply	other threads:[~2009-05-31  6:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-31  1:55 Larry H.
2009-05-31  2:04 ` Linus Torvalds
2009-05-31  2:35   ` Larry H.
2009-05-31  6:27     ` Pekka Enberg [this message]
2009-05-31  6:24   ` Pekka Enberg
2009-05-31 10:26     ` Alan Cox
2009-05-31 17:05       ` Linus Torvalds
2009-05-31 17:10         ` Alan Cox
2009-05-31 17:17         ` Pekka Enberg
2009-06-02 15:05         ` Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84144f020905302327t36966003ufce87cf646d649a6@mail.gmail.com \
    --to=penberg@cs.helsinki.fi \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=research@subreption.com \
    --cc=riel@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox