[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20101101.071648.112608839.davem@davemloft.net>
Date: Mon, 01 Nov 2010 07:16:48 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: mst@...hat.com
Cc: herbert@...dor.hengli.com.au, eric.dumazet@...il.com,
joe@...ches.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC] tun: remove of user-controlled memory allocation
From: "Michael S. Tsirkin" <mst@...hat.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@...hat.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists