Bugzilla – Bug 141318
kernel headers leak kernel types
Last modified: 2006-01-09 15:19:51 UTC
<linux/mii.h> and <linux/ethtool.h> leak the kernel types u8, u16, u32, and u64 instead of using the user-space-friendly __u8, __u16, etc. Aside from "don't pollute the user name space" this causes compilation failures as the types are only defined if __KERNEL__. I submitted a patch to lkml but it probably won't be in the kernel we ship for 10.1. I will attach it here. In the meantime, this is causing compilation failures, so we need to fix it. I don't know whether we prefer to patch this in the kernel or glibc -- either will work.
Created attachment 61926 [details] don't leak kernel types in ethtool.h
Created attachment 61927 [details] don't leak kernel types in mii.h
FYI: Just checked, and Red Hat patches these files in their glibc.
kukuk - by the looks of the changelog, you are the man wrt glibc. ;-) Can we get these two simple patches in? I submitted fixes for the upstream kernel headers, but in the interim can we just fix the headers in our glibc? Obviously, these files using those types is going to cause compilation issues...
(In reply to comment #4) > kukuk - by the looks of the changelog, you are the man wrt glibc. ;-) > > Can we get these two simple patches in? I submitted fixes for the upstream > kernel headers, but in the interim can we just fix the headers in our glibc? > > Obviously, these files using those types is going to cause compilation > issues... You always write about compilation issues without telling us which applications have problems. No package in autobuild has problems with this and including kernel headers in userland applications is not supported by us. So I will not add this patches.
Any application that uses mii.h or ethtool.h will have problems. This includes ethtool and NetworkManager. They both work because they are patched -- they self-define the kernel types u32, et al. These headers are meant to be included in user-space applications: ALL they do is define a user-kernel interface. The patches have already gone upstream (in 2.6-mm and now in Linus's git tree). > including kernel headers in userland applications is not supported by us Many glibc headers derive from the kernel and are intended for use by user-space. These are but two examples. What is not allowed is using kernel-only __KERNEL__ headers in user-space. These do not fall in that category.
Correct, glibc headers are adjusted for inclusion in user-space, not the other one.
Sorry, I don't understand. What "other one" ?