Guest User

Untitled

a guest
Jan 10th, 2022
178
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/arch/arm64/include/asm/mman.h b/arch/arm64/include/asm/mman.h
  2. index e3e28f7daf62..446d13c17d54 100644
  3. --- a/arch/arm64/include/asm/mman.h
  4. +++ b/arch/arm64/include/asm/mman.h
  5. @@ -4,6 +4,7 @@
  6.  
  7. #include <linux/compiler.h>
  8. #include <linux/types.h>
  9. +#include <asm/memory.h> /* MT_NORMAL_TAGGED */
  10. #include <uapi/asm/mman.h>
  11.  
  12. static inline unsigned long arch_calc_vm_prot_bits(unsigned long prot,
  13. diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h
  14. index 0989b162a999..817080769b7d 100644
  15. --- a/arch/arm64/include/asm/mmu.h
  16. +++ b/arch/arm64/include/asm/mmu.h
  17. @@ -6,7 +6,6 @@
  18. #define __ASM_MMU_H
  19.  
  20. #include <asm/pgtable_types.h>
  21. -#include <asm/page.h>
  22. #include <asm/cpufeature.h>
  23. #include <asm/cputype.h>
  24.  
  25. diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
  26. index 18cc82ade956..5cf2c131bbf1 100644
  27. --- a/arch/arm64/include/asm/pgtable-hwdef.h
  28. +++ b/arch/arm64/include/asm/pgtable-hwdef.h
  29. @@ -5,7 +5,6 @@
  30. #ifndef __ASM_PGTABLE_HWDEF_H
  31. #define __ASM_PGTABLE_HWDEF_H
  32.  
  33. -#include <asm/memory.h>
  34. #include <asm/pgtable_types.h>
  35.  
  36. /*
  37. diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h
  38. index b55145791abb..1fa6bb3294b8 100644
  39. --- a/arch/arm64/include/asm/pgtable-prot.h
  40. +++ b/arch/arm64/include/asm/pgtable-prot.h
  41. @@ -5,7 +5,6 @@
  42. #ifndef __ASM_PGTABLE_PROT_H
  43. #define __ASM_PGTABLE_PROT_H
  44.  
  45. -#include <asm/memory.h>
  46. #include <asm/pgtable-hwdef.h>
  47.  
  48. #include <linux/const.h>
  49. diff --git a/arch/x86/include/asm/fb.h b/arch/x86/include/asm/fb.h
  50. index daa337baf4c1..41ea6dfa00d2 100644
  51. --- a/arch/x86/include/asm/fb.h
  52. +++ b/arch/x86/include/asm/fb.h
  53. @@ -2,6 +2,7 @@
  54. #ifndef _ASM_X86_FB_H
  55. #define _ASM_X86_FB_H
  56.  
  57. +#include <linux/mm_types.h>
  58. #include <asm/cpufeature.h>
  59. #include <linux/fb.h>
  60. #include <linux/fs.h>
  61. diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
  62. index 096abc42b4cc..e8c79256beba 100644
  63. --- a/arch/x86/include/asm/mpspec.h
  64. +++ b/arch/x86/include/asm/mpspec.h
  65. @@ -6,6 +6,7 @@
  66. #include <linux/types.h>
  67. #include <linux/math.h>
  68. #include <linux/bitmap.h>
  69. +#include <linux/init.h>
  70. #include <asm/mpspec_def.h>
  71. #include <asm/x86_init.h>
  72. #include <asm/apicdef.h>
  73. diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c
  74. index 99d7907be894..075c35bc3733 100644
  75. --- a/drivers/input/keyboard/gpio_keys_polled.c
  76. +++ b/drivers/input/keyboard/gpio_keys_polled.c
  77. @@ -24,6 +24,9 @@
  78. #include <linux/gpio/consumer.h>
  79. #include <linux/gpio_keys.h>
  80. #include <linux/property.h>
  81. +#include <linux/bitops.h>
  82. +#include <linux/math.h>
  83. +#include <linux/string.h>
  84.  
  85. #define DRV_NAME "gpio-keys-polled"
  86.  
  87. diff --git a/drivers/media/test-drivers/vidtv/vidtv_channel.c b/drivers/media/test-drivers/vidtv/vidtv_channel.c
  88. index 68645326a658..49f3ad70f039 100644
  89. --- a/drivers/media/test-drivers/vidtv/vidtv_channel.c
  90. +++ b/drivers/media/test-drivers/vidtv/vidtv_channel.c
  91. @@ -25,6 +25,8 @@
  92. #include <linux/slab.h>
  93. #include <linux/types.h>
  94.  
  95. +#include <asm/byteorder.h>
  96. +
  97. #include "vidtv_channel.h"
  98. #include "vidtv_common.h"
  99. #include "vidtv_encoder.h"
  100. diff --git a/drivers/video/fbdev/core/fb_device.c b/drivers/video/fbdev/core/fb_device.c
  101. index cdb5d908c9fa..46732b64c4a5 100644
  102. --- a/drivers/video/fbdev/core/fb_device.c
  103. +++ b/drivers/video/fbdev/core/fb_device.c
  104. @@ -6,6 +6,7 @@
  105. #include <linux/major.h>
  106. #include <linux/slab.h>
  107. #include <linux/mm_api.h>
  108. +#include <linux/pgtable_api.h>
  109. #include <linux/mman.h>
  110. #include <linux/module.h>
  111. #include <linux/uaccess.h>
  112. diff --git a/drivers/xen/xen-pciback/xenbus.c b/drivers/xen/xen-pciback/xenbus.c
  113. index 629c16cd6b25..f66c2d26a55b 100644
  114. --- a/drivers/xen/xen-pciback/xenbus.c
  115. +++ b/drivers/xen/xen-pciback/xenbus.c
  116. @@ -7,6 +7,7 @@
  117.  
  118. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  119.  
  120. +#include <linux/string.h>
  121. #include <linux/workqueue_api.h>
  122. #include <linux/stat.h>
  123. #include <linux/slab.h>
  124. diff --git a/include/linux/if_link.h b/include/linux/if_link.h
  125. index 622658dfbf0a..e6657f594cfe 100644
  126. --- a/include/linux/if_link.h
  127. +++ b/include/linux/if_link.h
  128. @@ -2,8 +2,11 @@
  129. #ifndef _LINUX_IF_LINK_H
  130. #define _LINUX_IF_LINK_H
  131.  
  132. +#ifdef __KERNEL__
  133. #include <uapi/linux/if_link.h>
  134. -
  135. +#else
  136. +#include <linux/if_link.h>
  137. +#endif
  138.  
  139. /* We don't want this structure exposed to user space */
  140. struct ifla_vf_stats {
  141. diff --git a/include/linux/mm_api_kasan.h b/include/linux/mm_api_kasan.h
  142. index d5a0a21ad046..08780dc4d7ea 100644
  143. --- a/include/linux/mm_api_kasan.h
  144. +++ b/include/linux/mm_api_kasan.h
  145. @@ -18,7 +18,7 @@ static inline u8 page_kasan_tag(const struct page *page)
  146. {
  147. u8 tag = 0xff;
  148.  
  149. - if (kasan_enabled()) {
  150. + if (IS_ENABLED(CONFIG_KASAN)) {
  151. tag = (page->flags >> KASAN_TAG_PGSHIFT) & KASAN_TAG_MASK;
  152. tag ^= 0xff;
  153. }
  154. @@ -28,7 +28,7 @@ static inline u8 page_kasan_tag(const struct page *page)
  155.  
  156. static inline void page_kasan_tag_set(struct page *page, u8 tag)
  157. {
  158. - if (kasan_enabled()) {
  159. + if (IS_ENABLED(CONFIG_KASAN)) {
  160. tag ^= 0xff;
  161. page->flags &= ~(KASAN_TAG_MASK << KASAN_TAG_PGSHIFT);
  162. page->flags |= (tag & KASAN_TAG_MASK) << KASAN_TAG_PGSHIFT;
  163. @@ -37,7 +37,7 @@ static inline void page_kasan_tag_set(struct page *page, u8 tag)
  164.  
  165. static inline void page_kasan_tag_reset(struct page *page)
  166. {
  167. - if (kasan_enabled())
  168. + if (IS_ENABLED(CONFIG_KASAN))
  169. page_kasan_tag_set(page, 0xff);
  170. }
  171.  
  172. diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
  173. index 5da9c1a83f67..62219ec07498 100644
  174. --- a/include/linux/mm_types.h
  175. +++ b/include/linux/mm_types.h
  176. @@ -19,6 +19,7 @@
  177. #include <linux/page-flags-layout.h>
  178. #include <linux/page-flags-defs.h>
  179.  
  180. +#include <asm/page_types.h>
  181. #include <asm/mmu.h>
  182.  
  183. #ifndef AT_VECTOR_SIZE_ARCH
  184. diff --git a/include/linux/mmzone_api.h b/include/linux/mmzone_api.h
  185. index 6ee6fae98e34..d35144a21c3c 100644
  186. --- a/include/linux/mmzone_api.h
  187. +++ b/include/linux/mmzone_api.h
  188. @@ -27,6 +27,7 @@
  189. #include <linux/gfp_types.h>
  190. #include <linux/page-flags.h>
  191. #include <linux/local_lock.h>
  192. +#include <linux/pfn.h>
  193. #include <asm/page.h>
  194.  
  195. #ifdef CONFIG_HIGHMEM
  196. diff --git a/include/uapi/asm-generic/bpf_perf_event.h b/include/uapi/asm-generic/bpf_perf_event.h
  197. index 3be497cac87b..58e2a15b5682 100644
  198. --- a/include/uapi/asm-generic/bpf_perf_event.h
  199. +++ b/include/uapi/asm-generic/bpf_perf_event.h
  200. @@ -1,7 +1,11 @@
  201. #ifndef _UAPI__ASM_GENERIC_BPF_PERF_EVENT_H__
  202. #define _UAPI__ASM_GENERIC_BPF_PERF_EVENT_H__
  203.  
  204. +#ifdef __KERNEL__
  205. #include <uapi/linux/ptrace.h>
  206. +#else
  207. +#include <linux/ptrace.h>
  208. +#endif
  209.  
  210. /* Export kernel pt_regs structure */
  211. typedef struct pt_regs bpf_user_pt_regs_t;
  212. diff --git a/include/uapi/asm-generic/shmbuf.h b/include/uapi/asm-generic/shmbuf.h
  213. index 36f9dd440cb3..401a18bb139c 100644
  214. --- a/include/uapi/asm-generic/shmbuf.h
  215. +++ b/include/uapi/asm-generic/shmbuf.h
  216. @@ -4,7 +4,11 @@
  217.  
  218. #include <asm/bitsperlong.h>
  219.  
  220. +#ifdef __KERNEL__
  221. #include <uapi/asm-generic/ipcbuf.h>
  222. +#else
  223. +#include <asm-generic/ipcbuf.h>
  224. +#endif
  225.  
  226. /*
  227. * The shmid64_ds structure for x86 architecture.
  228. diff --git a/include/uapi/linux/netdevice.h b/include/uapi/linux/netdevice.h
  229. index 3bfa541bea45..57d1dcc2c314 100644
  230. --- a/include/uapi/linux/netdevice.h
  231. +++ b/include/uapi/linux/netdevice.h
  232. @@ -26,11 +26,17 @@
  233. #ifndef _UAPI_LINUX_NETDEVICE_H
  234. #define _UAPI_LINUX_NETDEVICE_H
  235.  
  236. +#ifdef __KERNEL__
  237. #include <uapi/linux/if.h>
  238. #include <uapi/linux/if_ether.h>
  239. #include <uapi/linux/if_packet.h>
  240. #include <uapi/linux/if_link.h>
  241. -
  242. +#else
  243. +#include <linux/if.h>
  244. +#include <linux/if_ether.h>
  245. +#include <linux/if_packet.h>
  246. +#include <linux/if_link.h>
  247. +#endif
  248.  
  249. #define MAX_ADDR_LEN 32 /* Largest hardware address length */
  250.  
  251. diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h
  252. index 77d1b2b8a4cc..6d53841a6470 100644
  253. --- a/include/uapi/linux/netlink.h
  254. +++ b/include/uapi/linux/netlink.h
  255. @@ -2,9 +2,15 @@
  256. #ifndef _UAPI__LINUX_NETLINK_H
  257. #define _UAPI__LINUX_NETLINK_H
  258.  
  259. +#ifdef __KERNEL__
  260. #include <uapi/linux/types.h>
  261. #include <uapi/linux/const.h>
  262. #include <uapi/linux/socket.h> /* for __kernel_sa_family_t */
  263. +#else
  264. +#include <linux/types.h>
  265. +#include <linux/const.h>
  266. +#include <linux/socket.h> /* for __kernel_sa_family_t */
  267. +#endif
  268.  
  269. #define NETLINK_ROUTE 0 /* Routing/device hook */
  270. #define NETLINK_UNUSED 1 /* Unused number */
  271. diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
  272. index 0ff333b05bf1..e2583d100192 100644
  273. --- a/include/uapi/linux/rtnetlink.h
  274. +++ b/include/uapi/linux/rtnetlink.h
  275. @@ -2,11 +2,19 @@
  276. #ifndef _UAPI__LINUX_RTNETLINK_H
  277. #define _UAPI__LINUX_RTNETLINK_H
  278.  
  279. +#ifdef __KERNEL__
  280. #include <uapi/linux/types.h>
  281. #include <uapi/linux/netlink.h>
  282. #include <uapi/linux/if_link.h>
  283. #include <uapi/linux/if_addr.h>
  284. #include <uapi/linux/neighbour.h>
  285. +#else
  286. +#include <linux/types.h>
  287. +#include <linux/netlink.h>
  288. +#include <linux/if_link.h>
  289. +#include <linux/if_addr.h>
  290. +#include <linux/neighbour.h>
  291. +#endif
  292.  
  293. /* rtnetlink families. Values up to 127 are reserved for real address
  294. * families, values above 128 may be used arbitrarily.
  295. diff --git a/include/uapi/linux/socket.h b/include/uapi/linux/socket.h
  296. index d52f3c6520a8..d271caddb022 100644
  297. --- a/include/uapi/linux/socket.h
  298. +++ b/include/uapi/linux/socket.h
  299. @@ -2,7 +2,11 @@
  300. #ifndef _UAPI_LINUX_SOCKET_H
  301. #define _UAPI_LINUX_SOCKET_H
  302.  
  303. +#ifdef __KERNEL__
  304. #include <uapi/linux/socket_types.h>
  305. +#else
  306. +#include <linux/socket_types.h>
  307. +#endif
  308.  
  309. typedef unsigned short __kernel_sa_family_t;
  310. typedef __kernel_sa_family_t sa_family_t;
  311. diff --git a/include/uapi/linux/x25.h b/include/uapi/linux/x25.h
  312. index adf7f0a28ad2..2ec7d1898b61 100644
  313. --- a/include/uapi/linux/x25.h
  314. +++ b/include/uapi/linux/x25.h
  315. @@ -12,7 +12,11 @@
  316. #ifndef X25_KERNEL_H
  317. #define X25_KERNEL_H
  318.  
  319. +#ifdef __KERNEL__
  320. #include <uapi/linux/sockios.h>
  321. +#else
  322. +#include <linux/sockios.h>
  323. +#endif
  324. #include <linux/types.h>
  325. #include <linux/socket.h>
  326.  
  327. diff --git a/init/main.c b/init/main.c
  328. index 99d3a2ef49e8..78b258c8e697 100644
  329. --- a/init/main.c
  330. +++ b/init/main.c
  331. @@ -970,7 +970,7 @@ void __init init_per_task_early(void)
  332. spin_lock_init(&per_task(&init_task, alloc_lock));
  333. raw_spin_lock_init(&per_task(&init_task, pi_lock));
  334. #ifdef CONFIG_KCSAN
  335. - per_task(&init_task, kcsan_ctx).scoped_addresses.next = LIST_POISON1;
  336. + per_task(&init_task, kcsan_ctx).scoped_accesses.next = LIST_POISON1;
  337. #endif
  338. task_flags(&init_task) = PF_KTHREAD;
  339. }
  340. diff --git a/kernel/kcsan/permissive.h b/kernel/kcsan/permissive.h
  341. index 2c01fe4a59ee..eb0627db54a6 100644
  342. --- a/kernel/kcsan/permissive.h
  343. +++ b/kernel/kcsan/permissive.h
  344. @@ -15,6 +15,7 @@
  345. #include <linux/bitops.h>
  346. #include <linux/sched.h>
  347. #include <linux/types.h>
  348. +#include <linux/sched/task_flags.h>
  349.  
  350. /*
  351. * Access ignore rules based on address.
  352. @@ -28,7 +29,7 @@ static __always_inline bool kcsan_ignore_address(const volatile void *ptr)
  353. * Data-racy bitops on current->flags are too common, ignore completely
  354. * for now.
  355. */
  356. - return ptr == &current->flags;
  357. + return ptr == &task_flags(current);
  358. }
  359.  
  360. /*
  361. diff --git a/mm/memtest.c b/mm/memtest.c
  362. index c13f13d3820e..6690a7a3dd3b 100644
  363. --- a/mm/memtest.c
  364. +++ b/mm/memtest.c
  365. @@ -6,6 +6,7 @@
  366. #include <linux/types.h>
  367. #include <linux/init.h>
  368. #include <linux/memblock.h>
  369. +#include <asm/page.h>
  370.  
  371. static u64 patterns[] __initdata = {
  372. /* The first entry has to be 0 to leave memtest with zeroed memory */
  373.  
RAW Paste Data