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]
Date:	Fri, 1 Jun 2007 09:43:04 -0700
From:	"David Schwartz" <davids@...master.com>
To:	<netbeans@...works.com>
Cc:	<linux-kernel@...r.kernel.org>
Subject: RE: SELECT() returns 1 But FIONREAD says (Input/output error)


> David Schwartz wrote:

> > Nope. An errored connection is always ready for read/write -- there is
> > nothing to wait for as far as the kernel is concerned. Your code keeps
> > asking the kernel if something interesting has happened, the
> > kernel keeps
> > telling it yes, and it refuses to do anything about it.

> The select() returns because i pulled the USB cable from hub. Seems
> reasonable.

Good. Then there is nothing further to discuss.

> The next select() found what? to be interesting in order to prematurely
> terminate the select-wait? As far as I can tell, nothing interesting has
> happened since the previous select(). In this case the select() is only
> looking at read()'s.

You have a very serious misunderstanding of what 'select' does. The 'select'
function is level triggered and state based, not edge triggered or event
based. The situation was the same as before, and so the same result is
required.

The kernel assumes that either you handled the error condition or you aren't
going to handle the error condition. In either case, the correct thing to do
is to again inform you of the error.

Suppose the first 'select' comes from code that is just curious how many
sockets are ready but has no intention of handling the events. Not reporting
the error on the next call to 'select' would be disastrous.

DS



-
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