Linux Kernels

types.h: don't expose struct ustat to userspace

This change “types.h: don't expose struct ustat to userspace” (commit 6c7c6af) in Linux kernel is authored by maximilian attems <max [at] stro.at> on Fri May 23 13:04:29 2008 -0700.

Description of "types.h: don't expose struct ustat to userspace"

The change “types.h: don't expose struct ustat to userspace” introduces changes as follows.

types.h: don't expose struct ustat to userspace

<linux/types.h> can't be used together with <sys/ustat.h> because they
both define struct ustat:

    $ cat test.c
    #include <sys/ustat.h>
    #include <linux/types.h>
    $ gcc -c test.c
    In file included from test.c:2:
    /usr/include/linux/types.h:165: error: redefinition of 'struct ustat'

has been reported a while ago to debian, but seems to have been
lost in cat fighting: http://bugs.debian.org/429064

Signed-off-by: maximilian attems <max@stro.at>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Linux kernel releases containing commit 6c7c6af

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "types.h: don't expose struct ustat to userspace"

There are 4 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 include/linux/types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 
diff --git a/include/linux/types.h b/include/linux/types.h
index 9dc2346627b4..d4a9ce6e2760 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -197,8 +197,6 @@ typedef u64 resource_size_t;
 typedef u32 resource_size_t;
 #endif
 
-#endif	/* __KERNEL__ */
-
 struct ustat {
 	__kernel_daddr_t	f_tfree;
 	__kernel_ino_t		f_tinode;
@@ -206,4 +204,6 @@ struct ustat {
 	char			f_fpack[6];
 };
 
+#endif	/* __KERNEL__ */
+
 #endif /* _LINUX_TYPES_H */

The commit for this change in Linux stable tree is 6c7c6af (patch).

Last modified: 2020/01/11 09:47