From: Greg Kroah-Hartman Date: Fri, 11 Aug 2023 15:41:02 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.14.323~75 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=17c5ea903cb71507139d0994dc84e5aba62c0b59;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: ipv6-adjust-ndisc_is_useropt-to-also-return-true-for-pio.patch mmc-moxart-read-scr-register-without-changing-byte-order.patch series wireguard-allowedips-expand-maximum-node-depth.patch --- diff --git a/queue-5.10/ipv6-adjust-ndisc_is_useropt-to-also-return-true-for-pio.patch b/queue-5.10/ipv6-adjust-ndisc_is_useropt-to-also-return-true-for-pio.patch new file mode 100644 index 00000000000..516947a434e --- /dev/null +++ b/queue-5.10/ipv6-adjust-ndisc_is_useropt-to-also-return-true-for-pio.patch @@ -0,0 +1,57 @@ +From 048c796beb6eb4fa3a5a647ee1c81f5c6f0f6a2a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= +Date: Mon, 7 Aug 2023 03:25:32 -0700 +Subject: ipv6: adjust ndisc_is_useropt() to also return true for PIO +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Maciej Żenczykowski + +commit 048c796beb6eb4fa3a5a647ee1c81f5c6f0f6a2a upstream. + +The upcoming (and nearly finalized): + https://datatracker.ietf.org/doc/draft-collink-6man-pio-pflag/ +will update the IPv6 RA to include a new flag in the PIO field, +which will serve as a hint to perform DHCPv6-PD. + +As we don't want DHCPv6 related logic inside the kernel, this piece of +information needs to be exposed to userspace. The simplest option is to +simply expose the entire PIO through the already existing mechanism. + +Even without this new flag, the already existing PIO R (router address) +flag (from RFC6275) cannot AFAICT be handled entirely in kernel, +and provides useful information that should be exposed to userspace +(the router's global address, for use by Mobile IPv6). + +Also cc'ing stable@ for inclusion in LTS, as while technically this is +not quite a bugfix, and instead more of a feature, it is absolutely +trivial and the alternative is manually cherrypicking into all Android +Common Kernel trees - and I know Greg will ask for it to be sent in via +LTS instead... + +Cc: Jen Linkova +Cc: Lorenzo Colitti +Cc: David Ahern +Cc: YOSHIFUJI Hideaki / 吉藤英明 +Cc: stable@vger.kernel.org +Signed-off-by: Maciej Żenczykowski +Link: https://lore.kernel.org/r/20230807102533.1147559-1-maze@google.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/ndisc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/net/ipv6/ndisc.c ++++ b/net/ipv6/ndisc.c +@@ -196,7 +196,8 @@ static struct nd_opt_hdr *ndisc_next_opt + static inline int ndisc_is_useropt(const struct net_device *dev, + struct nd_opt_hdr *opt) + { +- return opt->nd_opt_type == ND_OPT_RDNSS || ++ return opt->nd_opt_type == ND_OPT_PREFIX_INFO || ++ opt->nd_opt_type == ND_OPT_RDNSS || + opt->nd_opt_type == ND_OPT_DNSSL || + opt->nd_opt_type == ND_OPT_CAPTIVE_PORTAL || + opt->nd_opt_type == ND_OPT_PREF64 || diff --git a/queue-5.10/mmc-moxart-read-scr-register-without-changing-byte-order.patch b/queue-5.10/mmc-moxart-read-scr-register-without-changing-byte-order.patch new file mode 100644 index 00000000000..569295664d0 --- /dev/null +++ b/queue-5.10/mmc-moxart-read-scr-register-without-changing-byte-order.patch @@ -0,0 +1,44 @@ +From d44263222134b5635932974c6177a5cba65a07e8 Mon Sep 17 00:00:00 2001 +From: Sergei Antonov +Date: Tue, 27 Jun 2023 15:05:49 +0300 +Subject: mmc: moxart: read scr register without changing byte order + +From: Sergei Antonov + +commit d44263222134b5635932974c6177a5cba65a07e8 upstream. + +Conversion from big-endian to native is done in a common function +mmc_app_send_scr(). Converting in moxart_transfer_pio() is extra. +Double conversion on a LE system returns an incorrect SCR value, +leads to errors: + +mmc0: unrecognised SCR structure version 8 + +Fixes: 1b66e94e6b99 ("mmc: moxart: Add MOXA ART SD/MMC driver") +Signed-off-by: Sergei Antonov +Cc: Jonas Jensen +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20230627120549.2400325-1-saproj@gmail.com +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/host/moxart-mmc.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +--- a/drivers/mmc/host/moxart-mmc.c ++++ b/drivers/mmc/host/moxart-mmc.c +@@ -339,13 +339,7 @@ static void moxart_transfer_pio(struct m + return; + } + for (len = 0; len < remain && len < host->fifo_width;) { +- /* SCR data must be read in big endian. */ +- if (data->mrq->cmd->opcode == SD_APP_SEND_SCR) +- *sgp = ioread32be(host->base + +- REG_DATA_WINDOW); +- else +- *sgp = ioread32(host->base + +- REG_DATA_WINDOW); ++ *sgp = ioread32(host->base + REG_DATA_WINDOW); + sgp++; + len += 4; + } diff --git a/queue-5.10/series b/queue-5.10/series new file mode 100644 index 00000000000..019dbc46a9f --- /dev/null +++ b/queue-5.10/series @@ -0,0 +1,3 @@ +wireguard-allowedips-expand-maximum-node-depth.patch +mmc-moxart-read-scr-register-without-changing-byte-order.patch +ipv6-adjust-ndisc_is_useropt-to-also-return-true-for-pio.patch diff --git a/queue-5.10/wireguard-allowedips-expand-maximum-node-depth.patch b/queue-5.10/wireguard-allowedips-expand-maximum-node-depth.patch new file mode 100644 index 00000000000..dfb2d68c244 --- /dev/null +++ b/queue-5.10/wireguard-allowedips-expand-maximum-node-depth.patch @@ -0,0 +1,97 @@ +From 46622219aae2b67813fe31a7b8cb7da5baff5c8a Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Mon, 7 Aug 2023 15:21:27 +0200 +Subject: wireguard: allowedips: expand maximum node depth + +From: Jason A. Donenfeld + +commit 46622219aae2b67813fe31a7b8cb7da5baff5c8a upstream. + +In the allowedips self-test, nodes are inserted into the tree, but it +generated an even amount of nodes, but for checking maximum node depth, +there is of course the root node, which makes the total number +necessarily odd. With two few nodes added, it never triggered the +maximum depth check like it should have. So, add 129 nodes instead of +128 nodes, and do so with a more straightforward scheme, starting with +all the bits set, and shifting over one each time. Then increase the +maximum depth to 129, and choose a better name for that variable to +make it clear that it represents depth as opposed to bits. + +Cc: stable@vger.kernel.org +Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") +Signed-off-by: Jason A. Donenfeld +Link: https://lore.kernel.org/r/20230807132146.2191597-2-Jason@zx2c4.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireguard/allowedips.c | 8 ++++---- + drivers/net/wireguard/selftest/allowedips.c | 16 ++++++++++------ + 2 files changed, 14 insertions(+), 10 deletions(-) + +--- a/drivers/net/wireguard/allowedips.c ++++ b/drivers/net/wireguard/allowedips.c +@@ -6,7 +6,7 @@ + #include "allowedips.h" + #include "peer.h" + +-enum { MAX_ALLOWEDIPS_BITS = 128 }; ++enum { MAX_ALLOWEDIPS_DEPTH = 129 }; + + static struct kmem_cache *node_cache; + +@@ -42,7 +42,7 @@ static void push_rcu(struct allowedips_n + struct allowedips_node __rcu *p, unsigned int *len) + { + if (rcu_access_pointer(p)) { +- if (WARN_ON(IS_ENABLED(DEBUG) && *len >= MAX_ALLOWEDIPS_BITS)) ++ if (WARN_ON(IS_ENABLED(DEBUG) && *len >= MAX_ALLOWEDIPS_DEPTH)) + return; + stack[(*len)++] = rcu_dereference_raw(p); + } +@@ -55,7 +55,7 @@ static void node_free_rcu(struct rcu_hea + + static void root_free_rcu(struct rcu_head *rcu) + { +- struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_BITS] = { ++ struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_DEPTH] = { + container_of(rcu, struct allowedips_node, rcu) }; + unsigned int len = 1; + +@@ -68,7 +68,7 @@ static void root_free_rcu(struct rcu_hea + + static void root_remove_peer_lists(struct allowedips_node *root) + { +- struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_BITS] = { root }; ++ struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_DEPTH] = { root }; + unsigned int len = 1; + + while (len > 0 && (node = stack[--len])) { +--- a/drivers/net/wireguard/selftest/allowedips.c ++++ b/drivers/net/wireguard/selftest/allowedips.c +@@ -593,16 +593,20 @@ bool __init wg_allowedips_selftest(void) + wg_allowedips_remove_by_peer(&t, a, &mutex); + test_negative(4, a, 192, 168, 0, 1); + +- /* These will hit the WARN_ON(len >= MAX_ALLOWEDIPS_BITS) in free_node ++ /* These will hit the WARN_ON(len >= MAX_ALLOWEDIPS_DEPTH) in free_node + * if something goes wrong. + */ +- for (i = 0; i < MAX_ALLOWEDIPS_BITS; ++i) { +- part = cpu_to_be64(~(1LLU << (i % 64))); +- memset(&ip, 0xff, 16); +- memcpy((u8 *)&ip + (i < 64) * 8, &part, 8); ++ for (i = 0; i < 64; ++i) { ++ part = cpu_to_be64(~0LLU << i); ++ memset(&ip, 0xff, 8); ++ memcpy((u8 *)&ip + 8, &part, 8); ++ wg_allowedips_insert_v6(&t, &ip, 128, a, &mutex); ++ memcpy(&ip, &part, 8); ++ memset((u8 *)&ip + 8, 0, 8); + wg_allowedips_insert_v6(&t, &ip, 128, a, &mutex); + } +- ++ memset(&ip, 0, 16); ++ wg_allowedips_insert_v6(&t, &ip, 128, a, &mutex); + wg_allowedips_free(&t, &mutex); + + wg_allowedips_init(&t);