From: Andrey Shumilin <shum.sdl(a)nppct.ru>
stable inclusion
from stable-v5.10.229
commit 5e431f85c87bbffd93a9830d5a576586f9855291
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB2YWV
CVE: CVE-2024-50205
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
[ Upstream commit 72cafe63b35d06b5cfbaf807e90ae657907858da ]
The step variable is initialized to zero. It is changed in the loop,
but if it's not changed it will remain zero. Add a variable check
before the division.
The observed behavior was introduced by commit 826b5de90c0b
("ALSA: firewire-lib: fix insufficient PCM rule for period/buffer size"),
and it is difficult to show that any of the interval parameters will
satisfy the snd_interval_test() condition with data from the
amdtp_rate_table[] table.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 826b5de90c0b ("ALSA: firewire-lib: fix insufficient PCM rule for period/buffer size")
Signed-off-by: Andrey Shumilin <shum.sdl(a)nppct.ru>
Reviewed-by: Takashi Sakamoto <o-takashi(a)sakamocchi.jp>
Link: https://patch.msgid.link/20241018060018.1189537-1-shum.sdl@nppct.ru
Signed-off-by: Takashi Iwai <tiwai(a)suse.de>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
Signed-off-by: Gu Bowen <gubowen5(a)huawei.com>
---
sound/firewire/amdtp-stream.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c
index 7a282d8e7148..bd272ab2048e 100644
--- a/sound/firewire/amdtp-stream.c
+++ b/sound/firewire/amdtp-stream.c
@@ -163,6 +163,9 @@ static int apply_constraint_to_size(struct snd_pcm_hw_params *params,
step = max(step, amdtp_syt_intervals[i]);
}
+ if (step == 0)
+ return -EINVAL;
+
t.min = roundup(s->min, step);
t.max = rounddown(s->max, step);
t.integer = 1;
--
2.25.1
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 0a813b20347c3788a30544ad2cec470b11cc197d
commit: 5d5f0e49572a1948fa42fd082aaa8238757614bd [1298/1298] ext4: Check journal inode extents more carefully
config: x86_64-randconfig-015-20241118 (https://download.01.org/0day-ci/archive/20241119/202411190810.m9d4nNAz-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/20241119/202411190810.m9d4nNAz-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/202411190810.m9d4nNAz-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from fs/ext4/inode.c:25:
include/linux/pagemap.h:425:21: warning: cast from 'int (*)(struct file *, struct page *)' to 'filler_t *' (aka 'int (*)(void *, struct page *)') converts to incompatible function type [-Wcast-function-type-strict]
425 | filler_t *filler = (filler_t *)mapping->a_ops->readpage;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
>> fs/ext4/inode.o: warning: objtool: ext4_map_blocks()+0x9ea: unreachable instruction
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Hi David,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 8a039651010897592567f5751c4e706ab794e9c0
commit: 43d4042e06d2bf96adf67d25e8d91653507a4cf9 [1484/1484] KEYS: Provide a function to load keys from a PGP keyring blob
config: x86_64-randconfig-074-20241119 (https://download.01.org/0day-ci/archive/20241119/202411190849.ohZKmN0Z-lkp@…)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241119/202411190849.ohZKmN0Z-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/202411190849.ohZKmN0Z-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
In file included from crypto/asymmetric_keys/pgp_public_key.c:20:
>> include/linux/pgplib.h:26:36: warning: 'enum pgp_packet_tag' declared inside parameter list will not be visible outside of this definition or declaration
26 | enum pgp_packet_tag type,
| ^~~~~~~~~~~~~~
>> include/linux/pgplib.h:36:30: warning: 'version' is narrower than values of its type
36 | enum pgp_key_version version : 8;
| ^~~~~~~
>> include/linux/pgplib.h:36:30: error: field 'version' has incomplete type
>> include/linux/pgplib.h:37:30: warning: 'pubkey_algo' is narrower than values of its type
37 | enum pgp_pubkey_algo pubkey_algo : 8;
| ^~~~~~~~~~~
>> include/linux/pgplib.h:37:30: error: field 'pubkey_algo' has incomplete type
crypto/asymmetric_keys/pgp_public_key.c: In function 'pgp_calc_pkey_keyid':
>> crypto/asymmetric_keys/pgp_public_key.c:63:9: error: implicit declaration of function 'kenter' [-Werror=implicit-function-declaration]
63 | kenter("");
| ^~~~~~
>> crypto/asymmetric_keys/pgp_public_key.c:65:29: error: 'PGP_KEY_VERSION_4' undeclared (first use in this function)
65 | n = (pgp->version < PGP_KEY_VERSION_4) ? 8 : 6;
| ^~~~~~~~~~~~~~~~~
crypto/asymmetric_keys/pgp_public_key.c:65:29: note: each undeclared identifier is reported only once for each function it appears in
>> crypto/asymmetric_keys/pgp_public_key.c:67:23: error: implicit declaration of function 'mpi_key_length' [-Werror=implicit-function-declaration]
67 | ret = mpi_key_length(key_ptr, keylen, nb + i, nn + i);
| ^~~~~~~~~~~~~~
>> crypto/asymmetric_keys/pgp_public_key.c:115:9: error: implicit declaration of function 'kleave' [-Werror=implicit-function-declaration]
115 | kleave(" = %d", ret);
| ^~~~~~
crypto/asymmetric_keys/pgp_public_key.c: In function 'pgp_generate_fingerprint':
crypto/asymmetric_keys/pgp_public_key.c:134:49: error: 'PGP_KEY_VERSION_4' undeclared (first use in this function)
134 | tfm = crypto_alloc_shash(pgp->version < PGP_KEY_VERSION_4 ?
| ^~~~~~~~~~~~~~~~~
crypto/asymmetric_keys/pgp_public_key.c: At top level:
>> crypto/asymmetric_keys/pgp_public_key.c:199:40: warning: 'enum pgp_packet_tag' declared inside parameter list will not be visible outside of this definition or declaration
199 | enum pgp_packet_tag type,
| ^~~~~~~~~~~~~~
>> crypto/asymmetric_keys/pgp_public_key.c:199:55: error: parameter 2 ('type') has incomplete type
199 | enum pgp_packet_tag type,
| ~~~~~~~~~~~~~~~~~~~~^~~~
>> crypto/asymmetric_keys/pgp_public_key.c:198:12: error: function declaration isn't a prototype [-Werror=strict-prototypes]
198 | static int pgp_process_public_key(struct pgp_parse_context *context,
| ^~~~~~~~~~~~~~~~~~~~~~
crypto/asymmetric_keys/pgp_public_key.c: In function 'pgp_process_public_key':
>> crypto/asymmetric_keys/pgp_public_key.c:213:21: error: 'PGP_PKT_USER_ID' undeclared (first use in this function)
213 | if (type == PGP_PKT_USER_ID) {
| ^~~~~~~~~~~~~~~
>> crypto/asymmetric_keys/pgp_public_key.c:234:32: error: 'PGP_PUBKEY__LAST' undeclared (first use in this function)
234 | if (pgp.pubkey_algo >= PGP_PUBKEY__LAST)
| ^~~~~~~~~~~~~~~~
>> crypto/asymmetric_keys/pgp_public_key.c:236:16: error: 'pgp_to_public_key_algo' undeclared (first use in this function); did you mean 'pgp_pubkey_algo'?
236 | algo = pgp_to_public_key_algo[pgp.pubkey_algo];
| ^~~~~~~~~~~~~~~~~~~~~~
| pgp_pubkey_algo
crypto/asymmetric_keys/pgp_public_key.c: In function 'pgp_key_parse':
>> crypto/asymmetric_keys/pgp_public_key.c:313:43: error: 'PGP_PKT_PUBLIC_KEY' undeclared (first use in this function)
313 | ctx.pgp.types_of_interest = (1 << PGP_PKT_PUBLIC_KEY) |
| ^~~~~~~~~~~~~~~~~~
crypto/asymmetric_keys/pgp_public_key.c:314:43: error: 'PGP_PKT_USER_ID' undeclared (first use in this function)
314 | (1 << PGP_PKT_USER_ID);
| ^~~~~~~~~~~~~~~
>> crypto/asymmetric_keys/pgp_public_key.c:315:32: error: assignment to 'int (*)(struct pgp_parse_context *, enum pgp_packet_tag, u8, const u8 *, size_t)' {aka 'int (*)(struct pgp_parse_context *, enum pgp_packet_tag, unsigned char, const unsigned char *, long unsigned int)'} from incompatible pointer type 'int (*)()' [-Werror=incompatible-pointer-types]
315 | ctx.pgp.process_packet = pgp_process_public_key;
| ^
cc1: some warnings being treated as errors
--
In file included from crypto/asymmetric_keys/pgp_preload.c:19:
>> include/linux/pgplib.h:26:36: warning: 'enum pgp_packet_tag' declared inside parameter list will not be visible outside of this definition or declaration
26 | enum pgp_packet_tag type,
| ^~~~~~~~~~~~~~
>> include/linux/pgplib.h:36:30: warning: 'version' is narrower than values of its type
36 | enum pgp_key_version version : 8;
| ^~~~~~~
>> include/linux/pgplib.h:36:30: error: field 'version' has incomplete type
>> include/linux/pgplib.h:37:30: warning: 'pubkey_algo' is narrower than values of its type
37 | enum pgp_pubkey_algo pubkey_algo : 8;
| ^~~~~~~~~~~
>> include/linux/pgplib.h:37:30: error: field 'pubkey_algo' has incomplete type
>> crypto/asymmetric_keys/pgp_preload.c:63:38: warning: 'enum pgp_packet_tag' declared inside parameter list will not be visible outside of this definition or declaration
63 | enum pgp_packet_tag type, u8 headerlen,
| ^~~~~~~~~~~~~~
>> crypto/asymmetric_keys/pgp_preload.c:63:53: error: parameter 2 ('type') has incomplete type
63 | enum pgp_packet_tag type, u8 headerlen,
| ~~~~~~~~~~~~~~~~~~~~^~~~
>> crypto/asymmetric_keys/pgp_preload.c:62:19: error: function declaration isn't a prototype [-Werror=strict-prototypes]
62 | static int __init found_pgp_key(struct pgp_parse_context *context,
| ^~~~~~~~~~~~~
>> crypto/asymmetric_keys/pgp_preload.c:101:12: warning: no previous prototype for 'preload_pgp_keys' [-Wmissing-prototypes]
101 | int __init preload_pgp_keys(const u8 *pgpdata, size_t pgpdatalen,
| ^~~~~~~~~~~~~~~~
crypto/asymmetric_keys/pgp_preload.c: In function 'preload_pgp_keys':
>> crypto/asymmetric_keys/pgp_preload.c:107:43: error: 'PGP_PKT_PUBLIC_KEY' undeclared (first use in this function)
107 | ctx.pgp.types_of_interest = (1 << PGP_PKT_PUBLIC_KEY);
| ^~~~~~~~~~~~~~~~~~
crypto/asymmetric_keys/pgp_preload.c:107:43: note: each undeclared identifier is reported only once for each function it appears in
>> crypto/asymmetric_keys/pgp_preload.c:108:32: error: assignment to 'int (*)(struct pgp_parse_context *, enum pgp_packet_tag, u8, const u8 *, size_t)' {aka 'int (*)(struct pgp_parse_context *, enum pgp_packet_tag, unsigned char, const unsigned char *, long unsigned int)'} from incompatible pointer type 'int (*)()' [-Werror=incompatible-pointer-types]
108 | ctx.pgp.process_packet = found_pgp_key;
| ^
cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for PGP_KEY_PARSER
Depends on [m]: CRYPTO [=y] && ASYMMETRIC_KEY_TYPE [=y] && ASYMMETRIC_PUBLIC_KEY_SUBTYPE [=m]
Selected by [y]:
- PGP_PRELOAD [=y] && CRYPTO [=y] && ASYMMETRIC_KEY_TYPE [=y]
vim +/version +36 include/linux/pgplib.h
b78af6579e15dc David Howells 2023-09-12 19
b78af6579e15dc David Howells 2023-09-12 20 /*
b78af6579e15dc David Howells 2023-09-12 21 * PGP library packet parser
b78af6579e15dc David Howells 2023-09-12 22 */
b78af6579e15dc David Howells 2023-09-12 23 struct pgp_parse_context {
b78af6579e15dc David Howells 2023-09-12 24 u64 types_of_interest;
b78af6579e15dc David Howells 2023-09-12 25 int (*process_packet)(struct pgp_parse_context *context,
b78af6579e15dc David Howells 2023-09-12 @26 enum pgp_packet_tag type,
b78af6579e15dc David Howells 2023-09-12 27 u8 headerlen,
b78af6579e15dc David Howells 2023-09-12 28 const u8 *data,
b78af6579e15dc David Howells 2023-09-12 29 size_t datalen);
b78af6579e15dc David Howells 2023-09-12 30 };
b78af6579e15dc David Howells 2023-09-12 31
b78af6579e15dc David Howells 2023-09-12 32 extern int pgp_parse_packets(const u8 *data, size_t datalen,
b78af6579e15dc David Howells 2023-09-12 33 struct pgp_parse_context *ctx);
b78af6579e15dc David Howells 2023-09-12 34
b78af6579e15dc David Howells 2023-09-12 35 struct pgp_parse_pubkey {
b78af6579e15dc David Howells 2023-09-12 @36 enum pgp_key_version version : 8;
b78af6579e15dc David Howells 2023-09-12 @37 enum pgp_pubkey_algo pubkey_algo : 8;
b78af6579e15dc David Howells 2023-09-12 38 __kernel_old_time_t creation_time;
b78af6579e15dc David Howells 2023-09-12 39 __kernel_old_time_t expires_at;
b78af6579e15dc David Howells 2023-09-12 40 };
b78af6579e15dc David Howells 2023-09-12 41
:::::: The code at line 36 was first introduced by commit
:::::: b78af6579e15dcdff86504da90af77f3e890270e PGPLIB: Basic packet parser
:::::: TO: David Howells <dhowells(a)redhat.com>
:::::: CC: zgzxx <zhangguangzhi3(a)huawei.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Hi fangbaoshun,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 8a039651010897592567f5751c4e706ab794e9c0
commit: 1c3b1095a26ed8bc1aa7ac3d4e8dd3e65964a74b [1484/1484] KVM: SVM: Add KVM_CSV_COMMAND_BATCH command for applying CSV RING_BUFFER mode
config: x86_64-randconfig-073-20241119 (https://download.01.org/0day-ci/archive/20241119/202411190617.6rJdyaze-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/20241119/202411190617.6rJdyaze-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/202411190617.6rJdyaze-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from arch/x86/kvm/svm/sev.c:12:
In file included from include/linux/kvm_host.h:16:
In file included from include/linux/mm.h:2235:
include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> arch/x86/kvm/svm/sev.c:2200:18: error: no member named 'false' in 'struct hygon_kvm_hooks_table'
2200 | hygon_kvm_hooks.sev_enabled = &sev_enabled;
| ~~~~~~~~~~~~~~~ ^
arch/x86/kvm/svm/sev.c:66:21: note: expanded from macro 'sev_enabled'
66 | #define sev_enabled false
| ^
>> arch/x86/kvm/svm/sev.c:2200:32: error: cannot take the address of an rvalue of type 'int'
2200 | hygon_kvm_hooks.sev_enabled = &sev_enabled;
| ^~~~~~~~~~~~
arch/x86/kvm/svm/sev.c:2198:6: warning: no previous prototype for function 'sev_install_hooks' [-Wmissing-prototypes]
2198 | void sev_install_hooks(void)
| ^
arch/x86/kvm/svm/sev.c:2198:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
2198 | void sev_install_hooks(void)
| ^
| static
2 warnings and 2 errors generated.
vim +2200 arch/x86/kvm/svm/sev.c
2195
2196 #ifdef CONFIG_HYGON_CSV
2197 /* Code to set all of the function and vaiable pointers */
2198 void sev_install_hooks(void)
2199 {
> 2200 hygon_kvm_hooks.sev_enabled = &sev_enabled;
2201 hygon_kvm_hooks.sev_issue_cmd = sev_issue_cmd;
2202 hygon_kvm_hooks.get_num_contig_pages = get_num_contig_pages;
2203 hygon_kvm_hooks.sev_pin_memory = sev_pin_memory;
2204 hygon_kvm_hooks.sev_unpin_memory = sev_unpin_memory;
2205
2206 hygon_kvm_hooks.sev_hooks_installed = true;
2207 }
2208 #endif
2209
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 8a039651010897592567f5751c4e706ab794e9c0
commit: 69181c3c9413ccaa4dab458057d13efda520cb60 [1484/1484] Net: nebula_matrix: fix ci build warning
config: x86_64-randconfig-001-20241119 (https://download.01.org/0day-ci/archive/20241119/202411190357.RZb9MYNL-lkp@…)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241119/202411190357.RZb9MYNL-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/202411190357.RZb9MYNL-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c: In function 'nbl_get_drvinfo':
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:133:33: warning: variable 'priv' set but not used [-Wunused-but-set-variable]
133 | struct nbl_netdev_priv *priv;
| ^~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c: At top level:
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:308:6: warning: no previous prototype for 'nbl_serv_adjust_interrpt_param' [-Wmissing-prototypes]
308 | void nbl_serv_adjust_interrpt_param(struct nbl_service_mgt *serv_mgt, bool ethtool)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c: In function 'nbl_serv_adjust_interrpt_param':
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:314:33: warning: variable 'net_priv' set but not used [-Wunused-but-set-variable]
314 | struct nbl_netdev_priv *net_priv;
| ^~~~~~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c: In function 'nbl_serv_update_stats':
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:365:33: warning: variable 'net_priv' set but not used [-Wunused-but-set-variable]
365 | struct nbl_netdev_priv *net_priv;
| ^~~~~~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c: At top level:
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:510:5: warning: no previous prototype for 'nbl_get_eeprom_length' [-Wmissing-prototypes]
510 | int nbl_get_eeprom_length(struct net_device *netdev)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:515:5: warning: no previous prototype for 'nbl_get_eeprom' [-Wmissing-prototypes]
515 | int nbl_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, u8 *bytes)
| ^~~~~~~~~~~~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c: In function 'nbl_set_ksettings':
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:782:13: warning: variable 'autoneg' set but not used [-Wunused-but-set-variable]
782 | u32 autoneg = 0;
| ^~~~~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:779:30: warning: variable 'phy_caps' set but not used [-Wunused-but-set-variable]
779 | struct nbl_phy_caps *phy_caps;
| ^~~~~~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:778:31: warning: variable 'phy_state' set but not used [-Wunused-but-set-variable]
778 | struct nbl_phy_state *phy_state;
| ^~~~~~~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c: In function 'nbl_set_pause_param':
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:1695:30: warning: variable 'phy_caps' set but not used [-Wunused-but-set-variable]
1695 | struct nbl_phy_caps *phy_caps;
| ^~~~~~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:1694:31: warning: variable 'phy_state' set but not used [-Wunused-but-set-variable]
1694 | struct nbl_phy_state *phy_state;
| ^~~~~~~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c: In function 'nbl_get_fec_param':
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:1877:12: warning: variable 'autoneg' set but not used [-Wunused-but-set-variable]
1877 | u8 autoneg = 0;
| ^~~~~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c: In function 'nbl_stats_fill_strings':
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:170:47: warning: '%s' directive output may be truncated writing up to 1847 bytes into a region of size 32 [-Wformat-truncation=]
170 | snprintf(p, ETH_GSTRING_LEN, "%s", nbl_gstrings_stats[i].stat_string);
| ^~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:170:17: note: 'snprintf' output between 1 and 1848 bytes into a destination of size 32
170 | snprintf(p, ETH_GSTRING_LEN, "%s", nbl_gstrings_stats[i].stat_string);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:181:58: warning: '_dvn_pkt_drop_cnt' directive output may be truncated writing 17 bytes into a region of size between 13 and 22 [-Wformat-truncation=]
181 | snprintf(p, ETH_GSTRING_LEN, "tx_queue_%u_dvn_pkt_drop_cnt", i);
| ^~~~~~~~~~~~~~~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:181:17: note: 'snprintf' output between 28 and 37 bytes into a destination of size 32
181 | snprintf(p, ETH_GSTRING_LEN, "tx_queue_%u_dvn_pkt_drop_cnt", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:183:58: warning: '_tx_timeout_cnt' directive output may be truncated writing 15 bytes into a region of size between 13 and 22 [-Wformat-truncation=]
183 | snprintf(p, ETH_GSTRING_LEN, "tx_queue_%u_tx_timeout_cnt", i);
| ^~~~~~~~~~~~~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:183:17: note: 'snprintf' output between 26 and 35 bytes into a destination of size 32
183 | snprintf(p, ETH_GSTRING_LEN, "tx_queue_%u_tx_timeout_cnt", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:194:58: warning: '_uvn_stat_pkt_drop' directive output may be truncated writing 18 bytes into a region of size between 13 and 22 [-Wformat-truncation=]
194 | snprintf(p, ETH_GSTRING_LEN, "rx_queue_%u_uvn_stat_pkt_drop", i);
| ^~~~~~~~~~~~~~~~~~
drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c:194:17: note: 'snprintf' output between 29 and 38 bytes into a destination of size 32
194 | snprintf(p, ETH_GSTRING_LEN, "rx_queue_%u_uvn_stat_pkt_drop", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/_dvn_pkt_drop_cnt +181 drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_ethtool.c
bad535d287c9c1 Bennie Yan 2024-09-24 155
bad535d287c9c1 Bennie Yan 2024-09-24 156 static void nbl_stats_fill_strings(struct net_device *netdev, u8 *data)
bad535d287c9c1 Bennie Yan 2024-09-24 157 {
bad535d287c9c1 Bennie Yan 2024-09-24 158 struct nbl_adapter *adapter = NBL_NETDEV_TO_ADAPTER(netdev);
bad535d287c9c1 Bennie Yan 2024-09-24 159 struct nbl_service_mgt *serv_mgt = NBL_ADAPTER_TO_SERV_MGT(adapter);
bad535d287c9c1 Bennie Yan 2024-09-24 160 struct nbl_serv_ring_mgt *ring_mgt = NBL_SERV_MGT_TO_RING_MGT(serv_mgt);
bad535d287c9c1 Bennie Yan 2024-09-24 161 struct nbl_dispatch_ops *disp_ops = NBL_SERV_MGT_TO_DISP_OPS(serv_mgt);
bad535d287c9c1 Bennie Yan 2024-09-24 162 struct nbl_common_info *common = NBL_SERV_MGT_TO_COMMON(serv_mgt);
bad535d287c9c1 Bennie Yan 2024-09-24 163 struct nbl_serv_ring_vsi_info *vsi_info;
bad535d287c9c1 Bennie Yan 2024-09-24 164 char *p = (char *)data;
bad535d287c9c1 Bennie Yan 2024-09-24 165 unsigned int i;
bad535d287c9c1 Bennie Yan 2024-09-24 166
bad535d287c9c1 Bennie Yan 2024-09-24 167 vsi_info = &ring_mgt->vsi_info[NBL_VSI_DATA];
bad535d287c9c1 Bennie Yan 2024-09-24 168
bad535d287c9c1 Bennie Yan 2024-09-24 169 for (i = 0; i < NBL_GLOBAL_STATS_LEN; i++) {
bad535d287c9c1 Bennie Yan 2024-09-24 170 snprintf(p, ETH_GSTRING_LEN, "%s", nbl_gstrings_stats[i].stat_string);
bad535d287c9c1 Bennie Yan 2024-09-24 171 p += ETH_GSTRING_LEN;
bad535d287c9c1 Bennie Yan 2024-09-24 172 }
bad535d287c9c1 Bennie Yan 2024-09-24 173
bad535d287c9c1 Bennie Yan 2024-09-24 174 for (i = 0; i < vsi_info->active_ring_num; i++) {
bad535d287c9c1 Bennie Yan 2024-09-24 175 snprintf(p, ETH_GSTRING_LEN, "tx_queue_%u_packets", i);
bad535d287c9c1 Bennie Yan 2024-09-24 176 p += ETH_GSTRING_LEN;
bad535d287c9c1 Bennie Yan 2024-09-24 177 snprintf(p, ETH_GSTRING_LEN, "tx_queue_%u_bytes", i);
bad535d287c9c1 Bennie Yan 2024-09-24 178 p += ETH_GSTRING_LEN;
bad535d287c9c1 Bennie Yan 2024-09-24 179 snprintf(p, ETH_GSTRING_LEN, "tx_queue_%u_descs", i);
bad535d287c9c1 Bennie Yan 2024-09-24 180 p += ETH_GSTRING_LEN;
bad535d287c9c1 Bennie Yan 2024-09-24 @181 snprintf(p, ETH_GSTRING_LEN, "tx_queue_%u_dvn_pkt_drop_cnt", i);
bad535d287c9c1 Bennie Yan 2024-09-24 182 p += ETH_GSTRING_LEN;
bad535d287c9c1 Bennie Yan 2024-09-24 @183 snprintf(p, ETH_GSTRING_LEN, "tx_queue_%u_tx_timeout_cnt", i);
bad535d287c9c1 Bennie Yan 2024-09-24 184 p += ETH_GSTRING_LEN;
bad535d287c9c1 Bennie Yan 2024-09-24 185 }
bad535d287c9c1 Bennie Yan 2024-09-24 186
bad535d287c9c1 Bennie Yan 2024-09-24 187 for (i = 0; i < vsi_info->active_ring_num; i++) {
bad535d287c9c1 Bennie Yan 2024-09-24 188 snprintf(p, ETH_GSTRING_LEN, "rx_queue_%u_packets", i);
bad535d287c9c1 Bennie Yan 2024-09-24 189 p += ETH_GSTRING_LEN;
bad535d287c9c1 Bennie Yan 2024-09-24 190 snprintf(p, ETH_GSTRING_LEN, "rx_queue_%u_bytes", i);
bad535d287c9c1 Bennie Yan 2024-09-24 191 p += ETH_GSTRING_LEN;
bad535d287c9c1 Bennie Yan 2024-09-24 192 snprintf(p, ETH_GSTRING_LEN, "rx_queue_%u_descs", i);
bad535d287c9c1 Bennie Yan 2024-09-24 193 p += ETH_GSTRING_LEN;
bad535d287c9c1 Bennie Yan 2024-09-24 @194 snprintf(p, ETH_GSTRING_LEN, "rx_queue_%u_uvn_stat_pkt_drop", i);
bad535d287c9c1 Bennie Yan 2024-09-24 195 p += ETH_GSTRING_LEN;
bad535d287c9c1 Bennie Yan 2024-09-24 196 }
bad535d287c9c1 Bennie Yan 2024-09-24 197 if (!common->is_vf)
bad535d287c9c1 Bennie Yan 2024-09-24 198 disp_ops->fill_private_stat_strings(NBL_SERV_MGT_TO_DISP_PRIV(serv_mgt), p);
bad535d287c9c1 Bennie Yan 2024-09-24 199 }
bad535d287c9c1 Bennie Yan 2024-09-24 200
:::::: The code at line 181 was first introduced by commit
:::::: bad535d287c9c1056d99de3666be7da84de4a8fc Net:nbl_core: Add nbl_core-driver for nebula-matrix S1055AS series smart NIC.
:::::: TO: Bennie Yan <bennie.yan(a)nebula-matrix.com>
:::::: CC: Bennie Yan <bennie.yan(a)nebula-matrix.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki