timerfd: add flags check
authorDavide Libenzi <davidel@xmailserver.org>
Wed, 18 Feb 2009 22:48:18 +0000 (14:48 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 Mar 2009 00:52:47 +0000 (17:52 -0700)
commit067d0083685ed743f17049fa74b80b7fd20e290c
tree4f2377da18fcb1c1695384158e697a9d9341e16e
parent4a61d3855a95e6e513be5bdfed536d071b853904
timerfd: add flags check

commit 610d18f4128ebbd88845d0fc60cce67b49af881e upstream.

As requested by Michael, add a missing check for valid flags in
timerfd_settime(), and make it return EINVAL in case some extra bits are
set.

Michael said:
If this is to be any use to userland apps that want to check flag
support (perhaps it is too late already), then the sooner we get it
into the kernel the better: 2.6.29 would be good; earlier stables as
well would be even better.

[akpm@linux-foundation.org: remove unused TFD_FLAGS_SET]
Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Davide Libenzi <davidel@xmailserver.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/timerfd.c
include/linux/timerfd.h