From: David Miller <davem@davemloft.net>
To: mst@redhat.com
Cc: herbert@gondor.hengli.com.au, eric.dumazet@gmail.com,
joe@perches.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] tun: remove of user-controlled memory allocation
Date: Mon, 01 Nov 2010 07:16:48 -0700 (PDT) [thread overview]
Message-ID: <20101101.071648.112608839.davem@davemloft.net> (raw)
In-Reply-To: <20101101082749.GA25860@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Mon, 1 Nov 2010 10:27:49 +0200
> Untested, this is just an RFC.
>
> tun does a kmalloc where userspace controls the length. This will
> produce warnings in kernel log when the length is too large, or might
> block for a long while. A simple fix is to avoid the allocatiuon
> altogether, and copy from user in a loop.
>
> However, with this patch an illegal address passed to the ioctl might
> leave the filter disabled. Is this something we care about? If
> yes we could recover by creating a copy of the filter. Thoughts?
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
I think the key issue in situations like this is simply to make
sure that reasonable things that worked before, still do afterwards.
And I think your patch does that, so it's fine as far as I can tell.
prev parent reply other threads:[~2010-11-01 14:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-01 8:27 [PATCH RFC] tun: remove of user-controlled memory allocation Michael S. Tsirkin
2010-11-01 14:16 ` David Miller [this message]
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=20101101.071648.112608839.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=herbert@gondor.hengli.com.au \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).