[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20131118.130310.1183708218770881544.davem@davemloft.net>
Date: Mon, 18 Nov 2013 13:03:10 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: dborkman@...hat.com
Cc: noureddine@...stanetworks.com, willemb@...gle.com, phil@....cc,
edumazet@...gle.com, netdev@...r.kernel.org,
greearb@...delatech.com
Subject: Re: [PATCH 1/1] Revert "af-packet: Use existing netdev reference
for bound sockets"
From: Daniel Borkmann <dborkman@...hat.com>
Date: Mon, 18 Nov 2013 10:00:53 +0100
> On 11/18/2013 08:40 AM, Salam Noureddine wrote:
>> This reverts commit 827d978037d7d0bf0860481948c6d26ead10042f
>> ("af-packet: Use existing netdev reference for bound sockets")
>>
>> The patch introduced a race condition between packet_snd and
>> packet_notifier when a net_device is being unregistered. In the case
>> of
>> a bound socket, packet_notifier can drop the last reference to the
>> net_device and packet_snd might end up sending a packet over a freed
>> net_device.
>
> So there's no other workaround possible like e.g. setting a flag in
> struct packet_sock so that in case our netdevice goes down, we just
> set the flag and if set, we return with -ENXIO in send path?
> Reverting this would decrease performance for everyone as we would
> then do the lookup every time we send a packet again.
Agreed, we should try first to find a reasonable fix instead of just
doing a knee-jerk revert of this change.
Thanks.
--
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