History

[PATCH] headers_check: don't expose PFN stuff to userspace in <asm-i386/setup.h>

The header file <linux/pfn.h> doesn't exist in userspace and probably shouldn't -- but it's used unconditionally in <asm-i386/setup.h>. Protect it with #ifdef __KERNEL__ and move setup.h from $(header-y) to $(unifdef-y) in Kbuild accordingly.

David Woodhouse committed 20 years ago

Commit f01f0f01 parent 651c9232 files · +4 −2Browse files

Showing the changes to include (2 of 2 files). Show all

Unified · Split

2 files
  1. include/asm-i386/Kbuild +2 −2
  2. include/asm-i386/setup.h +2 −0
include/asm-i386/Kbuild+2−2
@@ -1,5 +1,5 @@
11 include include/asm-generic/Kbuild.asm
22
3−header-y += boot.h debugreg.h ldt.h setup.h ucontext.h
3+header-y += boot.h debugreg.h ldt.h ucontext.h
44
5−unifdef-y += mtrr.h vm86.h
5+unifdef-y += mtrr.h setup.h vm86.h
include/asm-i386/setup.h+2−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #ifndef _i386_SETUP_H
77 #define _i386_SETUP_H
88
9+#ifdef __KERNEL__
910 #include <linux/pfn.h>
1011
1112 /*
@@ -13,6 +14,7 @@ · 1 unmodified line
1314 */
1415 #define MAXMEM_PFN PFN_DOWN(MAXMEM)
1516 #define MAX_NONPAE_PFN (1 << 20)
17+#endif
1618
1719 #define PARAM_SIZE 4096
1820 #define COMMAND_LINE_SIZE 256