Re: [patch 2/2] alarm unsigned signed conversion fixup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2006-03-18 at 12:12 -0800, Andrew Morton wrote:
> Thomas Gleixner <[email protected]> wrote:
> >
> > alarm() calls the kernel with an unsigend int timeout in seconds.
> >  The value is converted to a timeval which is used to setup the
> >  itimer. The tv_sec field of the timeval is a long, which causes
> >  the timeout to be negative on 32 bit machines if seconds > INT_MAX.
> >  Also this was silently caught before the hrtimer merge. 
> >  To avoid fixups all over the place the duplicated sys_alarm code 
> >  is moved to itimer.c.
> 
> It's not clear what you mean by this.   What does "silently caught" mean?
> 
> I _think_ you mean "a negative tv_sec gets treated in a random fashion, but
> with my preceding patch it will incorrectly get -EINVAL, so fix things to
> accept this large tv_sec".  Or something else.
> 
> Please clarify.
> 
> What happens if change sys_setitimer() to normalise the incoming timeval as
> I suggested?  I guess that doesn't affect this..

No, because a negative value does not become positive by normalizing.
Well except you build a normalizing function which converts negative
values to INT_MAX.

	tglx



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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux