[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1333417997.18626.1.camel@edumazet-glaptop>
Date: Tue, 03 Apr 2012 03:53:17 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: remi@...lab.net, levinsasha928@...il.com,
remi.denis-courmont@...ia.com, davej@...hat.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] phonet: Check input from user before allocating
On Mon, 2012-04-02 at 17:40 -0400, David Miller wrote:
> From: "Rémi Denis-Courmont" <remi@...lab.net>
> Date: Mon, 2 Apr 2012 22:01:40 +0300
>
> > Le lundi 2 avril 2012 23:31:00 Sasha Levin, vous avez écrit :
> >> A phonet packet is limited to USHRT_MAX bytes, this is never checked during
> >> tx which means that the user can specify any size he wishes, and the kernel
> >> will attempt to allocate that size.
> >
> > Does this really solve the problem? I guess 128kb is still possible with
> > USHRT_MAX plus skbuff overhead, which might still trigger OOM relatively
> > easily once the memory gets sufficiently fragmented.
> >
> > How does UDP deal with this?
>
> UDP generates a fragment list of MTU sized SKBs.
>
> Phonet could avoid the large allocations by building page based
> SKBs.
Not that AF_UNIX does nothing in this respect, it can use order-XX pages
for large datagrams.
(I beleve I sent a patch some time ago to address this point)
--
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