Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/toolchain/linux-headers-patches:master commit in: 4.19/
Date: Tue, 23 Oct 2018 22:39:09
Message-Id: 1540333951.617731890c0f515b7318101a828f6ca2f6e5db08.slyfox@gentoo
1 commit: 617731890c0f515b7318101a828f6ca2f6e5db08
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 23 22:32:31 2018 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 23 22:32:31 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/toolchain/linux-headers-patches.git/commit/?id=61773189
7
8 4.19: copy 4.18 patches as-is
9
10 Reported-by: Tomáš Mózes
11 Bug: https://bugs.gentoo.org/669388
12 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
13
14 ...0001-linux-stat.h-remove-__GLIBC__-checks.patch | 28 ++++++++
15 4.19/00_all_0002-netfilter-pull-in-limits.h.patch | 28 ++++++++
16 4.19/00_all_0003-convert-PAGE_SIZE-usage.patch | 54 +++++++++++++++
17 ...ric-fcntl.h-namespace-kernel-file-structs.patch | 54 +++++++++++++++
18 ..._0005-unifdef-drop-unused-errno.h-include.patch | 32 +++++++++
19 ...build-relocs-tool-when-installing-headers.patch | 33 ++++++++++
20 ...k-drop-int-cast-on-length-arg-in-NLMSG_OK.patch | 43 ++++++++++++
21 ...008-uapi-fix-System-V-buf-header-includes.patch | 76 ++++++++++++++++++++++
22 8 files changed, 348 insertions(+)
23
24 diff --git a/4.19/00_all_0001-linux-stat.h-remove-__GLIBC__-checks.patch b/4.19/00_all_0001-linux-stat.h-remove-__GLIBC__-checks.patch
25 new file mode 100644
26 index 0000000..24a4199
27 --- /dev/null
28 +++ b/4.19/00_all_0001-linux-stat.h-remove-__GLIBC__-checks.patch
29 @@ -0,0 +1,28 @@
30 +From 1f4498530090a5fe7f6b2c46f2beb8818d7cb27b Mon Sep 17 00:00:00 2001
31 +From: Mike Frysinger <vapier@g.o>
32 +Date: Mon, 29 Dec 2008 06:52:59 -0500
33 +Subject: [PATCH] linux/stat.h: remove __GLIBC__ checks
34 +
35 +Only check __KERNEL__ so we don't assume the C library is glibc.
36 +
37 +Signed-off-by: Mike Frysinger <vapier@g.o>
38 +---
39 + include/uapi/linux/stat.h | 2 +-
40 + 1 file changed, 1 insertion(+), 1 deletion(-)
41 +
42 +diff --git a/include/uapi/linux/stat.h b/include/uapi/linux/stat.h
43 +index 7b35e98d3c58..eb7474652d27 100644
44 +--- a/include/uapi/linux/stat.h
45 ++++ b/include/uapi/linux/stat.h
46 +@@ -4,7 +4,7 @@
47 +
48 + #include <linux/types.h>
49 +
50 +-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
51 ++#if defined(__KERNEL__)
52 +
53 + #define S_IFMT 00170000
54 + #define S_IFSOCK 0140000
55 +--
56 +2.16.1
57 +
58
59 diff --git a/4.19/00_all_0002-netfilter-pull-in-limits.h.patch b/4.19/00_all_0002-netfilter-pull-in-limits.h.patch
60 new file mode 100644
61 index 0000000..9b5b2c0
62 --- /dev/null
63 +++ b/4.19/00_all_0002-netfilter-pull-in-limits.h.patch
64 @@ -0,0 +1,28 @@
65 +From 0e43763b07e10e2c3cb517349ac2d541bcb62e5a Mon Sep 17 00:00:00 2001
66 +From: Mike Frysinger <vapier@g.o>
67 +Date: Sat, 9 May 2009 17:30:35 -0400
68 +Subject: [PATCH] netfilter: pull in limits.h
69 +
70 +A few netfilter sub-headers use INT_MAX which is in limits.h.
71 +
72 +URL: http://bugs.gentoo.org/246160
73 +Signed-off-by: Mike Frysinger <vapier@g.o>
74 +---
75 + include/uapi/linux/netfilter.h | 1 +
76 + 1 file changed, 1 insertion(+)
77 +
78 +diff --git a/include/uapi/linux/netfilter.h b/include/uapi/linux/netfilter.h
79 +index cca10e767cd8..de6d76399cd7 100644
80 +--- a/include/uapi/linux/netfilter.h
81 ++++ b/include/uapi/linux/netfilter.h
82 +@@ -6,6 +6,7 @@
83 + #include <linux/compiler.h>
84 + #include <linux/in.h>
85 + #include <linux/in6.h>
86 ++#include <limits.h>
87 +
88 + /* Responses from hook functions. */
89 + #define NF_DROP 0
90 +--
91 +2.16.1
92 +
93
94 diff --git a/4.19/00_all_0003-convert-PAGE_SIZE-usage.patch b/4.19/00_all_0003-convert-PAGE_SIZE-usage.patch
95 new file mode 100644
96 index 0000000..fbc2c45
97 --- /dev/null
98 +++ b/4.19/00_all_0003-convert-PAGE_SIZE-usage.patch
99 @@ -0,0 +1,54 @@
100 +From 25f2bcfa6c8a9e7cee2b92a823495479fe0ccc92 Mon Sep 17 00:00:00 2001
101 +From: Mike Frysinger <vapier@g.o>
102 +Date: Sat, 13 Feb 2010 03:09:23 -0500
103 +Subject: [PATCH] convert PAGE_SIZE usage
104 +
105 +The size of a page may change at runtime or based on kernel settings, so
106 +a static value at compile time doesn't work. More importantly, no one
107 +exports PAGE_SIZE to user space anymore.
108 +
109 +URL: http://bugs.gentoo.org/301431
110 +Signed-off-by: Mike Frysinger <vapier@g.o>
111 +---
112 + include/uapi/linux/binfmts.h | 3 ++-
113 + include/uapi/linux/resource.h | 3 ++-
114 + 2 files changed, 4 insertions(+), 2 deletions(-)
115 +
116 +diff --git a/include/uapi/linux/binfmts.h b/include/uapi/linux/binfmts.h
117 +index 4abad03a8853..3e98cfc84d1c 100644
118 +--- a/include/uapi/linux/binfmts.h
119 ++++ b/include/uapi/linux/binfmts.h
120 +@@ -2,6 +2,7 @@
121 + #ifndef _UAPI_LINUX_BINFMTS_H
122 + #define _UAPI_LINUX_BINFMTS_H
123 +
124 ++#include <unistd.h>
125 + #include <linux/capability.h>
126 +
127 + struct pt_regs;
128 +@@ -12,7 +13,7 @@ struct pt_regs;
129 + * prevent the kernel from being unduly impacted by misaddressed pointers.
130 + * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
131 + */
132 +-#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
133 ++#define MAX_ARG_STRLEN (sysconf(_SC_PAGESIZE) * 32)
134 + #define MAX_ARG_STRINGS 0x7FFFFFFF
135 +
136 + /* sizeof(linux_binprm->buf) */
137 +diff --git a/include/uapi/linux/resource.h b/include/uapi/linux/resource.h
138 +index cc00fd079631..6f9e76f513b5 100644
139 +--- a/include/uapi/linux/resource.h
140 ++++ b/include/uapi/linux/resource.h
141 +@@ -69,7 +69,8 @@ struct rlimit64 {
142 + * GPG2 wants 64kB of mlocked memory, to make sure pass phrases
143 + * and other sensitive information are never written to disk.
144 + */
145 +-#define MLOCK_LIMIT ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024)
146 ++/* No one currently defines PAGE_SIZE bigger than 64kB */
147 ++#define MLOCK_LIMIT (64 * 1024)
148 +
149 + /*
150 + * Due to binary compatibility, the actual resource numbers
151 +--
152 +2.16.1
153 +
154
155 diff --git a/4.19/00_all_0004-asm-generic-fcntl.h-namespace-kernel-file-structs.patch b/4.19/00_all_0004-asm-generic-fcntl.h-namespace-kernel-file-structs.patch
156 new file mode 100644
157 index 0000000..625fb6e
158 --- /dev/null
159 +++ b/4.19/00_all_0004-asm-generic-fcntl.h-namespace-kernel-file-structs.patch
160 @@ -0,0 +1,54 @@
161 +From 091dfce6aed898f4bc4eaca0edab942dd03b8016 Mon Sep 17 00:00:00 2001
162 +From: Mike Frysinger <vapier@g.o>
163 +Date: Mon, 29 Dec 2008 07:39:14 -0500
164 +Subject: [PATCH] asm-generic/fcntl.h: namespace kernel file structs
165 +
166 +No one should be using these structs, but just in case they are,
167 +keep them available in the __kernel_ namespace.
168 +
169 +Otherwise, trying to include something like:
170 + #include <fcntl.h>
171 + #include <linux/inotify.h>
172 +leads to horrible failure.
173 +
174 +URL: http://bugs.gentoo.org/244470
175 +URL: http://bugs.gentoo.org/388633
176 +Signed-off-by: Mike Frysinger <vapier@g.o>
177 +---
178 + include/uapi/asm-generic/fcntl.h | 6 +++---
179 + 1 file changed, 3 insertions(+), 3 deletions(-)
180 +
181 +diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h
182 +index 9dc0bf0c5a6e..dc9b2e467ad9 100644
183 +--- a/include/uapi/asm-generic/fcntl.h
184 ++++ b/include/uapi/asm-generic/fcntl.h
185 +@@ -153,7 +153,7 @@
186 + #define F_OWNER_PID 1
187 + #define F_OWNER_PGRP 2
188 +
189 +-struct f_owner_ex {
190 ++struct __kernel_f_owner_ex {
191 + int type;
192 + __kernel_pid_t pid;
193 + };
194 +@@ -193,7 +193,7 @@ struct f_owner_ex {
195 + #define __ARCH_FLOCK_PAD
196 + #endif
197 +
198 +-struct flock {
199 ++struct __kernel_flock {
200 + short l_type;
201 + short l_whence;
202 + __kernel_off_t l_start;
203 +@@ -208,7 +208,7 @@ struct flock {
204 + #define __ARCH_FLOCK64_PAD
205 + #endif
206 +
207 +-struct flock64 {
208 ++struct __kernel_flock64 {
209 + short l_type;
210 + short l_whence;
211 + __kernel_loff_t l_start;
212 +--
213 +2.16.1
214 +
215
216 diff --git a/4.19/00_all_0005-unifdef-drop-unused-errno.h-include.patch b/4.19/00_all_0005-unifdef-drop-unused-errno.h-include.patch
217 new file mode 100644
218 index 0000000..617eb9a
219 --- /dev/null
220 +++ b/4.19/00_all_0005-unifdef-drop-unused-errno.h-include.patch
221 @@ -0,0 +1,32 @@
222 +From c4d1a109c5c0b1bd27d2b5448a1306a2f6005339 Mon Sep 17 00:00:00 2001
223 +From: Mike Frysinger <vapier@g.o>
224 +Date: Tue, 6 Dec 2011 17:22:42 -0500
225 +Subject: [PATCH] unifdef: drop unused errno.h include
226 +
227 +This is the only header on my system that ends up requiring kernel
228 +headers, so if the kernel headers aren't available, we end up being
229 +unable to install kernel headers :).
230 +
231 +Since this file doesn't actually use anything from errno.h, drop
232 +the include so it at least makes us a bit more robust on glibc.
233 +
234 +Signed-off-by: Mike Frysinger <vapier@g.o>
235 +---
236 + scripts/unifdef.c | 1 -
237 + 1 file changed, 1 deletion(-)
238 +
239 +diff --git a/scripts/unifdef.c b/scripts/unifdef.c
240 +index 7493c0ee51cc..c5dfae538b08 100644
241 +--- a/scripts/unifdef.c
242 ++++ b/scripts/unifdef.c
243 +@@ -48,7 +48,6 @@
244 +
245 + #include <ctype.h>
246 + #include <err.h>
247 +-#include <errno.h>
248 + #include <stdarg.h>
249 + #include <stdbool.h>
250 + #include <stdio.h>
251 +--
252 +2.16.1
253 +
254
255 diff --git a/4.19/00_all_0006-x86-do-not-build-relocs-tool-when-installing-headers.patch b/4.19/00_all_0006-x86-do-not-build-relocs-tool-when-installing-headers.patch
256 new file mode 100644
257 index 0000000..c4af343
258 --- /dev/null
259 +++ b/4.19/00_all_0006-x86-do-not-build-relocs-tool-when-installing-headers.patch
260 @@ -0,0 +1,33 @@
261 +From 57875de37c5375ea95e1e949ec7c741d0038d3a1 Mon Sep 17 00:00:00 2001
262 +From: Mike Frysinger <vapier@g.o>
263 +Date: Sat, 15 Nov 2014 03:37:38 -0500
264 +Subject: [PATCH] x86: do not build relocs tool when installing headers
265 +
266 +This isn't needed to install headers, so don't bother building it.
267 +Otherwise we run into a chicken/egg issue where we need the kernel
268 +headers in order to install the kernel headers. It's also a waste
269 +of time.
270 +
271 +Signed-off-by: Mike Frysinger <vapier@g.o>
272 +---
273 + arch/x86/Makefile | 2 ++
274 + 1 file changed, 2 insertions(+)
275 +
276 +diff --git a/arch/x86/Makefile b/arch/x86/Makefile
277 +index 60135cbd905c..9b15b2daa77f 100644
278 +--- a/arch/x86/Makefile
279 ++++ b/arch/x86/Makefile
280 +@@ -249,8 +249,10 @@ ifneq ($(RETPOLINE_CFLAGS),)
281 + endif
282 + endif
283 +
284 ++ifneq ($(filter-out headers_install,$(MAKECMDGOALS)),)
285 + archscripts: scripts_basic
286 + $(Q)$(MAKE) $(build)=arch/x86/tools relocs
287 ++endif
288 +
289 + ###
290 + # Syscall table generation
291 +--
292 +2.16.1
293 +
294
295 diff --git a/4.19/00_all_0007-netlink-drop-int-cast-on-length-arg-in-NLMSG_OK.patch b/4.19/00_all_0007-netlink-drop-int-cast-on-length-arg-in-NLMSG_OK.patch
296 new file mode 100644
297 index 0000000..1fed99d
298 --- /dev/null
299 +++ b/4.19/00_all_0007-netlink-drop-int-cast-on-length-arg-in-NLMSG_OK.patch
300 @@ -0,0 +1,43 @@
301 +From cb87a9562cca933c97a482f09a36542b876608e8 Mon Sep 17 00:00:00 2001
302 +From: Mike Frysinger <vapier@g.o>
303 +Date: Thu, 5 Mar 2015 00:26:58 -0500
304 +Subject: [PATCH] netlink: drop (int) cast on length arg in NLMSG_OK
305 +
306 +The NLMSG_OK macro compares three things:
307 + - the len arg from the user
308 + - a size_t: sizeof(struct nlmsghdr)
309 + - an int: sizeof(struct nlmsghdr) casted
310 + - an u32: the nlmsghdr->nlmsg_len member
311 +
312 +When building with -Wsign-compare, this macro triggers a signed compare
313 +warning. This is because it compares len to an int, and then compares
314 +it to a u32. If len is signed, we get a warning due to the last test.
315 +If len is unsigned, we get a warning due to the first test. Like in
316 +strace:
317 +socketutils.c:145:8: warning: comparison between signed and unsigned
318 + integer expressions [-Wsign-compare]
319 +
320 +Lets drop the int cast on the first sizeof. This way, once the user
321 +casts len to an unsigned value, everything shakes out correctly.
322 +
323 +Signed-off-by: Mike Frysinger <vapier@g.o>
324 +---
325 + include/uapi/linux/netlink.h | 2 +-
326 + 1 file changed, 1 insertion(+), 1 deletion(-)
327 +
328 +diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h
329 +index 776bc92e9118..d0c4df5fa670 100644
330 +--- a/include/uapi/linux/netlink.h
331 ++++ b/include/uapi/linux/netlink.h
332 +@@ -94,7 +94,7 @@ struct nlmsghdr {
333 + #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
334 + #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
335 + (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
336 +-#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
337 ++#define NLMSG_OK(nlh,len) ((len) >= sizeof(struct nlmsghdr) && \
338 + (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
339 + (nlh)->nlmsg_len <= (len))
340 + #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
341 +--
342 +2.16.1
343 +
344
345 diff --git a/4.19/00_all_0008-uapi-fix-System-V-buf-header-includes.patch b/4.19/00_all_0008-uapi-fix-System-V-buf-header-includes.patch
346 new file mode 100644
347 index 0000000..fce1944
348 --- /dev/null
349 +++ b/4.19/00_all_0008-uapi-fix-System-V-buf-header-includes.patch
350 @@ -0,0 +1,76 @@
351 +From beac664726b0b5b5c833aaf6576ca583534406ba Mon Sep 17 00:00:00 2001
352 +From: Mike Frysinger <vapier@g.o>
353 +Date: Mon, 2 Nov 2015 13:30:12 -0500
354 +Subject: [PATCH] uapi: fix System V buf header includes
355 +
356 +These headers rely on kernel types but don't include the other headers
357 +that define them. So when you try to include them directly, you often
358 +hit build failures due to unknown types.
359 +
360 +Signed-off-by: Mike Frysinger <vapier@g.o>
361 +---
362 + include/uapi/asm-generic/ipcbuf.h | 2 ++
363 + include/uapi/asm-generic/msgbuf.h | 3 +++
364 + include/uapi/asm-generic/sembuf.h | 2 ++
365 + include/uapi/asm-generic/shmbuf.h | 2 ++
366 + 4 files changed, 9 insertions(+)
367 +
368 +diff --git a/include/uapi/asm-generic/ipcbuf.h b/include/uapi/asm-generic/ipcbuf.h
369 +index 7d80dbd336fb..b4534bfd63e4 100644
370 +--- a/include/uapi/asm-generic/ipcbuf.h
371 ++++ b/include/uapi/asm-generic/ipcbuf.h
372 +@@ -2,6 +2,8 @@
373 + #ifndef __ASM_GENERIC_IPCBUF_H
374 + #define __ASM_GENERIC_IPCBUF_H
375 +
376 ++#include <linux/types.h>
377 ++
378 + /*
379 + * The generic ipc64_perm structure:
380 + * Note extra padding because this structure is passed back and forth
381 +diff --git a/include/uapi/asm-generic/msgbuf.h b/include/uapi/asm-generic/msgbuf.h
382 +index fb306ebdb36f..f28b8e6fe931 100644
383 +--- a/include/uapi/asm-generic/msgbuf.h
384 ++++ b/include/uapi/asm-generic/msgbuf.h
385 +@@ -2,7 +2,10 @@
386 + #ifndef __ASM_GENERIC_MSGBUF_H
387 + #define __ASM_GENERIC_MSGBUF_H
388 +
389 ++#include <linux/types.h>
390 + #include <asm/bitsperlong.h>
391 ++#include <asm/ipcbuf.h>
392 ++
393 + /*
394 + * generic msqid64_ds structure.
395 + *
396 +diff --git a/include/uapi/asm-generic/sembuf.h b/include/uapi/asm-generic/sembuf.h
397 +index cbf9cfe977d6..3058e1ec00b5 100644
398 +--- a/include/uapi/asm-generic/sembuf.h
399 ++++ b/include/uapi/asm-generic/sembuf.h
400 +@@ -2,7 +2,9 @@
401 + #ifndef __ASM_GENERIC_SEMBUF_H
402 + #define __ASM_GENERIC_SEMBUF_H
403 +
404 ++#include <linux/types.h>
405 + #include <asm/bitsperlong.h>
406 ++#include <asm/ipcbuf.h>
407 +
408 + /*
409 + * The semid64_ds structure for x86 architecture.
410 +diff --git a/include/uapi/asm-generic/shmbuf.h b/include/uapi/asm-generic/shmbuf.h
411 +index 2b6c3bb97f97..a0171147d796 100644
412 +--- a/include/uapi/asm-generic/shmbuf.h
413 ++++ b/include/uapi/asm-generic/shmbuf.h
414 +@@ -2,7 +2,9 @@
415 + #ifndef __ASM_GENERIC_SHMBUF_H
416 + #define __ASM_GENERIC_SHMBUF_H
417 +
418 ++#include <linux/types.h>
419 + #include <asm/bitsperlong.h>
420 ++#include <asm/ipcbuf.h>
421 +
422 + /*
423 + * The shmid64_ds structure for x86 architecture.
424 +--
425 +2.16.1
426 +