lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140715103230.GC28235@mikrodark.usersys.redhat.com>
Date:	Tue, 15 Jul 2014 12:32:30 +0200
From:	Veaceslav Falico <vfalico@...il.com>
To:	Eric Dumazet <edumazet@...gle.com>
Cc:	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
	Jay Vosburgh <j.vosburgh@...il.com>,
	Andy Gospodarek <andy@...yhouse.net>,
	Nikolay Aleksandrov <nikolay@...hat.com>,
	Mahesh Bandewar <maheshb@...gle.com>
Subject: Re: [PATCH net-next 2/3] bonding: use rcu_access_pointer() in
 bonding_show_mii_status()

On Tue, Jul 15, 2014 at 02:46:43AM -0700, Eric Dumazet wrote:
>curr_active_slave is rcu protected, and bonding_show_mii_status() only
>wants to check if pointer is NULL or not.
>
>Signed-off-by: Eric Dumazet <edumazet@...gle.com>

Acked-by: Veaceslav Falico <vfalico@...il.com>

>---
> drivers/net/bonding/bond_sysfs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
>index daed52f68ce1..98db8edd9c75 100644
>--- a/drivers/net/bonding/bond_sysfs.c
>+++ b/drivers/net/bonding/bond_sysfs.c
>@@ -492,8 +492,9 @@ static ssize_t bonding_show_mii_status(struct device *d,
> 				       char *buf)
> {
> 	struct bonding *bond = to_bond(d);
>+	bool active = !!rcu_access_pointer(bond->curr_active_slave);
>
>-	return sprintf(buf, "%s\n", bond->curr_active_slave ? "up" : "down");
>+	return sprintf(buf, "%s\n", active ? "up" : "down");
> }
> static DEVICE_ATTR(mii_status, S_IRUGO, bonding_show_mii_status, NULL);
>
>-- 
>2.0.0.526.g5318336
>
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ