aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Boyer2012-07-25 09:40:34 -0500
committerLinus Torvalds2012-07-26 15:36:43 -0500
commit8ded2bbc1845e19c771eb55209aab166ef011243 (patch)
tree9ab400cdd407a9426fdfcc3432d7c0e19a0607ed /security/selinux
parent4cb38750d49010ae72e718d46605ac9ba5a851b4 (diff)
downloadam43-linux-kernel-8ded2bbc1845e19c771eb55209aab166ef011243.tar.gz
am43-linux-kernel-8ded2bbc1845e19c771eb55209aab166ef011243.tar.xz
am43-linux-kernel-8ded2bbc1845e19c771eb55209aab166ef011243.zip
posix_types.h: Cleanup stale __NFDBITS and related definitions
Recently, glibc made a change to suppress sign-conversion warnings in FD_SET (glibc commit ceb9e56b3d1). This uncovered an issue with the kernel's definition of __NFDBITS if applications #include <linux/types.h> after including <sys/select.h>. A build failure would be seen when passing the -Werror=sign-compare and -D_FORTIFY_SOURCE=2 flags to gcc. It was suggested that the kernel should either match the glibc definition of __NFDBITS or remove that entirely. The current in-kernel uses of __NFDBITS can be replaced with BITS_PER_LONG, and there are no uses of the related __FDELT and __FDMASK defines. Given that, we'll continue the cleanup that was started with commit 8b3d1cda4f5f ("posix_types: Remove fd_set macros") and drop the remaining unused macros. Additionally, linux/time.h has similar macros defined that expand to nothing so we'll remove those at the same time. Reported-by: Jeff Law <law@redhat.com> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> CC: <stable@vger.kernel.org> Signed-off-by: Josh Boyer <jwboyer@redhat.com> [ .. and fix up whitespace as per akpm ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/hooks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 689fe2d2216..94c45a1531a 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2129,7 +2129,7 @@ static inline void flush_unauthorized_files(const struct cred *cred,
2129 int fd; 2129 int fd;
2130 2130
2131 j++; 2131 j++;
2132 i = j * __NFDBITS; 2132 i = j * BITS_PER_LONG;
2133 fdt = files_fdtable(files); 2133 fdt = files_fdtable(files);
2134 if (i >= fdt->max_fds) 2134 if (i >= fdt->max_fds)
2135 break; 2135 break;