From: Sasha Levin Date: Wed, 15 Feb 2023 16:33:45 +0000 (-0500) Subject: Fixes for 5.10 X-Git-Tag: v4.14.306~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d50aefd19619538d0154f43686324466ef5f390;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.10 Signed-off-by: Sasha Levin --- diff --git a/queue-5.10/alsa-hda-do-not-unset-preset-when-cleaning-up-codec.patch b/queue-5.10/alsa-hda-do-not-unset-preset-when-cleaning-up-codec.patch new file mode 100644 index 00000000000..fd1c7a66c50 --- /dev/null +++ b/queue-5.10/alsa-hda-do-not-unset-preset-when-cleaning-up-codec.patch @@ -0,0 +1,71 @@ +From defcbd50d9dac832f0ecba9c7fdeacb039dc9de6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 19 Jan 2023 15:32:35 +0100 +Subject: ALSA: hda: Do not unset preset when cleaning up codec + +From: Cezary Rojewski + +[ Upstream commit 87978e6ad45a16835cc58234451111091be3c59a ] + +Several functions that take part in codec's initialization and removal +are re-used by ASoC codec drivers implementations. Drivers mimic the +behavior of hda_codec_driver_probe/remove() found in +sound/pci/hda/hda_bind.c with their component->probe/remove() instead. + +One of the reasons for that is the expectation of +snd_hda_codec_device_new() to receive a valid pointer to an instance of +struct snd_card. This expectation can be met only once sound card +components probing commences. + +As ASoC sound card may be unbound without codec device being actually +removed from the system, unsetting ->preset in +snd_hda_codec_cleanup_for_unbind() interferes with module unload -> load +scenario causing null-ptr-deref. Preset is assigned only once, during +device/driver matching whereas ASoC codec driver's module reloading may +occur several times throughout the lifetime of an audio stack. + +Suggested-by: Takashi Iwai +Signed-off-by: Cezary Rojewski +Link: https://lore.kernel.org/r/20230119143235.1159814-1-cezary.rojewski@intel.com +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/hda/hda_bind.c | 2 ++ + sound/pci/hda/hda_codec.c | 1 - + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/sound/pci/hda/hda_bind.c b/sound/pci/hda/hda_bind.c +index 4efbcc41fdfb7..0a83afa5f373c 100644 +--- a/sound/pci/hda/hda_bind.c ++++ b/sound/pci/hda/hda_bind.c +@@ -143,6 +143,7 @@ static int hda_codec_driver_probe(struct device *dev) + + error: + snd_hda_codec_cleanup_for_unbind(codec); ++ codec->preset = NULL; + return err; + } + +@@ -159,6 +160,7 @@ static int hda_codec_driver_remove(struct device *dev) + if (codec->patch_ops.free) + codec->patch_ops.free(codec); + snd_hda_codec_cleanup_for_unbind(codec); ++ codec->preset = NULL; + module_put(dev->driver->owner); + return 0; + } +diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c +index 39281106477eb..fc4a64a83ff2f 100644 +--- a/sound/pci/hda/hda_codec.c ++++ b/sound/pci/hda/hda_codec.c +@@ -784,7 +784,6 @@ void snd_hda_codec_cleanup_for_unbind(struct hda_codec *codec) + snd_array_free(&codec->cvt_setups); + snd_array_free(&codec->spdif_out); + snd_array_free(&codec->verbs); +- codec->preset = NULL; + codec->follower_dig_outs = NULL; + codec->spdif_status_reset = 0; + snd_array_free(&codec->mixers); +-- +2.39.0 + diff --git a/queue-5.10/asoc-cs42l56-fix-dt-probe.patch b/queue-5.10/asoc-cs42l56-fix-dt-probe.patch new file mode 100644 index 00000000000..decf534bf54 --- /dev/null +++ b/queue-5.10/asoc-cs42l56-fix-dt-probe.patch @@ -0,0 +1,56 @@ +From 6585acbd105174f9e50d4b4b96aaa6fac83dcd6e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 26 Jan 2023 17:21:24 +0100 +Subject: ASoC: cs42l56: fix DT probe + +From: Arnd Bergmann + +[ Upstream commit e18c6da62edc780e4f4f3c9ce07bdacd69505182 ] + +While looking through legacy platform data users, I noticed that +the DT probing never uses data from the DT properties, as the +platform_data structure gets overwritten directly after it +is initialized. + +There have never been any boards defining the platform_data in +the mainline kernel either, so this driver so far only worked +with patched kernels or with the default values. + +For the benefit of possible downstream users, fix the DT probe +by no longer overwriting the data. + +Signed-off-by: Arnd Bergmann +Acked-by: Charles Keepax +Link: https://lore.kernel.org/r/20230126162203.2986339-1-arnd@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/cs42l56.c | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/sound/soc/codecs/cs42l56.c b/sound/soc/codecs/cs42l56.c +index d41e031931061..3c5ec47a8fe64 100644 +--- a/sound/soc/codecs/cs42l56.c ++++ b/sound/soc/codecs/cs42l56.c +@@ -1193,18 +1193,12 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client, + if (pdata) { + cs42l56->pdata = *pdata; + } else { +- pdata = devm_kzalloc(&i2c_client->dev, sizeof(*pdata), +- GFP_KERNEL); +- if (!pdata) +- return -ENOMEM; +- + if (i2c_client->dev.of_node) { + ret = cs42l56_handle_of_data(i2c_client, + &cs42l56->pdata); + if (ret != 0) + return ret; + } +- cs42l56->pdata = *pdata; + } + + if (cs42l56->pdata.gpio_nreset) { +-- +2.39.0 + diff --git a/queue-5.10/asoc-intel-sof_rt5682-always-set-dpcm_capture-for-am.patch b/queue-5.10/asoc-intel-sof_rt5682-always-set-dpcm_capture-for-am.patch new file mode 100644 index 00000000000..3a70de646a8 --- /dev/null +++ b/queue-5.10/asoc-intel-sof_rt5682-always-set-dpcm_capture-for-am.patch @@ -0,0 +1,49 @@ +From bc8f48224af3fe7bd0e5bfb14eaaa8807037f702 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 19 Jan 2023 18:34:56 +0200 +Subject: ASoC: Intel: sof_rt5682: always set dpcm_capture for amplifiers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pierre-Louis Bossart + +[ Upstream commit 324f065cdbaba1b879a63bf07e61ca156b789537 ] + +The amplifier may provide hardware support for I/V feedback, or +alternatively the firmware may generate an echo reference attached to +the SSP and dailink used for the amplifier. + +To avoid any issues with invalid/NULL substreams in the latter case, +always unconditionally set dpcm_capture. + +Link: https://github.com/thesofproject/linux/issues/4083 +Signed-off-by: Pierre-Louis Bossart +Reviewed-by: Ranjani Sridharan +Reviewed-by: Péter Ujfalusi +Reviewed-by: Bard Liao +Signed-off-by: Kai Vehmanen +Link: https://lore.kernel.org/r/20230119163459.2235843-2-kai.vehmanen@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/boards/sof_rt5682.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c +index 1f94fa5a15db6..5883d1fa3b7ed 100644 +--- a/sound/soc/intel/boards/sof_rt5682.c ++++ b/sound/soc/intel/boards/sof_rt5682.c +@@ -704,6 +704,9 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, + links[id].num_platforms = ARRAY_SIZE(platform_component); + links[id].nonatomic = true; + links[id].dpcm_playback = 1; ++ /* feedback stream or firmware-generated echo reference */ ++ links[id].dpcm_capture = 1; ++ + links[id].no_pcm = 1; + links[id].cpus = &cpus[id]; + links[id].num_cpus = 1; +-- +2.39.0 + diff --git a/queue-5.10/net-rose-fix-to-not-accept-on-connected-socket.patch b/queue-5.10/net-rose-fix-to-not-accept-on-connected-socket.patch new file mode 100644 index 00000000000..6d4588e185e --- /dev/null +++ b/queue-5.10/net-rose-fix-to-not-accept-on-connected-socket.patch @@ -0,0 +1,63 @@ +From 6ef475aa4a27196fc5e6eae9c6e026509d2c61d1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 25 Jan 2023 02:59:44 -0800 +Subject: net/rose: Fix to not accept on connected socket + +From: Hyunwoo Kim + +[ Upstream commit 14caefcf9837a2be765a566005ad82cd0d2a429f ] + +If you call listen() and accept() on an already connect()ed +rose socket, accept() can successfully connect. +This is because when the peer socket sends data to sendmsg, +the skb with its own sk stored in the connected socket's +sk->sk_receive_queue is connected, and rose_accept() dequeues +the skb waiting in the sk->sk_receive_queue. + +This creates a child socket with the sk of the parent +rose socket, which can cause confusion. + +Fix rose_listen() to return -EINVAL if the socket has +already been successfully connected, and add lock_sock +to prevent this issue. + +Signed-off-by: Hyunwoo Kim +Reviewed-by: Kuniyuki Iwashima +Link: https://lore.kernel.org/r/20230125105944.GA133314@ubuntu +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/rose/af_rose.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c +index 29a208ed8fb88..86c93cf1744b0 100644 +--- a/net/rose/af_rose.c ++++ b/net/rose/af_rose.c +@@ -487,6 +487,12 @@ static int rose_listen(struct socket *sock, int backlog) + { + struct sock *sk = sock->sk; + ++ lock_sock(sk); ++ if (sock->state != SS_UNCONNECTED) { ++ release_sock(sk); ++ return -EINVAL; ++ } ++ + if (sk->sk_state != TCP_LISTEN) { + struct rose_sock *rose = rose_sk(sk); + +@@ -496,8 +502,10 @@ static int rose_listen(struct socket *sock, int backlog) + memset(rose->dest_digis, 0, AX25_ADDR_LEN * ROSE_MAX_DIGIS); + sk->sk_max_ack_backlog = backlog; + sk->sk_state = TCP_LISTEN; ++ release_sock(sk); + return 0; + } ++ release_sock(sk); + + return -EOPNOTSUPP; + } +-- +2.39.0 + diff --git a/queue-5.10/net-sched-sch-bounds-check-priority.patch b/queue-5.10/net-sched-sch-bounds-check-priority.patch new file mode 100644 index 00000000000..ea7bda2813e --- /dev/null +++ b/queue-5.10/net-sched-sch-bounds-check-priority.patch @@ -0,0 +1,57 @@ +From 1b236b34082c3b2d948248e9f9ed0c2999208519 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Jan 2023 14:40:37 -0800 +Subject: net: sched: sch: Bounds check priority + +From: Kees Cook + +[ Upstream commit de5ca4c3852f896cacac2bf259597aab5e17d9e3 ] + +Nothing was explicitly bounds checking the priority index used to access +clpriop[]. WARN and bail out early if it's pathological. Seen with GCC 13: + +../net/sched/sch_htb.c: In function 'htb_activate_prios': +../net/sched/sch_htb.c:437:44: warning: array subscript [0, 31] is outside array bounds of 'struct htb_prio[8]' [-Warray-bounds=] + 437 | if (p->inner.clprio[prio].feed.rb_node) + | ~~~~~~~~~~~~~~~^~~~~~ +../net/sched/sch_htb.c:131:41: note: while referencing 'clprio' + 131 | struct htb_prio clprio[TC_HTB_NUMPRIO]; + | ^~~~~~ + +Cc: Jamal Hadi Salim +Cc: Cong Wang +Cc: Jiri Pirko +Cc: "David S. Miller" +Cc: Eric Dumazet +Cc: Jakub Kicinski +Cc: Paolo Abeni +Cc: netdev@vger.kernel.org +Signed-off-by: Kees Cook +Reviewed-by: Simon Horman +Reviewed-by: Cong Wang +Link: https://lore.kernel.org/r/20230127224036.never.561-kees@kernel.org +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +--- + net/sched/sch_htb.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c +index c3ba018fd083e..c3e773d2ca419 100644 +--- a/net/sched/sch_htb.c ++++ b/net/sched/sch_htb.c +@@ -405,7 +405,10 @@ static void htb_activate_prios(struct htb_sched *q, struct htb_class *cl) + while (cl->cmode == HTB_MAY_BORROW && p && mask) { + m = mask; + while (m) { +- int prio = ffz(~m); ++ unsigned int prio = ffz(~m); ++ ++ if (WARN_ON_ONCE(prio > ARRAY_SIZE(p->inner.clprio))) ++ break; + m &= ~(1 << prio); + + if (p->inner.clprio[prio].feed.rb_node) +-- +2.39.0 + diff --git a/queue-5.10/net-stmmac-do-not-stop-rx_clk-in-rx-lpi-state-for-qc.patch b/queue-5.10/net-stmmac-do-not-stop-rx_clk-in-rx-lpi-state-for-qc.patch new file mode 100644 index 00000000000..3824536c597 --- /dev/null +++ b/queue-5.10/net-stmmac-do-not-stop-rx_clk-in-rx-lpi-state-for-qc.patch @@ -0,0 +1,67 @@ +From 7b18e9e2c260056723fd6ef0b0fc7d89b83da820 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Jan 2023 00:35:39 +0300 +Subject: net: stmmac: do not stop RX_CLK in Rx LPI state for qcs404 SoC + +From: Andrey Konovalov + +[ Upstream commit 54aa39a513dbf2164ca462a19f04519b2407a224 ] + +Currently in phy_init_eee() the driver unconditionally configures the PHY +to stop RX_CLK after entering Rx LPI state. This causes an LPI interrupt +storm on my qcs404-base board. + +Change the PHY initialization so that for "qcom,qcs404-ethqos" compatible +device RX_CLK continues to run even in Rx LPI state. + +Signed-off-by: Andrey Konovalov +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 ++ + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- + include/linux/stmmac.h | 1 + + 3 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +index bfc4a92f1d92b..78be62ecc9a9a 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +@@ -505,6 +505,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev) + plat_dat->has_gmac4 = 1; + plat_dat->pmt = 1; + plat_dat->tso_en = of_property_read_bool(np, "snps,tso"); ++ if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) ++ plat_dat->rx_clk_runs_in_lpi = 1; + + ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); + if (ret) +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +index b52ca2fe04d87..1ec000d4c7705 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +@@ -1058,7 +1058,8 @@ static void stmmac_mac_link_up(struct phylink_config *config, + + stmmac_mac_set(priv, priv->ioaddr, true); + if (phy && priv->dma_cap.eee) { +- priv->eee_active = phy_init_eee(phy, 1) >= 0; ++ priv->eee_active = ++ phy_init_eee(phy, !priv->plat->rx_clk_runs_in_lpi) >= 0; + priv->eee_enabled = stmmac_eee_init(priv); + priv->tx_lpi_enabled = priv->eee_enabled; + stmmac_set_eee_pls(priv, priv->hw, true); +diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h +index 40df88728a6f4..abf7b8ec1fb64 100644 +--- a/include/linux/stmmac.h ++++ b/include/linux/stmmac.h +@@ -199,6 +199,7 @@ struct plat_stmmacenet_data { + int rss_en; + int mac_port_sel_speed; + bool en_tx_lpi_clockgating; ++ bool rx_clk_runs_in_lpi; + int has_xgmac; + bool vlan_fail_q_en; + u8 vlan_fail_q; +-- +2.39.0 + diff --git a/queue-5.10/nvme-fc-fix-a-missing-queue-put-in-nvmet_fc_ls_creat.patch b/queue-5.10/nvme-fc-fix-a-missing-queue-put-in-nvmet_fc_ls_creat.patch new file mode 100644 index 00000000000..fadbbc76126 --- /dev/null +++ b/queue-5.10/nvme-fc-fix-a-missing-queue-put-in-nvmet_fc_ls_creat.patch @@ -0,0 +1,41 @@ +From 9f28e0f66285bf98f5750f64307d725bb1ef51da Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 23 Jan 2023 14:37:28 +0200 +Subject: nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association + +From: Amit Engel + +[ Upstream commit 0cab4404874f2de52617de8400c844891c6ea1ce ] + +As part of nvmet_fc_ls_create_association there is a case where +nvmet_fc_alloc_target_queue fails right after a new association with an +admin queue is created. In this case, no one releases the get taken in +nvmet_fc_alloc_target_assoc. This fix is adding the missing put. + +Signed-off-by: Amit Engel +Reviewed-by: James Smart +Signed-off-by: Christoph Hellwig +Signed-off-by: Sasha Levin +--- + drivers/nvme/target/fc.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c +index 640031cbda7cc..46fc44ce86712 100644 +--- a/drivers/nvme/target/fc.c ++++ b/drivers/nvme/target/fc.c +@@ -1675,8 +1675,10 @@ nvmet_fc_ls_create_association(struct nvmet_fc_tgtport *tgtport, + else { + queue = nvmet_fc_alloc_target_queue(iod->assoc, 0, + be16_to_cpu(rqst->assoc_cmd.sqsize)); +- if (!queue) ++ if (!queue) { + ret = VERR_QUEUE_ALLOC_FAIL; ++ nvmet_fc_tgt_a_put(iod->assoc); ++ } + } + } + +-- +2.39.0 + diff --git a/queue-5.10/nvmem-core-add-error-handling-for-dev_set_name.patch b/queue-5.10/nvmem-core-add-error-handling-for-dev_set_name.patch new file mode 100644 index 00000000000..12a49540bce --- /dev/null +++ b/queue-5.10/nvmem-core-add-error-handling-for-dev_set_name.patch @@ -0,0 +1,58 @@ +From 47916c917f46d1c33a947c5a0227c37715c6055b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Sep 2022 13:20:50 +0100 +Subject: nvmem: core: add error handling for dev_set_name + +From: Gaosheng Cui + +[ Upstream commit 5544e90c81261e82e02bbf7c6015a4b9c8c825ef ] + +The type of return value of dev_set_name is int, which may return +wrong result, so we add error handling for it to reclaim memory +of nvmem resource, and return early when an error occurs. + +Signed-off-by: Gaosheng Cui +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20220916122100.170016-4-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman +Stable-dep-of: ab3428cfd9aa ("nvmem: core: fix registration vs use race") +Signed-off-by: Sasha Levin +--- + drivers/nvmem/core.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c +index 48fbe49e3772b..9da4edbabfe75 100644 +--- a/drivers/nvmem/core.c ++++ b/drivers/nvmem/core.c +@@ -661,18 +661,24 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) + + switch (config->id) { + case NVMEM_DEVID_NONE: +- dev_set_name(&nvmem->dev, "%s", config->name); ++ rval = dev_set_name(&nvmem->dev, "%s", config->name); + break; + case NVMEM_DEVID_AUTO: +- dev_set_name(&nvmem->dev, "%s%d", config->name, nvmem->id); ++ rval = dev_set_name(&nvmem->dev, "%s%d", config->name, nvmem->id); + break; + default: +- dev_set_name(&nvmem->dev, "%s%d", ++ rval = dev_set_name(&nvmem->dev, "%s%d", + config->name ? : "nvmem", + config->name ? config->id : nvmem->id); + break; + } + ++ if (rval) { ++ ida_free(&nvmem_ida, nvmem->id); ++ kfree(nvmem); ++ return ERR_PTR(rval); ++ } ++ + nvmem->read_only = device_property_present(config->dev, "read-only") || + config->read_only || !nvmem->reg_write; + +-- +2.39.0 + diff --git a/queue-5.10/nvmem-core-fix-cleanup-after-dev_set_name.patch b/queue-5.10/nvmem-core-fix-cleanup-after-dev_set_name.patch new file mode 100644 index 00000000000..04bc7fb172e --- /dev/null +++ b/queue-5.10/nvmem-core-fix-cleanup-after-dev_set_name.patch @@ -0,0 +1,97 @@ +From 5799877dd15679df553c5b6f7d52700d575ec1d3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Jan 2023 10:40:10 +0000 +Subject: nvmem: core: fix cleanup after dev_set_name() + +From: Russell King (Oracle) + +[ Upstream commit 560181d3ace61825f4ca9dd3481d6c0ee6709fa8 ] + +If dev_set_name() fails, we leak nvmem->wp_gpio as the cleanup does not +put this. While a minimal fix for this would be to add the gpiod_put() +call, we can do better if we split device_register(), and use the +tested nvmem_release() cleanup code by initialising the device early, +and putting the device. + +This results in a slightly larger fix, but results in clear code. + +Note: this patch depends on "nvmem: core: initialise nvmem->id early" +and "nvmem: core: remove nvmem_config wp_gpio". + +Fixes: 5544e90c8126 ("nvmem: core: add error handling for dev_set_name") +Cc: stable@vger.kernel.org +Reported-by: kernel test robot +Reported-by: Dan Carpenter +Signed-off-by: Russell King (Oracle) +[Srini: Fixed subject line and error code handing with wp_gpio while applying.] +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20230127104015.23839-6-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman +Stable-dep-of: ab3428cfd9aa ("nvmem: core: fix registration vs use race") +Signed-off-by: Sasha Levin +--- + drivers/nvmem/core.c | 22 ++++++++++------------ + 1 file changed, 10 insertions(+), 12 deletions(-) + +diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c +index 38c05fce7d740..de356cdde4ce8 100644 +--- a/drivers/nvmem/core.c ++++ b/drivers/nvmem/core.c +@@ -627,14 +627,18 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) + + nvmem->id = rval; + ++ nvmem->dev.type = &nvmem_provider_type; ++ nvmem->dev.bus = &nvmem_bus_type; ++ nvmem->dev.parent = config->dev; ++ ++ device_initialize(&nvmem->dev); ++ + if (!config->ignore_wp) + nvmem->wp_gpio = gpiod_get_optional(config->dev, "wp", + GPIOD_OUT_HIGH); + if (IS_ERR(nvmem->wp_gpio)) { +- ida_free(&nvmem_ida, nvmem->id); + rval = PTR_ERR(nvmem->wp_gpio); +- kfree(nvmem); +- return ERR_PTR(rval); ++ goto err_put_device; + } + + kref_init(&nvmem->refcnt); +@@ -646,9 +650,6 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) + nvmem->stride = config->stride ?: 1; + nvmem->word_size = config->word_size ?: 1; + nvmem->size = config->size; +- nvmem->dev.type = &nvmem_provider_type; +- nvmem->dev.bus = &nvmem_bus_type; +- nvmem->dev.parent = config->dev; + nvmem->root_only = config->root_only; + nvmem->priv = config->priv; + nvmem->type = config->type; +@@ -671,11 +672,8 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) + break; + } + +- if (rval) { +- ida_free(&nvmem_ida, nvmem->id); +- kfree(nvmem); +- return ERR_PTR(rval); +- } ++ if (rval) ++ goto err_put_device; + + nvmem->read_only = device_property_present(config->dev, "read-only") || + config->read_only || !nvmem->reg_write; +@@ -686,7 +684,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) + + dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name); + +- rval = device_register(&nvmem->dev); ++ rval = device_add(&nvmem->dev); + if (rval) + goto err_put_device; + +-- +2.39.0 + diff --git a/queue-5.10/nvmem-core-fix-registration-vs-use-race.patch b/queue-5.10/nvmem-core-fix-registration-vs-use-race.patch new file mode 100644 index 00000000000..67753a3e00d --- /dev/null +++ b/queue-5.10/nvmem-core-fix-registration-vs-use-race.patch @@ -0,0 +1,80 @@ +From f35e9aab2eb8882b2e4536ba56a9a73a972fd6a6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Jan 2023 10:40:11 +0000 +Subject: nvmem: core: fix registration vs use race + +From: Russell King (Oracle) + +[ Upstream commit ab3428cfd9aa2f3463ee4b2909b5bb2193bd0c4a ] + +The i.MX6 CPU frequency driver sometimes fails to register at boot time +due to nvmem_cell_read_u32() sporadically returning -ENOENT. + +This happens because there is a window where __nvmem_device_get() in +of_nvmem_cell_get() is able to return the nvmem device, but as cells +have been setup, nvmem_find_cell_entry_by_node() returns NULL. + +The occurs because the nvmem core registration code violates one of the +fundamental principles of kernel programming: do not publish data +structures before their setup is complete. + +Fix this by making nvmem core code conform with this principle. + +Fixes: eace75cfdcf7 ("nvmem: Add a simple NVMEM framework for nvmem providers") +Cc: stable@vger.kernel.org +Signed-off-by: Russell King (Oracle) +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20230127104015.23839-7-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/nvmem/core.c | 16 +++++++--------- + 1 file changed, 7 insertions(+), 9 deletions(-) + +diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c +index de356cdde4ce8..0ef7b95348b1b 100644 +--- a/drivers/nvmem/core.c ++++ b/drivers/nvmem/core.c +@@ -682,16 +682,10 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) + nvmem->dev.groups = nvmem_dev_groups; + #endif + +- dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name); +- +- rval = device_add(&nvmem->dev); +- if (rval) +- goto err_put_device; +- + if (config->compat) { + rval = nvmem_sysfs_setup_compat(nvmem, config); + if (rval) +- goto err_device_del; ++ goto err_put_device; + } + + if (config->cells) { +@@ -708,6 +702,12 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) + if (rval) + goto err_remove_cells; + ++ dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name); ++ ++ rval = device_add(&nvmem->dev); ++ if (rval) ++ goto err_remove_cells; ++ + blocking_notifier_call_chain(&nvmem_notifier, NVMEM_ADD, nvmem); + + return nvmem; +@@ -716,8 +716,6 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) + nvmem_device_remove_all_cells(nvmem); + if (config->compat) + nvmem_sysfs_remove_compat(nvmem, config); +-err_device_del: +- device_del(&nvmem->dev); + err_put_device: + put_device(&nvmem->dev); + +-- +2.39.0 + diff --git a/queue-5.10/nvmem-core-remove-nvmem_config-wp_gpio.patch b/queue-5.10/nvmem-core-remove-nvmem_config-wp_gpio.patch new file mode 100644 index 00000000000..745f9a5eba2 --- /dev/null +++ b/queue-5.10/nvmem-core-remove-nvmem_config-wp_gpio.patch @@ -0,0 +1,62 @@ +From 87caf86061df97e54328e5e905f0a2ef671d1416 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Jan 2023 10:40:09 +0000 +Subject: nvmem: core: remove nvmem_config wp_gpio + +From: Russell King (Oracle) + +[ Upstream commit 569653f022a29a1a44ea9de5308b657228303fa5 ] + +No one provides wp_gpio, so let's remove it to avoid issues with +the nvmem core putting this gpio. + +Cc: stable@vger.kernel.org +Signed-off-by: Russell King (Oracle) +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20230127104015.23839-5-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman +Stable-dep-of: ab3428cfd9aa ("nvmem: core: fix registration vs use race") +Signed-off-by: Sasha Levin +--- + drivers/nvmem/core.c | 4 +--- + include/linux/nvmem-provider.h | 2 -- + 2 files changed, 1 insertion(+), 5 deletions(-) + +diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c +index 9da4edbabfe75..38c05fce7d740 100644 +--- a/drivers/nvmem/core.c ++++ b/drivers/nvmem/core.c +@@ -627,9 +627,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) + + nvmem->id = rval; + +- if (config->wp_gpio) +- nvmem->wp_gpio = config->wp_gpio; +- else if (!config->ignore_wp) ++ if (!config->ignore_wp) + nvmem->wp_gpio = gpiod_get_optional(config->dev, "wp", + GPIOD_OUT_HIGH); + if (IS_ERR(nvmem->wp_gpio)) { +diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h +index 39ec67689898b..5e07f3cfad301 100644 +--- a/include/linux/nvmem-provider.h ++++ b/include/linux/nvmem-provider.h +@@ -49,7 +49,6 @@ enum nvmem_type { + * @word_size: Minimum read/write access granularity. + * @stride: Minimum read/write access stride. + * @priv: User context passed to read/write callbacks. +- * @wp-gpio: Write protect pin + * @ignore_wp: Write Protect pin is managed by the provider. + * + * Note: A default "nvmem" name will be assigned to the device if +@@ -64,7 +63,6 @@ struct nvmem_config { + const char *name; + int id; + struct module *owner; +- struct gpio_desc *wp_gpio; + const struct nvmem_cell_info *cells; + int ncells; + enum nvmem_type type; +-- +2.39.0 + diff --git a/queue-5.10/platform-x86-touchscreen_dmi-add-chuwi-vi8-cwi501-dm.patch b/queue-5.10/platform-x86-touchscreen_dmi-add-chuwi-vi8-cwi501-dm.patch new file mode 100644 index 00000000000..feace32595c --- /dev/null +++ b/queue-5.10/platform-x86-touchscreen_dmi-add-chuwi-vi8-cwi501-dm.patch @@ -0,0 +1,43 @@ +From bc2d73e9a7709060a9d57d2c6c39d7be10ff2196 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 2 Feb 2023 11:34:13 +0100 +Subject: platform/x86: touchscreen_dmi: Add Chuwi Vi8 (CWI501) DMI match + +From: Hans de Goede + +[ Upstream commit eecf2acd4a580e9364e5087daf0effca60a240b7 ] + +Add a DMI match for the CWI501 version of the Chuwi Vi8 tablet, +pointing to the same chuwi_vi8_data as the existing CWI506 version +DMI match. + +Signed-off-by: Hans de Goede +Link: https://lore.kernel.org/r/20230202103413.331459-1-hdegoede@redhat.com +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/touchscreen_dmi.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/drivers/platform/x86/touchscreen_dmi.c b/drivers/platform/x86/touchscreen_dmi.c +index bc26acace2c30..b96fbc8dba09d 100644 +--- a/drivers/platform/x86/touchscreen_dmi.c ++++ b/drivers/platform/x86/touchscreen_dmi.c +@@ -1030,6 +1030,15 @@ const struct dmi_system_id touchscreen_dmi_table[] = { + DMI_MATCH(DMI_BIOS_DATE, "05/07/2016"), + }, + }, ++ { ++ /* Chuwi Vi8 (CWI501) */ ++ .driver_data = (void *)&chuwi_vi8_data, ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Insyde"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "i86"), ++ DMI_MATCH(DMI_BIOS_VERSION, "CHUWI.W86JLBNR01"), ++ }, ++ }, + { + /* Chuwi Vi8 (CWI506) */ + .driver_data = (void *)&chuwi_vi8_data, +-- +2.39.0 + diff --git a/queue-5.10/s390-decompressor-specify-__decompress-buf-len-to-av.patch b/queue-5.10/s390-decompressor-specify-__decompress-buf-len-to-av.patch new file mode 100644 index 00000000000..ef29524e591 --- /dev/null +++ b/queue-5.10/s390-decompressor-specify-__decompress-buf-len-to-av.patch @@ -0,0 +1,47 @@ +From 86841901b41ae577a5f70556af6d4f6985f3ec9e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 29 Jan 2023 23:47:23 +0100 +Subject: s390/decompressor: specify __decompress() buf len to avoid overflow + +From: Vasily Gorbik + +[ Upstream commit 7ab41c2c08a32132ba8c14624910e2fe8ce4ba4b ] + +Historically calls to __decompress() didn't specify "out_len" parameter +on many architectures including s390, expecting that no writes beyond +uncompressed kernel image are performed. This has changed since commit +2aa14b1ab2c4 ("zstd: import usptream v1.5.2") which includes zstd library +commit 6a7ede3dfccb ("Reduce size of dctx by reutilizing dst buffer +(#2751)"). Now zstd decompression code might store literal buffer in +the unwritten portion of the destination buffer. Since "out_len" is +not set, it is considered to be unlimited and hence free to use for +optimization needs. On s390 this might corrupt initrd or ipl report +which are often placed right after the decompressor buffer. Luckily the +size of uncompressed kernel image is already known to the decompressor, +so to avoid the problem simply specify it in the "out_len" parameter. + +Link: https://github.com/facebook/zstd/commit/6a7ede3dfccb +Signed-off-by: Vasily Gorbik +Tested-by: Alexander Egorenkov +Link: https://lore.kernel.org/r/patch-1.thread-41c676.git-41c676c2d153.your-ad-here.call-01675030179-ext-9637@work.hours +Signed-off-by: Heiko Carstens +Signed-off-by: Sasha Levin +--- + arch/s390/boot/compressed/decompressor.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/s390/boot/compressed/decompressor.c b/arch/s390/boot/compressed/decompressor.c +index 3061b11c4d27f..8eaa1712a1c8d 100644 +--- a/arch/s390/boot/compressed/decompressor.c ++++ b/arch/s390/boot/compressed/decompressor.c +@@ -79,6 +79,6 @@ void *decompress_kernel(void) + void *output = (void *)decompress_offset; + + __decompress(_compressed_start, _compressed_end - _compressed_start, +- NULL, NULL, output, 0, NULL, error); ++ NULL, NULL, output, vmlinux.image_size, NULL, error); + return output; + } +-- +2.39.0 + diff --git a/queue-5.10/selftests-bpf-verify-copy_register_state-preserves-p.patch b/queue-5.10/selftests-bpf-verify-copy_register_state-preserves-p.patch new file mode 100644 index 00000000000..e82b9dae1fd --- /dev/null +++ b/queue-5.10/selftests-bpf-verify-copy_register_state-preserves-p.patch @@ -0,0 +1,68 @@ +From d61cef8e383c3078ccbccaf5b5ca59479c71f2bc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 6 Jan 2023 16:22:14 +0200 +Subject: selftests/bpf: Verify copy_register_state() preserves parent/live + fields + +From: Eduard Zingerman + +[ Upstream commit b9fa9bc839291020b362ab5392e5f18ba79657ac ] + +A testcase to check that verifier.c:copy_register_state() preserves +register parentage chain and livness information. + +Signed-off-by: Eduard Zingerman +Link: https://lore.kernel.org/r/20230106142214.1040390-3-eddyz87@gmail.com +Signed-off-by: Alexei Starovoitov +Signed-off-by: Sasha Levin +--- + .../selftests/bpf/verifier/search_pruning.c | 36 +++++++++++++++++++ + 1 file changed, 36 insertions(+) + +diff --git a/tools/testing/selftests/bpf/verifier/search_pruning.c b/tools/testing/selftests/bpf/verifier/search_pruning.c +index 7e50cb80873a5..7e36078f8f482 100644 +--- a/tools/testing/selftests/bpf/verifier/search_pruning.c ++++ b/tools/testing/selftests/bpf/verifier/search_pruning.c +@@ -154,3 +154,39 @@ + .result_unpriv = ACCEPT, + .insn_processed = 15, + }, ++/* The test performs a conditional 64-bit write to a stack location ++ * fp[-8], this is followed by an unconditional 8-bit write to fp[-8], ++ * then data is read from fp[-8]. This sequence is unsafe. ++ * ++ * The test would be mistakenly marked as safe w/o dst register parent ++ * preservation in verifier.c:copy_register_state() function. ++ * ++ * Note the usage of BPF_F_TEST_STATE_FREQ to force creation of the ++ * checkpoint state after conditional 64-bit assignment. ++ */ ++{ ++ "write tracking and register parent chain bug", ++ .insns = { ++ /* r6 = ktime_get_ns() */ ++ BPF_EMIT_CALL(BPF_FUNC_ktime_get_ns), ++ BPF_MOV64_REG(BPF_REG_6, BPF_REG_0), ++ /* r0 = ktime_get_ns() */ ++ BPF_EMIT_CALL(BPF_FUNC_ktime_get_ns), ++ /* if r0 > r6 goto +1 */ ++ BPF_JMP_REG(BPF_JGT, BPF_REG_0, BPF_REG_6, 1), ++ /* *(u64 *)(r10 - 8) = 0xdeadbeef */ ++ BPF_ST_MEM(BPF_DW, BPF_REG_FP, -8, 0xdeadbeef), ++ /* r1 = 42 */ ++ BPF_MOV64_IMM(BPF_REG_1, 42), ++ /* *(u8 *)(r10 - 8) = r1 */ ++ BPF_STX_MEM(BPF_B, BPF_REG_FP, BPF_REG_1, -8), ++ /* r2 = *(u64 *)(r10 - 8) */ ++ BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_FP, -8), ++ /* exit(0) */ ++ BPF_MOV64_IMM(BPF_REG_0, 0), ++ BPF_EXIT_INSN(), ++ }, ++ .flags = BPF_F_TEST_STATE_FREQ, ++ .errstr = "invalid read from stack off -8+1 size 8", ++ .result = REJECT, ++}, +-- +2.39.0 + diff --git a/queue-5.10/series b/queue-5.10/series new file mode 100644 index 00000000000..953587e5d86 --- /dev/null +++ b/queue-5.10/series @@ -0,0 +1,15 @@ +asoc-intel-sof_rt5682-always-set-dpcm_capture-for-am.patch +selftests-bpf-verify-copy_register_state-preserves-p.patch +alsa-hda-do-not-unset-preset-when-cleaning-up-codec.patch +asoc-cs42l56-fix-dt-probe.patch +tools-virtio-fix-the-vringh-test-for-virtio-ring-cha.patch +net-rose-fix-to-not-accept-on-connected-socket.patch +net-stmmac-do-not-stop-rx_clk-in-rx-lpi-state-for-qc.patch +net-sched-sch-bounds-check-priority.patch +s390-decompressor-specify-__decompress-buf-len-to-av.patch +nvme-fc-fix-a-missing-queue-put-in-nvmet_fc_ls_creat.patch +platform-x86-touchscreen_dmi-add-chuwi-vi8-cwi501-dm.patch +nvmem-core-add-error-handling-for-dev_set_name.patch +nvmem-core-remove-nvmem_config-wp_gpio.patch +nvmem-core-fix-cleanup-after-dev_set_name.patch +nvmem-core-fix-registration-vs-use-race.patch diff --git a/queue-5.10/tools-virtio-fix-the-vringh-test-for-virtio-ring-cha.patch b/queue-5.10/tools-virtio-fix-the-vringh-test-for-virtio-ring-cha.patch new file mode 100644 index 00000000000..8e0ec078ce3 --- /dev/null +++ b/queue-5.10/tools-virtio-fix-the-vringh-test-for-virtio-ring-cha.patch @@ -0,0 +1,148 @@ +From f113846fffa5e194a1136bf6092688b673ee9059 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 10 Jan 2023 12:43:10 +0900 +Subject: tools/virtio: fix the vringh test for virtio ring changes + +From: Shunsuke Mie + +[ Upstream commit 3f7b75abf41cc4143aa295f62acbb060a012868d ] + +Fix the build caused by missing kmsan_handle_dma() and is_power_of_2() that +are used in drivers/virtio/virtio_ring.c. + +Signed-off-by: Shunsuke Mie +Message-Id: <20230110034310.779744-1-mie@igel.co.jp> +Signed-off-by: Michael S. Tsirkin +Signed-off-by: Sasha Levin +--- + tools/virtio/linux/bug.h | 8 +++----- + tools/virtio/linux/build_bug.h | 7 +++++++ + tools/virtio/linux/cpumask.h | 7 +++++++ + tools/virtio/linux/gfp.h | 7 +++++++ + tools/virtio/linux/kernel.h | 1 + + tools/virtio/linux/kmsan.h | 12 ++++++++++++ + tools/virtio/linux/scatterlist.h | 1 + + tools/virtio/linux/topology.h | 7 +++++++ + 8 files changed, 45 insertions(+), 5 deletions(-) + create mode 100644 tools/virtio/linux/build_bug.h + create mode 100644 tools/virtio/linux/cpumask.h + create mode 100644 tools/virtio/linux/gfp.h + create mode 100644 tools/virtio/linux/kmsan.h + create mode 100644 tools/virtio/linux/topology.h + +diff --git a/tools/virtio/linux/bug.h b/tools/virtio/linux/bug.h +index b14c2c3b6b857..74aef964f5099 100644 +--- a/tools/virtio/linux/bug.h ++++ b/tools/virtio/linux/bug.h +@@ -1,11 +1,9 @@ + /* SPDX-License-Identifier: GPL-2.0 */ +-#ifndef BUG_H +-#define BUG_H ++#ifndef _LINUX_BUG_H ++#define _LINUX_BUG_H + + #define BUG_ON(__BUG_ON_cond) assert(!(__BUG_ON_cond)) + +-#define BUILD_BUG_ON(x) +- + #define BUG() abort() + +-#endif /* BUG_H */ ++#endif /* _LINUX_BUG_H */ +diff --git a/tools/virtio/linux/build_bug.h b/tools/virtio/linux/build_bug.h +new file mode 100644 +index 0000000000000..cdbb75e28a604 +--- /dev/null ++++ b/tools/virtio/linux/build_bug.h +@@ -0,0 +1,7 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++#ifndef _LINUX_BUILD_BUG_H ++#define _LINUX_BUILD_BUG_H ++ ++#define BUILD_BUG_ON(x) ++ ++#endif /* _LINUX_BUILD_BUG_H */ +diff --git a/tools/virtio/linux/cpumask.h b/tools/virtio/linux/cpumask.h +new file mode 100644 +index 0000000000000..307da69d6b26c +--- /dev/null ++++ b/tools/virtio/linux/cpumask.h +@@ -0,0 +1,7 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++#ifndef _LINUX_CPUMASK_H ++#define _LINUX_CPUMASK_H ++ ++#include ++ ++#endif /* _LINUX_CPUMASK_H */ +diff --git a/tools/virtio/linux/gfp.h b/tools/virtio/linux/gfp.h +new file mode 100644 +index 0000000000000..43d146f236f14 +--- /dev/null ++++ b/tools/virtio/linux/gfp.h +@@ -0,0 +1,7 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++#ifndef __LINUX_GFP_H ++#define __LINUX_GFP_H ++ ++#include ++ ++#endif +diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h +index 315e85cabedab..063ccc8975647 100644 +--- a/tools/virtio/linux/kernel.h ++++ b/tools/virtio/linux/kernel.h +@@ -10,6 +10,7 @@ + #include + + #include ++#include + #include + #include + #include +diff --git a/tools/virtio/linux/kmsan.h b/tools/virtio/linux/kmsan.h +new file mode 100644 +index 0000000000000..272b5aa285d5a +--- /dev/null ++++ b/tools/virtio/linux/kmsan.h +@@ -0,0 +1,12 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++#ifndef _LINUX_KMSAN_H ++#define _LINUX_KMSAN_H ++ ++#include ++ ++inline void kmsan_handle_dma(struct page *page, size_t offset, size_t size, ++ enum dma_data_direction dir) ++{ ++} ++ ++#endif /* _LINUX_KMSAN_H */ +diff --git a/tools/virtio/linux/scatterlist.h b/tools/virtio/linux/scatterlist.h +index 369ee308b6686..74d9e1825748e 100644 +--- a/tools/virtio/linux/scatterlist.h ++++ b/tools/virtio/linux/scatterlist.h +@@ -2,6 +2,7 @@ + #ifndef SCATTERLIST_H + #define SCATTERLIST_H + #include ++#include + + struct scatterlist { + unsigned long page_link; +diff --git a/tools/virtio/linux/topology.h b/tools/virtio/linux/topology.h +new file mode 100644 +index 0000000000000..910794afb993a +--- /dev/null ++++ b/tools/virtio/linux/topology.h +@@ -0,0 +1,7 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++#ifndef _LINUX_TOPOLOGY_H ++#define _LINUX_TOPOLOGY_H ++ ++#include ++ ++#endif /* _LINUX_TOPOLOGY_H */ +-- +2.39.0 +