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: <1255080038.8802.1.camel@laptop>
Date:	Fri, 09 Oct 2009 11:20:38 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Alan Jenkins <sourcejedi.lkml@...glemail.com>
Cc:	wu Jianfeng <stormplayer@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: select system call's implementation may have some bug, need
 your  help and confirm !!!

On Fri, 2009-10-09 at 08:52 +0100, Alan Jenkins wrote:
> On 10/9/09, wu Jianfeng <stormplayer@...il.com> wrote:
> > A process may sleep for ever when he call select system call.
> > In detail, if the process was scheduled out just at the point it set
> > its state to TASK_INTERRUPTIBLE.
> >

> > set_current_state(TASK_INTERRUPTIBLE);
> > ## here set the process state TASK_INTERRUPTIBLE
> >
> >  ## if  the process was scheduled out here, then the process will
> > never can be waked up, because it has not been attached to any file 's
> > wait queue.
> 
> I'm not sure about that, but if you look at the current code (e.g. in
> linus' git tree) you will see this code has been changed.  Now
> set_current_state() is only called from poll_schedule_timeout(), and
> it won't suffer from the problem you suggested:
> 
> 
> int poll_schedule_timeout(struct poll_wqueues *pwq, int state,
> 			  ktime_t *expires, unsigned long slack)
> {
> 	int rc = -EINTR;
> 
> 	set_current_state(state);
> 	if (!pwq->triggered)
> 		rc = schedule_hrtimeout_range(expires, slack, HRTIMER_MODE_ABS);
> 	__set_current_state(TASK_RUNNING);

It would still be liable to the problem suggested, if it were real,
which it is not, as Thomas pointed out.

The distinction is between getting preempted and calling schedule().

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