From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12138 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Updates for linux v4.14 Date: Mon, 27 Nov 2017 02:27:23 +0100 Message-ID: <20171127012723.GH15263@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Q8BnQc91gJZX4vDc" X-Trace: blaine.gmane.org 1511746057 19041 195.159.176.226 (27 Nov 2017 01:27:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 27 Nov 2017 01:27:37 +0000 (UTC) User-Agent: Mutt/1.6.0 (2016-04-01) To: musl@lists.openwall.com Original-X-From: musl-return-12154-gllmg-musl=m.gmane.org@lists.openwall.com Mon Nov 27 02:27:33 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1eJ8Co-0004RL-DP for gllmg-musl@m.gmane.org; Mon, 27 Nov 2017 02:27:30 +0100 Original-Received: (qmail 5720 invoked by uid 550); 27 Nov 2017 01:27:35 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5683 invoked from network); 27 Nov 2017 01:27:35 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline Xref: news.gmane.org gmane.linux.lib.musl.general:12138 Archived-At: --Q8BnQc91gJZX4vDc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline linux v4.14 changes and a few missing earlier ones, build tested on most targets. Szabolcs Nagy (10): sys/socket.h: add PF_SMC from linux v4.11 sys/socket.h: add SOL_TLS from linux v4.13 sys/socket.h: add MSG_ZEROCOPY from linux v4.14 sys/mman.h: add MADV_WIPEONFORK from linux v4.14 aarch64: add HWCAP_DCPOP from linux v4.14 signal.h: add missing SIGTRAP and SIGSYS si_codes net/if_arp.h: add ARPHRD_RAWIP from linux v4.14 netinet/if_ether.h: add new ETH_P_ macros from linux v4.14 sys/{mman,shm}.h: add {MAP,SHM}_HUGE_ macros from linux uapi netinet/tcp.h: add tcp_diag_md5sig struct from linux v4.14 arch/aarch64/bits/hwcap.h | 1 + include/net/if_arp.h | 1 + include/netinet/if_ether.h | 4 ++++ include/netinet/tcp.h | 8 ++++++++ include/signal.h | 3 +++ include/sys/mman.h | 15 +++++++++++++++ include/sys/shm.h | 13 +++++++++++++ include/sys/socket.h | 7 ++++++- 8 files changed, 51 insertions(+), 1 deletion(-) -- 2.15.0 --Q8BnQc91gJZX4vDc Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-sys-socket.h-add-PF_SMC-from-linux-v4.11.patch" >From 4df81b7110f106a7177decfd129e7a6e39456b16 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 26 Nov 2017 22:21:31 +0000 Subject: [PATCH 01/10] sys/socket.h: add PF_SMC from linux v4.11 add AF_SMC and PF_SMC for the IBM shared memory communication protocol. new in linux commit ac7138746e14137a451f8539614cdd349153e0c0 (linux socket.h is not in uapi so this update was missed earlier) --- include/sys/socket.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/sys/socket.h b/include/sys/socket.h index 051d20e0..396a47ad 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -108,7 +108,8 @@ struct linger { #define PF_VSOCK 40 #define PF_KCM 41 #define PF_QIPCRTR 42 -#define PF_MAX 43 +#define PF_SMC 43 +#define PF_MAX 44 #define AF_UNSPEC PF_UNSPEC #define AF_LOCAL PF_LOCAL @@ -156,6 +157,7 @@ struct linger { #define AF_VSOCK PF_VSOCK #define AF_KCM PF_KCM #define AF_QIPCRTR PF_QIPCRTR +#define AF_SMC PF_SMC #define AF_MAX PF_MAX #ifndef SO_DEBUG -- 2.15.0 --Q8BnQc91gJZX4vDc Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0002-sys-socket.h-add-SOL_TLS-from-linux-v4.13.patch" >From a54739c62ac6a41b5e41a656834b47995b9f3ccb Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 26 Nov 2017 22:34:31 +0000 Subject: [PATCH 02/10] sys/socket.h: add SOL_TLS from linux v4.13 socket option for kernel TLS support new in linux commit 3c4d7559159bfe1e3b94df3a657b2cda3a34e218 --- include/sys/socket.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sys/socket.h b/include/sys/socket.h index 396a47ad..26d16bdf 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -263,6 +263,7 @@ struct linger { #define SOL_ALG 279 #define SOL_NFC 280 #define SOL_KCM 281 +#define SOL_TLS 282 #define SOMAXCONN 128 -- 2.15.0 --Q8BnQc91gJZX4vDc Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-sys-socket.h-add-MSG_ZEROCOPY-from-linux-v4.14.patch" >From 387eebf8d406d9a293180f1949170178b3ffe1a6 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 26 Nov 2017 22:53:48 +0000 Subject: [PATCH 03/10] sys/socket.h: add MSG_ZEROCOPY from linux v4.14 MSG_ZEROCOPY socket send flag avoids copy in the kernel new in linux commit 52267790ef52d7513879238ca9fac22c1733e0e3 SO_ZEROCOPY socket option enables MSG_ZEROCOPY if availale new in linux commit 76851d1212c11365362525e1e2c0a18c97478e6b --- include/sys/socket.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/sys/socket.h b/include/sys/socket.h index 26d16bdf..507da5cc 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -232,6 +232,7 @@ struct linger { #define SO_COOKIE 57 #define SCM_TIMESTAMPING_PKTINFO 58 #define SO_PEERGROUPS 59 +#define SO_ZEROCOPY 60 #ifndef SOL_SOCKET #define SOL_SOCKET 1 @@ -285,6 +286,7 @@ struct linger { #define MSG_MORE 0x8000 #define MSG_WAITFORONE 0x10000 #define MSG_BATCH 0x40000 +#define MSG_ZEROCOPY 0x4000000 #define MSG_FASTOPEN 0x20000000 #define MSG_CMSG_CLOEXEC 0x40000000 -- 2.15.0 --Q8BnQc91gJZX4vDc Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0004-sys-mman.h-add-MADV_WIPEONFORK-from-linux-v4.14.patch" >From 78fa38ccfbcadeec6f7c6c7676bf6888023b9a67 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 26 Nov 2017 21:54:30 +0000 Subject: [PATCH 04/10] sys/mman.h: add MADV_WIPEONFORK from linux v4.14 allows zeroing anonymous private pages inherited by a child process. new in linux commit d2cd9ede6e193dd7d88b6d27399e96229a551b19 --- include/sys/mman.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/sys/mman.h b/include/sys/mman.h index 8a5149c9..12318782 100644 --- a/include/sys/mman.h +++ b/include/sys/mman.h @@ -72,6 +72,8 @@ extern "C" { #define MADV_NOHUGEPAGE 15 #define MADV_DONTDUMP 16 #define MADV_DODUMP 17 +#define MADV_WIPEONFORK 18 +#define MADV_KEEPONFORK 19 #define MADV_HWPOISON 100 #define MADV_SOFT_OFFLINE 101 #endif -- 2.15.0 --Q8BnQc91gJZX4vDc Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0005-aarch64-add-HWCAP_DCPOP-from-linux-v4.14.patch" >From e0bec581f1b2c23f1d8849003a3a36734b28bd37 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 26 Nov 2017 23:05:45 +0000 Subject: [PATCH 05/10] aarch64: add HWCAP_DCPOP from linux v4.14 indicates ARMv8.2-DCPoP persistent memory support extension. new in linux commit 7aac405ebb3224037efd56b73d82d181111cdac3 --- arch/aarch64/bits/hwcap.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/aarch64/bits/hwcap.h b/arch/aarch64/bits/hwcap.h index 11396d31..87f71ff3 100644 --- a/arch/aarch64/bits/hwcap.h +++ b/arch/aarch64/bits/hwcap.h @@ -14,3 +14,4 @@ #define HWCAP_JSCVT (1 << 13) #define HWCAP_FCMA (1 << 14) #define HWCAP_LRCPC (1 << 15) +#define HWCAP_DCPOP (1 << 16) -- 2.15.0 --Q8BnQc91gJZX4vDc Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0006-signal.h-add-missing-SIGTRAP-and-SIGSYS-si_codes.patch" >From 5d8d553c4acdca05e96dd3468062568a0a3b1c8d Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 26 Nov 2017 23:20:38 +0000 Subject: [PATCH 06/10] signal.h: add missing SIGTRAP and SIGSYS si_codes SYS_SECCOMP new in commit a0727e8ce513fe6890416da960181ceb10fbfae6 TRAP_BRANCH and TRAP_HWBKPT new in commit da654b74bda14c45a7d98c731bf3c1a43b6b74e2 --- include/signal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/signal.h b/include/signal.h index 2c8b3d55..1db5af5f 100644 --- a/include/signal.h +++ b/include/signal.h @@ -231,6 +231,8 @@ int sigrelse(int); void (*sigset(int, void (*)(int)))(int); #define TRAP_BRKPT 1 #define TRAP_TRACE 2 +#define TRAP_BRANCH 3 +#define TRAP_HWBKPT 4 #define POLL_IN 1 #define POLL_OUT 2 #define POLL_MSG 3 @@ -241,6 +243,7 @@ void (*sigset(int, void (*)(int)))(int); #define SS_DISABLE 2 #define SS_AUTODISARM (1U << 31) #define SS_FLAG_BITS SS_AUTODISARM +#define SYS_SECCOMP 1 #endif #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) -- 2.15.0 --Q8BnQc91gJZX4vDc Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0007-net-if_arp.h-add-ARPHRD_RAWIP-from-linux-v4.14.patch" >From 8c1f081568aca29685b9bc7dfceb03da5da5c8ad Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 26 Nov 2017 23:26:26 +0000 Subject: [PATCH 07/10] net/if_arp.h: add ARPHRD_RAWIP from linux v4.14 new in linux commmit cdf4969c42a6c1a376dd03a9e846cf638d3cd4b1 --- include/net/if_arp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/net/if_arp.h b/include/net/if_arp.h index c832ff95..27becc83 100644 --- a/include/net/if_arp.h +++ b/include/net/if_arp.h @@ -59,6 +59,7 @@ struct arphdr { #define ARPHRD_LAPB 516 #define ARPHRD_DDCMP 517 #define ARPHRD_RAWHDLC 518 +#define ARPHRD_RAWIP 519 #define ARPHRD_TUNNEL 768 #define ARPHRD_TUNNEL6 769 -- 2.15.0 --Q8BnQc91gJZX4vDc Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0008-netinet-if_ether.h-add-new-ETH_P_-macros-from-linux-.patch" >From d892c3e61ae20ee173b096cba3c0c3dc912164f9 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 26 Nov 2017 23:36:17 +0000 Subject: [PATCH 08/10] netinet/if_ether.h: add new ETH_P_ macros from linux v4.14 new ethertypes in linux v4.14: ETH_P_ERSPAN new in 84e54fe0a5eaed696dee4019c396f8396f5a908b ETH_P_IFE new in 2804fd3af6ba5ae5737705b27146455eabe2e2f8 ETH_P_NSH new in 155e6f649757c902901e599c268f8b575ddac1f8 ETH_P_MAP new in 7373ae7e8f0bf2c0718422481da986db5058b005 --- include/netinet/if_ether.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h index d9a131aa..67d32734 100644 --- a/include/netinet/if_ether.h +++ b/include/netinet/if_ether.h @@ -53,6 +53,7 @@ #define ETH_P_AOE 0x88A2 #define ETH_P_8021AD 0x88A8 #define ETH_P_802_EX1 0x88B5 +#define ETH_P_ERSPAN 0x88BE #define ETH_P_TIPC 0x88CA #define ETH_P_MACSEC 0x88E5 #define ETH_P_8021AH 0x88E7 @@ -66,11 +67,13 @@ #define ETH_P_IBOE 0x8915 #define ETH_P_80221 0x8917 #define ETH_P_HSR 0x892F +#define ETH_P_NSH 0x894F #define ETH_P_LOOPBACK 0x9000 #define ETH_P_QINQ1 0x9100 #define ETH_P_QINQ2 0x9200 #define ETH_P_QINQ3 0x9300 #define ETH_P_EDSA 0xDADA +#define ETH_P_IFE 0xED3E #define ETH_P_AF_IUCV 0xFBFB #define ETH_P_802_3_MIN 0x0600 @@ -100,6 +103,7 @@ #define ETH_P_IEEE802154 0x00F6 #define ETH_P_CAIF 0x00F7 #define ETH_P_XDSA 0x00F8 +#define ETH_P_MAP 0x00F9 struct ethhdr { uint8_t h_dest[ETH_ALEN]; -- 2.15.0 --Q8BnQc91gJZX4vDc Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0009-sys-mman-shm-.h-add-MAP-SHM-_HUGE_-macros-from-linux.patch" >From 063a0dbb729c794940c2cb278dc1047825a3ff59 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 26 Nov 2017 23:58:25 +0000 Subject: [PATCH 09/10] sys/{mman,shm}.h: add {MAP,SHM}_HUGE_ macros from linux uapi *_HUGE_SHIFT, *_HUGE_2MB, *_HUGE_1GB are documented in the man page, so add all of the *_HUGE_* macros from linux uapi. if MAP_HUGETLB is set, top bits of the mmap flags encode the page size. see the linux commit aafd4562dfee81a40ba21b5ea3cf5e06664bc7f6 if SHM_HUGETLB is set, top bits of the shmget flags encode the page size. see the linux commit 4da243ac1cf6aeb30b7c555d56208982d66d6d33 *_HUGE_16GB is defined unsigned to avoid signed left shift ub. --- include/sys/mman.h | 13 +++++++++++++ include/sys/shm.h | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/include/sys/mman.h b/include/sys/mman.h index 12318782..d13d4ca3 100644 --- a/include/sys/mman.h +++ b/include/sys/mman.h @@ -35,6 +35,19 @@ extern "C" { #define MAP_HUGETLB 0x40000 #define MAP_FILE 0 +#define MAP_HUGE_SHIFT 26 +#define MAP_HUGE_MASK 0x3f +#define MAP_HUGE_64KB (16 << 26) +#define MAP_HUGE_512KB (19 << 26) +#define MAP_HUGE_1MB (20 << 26) +#define MAP_HUGE_2MB (21 << 26) +#define MAP_HUGE_8MB (23 << 26) +#define MAP_HUGE_16MB (24 << 26) +#define MAP_HUGE_256MB (28 << 26) +#define MAP_HUGE_1GB (30 << 26) +#define MAP_HUGE_2GB (31 << 26) +#define MAP_HUGE_16GB (34U << 26) + #define PROT_NONE 0 #define PROT_READ 1 #define PROT_WRITE 2 diff --git a/include/sys/shm.h b/include/sys/shm.h index 67be822b..e7d39ff6 100644 --- a/include/sys/shm.h +++ b/include/sys/shm.h @@ -40,6 +40,19 @@ extern "C" { #define SHM_HUGETLB 04000 #define SHM_NORESERVE 010000 +#define SHM_HUGE_SHIFT 26 +#define SHM_HUGE_MASK 0x3f +#define SHM_HUGE_64KB (16 << 26) +#define SHM_HUGE_512KB (19 << 26) +#define SHM_HUGE_1MB (20 << 26) +#define SHM_HUGE_2MB (21 << 26) +#define SHM_HUGE_8MB (23 << 26) +#define SHM_HUGE_16MB (24 << 26) +#define SHM_HUGE_256MB (28 << 26) +#define SHM_HUGE_1GB (30 << 26) +#define SHM_HUGE_2GB (31 << 26) +#define SHM_HUGE_16GB (34U << 26) + typedef unsigned long shmatt_t; void *shmat(int, const void *, int); -- 2.15.0 --Q8BnQc91gJZX4vDc Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0010-netinet-tcp.h-add-tcp_diag_md5sig-struct-from-linux-.patch" >From 2b45f8f91cacb71c961eda44e8678bc56b58eea9 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 27 Nov 2017 00:22:01 +0000 Subject: [PATCH 10/10] netinet/tcp.h: add tcp_diag_md5sig struct from linux v4.14 for querying tcp md5 signing keys. new in linux commit c03fa9bcacd9ac04595cc13f34f3445f0a5ecf13 --- include/netinet/tcp.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h index 4d20936a..94a4f8e2 100644 --- a/include/netinet/tcp.h +++ b/include/netinet/tcp.h @@ -220,6 +220,14 @@ struct tcp_md5sig { uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; }; +struct tcp_diag_md5sig { + uint8_t tcpm_family; + uint8_t tcpm_prefixlen; + uint16_t tcpm_keylen; + uint32_t tcpm_addr[4]; + uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; +}; + struct tcp_repair_window { uint32_t snd_wl1; uint32_t snd_wnd; -- 2.15.0 --Q8BnQc91gJZX4vDc--