[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <510BFA79.90705@redhat.com>
Date: Fri, 01 Feb 2013 18:25:13 +0100
From: Daniel Borkmann <dborkman@...hat.com>
To: Phil Sutter <phil.sutter@...rinet.com>
CC: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Johann Baudy <johann.baudy@...-log.net>
Subject: Re: [PATCH v2] packet: fix leakage of tx_ring memory
On 02/01/2013 06:21 PM, Phil Sutter wrote:
> When releasing a packet socket, the routine packet_set_ring() is reused
> to free rings instead of allocating them. But when calling it for the
> first time, it fills req->tp_block_nr with the value of rb->pg_vec_len
> which in the second invocation makes it bail out since req->tp_block_nr
> is greater zero but req->tp_block_size is zero.
>
> This patch solves the problem by passing a zeroed auto-variable to
> packet_set_ring() upon each invocation from packet_release().
>
> As far as I can tell, this issue exists even since 69e3c75 (net: TX_RING
> and packet mmap), i.e. the original inclusion of TX ring support into
> af_packet, but applies only to sockets with both RX and TX ring
> allocated, which is probably why this was unnoticed all the time.
>
> Signed-off-by: Phil Sutter <phil.sutter@...rinet.com>
> Cc: Johann Baudy <johann.baudy@...-log.net>
> Cc: Daniel Borkmann <dborkman@...hat.com>
Acked-by: Daniel Borkmann <dborkman@...hat.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists