Subject: Re: [PATCH net] bonding: fix two race conditions in bond_store_updelay/downdelay

From: Nikolay Aleksandrov <[email-masked]>
Date: Wed, 13 Nov 2013 17:34:16 +0100

On 11/13/2013 05:07 PM, 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.
> 
> CC: Jay Vosburgh <[email-masked]>
> CC: Andy Gospodarek <[email-masked]>
> CC: Veaceslav Falico <[email-masked]>
> Signed-off-by: Nikolay Aleksandrov <[email-masked]>
> ---

A little addition: these can also race with anything that sets miimon to 0,
currently beside store_miimon only store_arp_interval does that. But that is
also fixed because store_arp_interval uses rtnl.

Cheers,
 Nik