From: Eduard Zingerman <eddyz87(a)gmail.com>
mainline inclusion
from mainline-v6.12-rc4
commit e9bd9c498cb0f5843996dbe5cbce7a1836a83c70
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB9533
CVE: CVE-2024-53125
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
Range propagation must not affect subreg_def marks, otherwise the
following example is rewritten by verifier incorrectly when
BPF_F_TEST_RND_HI32 flag is set:
0: call bpf_ktime_get_ns call bpf_ktime_get_ns
1: r0 &= 0x7fffffff after verifier r0 &= 0x7fffffff
2: w1 = w0 rewrites w1 = w0
3: if w0 < 10 goto +0 --------------> r11 = 0x2f5674a6 (r)
4: r1 >>= 32 r11 <<= 32 (r)
5: r0 = r1 r1 |= r11 (r)
6: exit; if w0 < 0xa goto pc+0
r1 >>= 32
r0 = r1
exit
(or zero extension of w1 at (2) is missing for architectures that
require zero extension for upper register half).
The following happens w/o this patch:
- r0 is marked as not a subreg at (0);
- w1 is marked as subreg at (2);
- w1 subreg_def is overridden at (3) by copy_register_state();
- w1 is read at (5) but mark_insn_zext() does not mark (2)
for zero extension, because w1 subreg_def is not set;
- because of BPF_F_TEST_RND_HI32 flag verifier inserts random
value for hi32 bits of (2) (marked (r));
- this random value is read at (5).
Fixes: 75748837b7e5 ("bpf: Propagate scalar ranges through register assignments.")
Reported-by: Lonial Con <kongln9170(a)gmail.com>
Signed-off-by: Lonial Con <kongln9170(a)gmail.com>
Signed-off-by: Eduard Zingerman <eddyz87(a)gmail.com>
Signed-off-by: Andrii Nakryiko <andrii(a)kernel.org>
Signed-off-by: Daniel Borkmann <daniel(a)iogearbox.net>
Acked-by: Daniel Borkmann <daniel(a)iogearbox.net>
Closes: https://lore.kernel.org/bpf/7e2aa30a62d740db182c170fdd8f81c596df280d.camel@…
Link: https://lore.kernel.org/bpf/20240924210844.1758441-1-eddyz87@gmail.com
Conflicts:
kernel/bpf/verifier.c
[The conflicts were due to not merge commit 98d7ca374ba4 and 4bf79f9be434e]
Signed-off-by: Pu Lehui <pulehui(a)huawei.com>
---
kernel/bpf/verifier.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 46ae1861d385..642746168b33 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -8394,8 +8394,12 @@ static void find_equal_scalars(struct bpf_verifier_state *vstate,
struct bpf_reg_state *reg;
bpf_for_each_reg_in_vstate(vstate, state, reg, ({
- if (reg->type == SCALAR_VALUE && reg->id == known_reg->id)
+ if (reg->type == SCALAR_VALUE && reg->id == known_reg->id) {
+ s32 saved_subreg_def = reg->subreg_def;
+
copy_register_state(reg, known_reg);
+ reg->subreg_def = saved_subreg_def;
+ }
}));
}
--
2.34.1
From: Eduard Zingerman <eddyz87(a)gmail.com>
mainline inclusion
from mainline-v6.12-rc4
commit e9bd9c498cb0f5843996dbe5cbce7a1836a83c70
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB9533
CVE: CVE-2024-53125
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
Range propagation must not affect subreg_def marks, otherwise the
following example is rewritten by verifier incorrectly when
BPF_F_TEST_RND_HI32 flag is set:
0: call bpf_ktime_get_ns call bpf_ktime_get_ns
1: r0 &= 0x7fffffff after verifier r0 &= 0x7fffffff
2: w1 = w0 rewrites w1 = w0
3: if w0 < 10 goto +0 --------------> r11 = 0x2f5674a6 (r)
4: r1 >>= 32 r11 <<= 32 (r)
5: r0 = r1 r1 |= r11 (r)
6: exit; if w0 < 0xa goto pc+0
r1 >>= 32
r0 = r1
exit
(or zero extension of w1 at (2) is missing for architectures that
require zero extension for upper register half).
The following happens w/o this patch:
- r0 is marked as not a subreg at (0);
- w1 is marked as subreg at (2);
- w1 subreg_def is overridden at (3) by copy_register_state();
- w1 is read at (5) but mark_insn_zext() does not mark (2)
for zero extension, because w1 subreg_def is not set;
- because of BPF_F_TEST_RND_HI32 flag verifier inserts random
value for hi32 bits of (2) (marked (r));
- this random value is read at (5).
Fixes: 75748837b7e5 ("bpf: Propagate scalar ranges through register assignments.")
Reported-by: Lonial Con <kongln9170(a)gmail.com>
Signed-off-by: Lonial Con <kongln9170(a)gmail.com>
Signed-off-by: Eduard Zingerman <eddyz87(a)gmail.com>
Signed-off-by: Andrii Nakryiko <andrii(a)kernel.org>
Signed-off-by: Daniel Borkmann <daniel(a)iogearbox.net>
Acked-by: Daniel Borkmann <daniel(a)iogearbox.net>
Closes: https://lore.kernel.org/bpf/7e2aa30a62d740db182c170fdd8f81c596df280d.camel@…
Link: https://lore.kernel.org/bpf/20240924210844.1758441-1-eddyz87@gmail.com
Conflicts:
kernel/bpf/verifier.c
[The conflicts were due to not merge commit 98d7ca374ba4 and 4bf79f9be434e]
Signed-off-by: Pu Lehui <pulehui(a)huawei.com>
---
kernel/bpf/verifier.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index c1a03ab632bb..91c33601021d 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -8010,15 +8010,23 @@ static void find_equal_scalars(struct bpf_verifier_state *vstate,
state = vstate->frame[i];
for (j = 0; j < MAX_BPF_REG; j++) {
reg = &state->regs[j];
- if (reg->type == SCALAR_VALUE && reg->id == known_reg->id)
+ if (reg->type == SCALAR_VALUE && reg->id == known_reg->id) {
+ s32 saved_subreg_def = reg->subreg_def;
+
*reg = *known_reg;
+ reg->subreg_def = saved_subreg_def;
+ }
}
bpf_for_each_spilled_reg(j, state, reg) {
if (!reg)
continue;
- if (reg->type == SCALAR_VALUE && reg->id == known_reg->id)
+ if (reg->type == SCALAR_VALUE && reg->id == known_reg->id) {
+ s32 saved_subreg_def = reg->subreg_def;
+
*reg = *known_reg;
+ reg->subreg_def = saved_subreg_def;
+ }
}
}
}
--
2.34.1
Hi Mark,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: faa52e40c08916893e09ba030e616f92e4fc020b
commit: 4aa5db22d35588e1a5d2ee88472348ea73d9fb23 [1321/1321] Merge branch 'asoc-4.19' into asoc-next
config: x86_64-buildonly-randconfig-002-20241205 (https://download.01.org/0day-ci/archive/20241208/202412081030.HpEhO2B9-lkp@…)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241208/202412081030.HpEhO2B9-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412081030.HpEhO2B9-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> sound/soc/codecs/simple-amplifier.o: warning: objtool: missing symbol for section .init.text
--
sound/soc/codecs/es7241.c:206:33: warning: unused variable 'es7241_chip' [-Wunused-const-variable]
206 | static const struct es7241_chip es7241_chip = {
| ^~~~~~~~~~~
1 warning generated.
>> sound/soc/codecs/es7241.o: warning: objtool: missing symbol for section .init.text
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: c8dbb3a6e214ad66d5d6099bf76e1f1c6eefc06f
commit: 7a77845c9768ccddbaa26a0fafe594aa756559d2 [2544/2544] drivers: update Yunsilicon driver to version 2406_rc16.2
config: x86_64-randconfig-123-20241205 (https://download.01.org/0day-ci/archive/20241208/202412080904.AHKBbuKD-lkp@…)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241208/202412080904.AHKBbuKD-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412080904.AHKBbuKD-lkp@intel.com/
All errors (new ones prefixed by >>):
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:1897:6: warning: no previous prototype for function 'xsc_eth_rss_params_change' [-Wmissing-prototypes]
1897 | void xsc_eth_rss_params_change(struct xsc_adapter *adapter, u32 change, void *modify)
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:1897:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1897 | void xsc_eth_rss_params_change(struct xsc_adapter *adapter, u32 change, void *modify)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2206:6: warning: no previous prototype for function 'xsc_build_default_indir_rqt' [-Wmissing-prototypes]
2206 | void xsc_build_default_indir_rqt(u32 *indirection_rqt, int len,
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2206:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2206 | void xsc_build_default_indir_rqt(u32 *indirection_rqt, int len,
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2295:5: warning: no previous prototype for function 'xsc_eth_nic_mtu_changed' [-Wmissing-prototypes]
2295 | int xsc_eth_nic_mtu_changed(struct xsc_adapter *priv)
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2295:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2295 | int xsc_eth_nic_mtu_changed(struct xsc_adapter *priv)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2365:5: warning: no previous prototype for function 'xsc_set_vf_mac' [-Wmissing-prototypes]
2365 | int xsc_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2365:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2365 | int xsc_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2433:5: warning: no previous prototype for function 'xsc_get_vf_config' [-Wmissing-prototypes]
2433 | int xsc_get_vf_config(struct net_device *dev,
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2433:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2433 | int xsc_get_vf_config(struct net_device *dev,
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2450:5: warning: no previous prototype for function 'xsc_set_vf_link_state' [-Wmissing-prototypes]
2450 | int xsc_set_vf_link_state(struct net_device *dev, int vf,
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2450:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2450 | int xsc_set_vf_link_state(struct net_device *dev, int vf,
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2460:5: warning: no previous prototype for function 'set_feature_rxcsum' [-Wmissing-prototypes]
2460 | int set_feature_rxcsum(struct net_device *netdev, bool enable)
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2460:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2460 | int set_feature_rxcsum(struct net_device *netdev, bool enable)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2482:5: warning: no previous prototype for function 'set_feature_vlan_offload' [-Wmissing-prototypes]
2482 | int set_feature_vlan_offload(struct net_device *netdev, bool enable)
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2482:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2482 | int set_feature_vlan_offload(struct net_device *netdev, bool enable)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2534:5: warning: no previous prototype for function 'xsc_eth_set_features' [-Wmissing-prototypes]
2534 | int xsc_eth_set_features(struct net_device *netdev, netdev_features_t features)
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2534:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2534 | int xsc_eth_set_features(struct net_device *netdev, netdev_features_t features)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2561:5: warning: no previous prototype for function 'xsc_select_queue' [-Wmissing-prototypes]
2561 | u16 xsc_select_queue(struct net_device *dev, struct sk_buff *skb,
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2561:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2561 | u16 xsc_select_queue(struct net_device *dev, struct sk_buff *skb,
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2570:10: warning: variable 'txq_ix' is uninitialized when used here [-Wuninitialized]
2570 | return txq_ix;
| ^~~~~~
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2564:12: note: initialize the variable 'txq_ix' to silence this warning
2564 | int txq_ix, up = 0;
| ^
| = 0
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2763:24: warning: no previous prototype for function 'xsc_tirc_get_default_config' [-Wmissing-prototypes]
2763 | struct xsc_tirc_config xsc_tirc_get_default_config(enum xsc_traffic_types tt)
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2763:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2763 | struct xsc_tirc_config xsc_tirc_get_default_config(enum xsc_traffic_types tt)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2768:6: warning: no previous prototype for function 'xsc_build_rss_params' [-Wmissing-prototypes]
2768 | void xsc_build_rss_params(struct xsc_rss_params *rss_params, u16 num_channels)
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2768:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2768 | void xsc_build_rss_params(struct xsc_rss_params *rss_params, u16 num_channels)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2786:6: warning: no previous prototype for function 'xsc_eth_build_nic_params' [-Wmissing-prototypes]
2786 | void xsc_eth_build_nic_params(struct xsc_adapter *adapter, u32 ch_num, u32 tc_num)
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2786:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2786 | void xsc_eth_build_nic_params(struct xsc_adapter *adapter, u32 ch_num, u32 tc_num)
| ^
| static
>> drivers/net/ethernet/yunsilicon/xsc/net/main.c:2823:10: error: no member named 'dcbnl_ops' in 'struct net_device'
2823 | netdev->dcbnl_ops = &xsc_dcbnl_ops;
| ~~~~~~ ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2814:6: warning: no previous prototype for function 'xsc_eth_build_nic_netdev' [-Wmissing-prototypes]
2814 | void xsc_eth_build_nic_netdev(struct xsc_adapter *adapter)
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2814:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2814 | void xsc_eth_build_nic_netdev(struct xsc_adapter *adapter)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2880:5: warning: no previous prototype for function 'xsc_eth_create_xdev_resources' [-Wmissing-prototypes]
2880 | int xsc_eth_create_xdev_resources(struct xsc_core_device *xdev)
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2880:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2880 | int xsc_eth_create_xdev_resources(struct xsc_core_device *xdev)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2899:5: warning: no previous prototype for function 'xsc_eth_init_nic_rx' [-Wmissing-prototypes]
2899 | int xsc_eth_init_nic_rx(struct xsc_adapter *adapter)
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:2899:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2899 | int xsc_eth_init_nic_rx(struct xsc_adapter *adapter)
| ^
| static
drivers/net/ethernet/yunsilicon/xsc/net/main.c:3134:5: warning: no previous prototype for function 'xsc_net_reboot_event_handler' [-Wmissing-prototypes]
3134 | int xsc_net_reboot_event_handler(struct notifier_block *nb, unsigned long action, void *data)
| ^
drivers/net/ethernet/yunsilicon/xsc/net/main.c:3134:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
3134 | int xsc_net_reboot_event_handler(struct notifier_block *nb, unsigned long action, void *data)
| ^
| static
52 warnings and 1 error generated.
vim +2823 drivers/net/ethernet/yunsilicon/xsc/net/main.c
d48b7d951d22f7f Wanrenyong 2023-10-27 2813
d48b7d951d22f7f Wanrenyong 2023-10-27 2814 void xsc_eth_build_nic_netdev(struct xsc_adapter *adapter)
d48b7d951d22f7f Wanrenyong 2023-10-27 2815 {
d48b7d951d22f7f Wanrenyong 2023-10-27 2816 struct net_device *netdev = adapter->netdev;
d48b7d951d22f7f Wanrenyong 2023-10-27 2817 struct xsc_core_device *xdev = adapter->xdev;
d48b7d951d22f7f Wanrenyong 2023-10-27 2818
d48b7d951d22f7f Wanrenyong 2023-10-27 2819 /* Set up network device as normal. */
d48b7d951d22f7f Wanrenyong 2023-10-27 2820 netdev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE;
d48b7d951d22f7f Wanrenyong 2023-10-27 2821 netdev->netdev_ops = &xsc_netdev_ops;
d48b7d951d22f7f Wanrenyong 2023-10-27 2822
d48b7d951d22f7f Wanrenyong 2023-10-27 @2823 netdev->dcbnl_ops = &xsc_dcbnl_ops;
d48b7d951d22f7f Wanrenyong 2023-10-27 2824 eth_set_ethtool_ops(netdev);
d48b7d951d22f7f Wanrenyong 2023-10-27 2825
d48b7d951d22f7f Wanrenyong 2023-10-27 2826 netdev->min_mtu = SW_MIN_MTU;
d48b7d951d22f7f Wanrenyong 2023-10-27 2827 netdev->max_mtu = SW_MAX_MTU;
d48b7d951d22f7f Wanrenyong 2023-10-27 2828 /*mtu - macheaderlen - ipheaderlen should be aligned in 8B*/
d48b7d951d22f7f Wanrenyong 2023-10-27 2829 netdev->mtu = SW_DEFAULT_MTU;
d48b7d951d22f7f Wanrenyong 2023-10-27 2830
d48b7d951d22f7f Wanrenyong 2023-10-27 2831 netdev->vlan_features |= NETIF_F_SG;
d48b7d951d22f7f Wanrenyong 2023-10-27 2832 netdev->vlan_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;//NETIF_F_HW_CSUM;
d48b7d951d22f7f Wanrenyong 2023-10-27 2833 netdev->vlan_features |= NETIF_F_GRO;
d48b7d951d22f7f Wanrenyong 2023-10-27 2834 netdev->vlan_features |= NETIF_F_TSO;//NETIF_F_TSO_ECN
d48b7d951d22f7f Wanrenyong 2023-10-27 2835 netdev->vlan_features |= NETIF_F_TSO6;
d48b7d951d22f7f Wanrenyong 2023-10-27 2836 //todo: enable rx csum
d48b7d951d22f7f Wanrenyong 2023-10-27 2837 netdev->vlan_features |= NETIF_F_RXCSUM;
d48b7d951d22f7f Wanrenyong 2023-10-27 2838 netdev->vlan_features |= NETIF_F_RXHASH;
d48b7d951d22f7f Wanrenyong 2023-10-27 2839 netdev->vlan_features |= NETIF_F_GSO_PARTIAL;
d48b7d951d22f7f Wanrenyong 2023-10-27 2840
d48b7d951d22f7f Wanrenyong 2023-10-27 2841 netdev->hw_features = netdev->vlan_features;
23b8024ef459f8b tianx 2024-02-06 2842 netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER;
7a77845c9768ccd Tian Xin 2024-11-06 2843 netdev->hw_features |= NETIF_F_HW_VLAN_STAG_RX | NETIF_F_HW_VLAN_STAG_TX;
d48b7d951d22f7f Wanrenyong 2023-10-27 2844
d48b7d951d22f7f Wanrenyong 2023-10-27 2845 if (xsc_vxlan_allowed(xdev) || xsc_geneve_tx_allowed(xdev) ||
d48b7d951d22f7f Wanrenyong 2023-10-27 2846 xsc_any_tunnel_proto_supported(xdev)) {
d48b7d951d22f7f Wanrenyong 2023-10-27 2847 netdev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
d48b7d951d22f7f Wanrenyong 2023-10-27 2848 netdev->hw_enc_features |= NETIF_F_TSO; //NETIF_F_TSO_ECN
d48b7d951d22f7f Wanrenyong 2023-10-27 2849 netdev->hw_enc_features |= NETIF_F_TSO6;
d48b7d951d22f7f Wanrenyong 2023-10-27 2850 netdev->hw_enc_features |= NETIF_F_GSO_PARTIAL;
d48b7d951d22f7f Wanrenyong 2023-10-27 2851 }
d48b7d951d22f7f Wanrenyong 2023-10-27 2852
d48b7d951d22f7f Wanrenyong 2023-10-27 2853 netdev->features |= netdev->hw_features;
d48b7d951d22f7f Wanrenyong 2023-10-27 2854 netdev->features |= NETIF_F_HIGHDMA;
d48b7d951d22f7f Wanrenyong 2023-10-27 2855 }
d48b7d951d22f7f Wanrenyong 2023-10-27 2856
:::::: The code at line 2823 was first introduced by commit
:::::: d48b7d951d22f7f97d68ae7b580769827683d404 drivers: initial support for xsc drivers from Yunsilicon Technology
:::::: TO: Wanrenyong <wanry(a)yunsilicon.com>
:::::: CC: Wanrenyong <wanry(a)yunsilicon.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: c8dbb3a6e214ad66d5d6099bf76e1f1c6eefc06f
commit: 6b65db0bde760a026bd93ae93f5bcacfece087cb [2544/2544] livepatch: Fix huge_depth in arch_klp_check_activeness_func()
config: x86_64-randconfig-123-20241205 (https://download.01.org/0day-ci/archive/20241208/202412080615.LTPtfUgh-lkp@…)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241208/202412080615.LTPtfUgh-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412080615.LTPtfUgh-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from arch/x86/kernel/livepatch.c:21:
In file included from include/linux/kallsyms.h:12:
In file included from include/linux/mm.h:1581:
include/linux/vmstat.h:431:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
431 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> arch/x86/kernel/livepatch.c:55:6: warning: no previous prototype for function 'arch_check_jump_insn' [-Wmissing-prototypes]
55 | bool arch_check_jump_insn(unsigned long func_addr)
| ^
arch/x86/kernel/livepatch.c:55:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
55 | bool arch_check_jump_insn(unsigned long func_addr)
| ^
| static
arch/x86/kernel/livepatch.c:224:5: warning: no previous prototype for function 'arch_klp_check_calltrace' [-Wmissing-prototypes]
224 | int arch_klp_check_calltrace(bool (*check_func)(void *, int *, unsigned long), void *data)
| ^
arch/x86/kernel/livepatch.c:224:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
224 | int arch_klp_check_calltrace(bool (*check_func)(void *, int *, unsigned long), void *data)
| ^
| static
arch/x86/kernel/livepatch.c:309:6: warning: no previous prototype for function 'arch_klp_code_modify_prepare' [-Wmissing-prototypes]
309 | void arch_klp_code_modify_prepare(void)
| ^
arch/x86/kernel/livepatch.c:309:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
309 | void arch_klp_code_modify_prepare(void)
| ^
| static
arch/x86/kernel/livepatch.c:315:6: warning: no previous prototype for function 'arch_klp_code_modify_post_process' [-Wmissing-prototypes]
315 | void arch_klp_code_modify_post_process(void)
| ^
arch/x86/kernel/livepatch.c:315:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
315 | void arch_klp_code_modify_post_process(void)
| ^
| static
5 warnings generated.
--
In file included from kernel/livepatch/core.c:16:
In file included from include/linux/kallsyms.h:12:
In file included from include/linux/mm.h:1581:
include/linux/vmstat.h:431:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
431 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
kernel/livepatch/core.c:71:16: warning: no previous prototype for function 'klp_check_patch_kprobed' [-Wmissing-prototypes]
71 | struct kprobe *klp_check_patch_kprobed(struct klp_patch *patch)
| ^
kernel/livepatch/core.c:71:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
71 | struct kprobe *klp_check_patch_kprobed(struct klp_patch *patch)
| ^
| static
kernel/livepatch/core.c:942:12: warning: no previous prototype for function 'arch_klp_init_func' [-Wmissing-prototypes]
942 | int __weak arch_klp_init_func(struct klp_object *obj, struct klp_func *func)
| ^
kernel/livepatch/core.c:942:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
942 | int __weak arch_klp_init_func(struct klp_object *obj, struct klp_func *func)
| ^
| static
kernel/livepatch/core.c:1342:12: warning: no previous prototype for function 'arch_klp_check_calltrace' [-Wmissing-prototypes]
1342 | int __weak arch_klp_check_calltrace(bool (*fn)(void *, int *, unsigned long), void *data)
| ^
kernel/livepatch/core.c:1342:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1342 | int __weak arch_klp_check_calltrace(bool (*fn)(void *, int *, unsigned long), void *data)
| ^
| static
>> kernel/livepatch/core.c:1347:13: warning: no previous prototype for function 'arch_check_jump_insn' [-Wmissing-prototypes]
1347 | bool __weak arch_check_jump_insn(unsigned long func_addr)
| ^
kernel/livepatch/core.c:1347:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1347 | bool __weak arch_check_jump_insn(unsigned long func_addr)
| ^
| static
kernel/livepatch/core.c:1352:12: warning: no previous prototype for function 'arch_klp_check_activeness_func' [-Wmissing-prototypes]
1352 | int __weak arch_klp_check_activeness_func(struct klp_func *func, int enable,
| ^
kernel/livepatch/core.c:1352:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1352 | int __weak arch_klp_check_activeness_func(struct klp_func *func, int enable,
| ^
| static
kernel/livepatch/core.c:1621:5: warning: no previous prototype for function 'klp_try_disable_patch' [-Wmissing-prototypes]
1621 | int klp_try_disable_patch(void *data)
| ^
kernel/livepatch/core.c:1621:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1621 | int klp_try_disable_patch(void *data)
| ^
| static
kernel/livepatch/core.c:1655:13: warning: no previous prototype for function 'arch_klp_code_modify_prepare' [-Wmissing-prototypes]
1655 | void __weak arch_klp_code_modify_prepare(void)
| ^
kernel/livepatch/core.c:1655:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1655 | void __weak arch_klp_code_modify_prepare(void)
| ^
| static
kernel/livepatch/core.c:1659:13: warning: no previous prototype for function 'arch_klp_code_modify_post_process' [-Wmissing-prototypes]
1659 | void __weak arch_klp_code_modify_post_process(void)
| ^
kernel/livepatch/core.c:1659:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1659 | void __weak arch_klp_code_modify_post_process(void)
| ^
| static
kernel/livepatch/core.c:1663:14: warning: no previous prototype for function 'arch_klp_mem_alloc' [-Wmissing-prototypes]
1663 | void __weak *arch_klp_mem_alloc(size_t size)
| ^
kernel/livepatch/core.c:1663:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1663 | void __weak *arch_klp_mem_alloc(size_t size)
| ^
| static
kernel/livepatch/core.c:1668:13: warning: no previous prototype for function 'arch_klp_mem_free' [-Wmissing-prototypes]
1668 | void __weak arch_klp_mem_free(void *mem)
| ^
kernel/livepatch/core.c:1668:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1668 | void __weak arch_klp_mem_free(void *mem)
| ^
| static
kernel/livepatch/core.c:1696:13: warning: no previous prototype for function 'arch_klp_set_brk_func' [-Wmissing-prototypes]
1696 | void __weak arch_klp_set_brk_func(struct klp_func_node *func_node, void *new_func)
| ^
kernel/livepatch/core.c:1696:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1696 | void __weak arch_klp_set_brk_func(struct klp_func_node *func_node, void *new_func)
| ^
| static
kernel/livepatch/core.c:2108:5: warning: no previous prototype for function 'klp_try_enable_patch' [-Wmissing-prototypes]
2108 | int klp_try_enable_patch(void *data)
| ^
kernel/livepatch/core.c:2108:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2108 | int klp_try_enable_patch(void *data)
| ^
| static
13 warnings generated.
vim +/arch_check_jump_insn +55 arch/x86/kernel/livepatch.c
54
> 55 bool arch_check_jump_insn(unsigned long func_addr)
56 {
57 int len = JMP_E9_INSN_SIZE;
58 struct insn insn;
59 u8 *addr = (u8*)func_addr;
60
61 do {
62 if (is_jump_insn(addr))
63 return true;
64 insn_init(&insn, addr, MAX_INSN_SIZE, 1);
65 insn_get_length(&insn);
66 if (!insn.length || !insn_complete(&insn))
67 return true;
68 len -= insn.length;
69 addr += insn.length;
70 } while (len > 0);
71
72 return false;
73 }
74
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki