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-next>] [day] [month] [year] [list]
Message-ID: <20110128032443.6f8b877e@apollo.gnet>
Date:	Fri, 28 Jan 2011 03:24:43 +0300
From:	Alexander Gordeev <lasaine@....cs.msu.su>
To:	uClibc <uclibc@...ibc.org>, linux-kernel@...r.kernel.org
Subject: timerfd incompatibility on mips

Hi!

I've just found a problem with TFD_NONBLOCK flag that can be passed to
timerfd_create.

<uclibc>/libc/sysdeps/linux/common/sys/timerfd.h which is installed
to /usr/include/sys/timerfd.h defines TFD_NONBLOCK as 04000 ie 0x800.
BTW glibc/eglibc headers do the same thing.

<linux>/include/linux/timerfd.h declares it as O_NONBLOCK which is
defined in fcntl.h. Usually O_NONBLOCK is 0x800 too but some
architectures including MIPS it redefine it:

arch/mips/include/asm/fcntl.h:#define O_NONBLOCK	0x0080
arch/alpha/include/asm/fcntl.h:#define O_NONBLOCK	00004
arch/sparc/include/asm/fcntl.h:#define O_NONBLOCK	0x4000
arch/parisc/include/asm/fcntl.h:#define O_NONBLOCK	000200004

My tests show that kernel thinks that TFD_NONBLOCK is 0x80 on MIPS. I
get what I want when I pass 0x80 and EINVAL when I pass 0x800. I don't
know why there are such uncertain things in Linux. Probably the problem
should be fixed in the kernel.

Right now one cannot use timerfd_create(..., TFD_NONBLOCK) on MIPS but
can use timerfd_create(..., O_NONBLOCK) instead.

-- 
  Alexander

Download attachment "signature.asc" of type "application/pgp-signature" (491 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ