5.10.208-rc1 review
Subsystems (2)
Greg Kroah-Hartman
maintainercover 5.10.208-rc1 review
This is the start of the stable review cycle for the 5.10.208 release. There are 43 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 15 Jan 2024 09:41:55 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.208-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.10.208-rc1
Greg Kroah-Hartman <[email protected]>
Revert "nvme: use command_id instead of req->tag in trace_nvme_complete_rq()"
Bartosz Pawlowski <[email protected]>
PCI: Disable ATS for specific Intel IPU E2000 devices
Bartosz Pawlowski <[email protected]>
PCI: Extract ATS disabling to a helper function
Phil Sutter <[email protected]>
netfilter: nf_tables: Reject tables of unsupported family
Wander Lairson Costa <[email protected]>
drm/qxl: fix UAF on handle creation
Jon Maxwell <[email protected]>
ipv6: remove max_size check inline with ipv4
John Fastabend <[email protected]>
net: tls, update curr on splice as well
Aditya Gupta <[email protected]>
powerpc: update ppc_save_regs to save current r1 in pt_regs
Wenchao Chen <[email protected]>
mmc: sdhci-sprd: Fix eMMC init failure after hw reset
Geert Uytterhoeven <[email protected]>
mmc: core: Cancel delayed work before releasing host
Jorge Ramirez-Ortiz <[email protected]>
mmc: rpmb: fixes pause retune on all RPMB partitions.
Ziyang Huang <[email protected]>
mmc: meson-mx-sdhc: Fix initialization frozen issue
Jiajun Xie <[email protected]>
mm: fix unmap_mapping_range high bits shift bug
Benjamin Bara <[email protected]>
i2c: core: Fix atomic xfer check for non-preempt config
Jinghao Jia <[email protected]>
x86/kprobes: fix incorrect return address calculation in kprobe_emulate_call_indirect
Takashi Sakamoto <[email protected]>
firewire: ohci: suppress unexpected system reboot in AMD Ryzen machines and ASM108x/VT630x PCIe cards
Matthew Wilcox (Oracle) <[email protected]>
mm/memory-failure: check the mapcount of the precise page
Thomas Lange <[email protected]>
net: Implement missing SO_TIMESTAMPING_NEW cmsg support
Michael Chan <[email protected]>
bnxt_en: Remove mis-applied code from bnxt_cfg_ntp_filters()
Chen Ni <[email protected]>
asix: Add check for usbnet_get_endpoints
Dinghao Liu <[email protected]>
net/qla3xxx: fix potential memleak in ql_alloc_buffer_queues
Christophe JAILLET <[email protected]>
net/qla3xxx: switch from 'pci_' to 'dma_' API
Andrii Staikov <[email protected]>
i40e: Restore VF MSI-X state during PCI reset
Mark Brown <[email protected]>
ASoC: meson: g12a-tohdmitx: Fix event generation for S/PDIF mux
Mark Brown <[email protected]>
ASoC: meson: g12a-toacodec: Fix event generation
Mark Brown <[email protected]>
ASoC: meson: g12a-tohdmitx: Validate written enum values
Mark Brown <[email protected]>
ASoC: meson: g12a-toacodec: Validate written enum values
Ke Xiao <[email protected]>
i40e: fix use-after-free in i40e_aqc_add_filters()
Marc Dionne <[email protected]>
net: Save and restore msg_namelen in sock_sendmsg
Pablo Neira Ayuso <[email protected]>
netfilter: nft_immediate: drop chain reference counter on error
Pablo Neira Ayuso <[email protected]>
netfilter: nftables: add loop check helper function
Adrian Cinal <[email protected]>
net: bcmgenet: Fix FCS generation for fragmented skbuffs
Zhipeng Lu <[email protected]>
sfc: fix a double-free bug in efx_probe_filters
Stefan Wahren <[email protected]>
ARM: sun9i: smp: Fix array-index-out-of-bounds read in sunxi_mc_smp_init
Jörn-Thorben Hinz <[email protected]>
net: Implement missing getsockopt(SO_TIMESTAMPING_NEW)
Hangyu Hua <[email protected]>
net: sched: em_text: fix possible memory leak in em_text_destroy()
Sudheer Mogilappagari <[email protected]>
i40e: Fix filter input checks to prevent config with invalid values
Khaled Almahallawy <[email protected]>
drm/i915/dp: Fix passing the correct DPCD_REV for drm_dp_set_phy_test_pattern
Suman Ghosh <[email protected]>
octeontx2-af: Fix marking couple of structure as __packed
Siddh Raman Pant <[email protected]>
nfc: llcp_core: Hold a ref to llcp_local->dev when holding a ref to llcp_local
Siddhesh Dharme <[email protected]>
ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP ProBook 440 G6
Sarthak Kukreti <[email protected]>
block: Don't invalidate pagecache for invalid falloc modes
Edward Adam Davis <[email protected]>
keys, dns: Fix missing size check of V1 server-list header
-------------
Diffstat:
Makefile | 4 +- arch/arm/mach-sunxi/mc_smp.c | 4 +- arch/powerpc/kernel/ppc_save_regs.S | 6 +- arch/x86/kernel/kprobes/core.c | 3 +- drivers/firewire/ohci.c | 51 ++++++ drivers/gpu/drm/i915/display/intel_dp.c | 2 +- drivers/gpu/drm/qxl/qxl_drv.h | 2 +- drivers/gpu/drm/qxl/qxl_dumb.c | 5 +- drivers/gpu/drm/qxl/qxl_gem.c | 25 ++- drivers/gpu/drm/qxl/qxl_ioctl.c | 6 +- drivers/i2c/i2c-core.h | 4 +- drivers/mmc/core/block.c | 7 +- drivers/mmc/core/host.c | 1 + drivers/mmc/host/meson-mx-sdhc-mmc.c | 26 +-- drivers/mmc/host/sdhci-sprd.c | 10 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 +- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 11 +- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 34 +++- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 3 + drivers/net/ethernet/marvell/octeontx2/af/npc.h | 4 +- drivers/net/ethernet/qlogic/qla3xxx.c | 198 +++++++++------------ drivers/net/ethernet/sfc/rx_common.c | 4 +- drivers/net/usb/ax88172a.c | 4 +- drivers/nvme/host/trace.h | 2 +- drivers/pci/quirks.c | 28 ++- fs/block_dev.c | 21 ++- include/net/dst_ops.h | 2 +- mm/memory-failure.c | 6 +- mm/memory.c | 4 +- net/core/dst.c | 8 +- net/core/sock.c | 12 +- net/dns_resolver/dns_key.c | 19 +- net/ipv6/route.c | 13 +- net/netfilter/nf_tables_api.c | 57 +++++- net/netfilter/nft_immediate.c | 2 +- net/nfc/llcp_core.c | 39 +++- net/sched/em_text.c | 4 +- net/socket.c | 2 + net/tls/tls_sw.c | 2 + sound/pci/hda/patch_realtek.c | 1 + sound/soc/meson/g12a-toacodec.c | 5 +- sound/soc/meson/g12a-tohdmitx.c | 8 +- 43 files changed, 429 insertions(+), 228 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/43 keys, dns: Fix missing size check of V1 server-list header
5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Edward Adam Davis <[email protected]>
commit 1997b3cb4217b09e49659b634c94da47f0340409 upstream.
The dns_resolver_preparse() function has a check on the size of the payload for the basic header of the binary-style payload, but is missing a check for the size of the V1 server-list payload header after determining that's what we've been given.
Fix this by getting rid of the the pointer to the basic header and just assuming that we have a V1 server-list payload and moving the V1 server list pointer inside the if-statement. Dealing with other types and versions can be left for when such have been defined.
This can be tested by doing the following with KASAN enabled:
echo -n -e '\x0\x0\x1\x2' | keyctl padd dns_resolver foo @p
and produces an oops like the following:
BUG: KASAN: slab-out-of-bounds in dns_resolver_preparse+0xc9f/0xd60 net/dns_resolver/dns_key.c:127
Read of size 1 at addr ffff888028894084 by task syz-executor265/5069
...
Call Trace:
dns_resolver_preparse+0xc9f/0xd60 net/dns_resolver/dns_key.c:127
__key_create_or_update+0x453/0xdf0 security/keys/key.c:842
key_create_or_update+0x42/0x50 security/keys/key.c:1007
__do_sys_add_key+0x29c/0x450 security/keys/keyctl.c:134
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x62/0x6aThis patch was originally by Edward Adam Davis, but was modified by Linus.
--- net/dns_resolver/dns_key.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
net/dns_resolver/dns_key.c +9 -10
@@ -91,8 +91,6 @@ const struct cred *dns_resolver_cache;static int dns_resolver_preparse (struct key_preparsed_payload *prep) { -const struct dns_server_list_v1_header *v1; -const struct dns_payload_header *bin;struct user_key_payload *upayload;unsigned long derrno;int ret;
@@ -103,27 +101,28 @@ dns_resolver_preparse(struct key_preparsreturn -EINVAL ;if (data[0 ] ==0 ) { +const struct dns_server_list_v1_header *v1; +/* It may be a server list. */ -if (datalen <=sizeof (*bin)) +if (datalen <=sizeof (*v1))return -EINVAL ; - bin = (const struct dns_payload_header *)data; -kenter ("[%u,%u],%u" , bin->content, bin->version, datalen); -if (bin->content !=DNS_PAYLOAD_IS_SERVER_LIST ) { + v1 = (const struct dns_server_list_v1_header *)data; +kenter ("[%u,%u],%u" , v1->hdr.content, v1->hdr.version, datalen); +if (v1->hdr.content !=DNS_PAYLOAD_IS_SERVER_LIST ) {pr_warn_ratelimited ("dns_resolver: Unsupported content type (%u)\n" , - bin->content); + v1->hdr.content);return -EINVAL ; } -if (bin->version !=1 ) { +if (v1->hdr.version !=1 ) {pr_warn_ratelimited ("dns_resolver: Unsupported server list version (%u)\n" , - bin->version); + v1->hdr.version);return -EINVAL ; } - v1 = (const struct dns_server_list_v1_header *)bin;if ((v1->status !=DNS_LOOKUP_GOOD && v1->status !=DNS_LOOKUP_GOOD_WITH_BAD )) {if (prep->expiry ==TIME64_MAX )
Greg Kroah-Hartman
maintainerPATCH 2/43 block: Dont invalidate pagecache for invalid falloc modes
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarthak Kukreti <[email protected]>
commit 1364a3c391aedfeb32aa025303ead3d7c91cdf9d upstream.
Only call truncate_bdev_range() if the fallocate mode is supported. This fixes a bug where data in the pagecache could be invalidated if the fallocate() was called on the block device with an invalid mode.
--- fs/block_dev.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
fs/block_dev.c +16 -5
@@ -2031,22 +2031,33 @@ static long blkdev_fallocate(struct fileif ((start | len) & (bdev_logical_block_size (bdev) -1 ))return -EINVAL ; -/* Invalidate the page cache, including dirty pages. */ - error =truncate_bdev_range (bdev, file->f_mode, start, end); -if (error) -return error; - +/* +* Invalidate the page cache, including dirty pages, for valid +* de-allocate mode calls to fallocate(). +*/ switch (mode) {case FALLOC_FL_ZERO_RANGE :case FALLOC_FL_ZERO_RANGE |FALLOC_FL_KEEP_SIZE : + error =truncate_bdev_range (bdev, file->f_mode, start, end); +if (error) +break ; + error =blkdev_issue_zeroout (bdev, start >>9 , len >>9 ,GFP_KERNEL ,BLKDEV_ZERO_NOUNMAP );break ;case FALLOC_FL_PUNCH_HOLE |FALLOC_FL_KEEP_SIZE : + error =truncate_bdev_range (bdev, file->f_mode, start, end); +if (error) +break ; + error =blkdev_issue_zeroout (bdev, start >>9 , len >>9 ,GFP_KERNEL ,BLKDEV_ZERO_NOFALLBACK );break ;case FALLOC_FL_PUNCH_HOLE |FALLOC_FL_KEEP_SIZE |FALLOC_FL_NO_HIDE_STALE : + error =truncate_bdev_range (bdev, file->f_mode, start, end); +if (error) +break ; + error =blkdev_issue_discard (bdev, start >>9 , len >>9 ,GFP_KERNEL ,0 );break ;
Greg Kroah-Hartman
maintainerPATCH 3/43 ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP ProBook 440 G6
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Siddhesh Dharme <[email protected]>
commit b6ce6e6c79e4ec650887f1fe391a70e54972001a upstream.
LEDs in 'HP ProBook 440 G6' laptop are controlled by ALC236 codec. Enable already existing quirk 'ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF' to fix mute and mic-mute LEDs.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -8990,6 +8990,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x103c ,0x84da ,"HP OMEN dc0019-ur" ,ALC295_FIXUP_HP_OMEN ),SND_PCI_QUIRK (0x103c ,0x84e7 ,"HP Pavilion 15" ,ALC269_FIXUP_HP_MUTE_LED_MIC3 ),SND_PCI_QUIRK (0x103c ,0x8519 ,"HP Spectre x360 15-df0xxx" ,ALC285_FIXUP_HP_SPECTRE_X360 ), +SND_PCI_QUIRK (0x103c ,0x8537 ,"HP ProBook 440 G6" ,ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF ),SND_PCI_QUIRK (0x103c ,0x860f ,"HP ZBook 15 G6" ,ALC285_FIXUP_HP_GPIO_AMP_INIT ),SND_PCI_QUIRK (0x103c ,0x861f ,"HP Elite Dragonfly G1" ,ALC285_FIXUP_HP_GPIO_AMP_INIT ), SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
Greg Kroah-Hartman
maintainerPATCH 4/43 nfc: llcp_core: Hold a ref to llcp_local->dev when holding a ref to llcp_local
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Siddh Raman Pant <[email protected]>
[ Upstream commit c95f919567d6f1914f13350af61a1b044ac85014 ]
llcp_sock_sendmsg() calls nfc_llcp_send_ui_frame() which in turn calls nfc_alloc_send_skb(), which accesses the nfc_dev from the llcp_sock for getting the headroom and tailroom needed for skb allocation.
Parallelly the nfc_dev can be freed, as the refcount is decreased via nfc_free_device(), leading to a UAF reported by Syzkaller, which can be summarized as follows:
(1) llcp_sock_sendmsg() -> nfc_llcp_send_ui_frame()
-> nfc_alloc_send_skb() -> Dereference *nfc_dev (2) virtual_ncidev_close() -> nci_free_device() -> nfc_free_device() -> put_device() -> nfc_release() -> Free *nfc_dev
When a reference to llcp_local is acquired, we do not acquire the same for the nfc_dev. This leads to freeing even when the llcp_local is in use, and this is the case with the UAF described above too.
Thus, when we acquire a reference to llcp_local, we should acquire a reference to nfc_dev, and release the references appropriately later.
References for llcp_local is initialized in nfc_llcp_register_device() (which is called by nfc_register_device()). Thus, we should acquire a reference to nfc_dev there.
nfc_unregister_device() calls nfc_llcp_unregister_device() which in turn calls nfc_llcp_local_put(). Thus, the reference to nfc_dev is appropriately released later.
--- net/nfc/llcp_core.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-)
net/nfc/llcp_core.c +36 -3
@@ -147,6 +147,13 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool device,static struct nfc_llcp_local *nfc_llcp_local_get (struct nfc_llcp_local *local) { +/* Since using nfc_llcp_local may result in usage of nfc_dev, whenever +* we hold a reference to local, we also need to hold a reference to +* the device to avoid UAF. +*/ +if (!nfc_get_device (local->dev->idx)) +return NULL ; +kref_get (&local->ref);return local;
@@ -179,10 +186,18 @@ static void local_release(struct kref *ref)int nfc_llcp_local_put (struct nfc_llcp_local *local) { +struct nfc_dev *dev; +int ret; +if (local ==NULL )return 0 ; -return kref_put (&local->ref, local_release); + dev = local->dev; + + ret =kref_put (&local->ref, local_release); +nfc_put_device (dev); + +return ret; } static struct nfc_llcp_sock *nfc_llcp_sock_get(struct nfc_llcp_local *local,
@@ -968,8 +983,17 @@ static void nfc_llcp_recv_connect(struct nfc_llcp_local *local, } new_sock =nfc_llcp_sock (new_sk); - new_sock->dev = local->dev; + new_sock->local =nfc_llcp_local_get (local); +if (!new_sock->local) { + reason =LLCP_DM_REJ ; +sock_put (&new_sock->sk); +release_sock (&sock->sk); +sock_put (&sock->sk); + goto fail; + } + + new_sock->dev = local->dev; new_sock->rw = sock->rw; new_sock->miux = sock->miux; new_sock->nfc_protocol = sock->nfc_protocol;
@@ -1607,7 +1631,16 @@ int nfc_llcp_register_device(struct nfc_dev *ndev)if (local ==NULL )return -ENOMEM ; - local->dev = ndev; +/* As we are going to initialize local's refcount, we need to get the +* nfc_dev to avoid UAF, otherwise there is no point in continuing. +* See nfc_llcp_local_get(). +*/ + local->dev =nfc_get_device (ndev->idx); +if (!local->dev) { +kfree (local); +return -ENODEV ; + } +INIT_LIST_HEAD (&local->list);kref_init (&local->ref);mutex_init (&local->sdp_lock);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 5/43 octeontx2-af: Fix marking couple of structure as __packed
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suman Ghosh <[email protected]>
[ Upstream commit 0ee2384a5a0f3b4eeac8d10bb01a0609d245a4d1 ]
Couple of structures was not marked as __packed. This patch fixes the same and mark them as __packed.
--- drivers/net/ethernet/marvell/octeontx2/af/npc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/npc.h +2 -2
@@ -359,7 +359,7 @@ struct npc_lt_def {u8 ltype_mask;u8 ltype_match;u8 lid; -}; +} __packed;struct npc_lt_def_ipsec {u8 ltype_mask;
@@ -367,7 +367,7 @@ struct npc_lt_def_ipsec {u8 lid;u8 spi_offset;u8 spi_nz; -}; +} __packed;struct npc_lt_def_cfg {struct npc_lt_def rx_ol2;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 6/43 drm/i915/dp: Fix passing the correct DPCD_REV for drm_dp_set_phy_test_pattern
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Khaled Almahallawy <[email protected]>
[ Upstream commit 2bd7a06a1208aaacb4e7a2a5436c23bce8d70801 ]
Using link_status to get DPCD_REV fails when disabling/defaulting phy pattern. Use intel_dp->dpcd to access DPCD_REV correctly.
--- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_dp.c +1 -1
@@ -5584,7 +5584,7 @@ void intel_dp_process_phy_request(struct intel_dp *intel_dp)intel_dp_autotest_phy_ddi_enable (intel_dp, data->num_lanes);drm_dp_set_phy_test_pattern (&intel_dp->aux, data, - link_status[DP_DPCD_REV ]); + intel_dp->dpcd[DP_DPCD_REV ]); }static u8 intel_dp_autotest_phy_pattern (struct intel_dp *intel_dp)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 7/43 i40e: Fix filter input checks to prevent config with invalid values
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudheer Mogilappagari <[email protected]>
[ Upstream commit 3e48041d9820c17e0a51599d12e66c6e12a8d08d ]
Prevent VF from configuring filters with unsupported actions or use REDIRECT action with invalid tc number. Current checks could cause out of bounds access on PF side.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +4 -4
@@ -3369,16 +3369,16 @@ static int i40e_validate_cloud_filter(struct i40e_vf *vf,bool found = false;int bkt; -if (!tc_filter->action) { +if (tc_filter->action !=VIRTCHNL_ACTION_TC_REDIRECT ) {dev_info (&pf->pdev->dev, -"VF %d: Currently ADq doesn't support Drop Action\n" , - vf->vf_id); +"VF %d: ADQ doesn't support this action (%d)\n" , + vf->vf_id, tc_filter->action); goto err; }/* action_meta is TC number here to which the filter is applied */ if (!tc_filter->action_meta || - tc_filter->action_meta >I40E_MAX_VF_VSI ) { + tc_filter->action_meta > vf->num_tc) {dev_info (&pf->pdev->dev,"VF %d: Invalid TC number %u\n" , vf->vf_id, tc_filter->action_meta); goto err;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 8/43 net: sched: em_text: fix possible memory leak in em_text_destroy()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hangyu Hua <[email protected]>
[ Upstream commit 8fcb0382af6f1ef50936f1be05b8149eb2f88496 ]
m->data needs to be freed when em_text_destroy is called.
--- net/sched/em_text.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/sched/em_text.c +3 -1
@@ -97,8 +97,10 @@ static int em_text_change(struct net *net, void *data, int len,static void em_text_destroy (struct tcf_ematch *m) { -if (EM_TEXT_PRIV (m) &&EM_TEXT_PRIV (m)->config) +if (EM_TEXT_PRIV (m) &&EM_TEXT_PRIV (m)->config) {textsearch_destroy (EM_TEXT_PRIV (m)->config); +kfree (EM_TEXT_PRIV (m)); + } }static int em_text_dump (struct sk_buff *skb,struct tcf_ematch *m)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 9/43 net: Implement missing getsockopt(SO_TIMESTAMPING_NEW)
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jörn-Thorben Hinz <[email protected]>
[ Upstream commit 7f6ca95d16b96567ce4cf458a2790ff17fa620c3 ]
Commit 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW") added the new socket option SO_TIMESTAMPING_NEW. Setting the option is handled in sk_setsockopt(), querying it was not handled in sk_getsockopt(), though.
Following remarks on an earlier submission of this patch, keep the old behavior of getsockopt(SO_TIMESTAMPING_OLD) which returns the active flags even if they actually have been set through SO_TIMESTAMPING_NEW.
The new getsockopt(SO_TIMESTAMPING_NEW) is stricter, returning flags only if they have been set through the same option.
--- net/core/sock.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
net/core/sock.c +9 -2
@@ -1383,9 +1383,16 @@ int sock_getsockopt(struct socket *sock, int level, int optname,break ;case SO_LINGER : +case SO_TIMESTAMPING_NEW : lv =sizeof (v.ling); - v.ling.l_onoff =sock_flag (sk,SOCK_LINGER ); - v.ling.l_linger = sk->sk_lingertime /HZ ; +/* For the later-added case SO_TIMESTAMPING_NEW: Be strict about only +* returning the flags when they were set through the same option. +* Don't change the beviour for the old case SO_TIMESTAMPING_OLD. +*/ +if (optname ==SO_TIMESTAMPING_OLD ||sock_flag (sk,SOCK_TSTAMP_NEW )) { + v.ling.l_onoff =sock_flag (sk,SOCK_LINGER ); + v.ling.l_linger = sk->sk_lingertime /HZ ; + }break ;case SO_BSDCOMPAT :
Signature · 1 line
2.43.0
Re: [PATCH 5.10 09/43] net: Implement missing getsockopt(SO_TIMESTAMPING_NEW)
Hi Greg,
this patch is applied in the wrong place (the wrong case) here in sock_getsockopt(). The function seems to have changed in a number of places after 5.10, apparently too much for an automatic(?!) merge.
Quoted 64 lines · Greg Kroah-Hartman
5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jörn-Thorben Hinz <[email protected]>
[ Upstream commit
7f6ca95d16b96567ce4cf458a2790ff17fa620c3]Commit
9718475e6908("socket: AddSO_TIMESTAMPING_NEW") added the new socket optionSO_TIMESTAMPING_NEW. Setting the option is handled insk_setsockopt(), querying it was not handled insk_getsockopt(), though.Following remarks on an earlier submission of this patch, keep the old
behavior ofgetsockopt(SO_TIMESTAMPING_OLD)which returns the active flags even if they actually have been set throughSO_TIMESTAMPING_NEW.The new
getsockopt(SO_TIMESTAMPING_NEW)is stricter, returning flags only if they have been set through the same option.Fixes 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW")Link:
https://lore.kernel.org/lkml/[email protected]/
Link:
https://lore.kernel.org/netdev/[email protected]/Signed-off-by Jörn-Thorben Hinz <[email protected]>Reviewed-by Willem de Bruijn <[email protected]>Signed-off-by David S. Miller <[email protected]>Signed-off-by Sasha Levin <[email protected]>---
net/core/sock.c | 11 +++++++++--1 file changed, 9 insertions(+), 2 deletions(-)net/core/sock.c +0
-0@@ -1383,9 +1383,16 @@ int sock_getsockopt(struct socket *sock, int level, int optname, break;
caseSO_LINGER:
+ caseSO_TIMESTAMPING_NEW:
lv = sizeof(v.ling);
- v.ling.l_onoff =sock_flag(sk, SOCK_LINGER); - v.ling.l_linger =sk->sk_lingertime/ HZ; + /* For the later-added caseSO_TIMESTAMPING_NEW: Be strict about only
+ * returning the flags when they were set through the same option.
+ * Don't change the beviour for the old caseSO_TIMESTAMPING_OLD.
+ */
+ if (optname ==SO_TIMESTAMPING_OLD||sock_flag(sk, SOCK_TSTAMP_NEW)) {
+ v.ling.l_onoff =sock_flag(sk, SOCK_LINGER); + v.ling.l_linger =sk->sk_lingertime/ HZ; + }
break;
caseSO_BSDCOMPAT:
Greg Kroah-Hartman
maintainerRe: [PATCH 5.10 09/43] net: Implement missing getsockopt(SO_TIMESTAMPING_NEW)
Quoted 5 lines · Jörn-Thorben Hinz
Hi Greg,
this patch is applied in the wrong place (the wrong case) here in
sock_getsockopt(). The function seems to have changed in a number of places after 5.10, apparently too much for an automatic(?!) merge.
Good catch, I've dropped it from the 5.4 and 5.10 trees now, thanks for the review!
greg k-h
Greg Kroah-Hartman
maintainerPATCH 10/43 ARM: sun9i: smp: Fix array-index-out-of-bounds read in sunxi_mc_smp_init
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wahren <[email protected]>
[ Upstream commit 72ad3b772b6d393701df58ba1359b0bb346a19ed ]
Running a multi-arch kernel (multi_v7_defconfig) on a Raspberry Pi 3B+ with enabled CONFIG_UBSAN triggers the following warning:
UBSAN: array-index-out-of-bounds in arch/arm/mach-sunxi/mc_smp.c:810:29 index 2 is out of range for type 'sunxi_mc_smp_data [2]' CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.7.0-rc6-00248-g5254c0cbc92d Hardware name: BCM2835 unwind_backtrace from show_stack+0x10/0x14 show_stack from dump_stack_lvl+0x40/0x4c dump_stack_lvl from ubsan_epilogue+0x8/0x34 ubsan_epilogue from __ubsan_handle_out_of_bounds+0x78/0x80 __ubsan_handle_out_of_bounds from sunxi_mc_smp_init+0xe4/0x4cc sunxi_mc_smp_init from do_one_initcall+0xa0/0x2fc do_one_initcall from kernel_init_freeable+0xf4/0x2f4 kernel_init_freeable from kernel_init+0x18/0x158 kernel_init from ret_from_fork+0x14/0x28
Since the enabled method couldn't match with any entry from sunxi_mc_smp_data, the value of the index shouldn't be used right after the loop. So move it after the check of ret in order to have a valid index.
--- arch/arm/mach-sunxi/mc_smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-sunxi/mc_smp.c +2 -2
@@ -808,12 +808,12 @@ static int __init sunxi_mc_smp_init(void)break ; } - is_a83t = sunxi_mc_smp_data[i].is_a83t; -of_node_put (node);if (ret)return -ENODEV ; + is_a83t = sunxi_mc_smp_data[i].is_a83t; +if (!sunxi_mc_smp_cpu_table_init ())return -EINVAL ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 11/43 sfc: fix a double-free bug in efx_probe_filters
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhipeng Lu <[email protected]>
[ Upstream commit d5a306aedba34e640b11d7026dbbafb78ee3a5f6 ]
In efx_probe_filters, the channel->rps_flow_id is freed in a efx_for_each_channel marco when success equals to 0. However, after the following call chain:
ef100_net_open
|-> efx_probe_filters
|-> ef100_net_stop
|-> efx_remove_filters
The channel->rps_flow_id is freed again in the efx_for_each_channel of efx_remove_filters, triggering a double-free bug.
--- drivers/net/ethernet/sfc/rx_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/sfc/rx_common.c +3 -1
@@ -837,8 +837,10 @@ int efx_probe_filters(struct efx_nic *efx) }if (!success) { -efx_for_each_channel (channel, efx) +efx_for_each_channel (channel, efx) {kfree (channel->rps_flow_id); + channel->rps_flow_id =NULL ; + } efx->type->filter_table_remove (efx); rc = -ENOMEM ; goto out_unlock;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 12/43 net: bcmgenet: Fix FCS generation for fragmented skbuffs
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Cinal <[email protected]>
[ Upstream commit e584f2ff1e6cc9b1d99e8a6b0f3415940d1b3eb3 ]
The flag DMA_TX_APPEND_CRC was only written to the first DMA descriptor in the TX path, where each descriptor corresponds to a single skbuff fragment (or the skbuff head). This led to packets with no FCS appearing on the wire if the kernel allocated the packet in fragments, which would always happen when using PACKET_MMAP/TPACKET (cf. tpacket_fill_skb() in net/af_packet.c).
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +3 -1
@@ -2086,8 +2086,10 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)/* Note: if we ever change from DMA_TX_APPEND_CRC below we * will need to restore software padding of "runt" packets */ + len_stat |=DMA_TX_APPEND_CRC ; +if (!i) { - len_stat |=DMA_TX_APPEND_CRC |DMA_SOP ; + len_stat |=DMA_SOP ;if (skb->ip_summed ==CHECKSUM_PARTIAL ) len_stat |=DMA_TX_DO_CSUM ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 13/43 netfilter: nftables: add loop check helper function
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit 6387aa6e59be8d1158c5703f34553c93d7743d8c ]
This patch adds nft_check_loops() to reuse it in the new catch-all element codebase.
Stable-dep-of: b29be0ca8e81 ("netfilter: nft_immediate: drop chain reference counter on error")
--- net/netfilter/nf_tables_api.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-)
net/netfilter/nf_tables_api.c +21 -9
@@ -8994,26 +8994,38 @@ EXPORT_SYMBOL_GPL(nft_chain_validate_hooks);static int nf_tables_check_loops (const struct nft_ctx *ctx,const struct nft_chain *chain); +static int nft_check_loops (const struct nft_ctx *ctx, +const struct nft_set_ext *ext) +{ +const struct nft_data *data; +int ret; + + data =nft_set_ext_data (ext); +switch (data->verdict.code) { +case NFT_JUMP : +case NFT_GOTO : + ret =nf_tables_check_loops (ctx, data->verdict.chain); +break ; +default : + ret =0 ; +break ; + } + +return ret; +} +static int nf_tables_loop_check_setelem (const struct nft_ctx *ctx,struct nft_set *set,const struct nft_set_iter *iter,struct nft_set_elem *elem) {const struct nft_set_ext *ext =nft_set_elem_ext (set, elem->priv); -const struct nft_data *data;if (nft_set_ext_exists (ext,NFT_SET_EXT_FLAGS ) && *nft_set_ext_flags (ext) &NFT_SET_ELEM_INTERVAL_END )return 0 ; - data =nft_set_ext_data (ext); -switch (data->verdict.code) { -case NFT_JUMP : -case NFT_GOTO : -return nf_tables_check_loops (ctx, data->verdict.chain); -default : -return 0 ; - } +return nft_check_loops (ctx, ext); } static int nf_tables_check_loops(const struct nft_ctx *ctx,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 14/43 netfilter: nft_immediate: drop chain reference counter on error
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit b29be0ca8e816119ccdf95cc7d7c7be9bde005f1 ]
In the init path, nft_data_init() bumps the chain reference counter, decrement it on error by following the error path which calls nft_data_release() to restore it.
--- net/netfilter/nft_immediate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nft_immediate.c +1 -1
@@ -78,7 +78,7 @@ static int nft_immediate_init(const struct nft_ctx *ctx,case NFT_GOTO : err =nf_tables_bind_chain (ctx, chain);if (err <0 ) -return err; + goto err1;break ;default :break ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 15/43 net: Save and restore msg_namelen in sock_sendmsg
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Dionne <[email protected]>
[ Upstream commit 01b2885d9415152bcb12ff1f7788f500a74ea0ed ]
Commit 86a7e0b69bd5 ("net: prevent rewrite of msg_name in sock_sendmsg()") made sock_sendmsg save the incoming msg_name pointer and restore it before returning, to insulate the caller against msg_name being changed by the called code. If the address length was also changed however, we may return with an inconsistent structure where the length doesn't match the address, and attempts to reuse it may lead to lost packets.
For example, a kernel that doesn't have commit 1c5950fc6fe9 ("udp6: fix potential access to stale information") will replace a v4 mapped address with its ipv4 equivalent, and shorten namelen accordingly from 28 to 16. If the caller attempts to reuse the resulting msg structure, it will have the original ipv6 (v4 mapped) address but an incorrect v4 length.
--- net/socket.c | 2 ++ 1 file changed, 2 insertions(+)
net/socket.c +2 -0
@@ -675,6 +675,7 @@ int sock_sendmsg(struct socket *sock, struct msghdr *msg) {struct sockaddr_storage *save_addr = (struct sockaddr_storage *)msg->msg_name;struct sockaddr_storage address; +int save_len = msg->msg_namelen;int ret;if (msg->msg_name) {
@@ -684,6 +685,7 @@ int sock_sendmsg(struct socket *sock, struct msghdr *msg) ret =__sock_sendmsg (sock, msg); msg->msg_name = save_addr; + msg->msg_namelen = save_len;return ret; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 16/43 i40e: fix use-after-free in i40e_aqc_add_filters()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ke Xiao <[email protected]>
[ Upstream commit 6a15584e99db8918b60e507539c7446375dcf366 ]
Commit 3116f59c12bd ("i40e: fix use-after-free in i40e_sync_filters_subtask()") avoided use-after-free issues, by increasing refcount during update the VSI filter list to the HW. However, it missed the unicast situation.
When deleting an unicast FDB entry, the i40e driver will release the mac_filter, and i40e_service_task will concurrently request firmware to add the mac_filter, which will lead to the following use-after-free issue.
Fix again for both netdev->uc and netdev->mc.
BUG: KASAN: use-after-free in i40e_aqc_add_filters+0x55c/0x5b0 [i40e] Read of size 2 at addr ffff888eb3452d60 by task kworker/8:7/6379 CPU: 8 PID: 6379 Comm: kworker/8:7 Kdump: loaded Tainted: G Workqueue: i40e i40e_service_task [i40e] Call Trace: dump_stack+0x71/0xab print_address_description+0x6b/0x290 kasan_report+0x14a/0x2b0 i40e_aqc_add_filters+0x55c/0x5b0 [i40e] i40e_sync_vsi_filters+0x1676/0x39c0 [i40e] i40e_service_task+0x1397/0x2bb0 [i40e] process_one_work+0x56a/0x11f0 worker_thread+0x8f/0xf40 kthread+0x2a0/0x390 ret_from_fork+0x1f/0x40 Allocated by task 21948: kasan_kmalloc+0xa6/0xd0 kmem_cache_alloc_trace+0xdb/0x1c0 i40e_add_filter+0x11e/0x520 [i40e] i40e_addr_sync+0x37/0x60 [i40e] __hw_addr_sync_dev+0x1f5/0x2f0 i40e_set_rx_mode+0x61/0x1e0 [i40e] dev_uc_add_excl+0x137/0x190 i40e_ndo_fdb_add+0x161/0x260 [i40e] rtnl_fdb_add+0x567/0x950 rtnetlink_rcv_msg+0x5db/0x880 netlink_rcv_skb+0x254/0x380 netlink_unicast+0x454/0x610 netlink_sendmsg+0x747/0xb00 sock_sendmsg+0xe2/0x120 __sys_sendto+0x1ae/0x290 __x64_sys_sendto+0xdd/0x1b0 do_syscall_64+0xa0/0x370 entry_SYSCALL_64_after_hwframe+0x65/0xca Freed by task 21948: __kasan_slab_free+0x137/0x190 kfree+0x8b/0x1b0 __i40e_del_filter+0x116/0x1e0 [i40e] i40e_del_mac_filter+0x16c/0x300 [i40e] i40e_addr_unsync+0x134/0x1b0 [i40e] __hw_addr_sync_dev+0xff/0x2f0 i40e_set_rx_mode+0x61/0x1e0 [i40e] dev_uc_del+0x77/0x90 rtnl_fdb_del+0x6a5/0x860 rtnetlink_rcv_msg+0x5db/0x880 netlink_rcv_skb+0x254/0x380 netlink_unicast+0x454/0x610 netlink_sendmsg+0x747/0xb00 sock_sendmsg+0xe2/0x120 __sys_sendto+0x1ae/0x290 __x64_sys_sendto+0xdd/0x1b0 do_syscall_64+0xa0/0x370 entry_SYSCALL_64_after_hwframe+0x65/0xca
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +7 -1
@@ -101,12 +101,18 @@ static struct workqueue_struct *i40e_wq;static void netdev_hw_addr_refcnt (struct i40e_mac_filter *f,struct net_device *netdev,int delta) { +struct netdev_hw_addr_list *ha_list;struct netdev_hw_addr *ha;if (!f || !netdev)return ; -netdev_for_each_mc_addr (ha, netdev) { +if (is_unicast_ether_addr (f->macaddr) ||is_link_local_ether_addr (f->macaddr)) + ha_list = &netdev->uc; +else + ha_list = &netdev->mc; + +netdev_hw_addr_list_for_each (ha, ha_list) {if (ether_addr_equal (ha->addr, f->macaddr)) { ha->refcount += delta;if (ha->refcount <=0 )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 17/43 ASoC: meson: g12a-toacodec: Validate written enum values
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
[ Upstream commit 3150b70e944ead909260285dfb5707d0bedcf87b ]
When writing to an enum we need to verify that the value written is valid for the enumeration, the helper function snd_soc_item_enum_to_val() doesn't do it since it needs to return an unsigned (and in any case we'd need to check the return value).
--- sound/soc/meson/g12a-toacodec.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/meson/g12a-toacodec.c +3 -0
@@ -46,6 +46,9 @@ static int g12a_toacodec_mux_put_enum(struct snd_kcontrol *kcontrol,struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;unsigned int mux, changed; +if (ucontrol->value.enumerated.item[0 ] >= e->items) +return -EINVAL ; + mux =snd_soc_enum_item_to_val (e, ucontrol->value.enumerated.item[0 ]); changed = snd_soc_component_test_bits(component, e->reg, CTRL0_DAT_SEL,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 18/43 ASoC: meson: g12a-tohdmitx: Validate written enum values
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
[ Upstream commit 1e001206804be3f3d21f4a1cf16e5d059d75643f ]
When writing to an enum we need to verify that the value written is valid for the enumeration, the helper function snd_soc_item_enum_to_val() doesn't do it since it needs to return an unsigned (and in any case we'd need to check the return value).
--- sound/soc/meson/g12a-tohdmitx.c | 6 ++++++ 1 file changed, 6 insertions(+)
sound/soc/meson/g12a-tohdmitx.c +6 -0
@@ -45,6 +45,9 @@ static int g12a_tohdmitx_i2s_mux_put_enum(struct snd_kcontrol *kcontrol,struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;unsigned int mux, changed; +if (ucontrol->value.enumerated.item[0 ] >= e->items) +return -EINVAL ; + mux =snd_soc_enum_item_to_val (e, ucontrol->value.enumerated.item[0 ]); changed = snd_soc_component_test_bits(component, e->reg, CTRL0_I2S_DAT_SEL,
@@ -93,6 +96,9 @@ static int g12a_tohdmitx_spdif_mux_put_enum(struct snd_kcontrol *kcontrol,struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;unsigned int mux, changed; +if (ucontrol->value.enumerated.item[0 ] >= e->items) +return -EINVAL ; + mux =snd_soc_enum_item_to_val (e, ucontrol->value.enumerated.item[0 ]); changed = snd_soc_component_test_bits(component, TOHDMITX_CTRL0, CTRL0_SPDIF_SEL,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 19/43 ASoC: meson: g12a-toacodec: Fix event generation
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
[ Upstream commit 172c88244b5f2d3375403ebb504d407be0fded59 ]
When a control changes value the return value from _put() should be 1 so we get events generated to userspace notifying applications of the change. We are checking if there has been a change and exiting early if not but we are not providing the correct return value in the latter case, fix this.
--- sound/soc/meson/g12a-toacodec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/meson/g12a-toacodec.c +1 -1
@@ -85,7 +85,7 @@ static int g12a_toacodec_mux_put_enum(struct snd_kcontrol *kcontrol,snd_soc_dapm_mux_update_power (dapm, kcontrol, mux, e,NULL ); -return 0 ; +return 1 ; } static SOC_ENUM_SINGLE_DECL(g12a_toacodec_mux_enum, TOACODEC_CTRL0,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 20/43 ASoC: meson: g12a-tohdmitx: Fix event generation for S/PDIF mux
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
[ Upstream commit b036d8ef3120b996751495ce25994eea58032a98 ]
When a control changes value the return value from _put() should be 1 so we get events generated to userspace notifying applications of the change. While the I2S mux gets this right the S/PDIF mux does not, fix the return value.
--- sound/soc/meson/g12a-tohdmitx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/meson/g12a-tohdmitx.c +1 -1
@@ -118,7 +118,7 @@ static int g12a_tohdmitx_spdif_mux_put_enum(struct snd_kcontrol *kcontrol,snd_soc_dapm_mux_update_power (dapm, kcontrol, mux, e,NULL ); -return 0 ; +return 1 ; } static SOC_ENUM_SINGLE_DECL(g12a_tohdmitx_spdif_mux_enum, TOHDMITX_CTRL0,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 21/43 i40e: Restore VF MSI-X state during PCI reset
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrii Staikov <[email protected]>
[ Upstream commit 371e576ff3e8580d91d49026e5d5faebf5565558 ]
During a PCI FLR the MSI-X Enable flag in the VF PCI MSI-X capability register will be cleared. This can lead to issues when a VF is assigned to a VM because in these cases the VF driver receives no indication of the PF PCI error/reset and additionally it is incapable of restoring the cleared flag in the hypervisor configuration space without fully reinitializing the driver interrupt functionality.
Since the VF driver is unable to easily resolve this condition on its own, restore the VF MSI-X flag during the PF PCI reset handling.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +++ .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 26 +++++++++++++++++++ .../ethernet/intel/i40e/i40e_virtchnl_pf.h | 3 +++ 3 files changed, 32 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +3 -0
@@ -15764,6 +15764,9 @@ static void i40e_pci_error_reset_done(struct pci_dev *pdev)struct i40e_pf *pf =pci_get_drvdata (pdev);i40e_reset_and_rebuild (pf, false, false); +#ifdef CONFIG_PCI_IOV +i40e_restore_all_vfs_msi_state (pdev); +#endif /* CONFIG_PCI_IOV */ }/**
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +26 -0
@@ -99,6 +99,32 @@ void i40e_vc_notify_reset(struct i40e_pf *pf) (u8 *)&pfe, sizeof(struct virtchnl_pf_event)); } +#ifdef CONFIG_PCI_IOV +void i40e_restore_all_vfs_msi_state (struct pci_dev *pdev) +{ +u16 vf_id; +u16 pos; + +/* Continue only if this is a PF */ +if (!pdev->is_physfn) +return ; + +if (!pci_num_vf (pdev)) +return ; + + pos =pci_find_ext_capability (pdev,PCI_EXT_CAP_ID_SRIOV ); +if (pos) { +struct pci_dev *vf_dev =NULL ; + +pci_read_config_word (pdev, pos +PCI_SRIOV_VF_DID , &vf_id); +while ((vf_dev =pci_get_device (pdev->vendor, vf_id, vf_dev))) { +if (vf_dev->is_virtfn && vf_dev->physfn == pdev) +pci_restore_msi_state (vf_dev); + } + } +} +#endif /* CONFIG_PCI_IOV */ +/** * i40e_vc_notify_vf_reset * @vf: pointer to the VF structure
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +3 -0
@@ -135,6 +135,9 @@ int i40e_ndo_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool enable);void i40e_vc_notify_link_state (struct i40e_pf *pf);void i40e_vc_notify_reset (struct i40e_pf *pf); +#ifdef CONFIG_PCI_IOV +void i40e_restore_all_vfs_msi_state (struct pci_dev *pdev); +#endif /* CONFIG_PCI_IOV */ int i40e_get_vf_stats (struct net_device *netdev,int vf_id,struct ifla_vf_stats *vf_stats);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 22/43 net/qla3xxx: switch from pci_ to dma_ API
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit 41fb4c1ba7478fe34c7e094e124e4ee4513b9763 ]
The wrappers in include/linux/pci-dma-compat.h should go away.
The patch has been generated with the coccinelle script below and has been hand modified to replace GFP_ with a correct flag.
It has been compile tested.
When memory is allocated in 'ql_alloc_net_req_rsp_queues()' GFP_KERNEL can be used because it is only called from 'ql_alloc_mem_resources()' which already calls 'ql_alloc_buffer_queues()' which uses GFP_KERNEL. (see below)
When memory is allocated in 'ql_alloc_buffer_queues()' GFP_KERNEL can be used because this flag is already used just a few line above.
When memory is allocated in 'ql_alloc_small_buffers()' GFP_KERNEL can be used because it is only called from 'ql_alloc_mem_resources()' which already calls 'ql_alloc_buffer_queues()' which uses GFP_KERNEL. (see above)
When memory is allocated in 'ql_alloc_mem_resources()' GFP_KERNEL can be used because this function already calls 'ql_alloc_buffer_queues()' which uses GFP_KERNEL. (see above)
While at it, use 'dma_set_mask_and_coherent()' instead of 'dma_set_mask()/ dma_set_coherent_mask()' in order to slightly simplify code.
@@
@@
- PCI_DMA_BIDIRECTIONAL
+ DMA_BIDIRECTIONAL
@@
@@
- PCI_DMA_TODEVICE
+ DMA_TO_DEVICE
@@
@@
- PCI_DMA_FROMDEVICE
+ DMA_FROM_DEVICE
@@
@@
- PCI_DMA_NONE
+ DMA_NONE
@@
expression e1, e2, e3;
@@
- pci_alloc_consistent(e1, e2, e3)
+ dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
@@
expression e1, e2, e3;
@@
- pci_zalloc_consistent(e1, e2, e3)
+ dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
@@
expression e1, e2, e3, e4;
@@
- pci_free_consistent(e1, e2, e3, e4)
+ dma_free_coherent(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_map_single(e1, e2, e3, e4)
+ dma_map_single(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_unmap_single(e1, e2, e3, e4)
+ dma_unmap_single(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4, e5;
@@
- pci_map_page(e1, e2, e3, e4, e5)
+ dma_map_page(&e1->dev, e2, e3, e4, e5)
@@
expression e1, e2, e3, e4;
@@
- pci_unmap_page(e1, e2, e3, e4)
+ dma_unmap_page(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_map_sg(e1, e2, e3, e4)
+ dma_map_sg(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_unmap_sg(e1, e2, e3, e4)
+ dma_unmap_sg(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+ dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_dma_sync_single_for_device(e1, e2, e3, e4)
+ dma_sync_single_for_device(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+ dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+ dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
@@
expression e1, e2;
@@
- pci_dma_mapping_error(e1, e2)
+ dma_mapping_error(&e1->dev, e2)
@@
expression e1, e2;
@@
- pci_set_dma_mask(e1, e2)
+ dma_set_mask(&e1->dev, e2)
@@
expression e1, e2;
@@
- pci_set_consistent_dma_mask(e1, e2)
+ dma_set_coherent_mask(&e1->dev, e2)
Stable-dep-of: 89f45c30172c ("net/qla3xxx: fix potential memleak in ql_alloc_buffer_queues")
--- drivers/net/ethernet/qlogic/qla3xxx.c | 196 ++++++++++++-------------- 1 file changed, 87 insertions(+), 109 deletions(-)
drivers/net/ethernet/qlogic/qla3xxx.c +87 -109
@@ -315,12 +315,11 @@ static void ql_release_to_lrg_buf_free_list(struct ql3_adapter *qdev,* buffer */ skb_reserve (lrg_buf_cb->skb,QL_HEADER_SPACE ); - map =pci_map_single (qdev->pdev, + map =dma_map_single (&qdev->pdev->dev, lrg_buf_cb->skb->data, - qdev->lrg_buffer_len - -QL_HEADER_SPACE , -PCI_DMA_FROMDEVICE ); - err =pci_dma_mapping_error (qdev->pdev, map); + qdev->lrg_buffer_len -QL_HEADER_SPACE , +DMA_FROM_DEVICE ); + err =dma_mapping_error (&qdev->pdev->dev, map);if (err) { netdev_err(qdev->ndev, "PCI mapping failed with error: %d\n",
@@ -1802,13 +1801,12 @@ static int ql_populate_free_queue(struct ql3_adapter *qdev)* first buffer */ skb_reserve (lrg_buf_cb->skb,QL_HEADER_SPACE ); - map =pci_map_single (qdev->pdev, + map =dma_map_single (&qdev->pdev->dev, lrg_buf_cb->skb->data, - qdev->lrg_buffer_len - -QL_HEADER_SPACE , -PCI_DMA_FROMDEVICE ); + qdev->lrg_buffer_len -QL_HEADER_SPACE , +DMA_FROM_DEVICE ); - err =pci_dma_mapping_error (qdev->pdev, map); + err =dma_mapping_error (&qdev->pdev->dev, map);if (err) { netdev_err(qdev->ndev, "PCI mapping failed with error: %d\n",
@@ -1943,18 +1941,16 @@ static void ql_process_mac_tx_intr(struct ql3_adapter *qdev, goto invalid_seg_count; } -pci_unmap_single (qdev->pdev, +dma_unmap_single (&qdev->pdev->dev,dma_unmap_addr (&tx_cb->map[0 ], mapaddr), -dma_unmap_len (&tx_cb->map[0 ], maplen), -PCI_DMA_TODEVICE ); +dma_unmap_len (&tx_cb->map[0 ], maplen),DMA_TO_DEVICE ); tx_cb->seg_count--;if (tx_cb->seg_count) {for (i =1 ; i < tx_cb->seg_count; i++) { -pci_unmap_page (qdev->pdev, -dma_unmap_addr (&tx_cb->map[i], - mapaddr), +dma_unmap_page (&qdev->pdev->dev, +dma_unmap_addr (&tx_cb->map[i], mapaddr),dma_unmap_len (&tx_cb->map[i], maplen), -PCI_DMA_TODEVICE ); +DMA_TO_DEVICE ); } } qdev->ndev->stats.tx_packets++;
@@ -2021,10 +2017,9 @@ static void ql_process_mac_rx_intr(struct ql3_adapter *qdev, qdev->ndev->stats.rx_bytes += length;skb_put (skb, length); -pci_unmap_single (qdev->pdev, +dma_unmap_single (&qdev->pdev->dev,dma_unmap_addr (lrg_buf_cb2, mapaddr), -dma_unmap_len (lrg_buf_cb2, maplen), -PCI_DMA_FROMDEVICE ); +dma_unmap_len (lrg_buf_cb2, maplen),DMA_FROM_DEVICE );prefetch (skb->data);skb_checksum_none_assert (skb); skb->protocol =eth_type_trans (skb, qdev->ndev);
@@ -2067,10 +2062,9 @@ static void ql_process_macip_rx_intr(struct ql3_adapter *qdev, skb2 = lrg_buf_cb2->skb;skb_put (skb2, length);/* Just the second buffer length here. */ -pci_unmap_single (qdev->pdev, +dma_unmap_single (&qdev->pdev->dev,dma_unmap_addr (lrg_buf_cb2, mapaddr), -dma_unmap_len (lrg_buf_cb2, maplen), -PCI_DMA_FROMDEVICE ); +dma_unmap_len (lrg_buf_cb2, maplen),DMA_FROM_DEVICE );prefetch (skb2->data);skb_checksum_none_assert (skb2);
@@ -2319,9 +2313,9 @@ static int ql_send_map(struct ql3_adapter *qdev,/* * Map the skb buffer first. */ - map =pci_map_single (qdev->pdev, skb->data, len,PCI_DMA_TODEVICE ); + map =dma_map_single (&qdev->pdev->dev, skb->data, len,DMA_TO_DEVICE ); - err =pci_dma_mapping_error (qdev->pdev, map); + err =dma_mapping_error (&qdev->pdev->dev, map);if (err) {netdev_err (qdev->ndev,"PCI mapping failed with error: %d\n" , err);
@@ -2357,11 +2351,11 @@ static int ql_send_map(struct ql3_adapter *qdev, (seg == 7 && seg_cnt > 8) || (seg == 12 && seg_cnt > 13) || (seg == 17 && seg_cnt > 18)) { - map =pci_map_single (qdev->pdev, oal, + map =dma_map_single (&qdev->pdev->dev, oal,sizeof (struct oal ), -PCI_DMA_TODEVICE ); +DMA_TO_DEVICE ); - err =pci_dma_mapping_error (qdev->pdev, map); + err =dma_mapping_error (&qdev->pdev->dev, map);if (err) { netdev_err(qdev->ndev, "PCI mapping outbound address list with error: %d\n",
@@ -2423,24 +2417,24 @@ static int ql_send_map(struct ql3_adapter *qdev, (seg == 7 && seg_cnt > 8) || (seg == 12 && seg_cnt > 13) || (seg == 17 && seg_cnt > 18)) { -pci_unmap_single (qdev->pdev, -dma_unmap_addr (&tx_cb->map[seg], mapaddr), -dma_unmap_len (&tx_cb->map[seg], maplen), -PCI_DMA_TODEVICE ); +dma_unmap_single (&qdev->pdev->dev, +dma_unmap_addr (&tx_cb->map[seg], mapaddr), +dma_unmap_len (&tx_cb->map[seg], maplen), +DMA_TO_DEVICE ); oal++; seg++; } -pci_unmap_page (qdev->pdev, +dma_unmap_page (&qdev->pdev->dev,dma_unmap_addr (&tx_cb->map[seg], mapaddr),dma_unmap_len (&tx_cb->map[seg], maplen), -PCI_DMA_TODEVICE ); +DMA_TO_DEVICE ); } -pci_unmap_single (qdev->pdev, +dma_unmap_single (&qdev->pdev->dev,dma_unmap_addr (&tx_cb->map[0 ], mapaddr),dma_unmap_addr (&tx_cb->map[0 ], maplen), -PCI_DMA_TODEVICE ); +DMA_TO_DEVICE );return NETDEV_TX_BUSY ;
@@ -2526,9 +2520,8 @@ static int ql_alloc_net_req_rsp_queues(struct ql3_adapter *qdev)wmb (); qdev->req_q_virt_addr = -pci_alloc_consistent (qdev->pdev, - (size_t ) qdev->req_q_size, - &qdev->req_q_phy_addr); +dma_alloc_coherent (&qdev->pdev->dev, (size_t )qdev->req_q_size, + &qdev->req_q_phy_addr,GFP_KERNEL );if ((qdev->req_q_virt_addr ==NULL ) ||LS_64BITS (qdev->req_q_phy_addr) & (qdev->req_q_size -1 )) {
@@ -2537,16 +2530,14 @@ static int ql_alloc_net_req_rsp_queues(struct ql3_adapter *qdev) } qdev->rsp_q_virt_addr = -pci_alloc_consistent (qdev->pdev, - (size_t ) qdev->rsp_q_size, - &qdev->rsp_q_phy_addr); +dma_alloc_coherent (&qdev->pdev->dev, (size_t )qdev->rsp_q_size, + &qdev->rsp_q_phy_addr,GFP_KERNEL );if ((qdev->rsp_q_virt_addr ==NULL ) ||LS_64BITS (qdev->rsp_q_phy_addr) & (qdev->rsp_q_size -1 )) {netdev_err (qdev->ndev,"rspQ allocation failed\n" ); -pci_free_consistent (qdev->pdev, (size_t ) qdev->req_q_size, - qdev->req_q_virt_addr, - qdev->req_q_phy_addr); +dma_free_coherent (&qdev->pdev->dev, (size_t )qdev->req_q_size, + qdev->req_q_virt_addr, qdev->req_q_phy_addr);return -ENOMEM ; }
@@ -2562,15 +2553,13 @@ static void ql_free_net_req_rsp_queues(struct ql3_adapter *qdev)return ; } -pci_free_consistent (qdev->pdev, - qdev->req_q_size, - qdev->req_q_virt_addr, qdev->req_q_phy_addr); +dma_free_coherent (&qdev->pdev->dev, qdev->req_q_size, + qdev->req_q_virt_addr, qdev->req_q_phy_addr); qdev->req_q_virt_addr =NULL ; -pci_free_consistent (qdev->pdev, - qdev->rsp_q_size, - qdev->rsp_q_virt_addr, qdev->rsp_q_phy_addr); +dma_free_coherent (&qdev->pdev->dev, qdev->rsp_q_size, + qdev->rsp_q_virt_addr, qdev->rsp_q_phy_addr); qdev->rsp_q_virt_addr =NULL ;
@@ -2594,9 +2583,9 @@ static int ql_alloc_buffer_queues(struct ql3_adapter *qdev)return -ENOMEM ; qdev->lrg_buf_q_alloc_virt_addr = -pci_alloc_consistent (qdev->pdev, - qdev->lrg_buf_q_alloc_size, - &qdev->lrg_buf_q_alloc_phy_addr); +dma_alloc_coherent (&qdev->pdev->dev, + qdev->lrg_buf_q_alloc_size, + &qdev->lrg_buf_q_alloc_phy_addr,GFP_KERNEL );if (qdev->lrg_buf_q_alloc_virt_addr ==NULL ) {netdev_err (qdev->ndev,"lBufQ failed\n" );
@@ -2614,15 +2603,16 @@ static int ql_alloc_buffer_queues(struct ql3_adapter *qdev) qdev->small_buf_q_alloc_size = qdev->small_buf_q_size *2 ; qdev->small_buf_q_alloc_virt_addr = -pci_alloc_consistent (qdev->pdev, - qdev->small_buf_q_alloc_size, - &qdev->small_buf_q_alloc_phy_addr); +dma_alloc_coherent (&qdev->pdev->dev, + qdev->small_buf_q_alloc_size, + &qdev->small_buf_q_alloc_phy_addr,GFP_KERNEL );if (qdev->small_buf_q_alloc_virt_addr ==NULL ) {netdev_err (qdev->ndev,"Small Buffer Queue allocation failed\n" ); -pci_free_consistent (qdev->pdev, qdev->lrg_buf_q_alloc_size, - qdev->lrg_buf_q_alloc_virt_addr, - qdev->lrg_buf_q_alloc_phy_addr); +dma_free_coherent (&qdev->pdev->dev, + qdev->lrg_buf_q_alloc_size, + qdev->lrg_buf_q_alloc_virt_addr, + qdev->lrg_buf_q_alloc_phy_addr);return -ENOMEM ; }
@@ -2639,17 +2629,15 @@ static void ql_free_buffer_queues(struct ql3_adapter *qdev)return ; }kfree (qdev->lrg_buf); -pci_free_consistent (qdev->pdev, - qdev->lrg_buf_q_alloc_size, - qdev->lrg_buf_q_alloc_virt_addr, - qdev->lrg_buf_q_alloc_phy_addr); +dma_free_coherent (&qdev->pdev->dev, qdev->lrg_buf_q_alloc_size, + qdev->lrg_buf_q_alloc_virt_addr, + qdev->lrg_buf_q_alloc_phy_addr); qdev->lrg_buf_q_virt_addr =NULL ; -pci_free_consistent (qdev->pdev, - qdev->small_buf_q_alloc_size, - qdev->small_buf_q_alloc_virt_addr, - qdev->small_buf_q_alloc_phy_addr); +dma_free_coherent (&qdev->pdev->dev, qdev->small_buf_q_alloc_size, + qdev->small_buf_q_alloc_virt_addr, + qdev->small_buf_q_alloc_phy_addr); qdev->small_buf_q_virt_addr =NULL ;
@@ -2667,9 +2655,9 @@ static int ql_alloc_small_buffers(struct ql3_adapter *qdev) QL_SMALL_BUFFER_SIZE); qdev->small_buf_virt_addr = -pci_alloc_consistent (qdev->pdev, - qdev->small_buf_total_size, - &qdev->small_buf_phy_addr); +dma_alloc_coherent (&qdev->pdev->dev, + qdev->small_buf_total_size, + &qdev->small_buf_phy_addr,GFP_KERNEL );if (qdev->small_buf_virt_addr ==NULL ) {netdev_err (qdev->ndev,"Failed to get small buffer memory\n" );
@@ -2702,10 +2690,10 @@ static void ql_free_small_buffers(struct ql3_adapter *qdev)return ; }if (qdev->small_buf_virt_addr !=NULL ) { -pci_free_consistent (qdev->pdev, - qdev->small_buf_total_size, - qdev->small_buf_virt_addr, - qdev->small_buf_phy_addr); +dma_free_coherent (&qdev->pdev->dev, + qdev->small_buf_total_size, + qdev->small_buf_virt_addr, + qdev->small_buf_phy_addr); qdev->small_buf_virt_addr =NULL ; }
@@ -2720,10 +2708,10 @@ static void ql_free_large_buffers(struct ql3_adapter *qdev) lrg_buf_cb = &qdev->lrg_buf[i];if (lrg_buf_cb->skb) {dev_kfree_skb (lrg_buf_cb->skb); -pci_unmap_single (qdev->pdev, +dma_unmap_single (&qdev->pdev->dev,dma_unmap_addr (lrg_buf_cb, mapaddr),dma_unmap_len (lrg_buf_cb, maplen), -PCI_DMA_FROMDEVICE ); +DMA_FROM_DEVICE );memset (lrg_buf_cb,0 ,sizeof (struct ql_rcv_buf_cb )); }else {break ;
@@ -2775,13 +2763,11 @@ static int ql_alloc_large_buffers(struct ql3_adapter *qdev)* buffer */ skb_reserve (skb,QL_HEADER_SPACE ); - map =pci_map_single (qdev->pdev, - skb->data, - qdev->lrg_buffer_len - -QL_HEADER_SPACE , -PCI_DMA_FROMDEVICE ); + map =dma_map_single (&qdev->pdev->dev, skb->data, + qdev->lrg_buffer_len -QL_HEADER_SPACE , +DMA_FROM_DEVICE ); - err =pci_dma_mapping_error (qdev->pdev, map); + err =dma_mapping_error (&qdev->pdev->dev, map);if (err) { netdev_err(qdev->ndev, "PCI mapping failed with error: %d\n",
@@ -2866,8 +2852,8 @@ static int ql_alloc_mem_resources(struct ql3_adapter *qdev)* Network Completion Queue Producer Index Register */ qdev->shadow_reg_virt_addr = -pci_alloc_consistent (qdev->pdev, -PAGE_SIZE , &qdev->shadow_reg_phy_addr); +dma_alloc_coherent (&qdev->pdev->dev,PAGE_SIZE , + &qdev->shadow_reg_phy_addr,GFP_KERNEL );if (qdev->shadow_reg_virt_addr !=NULL ) { qdev->preq_consumer_index = qdev->shadow_reg_virt_addr;
@@ -2922,10 +2908,9 @@ static int ql_alloc_mem_resources(struct ql3_adapter *qdev) err_buffer_queues:ql_free_net_req_rsp_queues (qdev); err_req_rsp: -pci_free_consistent (qdev->pdev, -PAGE_SIZE , - qdev->shadow_reg_virt_addr, - qdev->shadow_reg_phy_addr); +dma_free_coherent (&qdev->pdev->dev,PAGE_SIZE , + qdev->shadow_reg_virt_addr, + qdev->shadow_reg_phy_addr);return -ENOMEM ; }
@@ -2938,10 +2923,9 @@ static void ql_free_mem_resources(struct ql3_adapter *qdev)ql_free_buffer_queues (qdev);ql_free_net_req_rsp_queues (qdev);if (qdev->shadow_reg_virt_addr !=NULL ) { -pci_free_consistent (qdev->pdev, -PAGE_SIZE , - qdev->shadow_reg_virt_addr, - qdev->shadow_reg_phy_addr); +dma_free_coherent (&qdev->pdev->dev,PAGE_SIZE , + qdev->shadow_reg_virt_addr, + qdev->shadow_reg_phy_addr); qdev->shadow_reg_virt_addr =NULL ; } }
@@ -3642,18 +3626,15 @@ static void ql_reset_work(struct work_struct *work)if (tx_cb->skb) {netdev_printk (KERN_DEBUG , ndev,"Freeing lost SKB\n" ); -pci_unmap_single (qdev->pdev, -dma_unmap_addr (&tx_cb->map[0 ], - mapaddr), -dma_unmap_len (&tx_cb->map[0 ], maplen), -PCI_DMA_TODEVICE ); +dma_unmap_single (&qdev->pdev->dev, +dma_unmap_addr (&tx_cb->map[0 ], mapaddr), +dma_unmap_len (&tx_cb->map[0 ], maplen), +DMA_TO_DEVICE );for (j =1 ; j < tx_cb->seg_count; j++) { -pci_unmap_page (qdev->pdev, -dma_unmap_addr (&tx_cb->map[j], - mapaddr), -dma_unmap_len (&tx_cb->map[j], - maplen), -PCI_DMA_TODEVICE ); +dma_unmap_page (&qdev->pdev->dev, +dma_unmap_addr (&tx_cb->map[j], mapaddr), +dma_unmap_len (&tx_cb->map[j], maplen), +DMA_TO_DEVICE ); }dev_kfree_skb (tx_cb->skb); tx_cb->skb =NULL ;
@@ -3785,13 +3766,10 @@ static int ql3xxx_probe(struct pci_dev *pdev,pci_set_master (pdev); -if (!pci_set_dma_mask (pdev,DMA_BIT_MASK (64 ))) { +if (!dma_set_mask_and_coherent (&pdev->dev,DMA_BIT_MASK (64 ))) pci_using_dac =1 ; - err =pci_set_consistent_dma_mask (pdev,DMA_BIT_MASK (64 )); - }else if (!(err =pci_set_dma_mask (pdev,DMA_BIT_MASK (32 )))) { +else if (!(err =dma_set_mask_and_coherent (&pdev->dev,DMA_BIT_MASK (32 )))) pci_using_dac =0 ; - err =pci_set_consistent_dma_mask (pdev,DMA_BIT_MASK (32 )); - }if (err) {pr_err ("%s no usable DMA configuration\n" ,pci_name (pdev));
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 23/43 net/qla3xxx: fix potential memleak in ql_alloc_buffer_queues
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dinghao Liu <[email protected]>
[ Upstream commit 89f45c30172c80e55c887f32f1af8e184124577b ]
When dma_alloc_coherent() fails, we should free qdev->lrg_buf to prevent potential memleak.
--- drivers/net/ethernet/qlogic/qla3xxx.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/qlogic/qla3xxx.c +2 -0
@@ -2589,6 +2589,7 @@ static int ql_alloc_buffer_queues(struct ql3_adapter *qdev)if (qdev->lrg_buf_q_alloc_virt_addr ==NULL ) {netdev_err (qdev->ndev,"lBufQ failed\n" ); +kfree (qdev->lrg_buf);return -ENOMEM ; } qdev->lrg_buf_q_virt_addr = qdev->lrg_buf_q_alloc_virt_addr;
@@ -2613,6 +2614,7 @@ static int ql_alloc_buffer_queues(struct ql3_adapter *qdev) qdev->lrg_buf_q_alloc_size, qdev->lrg_buf_q_alloc_virt_addr, qdev->lrg_buf_q_alloc_phy_addr); +kfree (qdev->lrg_buf);return -ENOMEM ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 24/43 asix: Add check for usbnet_get_endpoints
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Ni <[email protected]>
[ Upstream commit eaac6a2d26b65511e164772bec6918fcbc61938e ]
Add check for usbnet_get_endpoints() and return the error if it fails in order to transfer the error.
--- drivers/net/usb/ax88172a.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/usb/ax88172a.c +3 -1
@@ -175,7 +175,9 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf)u8 buf[ETH_ALEN ];struct ax88172a_private *priv; -usbnet_get_endpoints (dev, intf); + ret =usbnet_get_endpoints (dev, intf); +if (ret) +return ret; priv =kzalloc (sizeof (*priv),GFP_KERNEL );if (!priv)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 25/43 bnxt_en: Remove mis-applied code from bnxt_cfg_ntp_filters()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Chan <[email protected]>
[ Upstream commit e009b2efb7a8850498796b360043ac25c8d3d28f ]
The 2 lines to check for the BNXT_HWRM_PF_UNLOAD_SP_EVENT bit was mis-applied to bnxt_cfg_ntp_filters() and should have been applied to bnxt_sp_task().
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -2
@@ -11143,6 +11143,8 @@ static void bnxt_sp_task(struct work_struct *work)bnxt_cfg_ntp_filters (bp);if (test_and_clear_bit (BNXT_HWRM_EXEC_FWD_REQ_SP_EVENT , &bp->sp_event))bnxt_hwrm_exec_fwd_req (bp); +if (test_and_clear_bit (BNXT_HWRM_PF_UNLOAD_SP_EVENT , &bp->sp_event)) +netdev_info (bp->dev,"Receive PF driver unload event!\n" );if (test_and_clear_bit (BNXT_PERIODIC_STATS_SP_EVENT , &bp->sp_event)) {bnxt_hwrm_port_qstats (bp,0 );bnxt_hwrm_port_qstats_ext (bp,0 );
@@ -12097,8 +12099,6 @@ static void bnxt_cfg_ntp_filters(struct bnxt *bp) } } } -if (test_and_clear_bit (BNXT_HWRM_PF_UNLOAD_SP_EVENT , &bp->sp_event)) -netdev_info (bp->dev,"Receive PF driver unload event!\n" ); }#else
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 26/43 net: Implement missing SO_TIMESTAMPING_NEW cmsg support
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Lange <[email protected]>
[ Upstream commit 382a32018b74f407008615e0e831d05ed28e81cd ]
Commit 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW") added the new socket option SO_TIMESTAMPING_NEW. However, it was never implemented in __sock_cmsg_send thus breaking SO_TIMESTAMPING cmsg for platforms using SO_TIMESTAMPING_NEW.
--- net/core/sock.c | 1 + 1 file changed, 1 insertion(+)
net/core/sock.c +1 -0
@@ -2402,6 +2402,7 @@ int __sock_cmsg_send(struct sock *sk, struct msghdr *msg, struct cmsghdr *cmsg, sockc->mark = *(u32 *)CMSG_DATA (cmsg);break ;case SO_TIMESTAMPING_OLD : +case SO_TIMESTAMPING_NEW :if (cmsg->cmsg_len !=CMSG_LEN (sizeof (u32)))return -EINVAL ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 27/43 mm/memory-failure: check the mapcount of the precise page
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wilcox (Oracle) <[email protected]>
[ Upstream commit c79c5a0a00a9457718056b588f312baadf44e471 ]
A process may map only some of the pages in a folio, and might be missed if it maps the poisoned page but not the head page. Or it might be unnecessarily hit if it maps the head page, but not the poisoned page.
--- mm/memory-failure.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
mm/memory-failure.c +3 -3
@@ -1010,7 +1010,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn,* This check implies we don't kill processes if their pages * are in the swap cache early. Those are always late kills. */ -if (!page_mapped (hpage)) +if (!page_mapped (p))return true;if (PageKsm (p)) {
@@ -1075,12 +1075,12 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn, unmap_success = false; } }else { - unmap_success =try_to_unmap (hpage, ttu); + unmap_success =try_to_unmap (p, ttu); } }if (!unmap_success)pr_err ("Memory failure: %#lx: failed to unmap page (mapcount=%d)\n" , - pfn,page_mapcount (hpage)); + pfn,page_mapcount (p));/* * try_to_unmap() might put mlocked page in lru cache, so call
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 28/43 firewire: ohci: suppress unexpected system reboot in AMD Ryzen machines and ASM108x/VT630x PCIe cards
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Sakamoto <[email protected]>
commit ac9184fbb8478dab4a0724b279f94956b69be827 upstream.
VIA VT6306/6307/6308 provides PCI interface compliant to 1394 OHCI. When the hardware is combined with Asmedia ASM1083/1085 PCIe-to-PCI bus bridge, it appears that accesses to its 'Isochronous Cycle Timer' register (offset 0xf0 on PCI memory space) often causes unexpected system reboot in any type of AMD Ryzen machine (both 0x17 and 0x19 families). It does not appears in the other type of machine (AMD pre-Ryzen machine, Intel machine, at least), or in the other OHCI 1394 hardware (e.g. Texas Instruments).
The issue explicitly appears at a commit dcadfd7f7c74 ("firewire: core:
use union for callback of transaction completion") added to v6.5 kernel. It changed 1394 OHCI driver to access to the register every time to dispatch local asynchronous transaction. However, the issue exists in older version of kernel as long as it runs in AMD Ryzen machine, since the access to the register is required to maintain bus time. It is not hard to imagine that users experience the unexpected system reboot when generating bus reset by plugging any devices in, or reading the register by time-aware application programs; e.g. audio sample processing.
This commit suppresses the unexpected system reboot in the combination of hardware. It avoids the access itself. As a result, the software stack can not provide the hardware time anymore to unit drivers, userspace applications, and nodes in the same IEEE 1394 bus. It brings apparent disadvantage since time-aware application programs require it, while time-unaware applications are available again; e.g. sbp2.
--- drivers/firewire/ohci.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+)
drivers/firewire/ohci.c +51 -0
@@ -279,6 +279,51 @@ static char ohci_driver_name[] = KBUILD_#define QUIRK_TI_SLLZ059 0x20#define QUIRK_IR_WAKE 0x40 +// On PCI Express Root Complex in any type of AMD Ryzen machine, VIA VT6306/6307/6308 with Asmedia +// ASM1083/1085 brings an inconvenience that the read accesses to 'Isochronous Cycle Timer' register +// (at offset 0xf0 in PCI I/O space) often causes unexpected system reboot. The mechanism is not +// clear, since the read access to the other registers is enough safe; e.g. 'Node ID' register, +// while it is probable due to detection of any type of PCIe error. +#define QUIRK_REBOOT_BY_CYCLE_TIMER_READ 0x80000000 + +#if IS_ENABLED (CONFIG_X86 ) + +static bool has_reboot_by_cycle_timer_read_quirk (const struct fw_ohci *ohci) +{ +return !!(ohci->quirks &QUIRK_REBOOT_BY_CYCLE_TIMER_READ ); +} + +#define PCI_DEVICE_ID_ASMEDIA_ASM108X 0x1080 + +static bool detect_vt630x_with_asm1083_on_amd_ryzen_machine (const struct pci_dev *pdev) +{ +const struct pci_dev *pcie_to_pci_bridge; + +// Detect any type of AMD Ryzen machine. +if (!static_cpu_has (X86_FEATURE_ZEN )) +return false; + +// Detect VIA VT6306/6307/6308. +if (pdev->vendor !=PCI_VENDOR_ID_VIA ) +return false; +if (pdev->device !=PCI_DEVICE_ID_VIA_VT630X ) +return false; + +// Detect Asmedia ASM1083/1085. + pcie_to_pci_bridge = pdev->bus->self; +if (pcie_to_pci_bridge->vendor !=PCI_VENDOR_ID_ASMEDIA ) +return false; +if (pcie_to_pci_bridge->device !=PCI_DEVICE_ID_ASMEDIA_ASM108X ) +return false; + +return true; +} + +#else +#define has_reboot_by_cycle_timer_read_quirk (ohci) false +#define detect_vt630x_with_asm1083_on_amd_ryzen_machine (pdev) false +#endif +/* In case of multiple matches in ohci_quirks[], only the first one is used. */ static const struct { unsigned short vendor, device, revision, flags;
@@ -1713,6 +1758,9 @@ static u32 get_cycle_time(struct fw_ohcis32 diff01, diff12;int i; +if (has_reboot_by_cycle_timer_read_quirk (ohci)) +return 0 ; + c2 =reg_read (ohci, OHCI1394_IsochronousCycleTimer);if (ohci->quirks &QUIRK_CYCLE_TIMER ) {
@@ -3615,6 +3663,9 @@ static int pci_probe(struct pci_dev *devif (param_quirks) ohci->quirks = param_quirks; +if (detect_vt630x_with_asm1083_on_amd_ryzen_machine (dev)) + ohci->quirks |=QUIRK_REBOOT_BY_CYCLE_TIMER_READ ; +/* * Because dma_alloc_coherent() allocates at least one page, * we save space by using a common buffer for the AR request/
Greg Kroah-Hartman
maintainerPATCH 29/43 x86/kprobes: fix incorrect return address calculation in kprobe_emulate_call_indirect
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jinghao Jia <[email protected]>
commit f5d03da48d062966c94f0199d20be0b3a37a7982 upstream.
kprobe_emulate_call_indirect currently uses int3_emulate_call to emulate indirect calls. However, int3_emulate_call always assumes the size of the call to be 5 bytes when calculating the return address. This is incorrect for register-based indirect calls in x86, which can be either 2 or 3 bytes depending on whether REX prefix is used. At kprobe runtime, the incorrect return address causes control flow to land onto the wrong place after return -- possibly not a valid instruction boundary. This can lead to a panic like the following:
[ 7.308204][ C1] BUG: unable to handle page fault for address: 000000000002b4d8 [ 7.308883][ C1] #PF: supervisor read access in kernel mode [ 7.309168][ C1] #PF: error_code(0x0000) - not-present page [ 7.309461][ C1] PGD 0 P4D 0 [ 7.309652][ C1] Oops: 0000 [#1] SMP [ 7.309929][ C1] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.7.0-rc5-trace-for-next #6 [ 7.310397][ C1] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-20220807_005459-localhost 04/01/2014 [ 7.311068][ C1] RIP: 0010:__common_interrupt+0x52/0xc0 [ 7.311349][ C1] Code: 01 00 4d 85 f6 74 39 49 81 fe 00 f0 ff ff 77 30 4c 89 f7 4d 8b 5e 68 41 ba 91 76 d8 42 45 03 53 fc 74 02 0f 0b cc ff d3 65 48 <8b> 05 30 c7 ff 7e 65 4c 89 3d 28 c7 ff 7e 5b 41 5c 41 5e 41 5f c3 [ 7.312512][ C1] RSP: 0018:ffffc900000e0fd0 EFLAGS: 00010046 [ 7.312899][ C1] RAX: 0000000000000001 RBX: 0000000000000023 RCX: 0000000000000001 [ 7.313334][ C1] RDX: 00000000000003cd RSI: 0000000000000001 RDI: ffff888100d302a4 [ 7.313702][ C1] RBP: 0000000000000001 R08: 0ef439818636191f R09: b1621ff338a3b482 [ 7.314146][ C1] R10: ffffffff81e5127b R11: ffffffff81059810 R12: 0000000000000023 [ 7.314509][ C1] R13: 0000000000000000 R14: ffff888100d30200 R15: 0000000000000000 [ 7.314951][ C1] FS: 0000000000000000(0000) GS:ffff88813bc80000(0000) knlGS:0000000000000000 [ 7.315396][ C1] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 7.315691][ C1] CR2: 000000000002b4d8 CR3: 0000000003028003 CR4: 0000000000370ef0 [ 7.316153][ C1] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 7.316508][ C1] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 7.316948][ C1] Call Trace: [ 7.317123][ C1] <IRQ> [ 7.317279][ C1] ? __die_body+0x64/0xb0 [ 7.317482][ C1] ? page_fault_oops+0x248/0x370 [ 7.317712][ C1] ? __wake_up+0x96/0xb0 [ 7.317964][ C1] ? exc_page_fault+0x62/0x130 [ 7.318211][ C1] ? asm_exc_page_fault+0x22/0x30 [ 7.318444][ C1] ? __cfi_native_send_call_func_single_ipi+0x10/0x10 [ 7.318860][ C1] ? default_idle+0xb/0x10 [ 7.319063][ C1] ? __common_interrupt+0x52/0xc0 [ 7.319330][ C1] common_interrupt+0x78/0x90 [ 7.319546][ C1] </IRQ> [ 7.319679][ C1] <TASK> [ 7.319854][ C1] asm_common_interrupt+0x22/0x40 [ 7.320082][ C1] RIP: 0010:default_idle+0xb/0x10 [ 7.320309][ C1] Code: 4c 01 c7 4c 29 c2 e9 72 ff ff ff cc cc cc cc 90 90 90 90 90 90 90 90 90 90 90 b8 0c 67 40 a5 66 90 0f 00 2d 09 b9 3b 00 fb f4 <fa> c3 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 b8 0c 67 40 a5 e9 [ 7.321449][ C1] RSP: 0018:ffffc9000009bee8 EFLAGS: 00000256 [ 7.321808][ C1] RAX: ffff88813bca8b68 RBX: 0000000000000001 RCX: 000000000001ef0c [ 7.322227][ C1] RDX: 0000000000000000 RSI: 0000000000000001 RDI: 000000000001ef0c [ 7.322656][ C1] RBP: ffffc9000009bef8 R08: 8000000000000000 R09: 00000000000008c2 [ 7.323083][ C1] R10: 0000000000000000 R11: ffffffff81058e70 R12: 0000000000000000 [ 7.323530][ C1] R13: ffff8881002b30c0 R14: 0000000000000000 R15: 0000000000000000 [ 7.323948][ C1] ? __cfi_lapic_next_deadline+0x10/0x10 [ 7.324239][ C1] default_idle_call+0x31/0x50 [ 7.324464][ C1] do_idle+0xd3/0x240 [ 7.324690][ C1] cpu_startup_entry+0x25/0x30 [ 7.324983][ C1] start_secondary+0xb4/0xc0 [ 7.325217][ C1] secondary_startup_64_no_verify+0x179/0x17b [ 7.325498][ C1] </TASK> [ 7.325641][ C1] Modules linked in: [ 7.325906][ C1] CR2: 000000000002b4d8 [ 7.326104][ C1] ---[ end trace 0000000000000000 ]--- [ 7.326354][ C1] RIP: 0010:__common_interrupt+0x52/0xc0 [ 7.326614][ C1] Code: 01 00 4d 85 f6 74 39 49 81 fe 00 f0 ff ff 77 30 4c 89 f7 4d 8b 5e 68 41 ba 91 76 d8 42 45 03 53 fc 74 02 0f 0b cc ff d3 65 48 <8b> 05 30 c7 ff 7e 65 4c 89 3d 28 c7 ff 7e 5b 41 5c 41 5e 41 5f c3 [ 7.327570][ C1] RSP: 0018:ffffc900000e0fd0 EFLAGS: 00010046 [ 7.327910][ C1] RAX: 0000000000000001 RBX: 0000000000000023 RCX: 0000000000000001 [ 7.328273][ C1] RDX: 00000000000003cd RSI: 0000000000000001 RDI: ffff888100d302a4 [ 7.328632][ C1] RBP: 0000000000000001 R08: 0ef439818636191f R09: b1621ff338a3b482 [ 7.329223][ C1] R10: ffffffff81e5127b R11: ffffffff81059810 R12: 0000000000000023 [ 7.329780][ C1] R13: 0000000000000000 R14: ffff888100d30200 R15: 0000000000000000 [ 7.330193][ C1] FS: 0000000000000000(0000) GS:ffff88813bc80000(0000) knlGS:0000000000000000 [ 7.330632][ C1] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 7.331050][ C1] CR2: 000000000002b4d8 CR3: 0000000003028003 CR4: 0000000000370ef0 [ 7.331454][ C1] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 7.331854][ C1] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 7.332236][ C1] Kernel panic - not syncing: Fatal exception in interrupt [ 7.332730][ C1] Kernel Offset: disabled [ 7.333044][ C1] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---
The relevant assembly code is (from objdump, faulting address highlighted):
ffffffff8102ed9d: 41 ff d3 call *%r11 ffffffff8102eda0: 65 48 <8b> 05 30 c7 ff mov %gs:0x7effc730(%rip),%rax
The emulation incorrectly sets the return address to be ffffffff8102ed9d
+ 0x5 = ffffffff8102eda2, which is the 8b byte in the middle of the next mov. This in turn causes incorrect subsequent instruction decoding and eventually triggers the page fault above.
Instead of invoking int3_emulate_call, perform push and jmp emulation directly in kprobe_emulate_call_indirect. At this point we can obtain the instruction size from p->ainsn.size so that we can calculate the correct return address.
--- arch/x86/kernel/kprobes/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/kprobes/core.c +2 -1
@@ -569,7 +569,8 @@ static void kprobe_emulate_call_indirect {unsigned long offs = addrmode_regoffs[p->ainsn.indirect.reg]; -int3_emulate_call (regs,regs_get_register (regs, offs)); +int3_emulate_push (regs, regs->ip -INT3_INSN_SIZE + p->ainsn.size); +int3_emulate_jmp (regs,regs_get_register (regs, offs)); }NOKPROBE_SYMBOL (kprobe_emulate_call_indirect);
Greg Kroah-Hartman
maintainerPATCH 30/43 i2c: core: Fix atomic xfer check for non-preempt config
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Bara <[email protected]>
commit a3368e1186e3ce8e38f78cbca019622095b1f331 upstream.
Since commit aa49c90894d0 ("i2c: core: Run atomic i2c xfer when !preemptible"), the whole reboot/power off sequence on non-preempt kernels is using atomic i2c xfer, as !preemptible() always results to 1.
During device_shutdown(), the i2c might be used a lot and not all busses have implemented an atomic xfer handler. This results in a lot of avoidable noise, like:
[ 12.687169] No atomic I2C transfer handler for 'i2c-0' [ 12.692313] WARNING: CPU: 6 PID: 275 at drivers/i2c/i2c-core.h:40 i2c_smbus_xfer+0x100/0x118
...
Fix this by allowing non-atomic xfer when the interrupts are enabled, as it was before.
--- drivers/i2c/i2c-core.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/i2c/i2c-core.h +3 -1
@@ -3,6 +3,7 @@* i2c-core.h - interfaces internal to the I2C framework */ +#include <linux/kconfig.h> #include <linux/rwsem.h> struct i2c_devinfo {
@@ -29,7 +30,8 @@ int i2c_dev_irq_from_resources(const str*/ static inline bool i2c_in_atomic_xfer_mode (void ) { -return system_state >SYSTEM_RUNNING && !preemptible (); +return system_state >SYSTEM_RUNNING && + (IS_ENABLED (CONFIG_PREEMPT_COUNT ) ? !preemptible () :irqs_disabled ()); }static inline int __i2c_lock_bus_helper (struct i2c_adapter *adap)
Greg Kroah-Hartman
maintainerPATCH 31/43 mm: fix unmap_mapping_range high bits shift bug
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiajun Xie <[email protected]>
commit 9eab0421fa94a3dde0d1f7e36ab3294fc306c99d upstream.
The bug happens when highest bit of holebegin is 1, suppose holebegin is 0x8000000111111000, after shift, hba would be 0xfff8000000111111, then vma_interval_tree_foreach would look it up fail or leads to the wrong result.
error call seq e.g.:
- mmap(..., offset=0x8000000111111000)
|- syscall(mmap, ... unsigned long, off):
|- ksys_mmap_pgoff( ... , off >> PAGE_SHIFT);
here pgoff is correctly shifted to 0x8000000111111, but pass 0x8000000111111000 as holebegin to unmap would then cause terrible result, as shown below:
- unmap_mapping_range(..., loff_t const holebegin)
|- pgoff_t hba = holebegin >> PAGE_SHIFT;
/* hba = 0xfff8000000111111 unexpectedly */The issue happens in Heterogeneous computing, where the device(e.g. gpu) and host share the same virtual address space.
A simple workflow pattern which hit the issue is:
/* host */
1. userspace first mmap a file backed VA range with specified offset. e.g. (offset=0x800..., mmap return: va_a)
2. write some data to the corresponding sys page
e.g. (va_a = 0xAABB)
/* device */
3. gpu workload touches VA, triggers gpu fault and notify the host. /* host */
4. reviced gpu fault notification, then it will:
4.1 unmap host pages and also takes care of cpu tlb
(use unmap_mapping_range with offset=0x800...)
4.2 migrate sys page to device
4.3 setup device page table and resolve device fault.
/* device */
5. gpu workload continued, it accessed va_a and got 0xAABB.
6. gpu workload continued, it wrote 0xBBCC to va_a.
/* host */
7. userspace access va_a, as expected, it will:
7.1 trigger cpu vm fault.
7.2 driver handling fault to migrate gpu local page to host.
8. userspace then could correctly get 0xBBCC from va_a
9. done
But in step 4.1, if we hit the bug this patch mentioned, then userspace would never trigger cpu fault, and still get the old value: 0xAABB.
Making holebegin unsigned first fixes the bug.
--- mm/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/memory.c +2 -2
@@ -3300,8 +3300,8 @@ void unmap_mapping_pages(struct address_void unmap_mapping_range (struct address_space *mapping,loff_t const holebegin,loff_t const holelen,int even_cows) { -pgoff_t hba = holebegin >>PAGE_SHIFT ; -pgoff_t hlen = (holelen +PAGE_SIZE -1 ) >>PAGE_SHIFT ; +pgoff_t hba = (pgoff_t)(holebegin) >>PAGE_SHIFT ; +pgoff_t hlen = ((pgoff_t)(holelen) +PAGE_SIZE -1 ) >>PAGE_SHIFT ;/* Check for overflow. */ if (sizeof (holelen) >sizeof (hlen)) {
Greg Kroah-Hartman
maintainerPATCH 32/43 mmc: meson-mx-sdhc: Fix initialization frozen issue
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ziyang Huang <[email protected]>
commit 8c124d998ea0c9022e247b11ac51f86ec8afa0e1 upstream.
Commit 4bc31edebde5 ("mmc: core: Set HS clock speed before sending HS CMD13") set HS clock (52MHz) before switching to HS mode. For this freq, FCLK_DIV5 will be selected and div value is 10 (reg value is 9). Then we set rx_clk_phase to 11 or 15 which is out of range and make hardware frozen. After we send command request, no irq will be interrupted and the mmc driver will keep to wait for request finished, even durning rebooting.
So let's set it to Phase 90 which should work in most cases. Then let meson_mx_sdhc_execute_tuning() to find the accurate value for data transfer.
If this doesn't work, maybe need to define a factor in dts.
--- drivers/mmc/host/meson-mx-sdhc-mmc.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-)
drivers/mmc/host/meson-mx-sdhc-mmc.c +5 -21
@@ -269,7 +269,7 @@ static int meson_mx_sdhc_enable_clks(struct mmc_host *mmc)static int meson_mx_sdhc_set_clk (struct mmc_host *mmc,struct mmc_ios *ios) {struct meson_mx_sdhc_host *host =mmc_priv (mmc); -u32 rx_clk_phase; +u32 val, rx_clk_phase;int ret;meson_mx_sdhc_disable_clks (mmc);
@@ -290,27 +290,11 @@ static int meson_mx_sdhc_set_clk(struct mmc_host *mmc, struct mmc_ios *ios) mmc->actual_clock =clk_get_rate (host->sd_clk);/* -* according to Amlogic the following latching points are -* selected with empirical values, there is no (known) formula -* to calculate these. +* Phase 90 should work in most cases. For data transmission, +* meson_mx_sdhc_execute_tuning() will find a accurate value */ -if (mmc->actual_clock >100000000 ) { - rx_clk_phase =1 ; - }else if (mmc->actual_clock >45000000 ) { -if (ios->signal_voltage ==MMC_SIGNAL_VOLTAGE_330 ) - rx_clk_phase =15 ; -else - rx_clk_phase =11 ; - }else if (mmc->actual_clock >=25000000 ) { - rx_clk_phase =15 ; - }else if (mmc->actual_clock >5000000 ) { - rx_clk_phase =23 ; - }else if (mmc->actual_clock >1000000 ) { - rx_clk_phase =55 ; - }else { - rx_clk_phase =1061 ; - } - +regmap_read (host->regmap,MESON_SDHC_CLKC , &val); + rx_clk_phase =FIELD_GET (MESON_SDHC_CLKC_CLK_DIV , val) /4 ; regmap_update_bits(host->regmap, MESON_SDHC_CLK2, MESON_SDHC_CLK2_RX_CLK_PHASE, FIELD_PREP(MESON_SDHC_CLK2_RX_CLK_PHASE,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 33/43 mmc: rpmb: fixes pause retune on all RPMB partitions.
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jorge Ramirez-Ortiz <[email protected]>
commit e7794c14fd73e5eb4a3e0ecaa5334d5a17377c50 upstream.
When RPMB was converted to a character device, it added support for multiple RPMB partitions (Commit 97548575bef3 ("mmc: block: Convert RPMB to a character device").
One of the changes in this commit was transforming the variable target_part defined in __mmc_blk_ioctl_cmd into a bitmask. This inadvertently regressed the validation check done in mmc_blk_part_switch_pre() and mmc_blk_part_switch_post(), so let's fix it.
--- drivers/mmc/core/block.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mmc/core/block.c +4 -3
@@ -800,9 +800,10 @@ static const struct block_device_operatistatic int mmc_blk_part_switch_pre (struct mmc_card *card,unsigned int part_type) { +const unsigned int mask =EXT_CSD_PART_CONFIG_ACC_RPMB ;int ret =0 ; -if (part_type ==EXT_CSD_PART_CONFIG_ACC_RPMB ) { +if ((part_type & mask) == mask) {if (card->ext_csd.cmdq_en) { ret =mmc_cmdq_disable (card);if (ret)
@@ -817,9 +818,10 @@ static int mmc_blk_part_switch_pre(strucstatic int mmc_blk_part_switch_post (struct mmc_card *card,unsigned int part_type) { +const unsigned int mask =EXT_CSD_PART_CONFIG_ACC_RPMB ;int ret =0 ; -if (part_type ==EXT_CSD_PART_CONFIG_ACC_RPMB ) { +if ((part_type & mask) == mask) {mmc_retune_unpause (card->host);if (card->reenable_cmdq && !card->ext_csd.cmdq_en) ret =mmc_cmdq_enable (card);
@@ -3102,4 +3104,3 @@ module_exit(mmc_blk_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Multimedia Card (MMC) block device driver" ); -
Greg Kroah-Hartman
maintainerPATCH 34/43 mmc: core: Cancel delayed work before releasing host
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit 1036f69e251380573e256568cf814506e3fb9988 upstream.
On RZ/Five SMARC EVK, where probing of SDHI is deferred due to probe deferral of the vqmmc-supply regulator:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 0 at kernel/time/timer.c:1738 __run_timers.part.0+0x1d0/0x1e8
Modules linked in:
CPU: 0 PID: 0 Comm: swapper Not tainted 6.7.0-rc4 #101
Hardware name: Renesas SMARC EVK based on r9a07g043f01 (DT)
epc : __run_timers.part.0+0x1d0/0x1e8
ra : __run_timers.part.0+0x134/0x1e8
epc : ffffffff800771a4 ra : ffffffff80077108 sp : ffffffc800003e60
gp : ffffffff814f5028 tp : ffffffff8140c5c0 t0 : ffffffc800000000
t1 : 0000000000000001 t2 : ffffffff81201300 s0 : ffffffc800003f20
s1 : ffffffd8023bc4a0 a0 : 00000000fffee6b0 a1 : 0004010000400000
a2 : ffffffffc0000016 a3 : ffffffff81488640 a4 : ffffffc800003e60
a5 : 0000000000000000 a6 : 0000000004000000 a7 : ffffffc800003e68
s2 : 0000000000000122 s3 : 0000000000200000 s4 : 0000000000000000
s5 : ffffffffffffffff s6 : ffffffff81488678 s7 : ffffffff814886c0
s8 : ffffffff814f49c0 s9 : ffffffff81488640 s10: 0000000000000000
s11: ffffffc800003e60 t3 : 0000000000000240 t4 : 0000000000000a52
t5 : ffffffd8024ae018 t6 : ffffffd8024ae038
status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000003
[<ffffffff800771a4>] __run_timers.part.0+0x1d0/0x1e8
[<ffffffff800771e0>] run_timer_softirq+0x24/0x4a
[<ffffffff80809092>] __do_softirq+0xc6/0x1fa
[<ffffffff80028e4c>] irq_exit_rcu+0x66/0x84
[<ffffffff80800f7a>] handle_riscv_irq+0x40/0x4e
[<ffffffff80808f48>] call_on_irq_stack+0x1c/0x28
---[ end trace 0000000000000000 ]---What happens?
renesas_sdhi_probe()
{
tmio_mmc_host_alloc()
mmc_alloc_host()
INIT_DELAYED_WORK(&host->detect, mmc_rescan);
devm_request_irq(tmio_mmc_irq);
/*
* After this, the interrupt handler may be invoked at any time
*
* tmio_mmc_irq()
* {
* __tmio_mmc_card_detect_irq()
* mmc_detect_change()
* _mmc_detect_change()
* mmc_schedule_delayed_work(&host->detect, delay);
* }
*/
tmio_mmc_host_probe()
tmio_mmc_init_ocr()
-EPROBE_DEFER
tmio_mmc_host_free()
mmc_free_host()
}When expire_timers() runs later, it warns because the MMC host structure containing the delayed work was freed, and now contains an invalid work function pointer.
Fix this by cancelling any pending delayed work before releasing the MMC host structure.
--- drivers/mmc/core/host.c | 1 + 1 file changed, 1 insertion(+)
drivers/mmc/core/host.c +1 -0
@@ -612,6 +612,7 @@ EXPORT_SYMBOL(mmc_remove_host);*/ void mmc_free_host (struct mmc_host *host) { +cancel_delayed_work_sync (&host->detect);mmc_pwrseq_free (host);put_device (&host->class_dev); }
Greg Kroah-Hartman
maintainerPATCH 35/43 mmc: sdhci-sprd: Fix eMMC init failure after hw reset
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenchao Chen <[email protected]>
commit 8abf77c88929b6d20fa4f9928b18d6448d64e293 upstream.
Some eMMC devices that do not close the auto clk gate after hw reset will cause eMMC initialization to fail. Let's fix this.
--- drivers/mmc/host/sdhci-sprd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci-sprd.c +7 -3
@@ -224,15 +224,19 @@ static inline void _sdhci_sprd_set_clock div = ((div &0x300 ) >>2 ) | ((div &0xFF ) <<8 );sdhci_enable_clk (host, div); + val =sdhci_readl (host,SDHCI_SPRD_REG_32_BUSY_POSI ); + mask =SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN |SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN ;/* Enable CLK_AUTO when the clock is greater than 400K. */ if (clk >400000 ) { - val =sdhci_readl (host,SDHCI_SPRD_REG_32_BUSY_POSI ); - mask =SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN | -SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN ;if (mask != (val & mask)) { val |= mask;sdhci_writel (host, val,SDHCI_SPRD_REG_32_BUSY_POSI ); } + }else { +if (val & mask) { + val &= ~mask; +sdhci_writel (host, val,SDHCI_SPRD_REG_32_BUSY_POSI ); + } } }
Greg Kroah-Hartman
maintainerPATCH 36/43 powerpc: update ppc_save_regs to save current r1 in pt_regs
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aditya Gupta <[email protected]>
commit b684c09f09e7a6af3794d4233ef785819e72db79 upstream.
ppc_save_regs() skips one stack frame while saving the CPU register states. Instead of saving current R1, it pulls the previous stack frame pointer.
When vmcores caused by direct panic call (such as echo c > /proc/sysrq-trigger), are debugged with gdb, gdb fails to show the backtrace correctly. On further analysis, it was found that it was because of mismatch between r1 and NIP.
GDB uses NIP to get current function symbol and uses corresponding debug info of that function to unwind previous frames, but due to the mismatching r1 and NIP, the unwinding does not work, and it fails to unwind to the 2nd frame and hence does not show the backtrace.
GDB backtrace with vmcore of kernel without this patch:
---------
(gdb) bt
#0 0xc0000000002a53e8 in crash_setup_regs (oldregs=<optimized out>,
newregs=0xc000000004f8f8d8) at ./arch/powerpc/include/asm/kexec.h:69 #1 __crash_kexec (regs=<optimized out>) at kernel/kexec_core.c:974 #2 0x0000000000000063 in ?? () #3 0xc000000003579320 in ?? ()
---------
Further analysis revealed that the mismatch occurred because "ppc_save_regs" was saving the previous stack's SP instead of the current r1. This patch fixes this by storing current r1 in the saved pt_regs.
GDB backtrace with vmcore of patched kernel:
--------
(gdb) bt
#0 0xc0000000002a53e8 in crash_setup_regs (oldregs=0x0, newregs=0xc00000000670b8d8)
at ./arch/powerpc/include/asm/kexec.h:69
#1 __crash_kexec (regs=regs@entry=0x0) at kernel/kexec_core.c:974
#2 0xc000000000168918 in panic (fmt=fmt@entry=0xc000000001654a60 "sysrq triggered crash\n")
at kernel/panic.c:358
#3 0xc000000000b735f8 in sysrq_handle_crash (key=<optimized out>) at drivers/tty/sysrq.c:155
#4 0xc000000000b742cc in __handle_sysrq (key=key@entry=99, check_mask=check_mask@entry=false)
at drivers/tty/sysrq.c:602
#5 0xc000000000b7506c in write_sysrq_trigger (file=<optimized out>, buf=<optimized out>,
count=2, ppos=<optimized out>) at drivers/tty/sysrq.c:1163
#6 0xc00000000069a7bc in pde_write (ppos=<optimized out>, count=<optimized out>,
buf=<optimized out>, file=<optimized out>, pde=0xc00000000362cb40) at fs/proc/inode.c:340
#7 proc_reg_write (file=<optimized out>, buf=<optimized out>, count=<optimized out>,
ppos=<optimized out>) at fs/proc/inode.c:352
#8 0xc0000000005b3bbc in vfs_write (file=file@entry=0xc000000006aa6b00,
buf=buf@entry=0x61f498b4f60 <error: Cannot access memory at address 0x61f498b4f60>,
count=count@entry=2, pos=pos@entry=0xc00000000670bda0) at fs/read_write.c:582
#9 0xc0000000005b4264 in ksys_write (fd=<optimized out>,
buf=0x61f498b4f60 <error: Cannot access memory at address 0x61f498b4f60>, count=2)
at fs/read_write.c:637
#10 0xc00000000002ea2c in system_call_exception (regs=0xc00000000670be80, r0=<optimized out>)
at arch/powerpc/kernel/syscall.c:171
#11 0xc00000000000c270 in system_call_vectored_common ()
at arch/powerpc/kernel/interrupt_64.S:192--------
Nick adds:
So this now saves regs as though it was an interrupt taken in the caller, at the instruction after the call to ppc_save_regs, whereas previously the NIP was there, but R1 came from the caller's caller and that mismatch is what causes gdb's dwarf unwinder to go haywire.
--- arch/powerpc/kernel/ppc_save_regs.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/kernel/ppc_save_regs.S +3 -3
@@ -58,10 +58,10 @@ _GLOBAL(ppc_save_regs) lbz r0,PACAIRQSOFTMASK(r13) PPC_STL r0,SOFTE-STACK_FRAME_OVERHEAD(r3) #endif - /* go up one stack frame for SP */ - PPC_LL r4,0(r1) - PPC_STL r4,1*SZL(r3) + /* store current SP */ + PPC_STL r1,1*SZL(r3) /* get caller's LR */ + PPC_LL r4,0(r1) PPC_LL r0,LRSAVE(r4) PPC_STL r0,_LINK-STACK_FRAME_OVERHEAD(r3) mflr r0
Greg Kroah-Hartman
maintainerPATCH 37/43 net: tls, update curr on splice as well
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Fastabend <[email protected]>
commit c5a595000e2677e865a39f249c056bc05d6e55fd upstream.
The curr pointer must also be updated on the splice similar to how we do this for other copy types.
--- net/tls/tls_sw.c | 2 ++ 1 file changed, 2 insertions(+)
net/tls/tls_sw.c +2 -0
@@ -1215,6 +1215,8 @@ alloc_payload: }sk_msg_page_add (msg_pl, page, copy, offset); + msg_pl->sg.copybreak =0 ; + msg_pl->sg.curr = msg_pl->sg.end;sk_mem_charge (sk, copy); offset += copy;
Greg Kroah-Hartman
maintainerPATCH 38/43 ipv6: remove max_size check inline with ipv4
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jon Maxwell <[email protected]>
commit af6d10345ca76670c1b7c37799f0d5576ccef277 upstream.
In ip6_dst_gc() replace:
if (entries > gc_thresh)
With:
if (entries > ops->gc_thresh)
Sending Ipv6 packets in a loop via a raw socket triggers an issue where a route is cloned by ip6_rt_cache_alloc() for each packet sent. This quickly consumes the Ipv6 max_size threshold which defaults to 4096 resulting in these warnings:
[1] 99.187805] dst_alloc: 7728 callbacks suppressed
[2] Route cache is full: consider increasing sysctl net.ipv6.route.max_size. .
.
[300] Route cache is full: consider increasing sysctl net.ipv6.route.max_size.
When this happens the packet is dropped and sendto() gets a network is unreachable error:
remaining pkt 200557 errno 101
remaining pkt 196462 errno 101
.
.
remaining pkt 126821 errno 101
Implement David Aherns suggestion to remove max_size check seeing that Ipv6 has a GC to manage memory usage. Ipv4 already does not check max_size.
Here are some memory comparisons for Ipv4 vs Ipv6 with the patch:
Test by running 5 instances of a program that sends UDP packets to a raw socket 5000000 times. Compare Ipv4 and Ipv6 performance with a similar program.
Ipv4:
Before test:
MemFree: 29427108 kB Slab: 237612 kB
ip6_dst_cache 1912 2528 256 32 2 : tunables 0 0 0 xfrm_dst_cache 0 0 320 25 2 : tunables 0 0 0 ip_dst_cache 2881 3990 192 42 2 : tunables 0 0 0
During test:
MemFree: 29417608 kB Slab: 247712 kB
ip6_dst_cache 1912 2528 256 32 2 : tunables 0 0 0 xfrm_dst_cache 0 0 320 25 2 : tunables 0 0 0 ip_dst_cache 44394 44394 192 42 2 : tunables 0 0 0
After test:
MemFree: 29422308 kB Slab: 238104 kB
ip6_dst_cache 1912 2528 256 32 2 : tunables 0 0 0 xfrm_dst_cache 0 0 320 25 2 : tunables 0 0 0 ip_dst_cache 3048 4116 192 42 2 : tunables 0 0 0
Ipv6 with patch:
Errno 101 errors are not observed anymore with the patch.
Before test:
MemFree: 29422308 kB Slab: 238104 kB
ip6_dst_cache 1912 2528 256 32 2 : tunables 0 0 0 xfrm_dst_cache 0 0 320 25 2 : tunables 0 0 0 ip_dst_cache 3048 4116 192 42 2 : tunables 0 0 0
During Test:
MemFree: 29431516 kB Slab: 240940 kB
ip6_dst_cache 11980 12064 256 32 2 : tunables 0 0 0 xfrm_dst_cache 0 0 320 25 2 : tunables 0 0 0 ip_dst_cache 3048 4116 192 42 2 : tunables 0 0 0
After Test:
MemFree: 29441816 kB Slab: 238132 kB
ip6_dst_cache 1902 2432 256 32 2 : tunables 0 0 0 xfrm_dst_cache 0 0 320 25 2 : tunables 0 0 0 ip_dst_cache 3048 4116 192 42 2 : tunables 0 0 0
--- include/net/dst_ops.h | 2 +- net/core/dst.c | 8 ++------ net/ipv6/route.c | 13 +++++-------- 3 files changed, 8 insertions(+), 15 deletions(-)
include/net/dst_ops.h +1 -1
@@ -16,7 +16,7 @@ struct dst_ops {unsigned short family;unsigned int gc_thresh; -int (*gc)(struct dst_ops *ops); +void (*gc)(struct dst_ops *ops);struct dst_entry * (*check)(struct dst_entry *,__u32 cookie);unsigned int (*default_advmss)(const struct dst_entry *);unsigned int (*mtu)(const struct dst_entry *);
net/core/dst.c +2 -6
@@ -83,12 +83,8 @@ void *dst_alloc(struct dst_ops *ops, strif (ops->gc && !(flags &DST_NOCOUNT ) && -dst_entries_get_fast (ops) > ops->gc_thresh) { -if (ops->gc (ops)) { -pr_notice_ratelimited ("Route cache is full: consider increasing sysctl net.ipv6.route.max_size.\n" ); -return NULL ; - } - } +dst_entries_get_fast (ops) > ops->gc_thresh) + ops->gc (ops); dst =kmem_cache_alloc (ops->kmem_cachep,GFP_ATOMIC );if (!dst)
net/ipv6/route.c +5 -8
@@ -89,7 +89,7 @@ static struct dst_entry *ip6_negative_adstatic void ip6_dst_destroy (struct dst_entry *);static void ip6_dst_ifdown (struct dst_entry *,struct net_device *dev,int how); -static int ip6_dst_gc (struct dst_ops *ops); +static void ip6_dst_gc (struct dst_ops *ops);static int ip6_pkt_discard (struct sk_buff *skb);static int ip6_pkt_discard_out (struct net *net,struct sock *sk,struct sk_buff *skb);
@@ -3184,11 +3184,10 @@ out:return dst; } -static int ip6_dst_gc (struct dst_ops *ops) +static void ip6_dst_gc (struct dst_ops *ops) { struct net *net = container_of(ops, struct net, ipv6.ip6_dst_ops);int rt_min_interval = net->ipv6.sysctl.ip6_rt_gc_min_interval; -int rt_max_size = net->ipv6.sysctl.ip6_rt_max_size;int rt_elasticity = net->ipv6.sysctl.ip6_rt_gc_elasticity;int rt_gc_timeout = net->ipv6.sysctl.ip6_rt_gc_timeout;unsigned long rt_last_gc = net->ipv6.ip6_rt_last_gc;
@@ -3196,11 +3195,10 @@ static int ip6_dst_gc(struct dst_ops *opint entries; entries =dst_entries_get_fast (ops); -if (entries > rt_max_size) +if (entries > ops->gc_thresh) entries =dst_entries_get_slow (ops); -if (time_after (rt_last_gc + rt_min_interval, jiffies) && - entries <= rt_max_size) +if (time_after (rt_last_gc + rt_min_interval, jiffies)) goto out;fib6_run_gc (atomic_inc_return (&net->ipv6.ip6_rt_gc_expire), net, true);
@@ -3210,7 +3208,6 @@ static int ip6_dst_gc(struct dst_ops *op out: val =atomic_read (&net->ipv6.ip6_rt_gc_expire);atomic_set (&net->ipv6.ip6_rt_gc_expire, val - (val >> rt_elasticity)); -return entries > rt_max_size; } static int ip6_nh_lookup_table(struct net *net, struct fib6_config *cfg,
@@ -6363,7 +6360,7 @@ static int __net_init ip6_route_net_init#endif net->ipv6.sysctl.flush_delay =0 ; - net->ipv6.sysctl.ip6_rt_max_size =4096 ; + net->ipv6.sysctl.ip6_rt_max_size =INT_MAX ; net->ipv6.sysctl.ip6_rt_gc_min_interval =HZ /2 ; net->ipv6.sysctl.ip6_rt_gc_timeout =60 *HZ ; net->ipv6.sysctl.ip6_rt_gc_interval =30 *HZ ;
Greg Kroah-Hartman
maintainerPATCH 39/43 drm/qxl: fix UAF on handle creation
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wander Lairson Costa <[email protected]>
commit c611589b4259ed63b9b77be6872b1ce07ec0ac16 upstream.
qxl_mode_dumb_create() dereferences the qobj returned by qxl_gem_object_create_with_handle(), but the handle is the only one holding a reference to it.
A potential attacker could guess the returned handle value and closes it between the return of qxl_gem_object_create_with_handle() and the qobj usage, triggering a use-after-free scenario.
Reproducer:
int dri_fd =-1;
struct drm_mode_create_dumb arg = {0};
void gem_close(int handle);
void* trigger(void* ptr)
{
int ret;
arg.width = arg.height = 0x20;
arg.bpp = 32;
ret = ioctl(dri_fd, DRM_IOCTL_MODE_CREATE_DUMB, &arg);
if(ret)
{
perror("[*] DRM_IOCTL_MODE_CREATE_DUMB Failed");
exit(-1);
}
gem_close(arg.handle);
while(1) {
struct drm_mode_create_dumb args = {0};
args.width = args.height = 0x20;
args.bpp = 32;
ret = ioctl(dri_fd, DRM_IOCTL_MODE_CREATE_DUMB, &args);
if (ret) {
perror("[*] DRM_IOCTL_MODE_CREATE_DUMB Failed");
exit(-1);
}
printf("[*] DRM_IOCTL_MODE_CREATE_DUMB created, %d\n", args.handle);
gem_close(args.handle);
}
return NULL;
}void gem_close(int handle)
{
struct drm_gem_close args;
args.handle = handle;
int ret = ioctl(dri_fd, DRM_IOCTL_GEM_CLOSE, &args); // gem close handle
if (!ret)
printf("gem close handle %d\n", args.handle);
}int main(void)
{
dri_fd= open("/dev/dri/card0", O_RDWR);
printf("fd:%d\n", dri_fd);
if(dri_fd == -1)
return -1;
pthread_t tid1;
if(pthread_create(&tid1,NULL,trigger,NULL)){
perror("[*] thread_create tid1\n");
return -1;
}
while (1)
{
gem_close(arg.handle);
}
return 0;
}This is a KASAN report:
==================================================================
BUG: KASAN: slab-use-after-free in qxl_mode_dumb_create+0x3c2/0x400 linux/drivers/gpu/drm/qxl/qxl_dumb.c:69 Write of size 1 at addr ffff88801136c240 by task poc/515 CPU: 1 PID: 515 Comm: poc Not tainted 6.3.0 #3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-debian-1.16.0-4 04/01/2014 Call Trace: <TASK> __dump_stack linux/lib/dump_stack.c:88 dump_stack_lvl+0x48/0x70 linux/lib/dump_stack.c:106 print_address_description linux/mm/kasan/report.c:319 print_report+0xd2/0x660 linux/mm/kasan/report.c:430 kasan_report+0xd2/0x110 linux/mm/kasan/report.c:536 __asan_report_store1_noabort+0x17/0x30 linux/mm/kasan/report_generic.c:383 qxl_mode_dumb_create+0x3c2/0x400 linux/drivers/gpu/drm/qxl/qxl_dumb.c:69 drm_mode_create_dumb linux/drivers/gpu/drm/drm_dumb_buffers.c:96 drm_mode_create_dumb_ioctl+0x1f5/0x2d0 linux/drivers/gpu/drm/drm_dumb_buffers.c:102 drm_ioctl_kernel+0x21d/0x430 linux/drivers/gpu/drm/drm_ioctl.c:788 drm_ioctl+0x56f/0xcc0 linux/drivers/gpu/drm/drm_ioctl.c:891 vfs_ioctl linux/fs/ioctl.c:51 __do_sys_ioctl linux/fs/ioctl.c:870 __se_sys_ioctl linux/fs/ioctl.c:856 __x64_sys_ioctl+0x13d/0x1c0 linux/fs/ioctl.c:856 do_syscall_x64 linux/arch/x86/entry/common.c:50 do_syscall_64+0x5b/0x90 linux/arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc linux/arch/x86/entry/entry_64.S:120 RIP: 0033:0x7ff5004ff5f7 Code: 00 00 00 48 8b 05 99 c8 0d 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 69 c8 0d 00 f7 d8 64 89 01 48
RSP: 002b:00007ff500408ea8 EFLAGS: 00000286 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff5004ff5f7
RDX: 00007ff500408ec0 RSI: 00000000c02064b2 RDI: 0000000000000003
RBP: 00007ff500408ef0 R08: 0000000000000000 R09: 000000000000002a
R10: 0000000000000000 R11: 0000000000000286 R12: 00007fff1c6cdafe
R13: 00007fff1c6cdaff R14: 00007ff500408fc0 R15: 0000000000802000
</TASK> Allocated by task 515: kasan_save_stack+0x38/0x70 linux/mm/kasan/common.c:45 kasan_set_track+0x25/0x40 linux/mm/kasan/common.c:52 kasan_save_alloc_info+0x1e/0x40 linux/mm/kasan/generic.c:510 ____kasan_kmalloc linux/mm/kasan/common.c:374 __kasan_kmalloc+0xc3/0xd0 linux/mm/kasan/common.c:383 kasan_kmalloc linux/./include/linux/kasan.h:196 kmalloc_trace+0x48/0xc0 linux/mm/slab_common.c:1066 kmalloc linux/./include/linux/slab.h:580 kzalloc linux/./include/linux/slab.h:720 qxl_bo_create+0x11a/0x610 linux/drivers/gpu/drm/qxl/qxl_object.c:124 qxl_gem_object_create+0xd9/0x360 linux/drivers/gpu/drm/qxl/qxl_gem.c:58 qxl_gem_object_create_with_handle+0xa1/0x180 linux/drivers/gpu/drm/qxl/qxl_gem.c:89 qxl_mode_dumb_create+0x1cd/0x400 linux/drivers/gpu/drm/qxl/qxl_dumb.c:63 drm_mode_create_dumb linux/drivers/gpu/drm/drm_dumb_buffers.c:96 drm_mode_create_dumb_ioctl+0x1f5/0x2d0 linux/drivers/gpu/drm/drm_dumb_buffers.c:102 drm_ioctl_kernel+0x21d/0x430 linux/drivers/gpu/drm/drm_ioctl.c:788 drm_ioctl+0x56f/0xcc0 linux/drivers/gpu/drm/drm_ioctl.c:891 vfs_ioctl linux/fs/ioctl.c:51 __do_sys_ioctl linux/fs/ioctl.c:870 __se_sys_ioctl linux/fs/ioctl.c:856 __x64_sys_ioctl+0x13d/0x1c0 linux/fs/ioctl.c:856 do_syscall_x64 linux/arch/x86/entry/common.c:50 do_syscall_64+0x5b/0x90 linux/arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc linux/arch/x86/entry/entry_64.S:120 Freed by task 515: kasan_save_stack+0x38/0x70 linux/mm/kasan/common.c:45 kasan_set_track+0x25/0x40 linux/mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x60 linux/mm/kasan/generic.c:521 ____kasan_slab_free linux/mm/kasan/common.c:236 ____kasan_slab_free+0x180/0x1f0 linux/mm/kasan/common.c:200 __kasan_slab_free+0x12/0x30 linux/mm/kasan/common.c:244 kasan_slab_free linux/./include/linux/kasan.h:162 slab_free_hook linux/mm/slub.c:1781 slab_free_freelist_hook+0xd2/0x1a0 linux/mm/slub.c:1807 slab_free linux/mm/slub.c:3787 __kmem_cache_free+0x196/0x2d0 linux/mm/slub.c:3800 kfree+0x78/0x120 linux/mm/slab_common.c:1019 qxl_ttm_bo_destroy+0x140/0x1a0 linux/drivers/gpu/drm/qxl/qxl_object.c:49 ttm_bo_release+0x678/0xa30 linux/drivers/gpu/drm/ttm/ttm_bo.c:381 kref_put linux/./include/linux/kref.h:65 ttm_bo_put+0x50/0x80 linux/drivers/gpu/drm/ttm/ttm_bo.c:393 qxl_gem_object_free+0x3e/0x60 linux/drivers/gpu/drm/qxl/qxl_gem.c:42 drm_gem_object_free+0x5c/0x90 linux/drivers/gpu/drm/drm_gem.c:974 kref_put linux/./include/linux/kref.h:65 __drm_gem_object_put linux/./include/drm/drm_gem.h:431 drm_gem_object_put linux/./include/drm/drm_gem.h:444 qxl_gem_object_create_with_handle+0x151/0x180 linux/drivers/gpu/drm/qxl/qxl_gem.c:100 qxl_mode_dumb_create+0x1cd/0x400 linux/drivers/gpu/drm/qxl/qxl_dumb.c:63 drm_mode_create_dumb linux/drivers/gpu/drm/drm_dumb_buffers.c:96 drm_mode_create_dumb_ioctl+0x1f5/0x2d0 linux/drivers/gpu/drm/drm_dumb_buffers.c:102 drm_ioctl_kernel+0x21d/0x430 linux/drivers/gpu/drm/drm_ioctl.c:788 drm_ioctl+0x56f/0xcc0 linux/drivers/gpu/drm/drm_ioctl.c:891 vfs_ioctl linux/fs/ioctl.c:51 __do_sys_ioctl linux/fs/ioctl.c:870 __se_sys_ioctl linux/fs/ioctl.c:856 __x64_sys_ioctl+0x13d/0x1c0 linux/fs/ioctl.c:856 do_syscall_x64 linux/arch/x86/entry/common.c:50 do_syscall_64+0x5b/0x90 linux/arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc linux/arch/x86/entry/entry_64.S:120 The buggy address belongs to the object at ffff88801136c000
which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 576 bytes inside of freed 1024-byte region [ffff88801136c000, ffff88801136c400)
The buggy address belongs to the physical page: page:0000000089fc329b refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11368 head:0000000089fc329b order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfffffc0010200(slab|head|node=0|zone=1|lastcpupid=0x1fffff) raw: 000fffffc0010200 ffff888007841dc0 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88801136c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801136c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801136c200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^ffff88801136c280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fbffff88801136c300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Disabling lock debugging due to kernel taint
Instead of returning a weak reference to the qxl_bo object, return the created drm_gem_object and let the caller decrement the reference count when it no longer needs it. As a convenience, if the caller is not interested in the gobj object, it can pass NULL to the parameter and the reference counting is descremented internally.
The bug and the reproducer were originally found by the Zero Day Initiative project (ZDI-CAN-20940).
[pchelkin: The problem can be reproduced on 5.10 stable. It lacks commit
f4a84e165e6d ("drm/qxl: allocate dumb buffers in ram"). Adjust a small conflict regarding that commit: it affects only where the buffers are placed.]
--- drivers/gpu/drm/qxl/qxl_drv.h | 2 +- drivers/gpu/drm/qxl/qxl_dumb.c | 5 ++++- drivers/gpu/drm/qxl/qxl_gem.c | 25 +++++++++++++++++-------- drivers/gpu/drm/qxl/qxl_ioctl.c | 6 ++---- 4 files changed, 24 insertions(+), 14 deletions(-)
drivers/gpu/drm/qxl/qxl_drv.h +1 -1
@@ -329,7 +329,7 @@ int qxl_gem_object_create_with_handle(stu32 domain, size_t size, struct qxl_surface *surf, - struct qxl_bo **qobj, + struct drm_gem_object **gobj, uint32_t *handle);void qxl_gem_object_free (struct drm_gem_object *gobj);int qxl_gem_object_open (struct drm_gem_object *obj,struct drm_file *file_priv);
drivers/gpu/drm/qxl/qxl_dumb.c +4 -1
@@ -34,6 +34,7 @@ int qxl_mode_dumb_create(struct drm_file {struct qxl_device *qdev =to_qxl (dev);struct qxl_bo *qobj; +struct drm_gem_object *gobj;uint32_t handle;int r;struct qxl_surface surf;
@@ -62,11 +63,13 @@ int qxl_mode_dumb_create(struct drm_file r =qxl_gem_object_create_with_handle (qdev, file_priv,QXL_GEM_DOMAIN_SURFACE , - args->size, &surf, &qobj, + args->size, &surf, &gobj, &handle);if (r)return r; + qobj =gem_to_qxl_bo (gobj); qobj->is_dumb = true; +drm_gem_object_put (gobj); args->pitch = pitch; args->handle = handle;return 0 ;
drivers/gpu/drm/qxl/qxl_gem.c +17 -8
@@ -72,32 +72,41 @@ int qxl_gem_object_create(struct qxl_devreturn 0 ; } +/* +* If the caller passed a valid gobj pointer, it is responsible to call +* drm_gem_object_put() when it no longer needs to acess the object. +* +* If gobj is NULL, it is handled internally. +*/ int qxl_gem_object_create_with_handle (struct qxl_device *qdev,struct drm_file *file_priv,u32 domain,size_t size,struct qxl_surface *surf, -struct qxl_bo **qobj, +struct drm_gem_object **gobj,uint32_t *handle) { -struct drm_gem_object *gobj;int r; +struct drm_gem_object *local_gobj; -BUG_ON (!qobj);BUG_ON (!handle); r =qxl_gem_object_create (qdev, size,0 , domain, false, false, surf, - &gobj); + &local_gobj);if (r)return -ENOMEM ; - r =drm_gem_handle_create (file_priv, gobj, handle); + r =drm_gem_handle_create (file_priv, local_gobj, handle);if (r)return r; -/* drop reference from allocate - handle holds it now */ - *qobj =gem_to_qxl_bo (gobj); -drm_gem_object_put (gobj); + +if (gobj) + *gobj = local_gobj; +else +/* drop reference from allocate - handle holds it now */ +drm_gem_object_put (local_gobj); +return 0 ; }
drivers/gpu/drm/qxl/qxl_ioctl.c +2 -4
@@ -39,7 +39,6 @@ static int qxl_alloc_ioctl(struct drm_destruct qxl_device *qdev =to_qxl (dev);struct drm_qxl_alloc *qxl_alloc = data;int ret; -struct qxl_bo *qobj;uint32_t handle;u32 domain =QXL_GEM_DOMAIN_VRAM ;
@@ -51,7 +50,7 @@ static int qxl_alloc_ioctl(struct drm_de domain, qxl_alloc->size,NULL , - &qobj, &handle); + NULL, &handle);if (ret) {DRM_ERROR ("%s: failed to create gem ret=%d\n" , __func__, ret);
@@ -393,7 +392,6 @@ static int qxl_alloc_surf_ioctl(struct d {struct qxl_device *qdev =to_qxl (dev);struct drm_qxl_alloc_surf *param = data; -struct qxl_bo *qobj;int handle;int ret;int size, actual_stride;
@@ -413,7 +411,7 @@ static int qxl_alloc_surf_ioctl(struct dQXL_GEM_DOMAIN_SURFACE , size, &surf, - &qobj, &handle); + NULL, &handle);if (ret) {DRM_ERROR ("%s: failed to create gem ret=%d\n" , __func__, ret);
Greg Kroah-Hartman
maintainerPATCH 40/43 netfilter: nf_tables: Reject tables of unsupported family
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Phil Sutter <[email protected]>
commit f1082dd31fe461d482d69da2a8eccfeb7bf07ac2 upstream.
An nftables family is merely a hollow container, its family just a number and such not reliant on compile-time options other than nftables support itself. Add an artificial check so attempts at using a family the kernel can't support fail as early as possible. This helps user space detect kernels which lack e.g. NFPROTO_INET.
--- net/netfilter/nf_tables_api.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
net/netfilter/nf_tables_api.c +27 -0
@@ -1186,6 +1186,30 @@ static int nft_objname_hash_cmp(struct rreturn strcmp (obj->key.name, k->name); } +static bool nft_supported_family (u8 family) +{ + return false +#ifdef CONFIG_NF_TABLES_INET + || family ==NFPROTO_INET +#endif +#ifdef CONFIG_NF_TABLES_IPV4 + || family ==NFPROTO_IPV4 +#endif +#ifdef CONFIG_NF_TABLES_ARP + || family ==NFPROTO_ARP +#endif +#ifdef CONFIG_NF_TABLES_NETDEV + || family == NFPROTO_NETDEV +#endif +#if IS_ENABLED(CONFIG_NF_TABLES_BRIDGE) + || family ==NFPROTO_BRIDGE +#endif +#ifdef CONFIG_NF_TABLES_IPV6 + || family ==NFPROTO_IPV6 +#endif + ; +} + static int nf_tables_newtable(struct net *net, struct sock *nlsk, struct sk_buff *skb, const struct nlmsghdr *nlh, const struct nlattr * const nla[],
@@ -1201,6 +1225,9 @@ static int nf_tables_newtable(struct netu32 flags =0 ;int err; +if (!nft_supported_family (family)) +return -EOPNOTSUPP ; +lockdep_assert_held (&nft_net->commit_mutex); attr = nla[NFTA_TABLE_NAME ]; table =nft_table_lookup (net, attr, family, genmask);
Greg Kroah-Hartman
maintainerPATCH 41/43 PCI: Extract ATS disabling to a helper function
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Pawlowski <[email protected]>
commit f18b1137d38c091cc8c16365219f0a1d4a30b3d1 upstream.
Introduce quirk_no_ats() helper function to provide a standard way to disable ATS capability in PCI quirks.
--- drivers/pci/quirks.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/pci/quirks.c +7 -2
@@ -5353,6 +5353,12 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SEDECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_SERVERWORKS ,0x0422 , quirk_no_ext_tags);#ifdef CONFIG_PCI_ATS +static void quirk_no_ats (struct pci_dev *pdev) +{ +pci_info (pdev,"disabling ATS\n" ); + pdev->ats_cap =0 ; +} +/* * Some devices require additional driver setup to enable ATS. Don't use * ATS for those devices as ATS will be enabled before the driver has had a
@@ -5365,8 +5371,7 @@ static void quirk_amd_harvest_no_ats(str (pdev->device == 0x7341 && pdev->revision != 0x00)) return; -pci_info (pdev,"disabling ATS\n" ); - pdev->ats_cap =0 ; +quirk_no_ats (pdev); }/* AMD Stoney platform GPU */
Greg Kroah-Hartman
maintainerPATCH 42/43 PCI: Disable ATS for specific Intel IPU E2000 devices
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Pawlowski <[email protected]>
commit a18615b1cfc04f00548c60eb9a77e0ce56e848fd upstream.
Due to a hardware issue in A and B steppings of Intel IPU E2000, it expects wrong endianness in ATS invalidation message body. This problem can lead to outdated translations being returned as valid and finally cause system instability.
To prevent such issues, add quirk_intel_e2000_no_ats() to disable ATS for vulnerable IPU E2000 devices.
--- drivers/pci/quirks.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/pci/quirks.c +19 -0
@@ -5383,6 +5383,25 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AT/* AMD Navi14 dGPU */ DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_ATI ,0x7340 , quirk_amd_harvest_no_ats);DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_ATI ,0x7341 , quirk_amd_harvest_no_ats); + +/* +* Intel IPU E2000 revisions before C0 implement incorrect endianness +* in ATS Invalidate Request message body. Disable ATS for those devices. +*/ +static void quirk_intel_e2000_no_ats (struct pci_dev *pdev) +{ +if (pdev->revision <0x20 ) +quirk_no_ats (pdev); +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x1451 , quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x1452 , quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x1453 , quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x1454 , quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x1455 , quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x1457 , quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x1459 , quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x145a , quirk_intel_e2000_no_ats); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x145c , quirk_intel_e2000_no_ats);#endif /* CONFIG_PCI_ATS */ /* Freescale PCIe doesn't support MSI in RC mode */
Greg Kroah-Hartman
maintainerPATCH 43/43 Revert "nvme: use command_id instead of req->tag in trace_nvme_complete_rq()"
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
This reverts commit 706960d328f5bdb1a9cde0b17a98ab84a59eed8e which is commit 679c54f2de672b7d79d02f8c4ad483ff6dd8ce2e upstream.
It is reported to cause issues.
--- drivers/nvme/host/trace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/trace.h +1 -1
@@ -98,7 +98,7 @@ TRACE_EVENT(nvme_complete_rq,TP_fast_assign ( __entry->ctrl_id = nvme_req(req)->ctrl->instance; __entry->qid =nvme_req_qid (req); - __entry->cid =nvme_req (req)->cmd->common.command_id; + __entry->cid = req->tag; __entry->result =le64_to_cpu (nvme_req (req)->result.u64); __entry->retries =nvme_req (req)->retries; __entry->flags =nvme_req (req)->flags;
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 5.10.208 release. There are 43 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
CIP testing did not find any problems here:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-5.10.y
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Greg Kroah-Hartman wrote on Sat, Jan 13, 2024 at 10:49:39AM +0100:
Quoted 5 lines
This is the start of the stable review cycle for the 5.10.208 release. There are 43 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 8 lines
Responses should be made by Mon, 15 Jan 2024 09:41:55 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.208-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.
Tested 7884d82278ab ("Linux 5.10.208-rc1") on:
- arm i.MX6ULL (Armadillo 640)
- arm64 i.MX8MP (Armadillo G4)
No obvious regression in dmesg or basic tests:
Signature · 1 line
Dominique Martinet | Asmadeus
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.208 release. There are 43 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 15 Jan 2024 09:41:55 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.208-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 5.10.208-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-5.10.y
* git commit: 7884d82278ab66374f212a263f44664a0da4c76c
* git describe: v5.10.206-52-g7884d82278ab
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.10.y/build/v5.10.206-52-g7884d82278ab
## Test Regressions (compared to v5.10.206)
## Metric Regressions (compared to v5.10.206)
## Test Fixes (compared to v5.10.206)
## Metric Fixes (compared to v5.10.206)
## Test result summary
total: 177915, pass: 136401, fail: 5687, skip: 35672, xfail: 155
## Build Summary
* arc: 10 total, 10 passed, 0 failed
* arm: 222 total, 222 passed, 0 failed
* arm64: 74 total, 74 passed, 0 failed
* i386: 58 total, 58 passed, 0 failed
* mips: 46 total, 46 passed, 0 failed
* parisc: 6 total, 0 passed, 6 failed
* powerpc: 48 total, 48 passed, 0 failed
* riscv: 20 total, 20 passed, 0 failed
* s390: 21 total, 21 passed, 0 failed
* sh: 20 total, 20 passed, 0 failed
* sparc: 14 total, 14 passed, 0 failed
* x86_64: 63 total, 63 passed, 0 failed
## Test suites summary
* boot
* kselftest-android
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers-dma-buf
* kselftest-efivarfs
* kselftest-exec
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-filesystems-epoll
* kselftest-firmware
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-net-forwarding
* kselftest-net-mptcp
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-sigaltstack
* kselftest-size
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-user_events
* kselftest-vDSO
* kselftest-vm
* kselftest-watchdog
* kselftest-x86
* kselftest-zram
* kunit
* kvm-unit-tests
* libgpiod
* log-parser-boot
* log-parser-test
* ltp-cap_bounds
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-filecaps
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-fsx
* ltp-hugetlb
* ltp-io
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-securebits
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* network-basic-tests
* perf
* rcutorture
* v4l2-compliance
--
Linaro LKFT
https://lkft.linaro.org
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.208 release. There are 43 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 15 Jan 2024 09:41:55 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.208-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v5.10:
10 builds: 10 pass, 0 fail
26 boots: 26 pass, 0 fail
68 tests: 68 pass, 0 failLinux version: 5.10.208-rc1-g7884d82278ab
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Jon
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.208 release. There are 43 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 9 lines
Responses should be made by Mon, 15 Jan 2024 09:41:55 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.208-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.
KernelCI report for stable-rc/linux-5.10.y for this week :-
## stable-rc HEAD for linux-5.10.y:
Date: 2024-01-13
5.10: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/log/?h=7884d82278ab66374f212a263f44664a0da4c76c
## Build failures:
No build failures seen for the stable-rc/linux-5.10.y commit head \o/
## Boot failures:
No **new** boot failures seen for the stable-rc/linux-5.10.y commit head \o/
Thanks,
Shreeya Patel
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.208 release. There are 43 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 15 Jan 2024 09:41:55 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.208-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Quoted 9 lines
This is the start of the stable review cycle for the 5.10.208 release. There are 43 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon, 15 Jan 2024 09:41:55 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.208-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my x86_64 and ARM64 test systems. No errors or regressions.
Thanks.