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] [day] [month] [year] [list]
Message-Id: <20111221.180011.42058520996715557.davem@davemloft.net>
Date:	Wed, 21 Dec 2011 18:00:11 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	shemminger@...tta.com
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH 3/3] netlink: wake up netlink listeners sooner

From: Stephen Hemminger <shemminger@...tta.com>
Date: Wed, 21 Dec 2011 13:49:44 -0800

> @@ -960,7 +960,7 @@ static int netlink_broadcast_deliver(str
>  		skb_set_owner_r(skb, sk);
>  		skb_queue_tail(&sk->sk_receive_queue, skb);
>  		sk->sk_data_ready(sk, skb->len);
> -		return atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf;
> +		return atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf / 2;
>  	}

Please mirror the logic we use in the generic socket code to do this
on the send side, namely use something like:

		return (atomic_read(&sk->sk_rmem_alloc) << 1) > sk->sk_rcvbuf;

because sk_rcvbuf is an int and this "/ 2" expression will generate a
really silly sequence of multiple shifts, adds, and comparisons in
order to handle negative values correctly.

--
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