[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1384362214.28458.117.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Wed, 13 Nov 2013 09:03:34 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Nikolay Aleksandrov <nikolay@...hat.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net,
Jay Vosburgh <fubar@...ibm.com>,
Andy Gospodarek <andy@...yhouse.net>,
Veaceslav Falico <vfalico@...hat.com>
Subject: Re: [PATCH net] bonding: fix two race conditions in
bond_store_updelay/downdelay
On Wed, 2013-11-13 at 17:07 +0100, Nikolay Aleksandrov wrote:
> This patch fixes two race conditions between bond_store_updelay/downdelay
> and bond_store_miimon which could lead to division by zero as miimon can
> be set to 0 while either updelay/downdelay are being set and thus miss the
> zero check in the beginning, the zero div happens because updelay/downdelay
> are stored as new_value / bond->params.miimon. Use rtnl to synchronize with
> miimon setting.
It seems a bit heavy duty to take rtnl for this.
Using ACCESS_ONCE() in bonding_store_updelay()/bonding_store_downdelay()
should be enough ?
int miimon = ACCESS_ONCE(bond->params.miimon);
--
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