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: <1321517934.3274.44.camel@edumazet-laptop>
Date:	Thu, 17 Nov 2011 09:18:54 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Robin Dong <hao.bigrat@...il.com>
Cc:	linux-api@...r.kernel.org, linux-netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org, davidel@...ilserver.org
Subject: Re: [Bug] epoll_wait return EPOLLOUT even with EPOLLET flag

Le jeudi 17 novembre 2011 à 16:07 +0800, Robin Dong a écrit :
> Hi,
> 
> I am a linux user and I found some question when using epoll with EPOLLET.
> 
> My program's step:
> 
> 1. create a socket (sfd) and connect to server
> 2. create epoll (efd)
> 3. add socket descriptor (sfd) to epoll (efd) with flag EPOLLET
> 4. get a EPOLLOUT event through epoll_wait
> 
> After that, the program will nerver get a EPOLLOUT event because ituse
> EPOLLET mode (the same event will not be got twice)
> 

Its not true. Same "status" can be delivered several time.

Think about Edge and Level trigger. An event (change of status) is the
trigger.

As soon as on trigger is done, epoll delivers a status.

And your file status is indeed EPOLLOUT | EPOLLIN, since you can read or
write on it.


> BUT,when a message comes from server,the client socket will get aevent
> and this event contains EPOLLOUT and EPOLLIN, looks epoll_waitreturn
> too much events than it should
> 
> My question is: Is this a bug for epoll ?

Not a bug, but a misinterpretation of what is an event and what is a
status.



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