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: <alpine.DEB.2.00.1101150938090.6884@davide-lnx1>
Date:	Sat, 15 Jan 2011 11:03:59 -0800 (PST)
From:	Davide Libenzi <davidel@...ilserver.org>
To:	Shawn Bohrer <shawn.bohrer@...il.com>
cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Jack Stone <jwjstone@...tmail.fm>,
	Viresh Kumar <viresh.kumar@...com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-fsdevel@...r.kernel.org, viro@...iv.linux.org.uk
Subject: Re: [PATCH 3/3] epoll: remove unnecessary test of ep->ovflist for
 available events

On Sat, 15 Jan 2011, Shawn Bohrer wrote:

> The additional test for ep->ovflist != EP_UNACTIVE_PTR to signify
> available events was added in 5071f97ec6d74f006072de0ce89b67c8792fe5a1
> but doesn't appear to do anything.  Either this is a bug or the check
> isn't needed.
> 
> If the ep->ovflist is not EP_UNACTIVE_PTR then ep_send_events() calls
> ep_scan_ready_list() which sets ep->ovflist = NULL thus loosing any
> events which may have been stored there.
> 
> Signed-off-by: Shawn Bohrer <shawn.bohrer@...il.com>

NACK. Not only NACK, but hell NACK.
The epoll_wait() might hit right after the delivery of the current events 
ended in/right-after:

	error = (*sproc)(ep, &txlist, priv);

So, if there are overflowed events, a following ep_send_events() can go 
fetch them, because ep_scan_ready_list() will go drop them back in the 
ready list (right after the line above).
Events in the overflow list are no different from the ones in the ready 
list, and removing such test will make you, either return with no events 
when they are really there, or take another unnecessary spin lock/unlock 
trip.
On the contrary, a missed optimization is applying the same rule even 
above, instead of the bare list_empty(). Will send a patch to Andrew.
And no, it is not a bug, because ep_scan_ready_list() is protected by a 
mutex.
	


- Davide


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ