Kernel
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- 52 participants
- 18285 discussions

[PATCH OLK-6.6] bpf: bpf_local_storage: Always use bpf_mem_alloc in PREEMPT_RT
by Tengda Wu 10 Mar '25
by Tengda Wu 10 Mar '25
10 Mar '25
From: Martin KaFai Lau <martin.lau(a)kernel.org>
stable inclusion
from stable-v6.6.76
commit 3392fa605d7c5708c5fbe02e4fbdac547c3b7352
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBREBI
CVE: CVE-2024-58070
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
[ Upstream commit 8eef6ac4d70eb1f0099fff93321d90ce8fa49ee1 ]
In PREEMPT_RT, kmalloc(GFP_ATOMIC) is still not safe in non preemptible
context. bpf_mem_alloc must be used in PREEMPT_RT. This patch is
to enforce bpf_mem_alloc in the bpf_local_storage when CONFIG_PREEMPT_RT
is enabled.
[ 35.118559] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
[ 35.118566] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1832, name: test_progs
[ 35.118569] preempt_count: 1, expected: 0
[ 35.118571] RCU nest depth: 1, expected: 1
[ 35.118577] INFO: lockdep is turned off.
...
[ 35.118647] __might_resched+0x433/0x5b0
[ 35.118677] rt_spin_lock+0xc3/0x290
[ 35.118700] ___slab_alloc+0x72/0xc40
[ 35.118723] __kmalloc_noprof+0x13f/0x4e0
[ 35.118732] bpf_map_kzalloc+0xe5/0x220
[ 35.118740] bpf_selem_alloc+0x1d2/0x7b0
[ 35.118755] bpf_local_storage_update+0x2fa/0x8b0
[ 35.118784] bpf_sk_storage_get_tracing+0x15a/0x1d0
[ 35.118791] bpf_prog_9a118d86fca78ebb_trace_inet_sock_set_state+0x44/0x66
[ 35.118795] bpf_trace_run3+0x222/0x400
[ 35.118820] __bpf_trace_inet_sock_set_state+0x11/0x20
[ 35.118824] trace_inet_sock_set_state+0x112/0x130
[ 35.118830] inet_sk_state_store+0x41/0x90
[ 35.118836] tcp_set_state+0x3b3/0x640
There is no need to adjust the gfp_flags passing to the
bpf_mem_cache_alloc_flags() which only honors the GFP_KERNEL.
The verifier has ensured GFP_KERNEL is passed only in sleepable context.
It has been an old issue since the first introduction of the
bpf_local_storage ~5 years ago, so this patch targets the bpf-next.
bpf_mem_alloc is needed to solve it, so the Fixes tag is set
to the commit when bpf_mem_alloc was first used in the bpf_local_storage.
Fixes: 08a7ce384e33 ("bpf: Use bpf_mem_cache_alloc/free in bpf_local_storage_elem")
Reported-by: Alexei Starovoitov <ast(a)kernel.org>
Signed-off-by: Martin KaFai Lau <martin.lau(a)kernel.org>
Link: https://lore.kernel.org/r/20241218193000.2084281-1-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast(a)kernel.org>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
Signed-off-by: Tengda Wu <wutengda2(a)huawei.com>
---
kernel/bpf/bpf_local_storage.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/bpf_local_storage.c b/kernel/bpf/bpf_local_storage.c
index e8d02212da70..b4c6b9b3cb42 100644
--- a/kernel/bpf/bpf_local_storage.c
+++ b/kernel/bpf/bpf_local_storage.c
@@ -823,8 +823,12 @@ bpf_local_storage_map_alloc(union bpf_attr *attr,
smap->elem_size = offsetof(struct bpf_local_storage_elem,
sdata.data[attr->value_size]);
- smap->bpf_ma = bpf_ma;
- if (bpf_ma) {
+ /* In PREEMPT_RT, kmalloc(GFP_ATOMIC) is still not safe in non
+ * preemptible context. Thus, enforce all storages to use
+ * bpf_mem_alloc when CONFIG_PREEMPT_RT is enabled.
+ */
+ smap->bpf_ma = IS_ENABLED(CONFIG_PREEMPT_RT) ? true : bpf_ma;
+ if (smap->bpf_ma) {
err = bpf_mem_alloc_init(&smap->selem_ma, smap->elem_size, false);
if (err)
goto free_smap;
--
2.34.1
2
1

[openeuler:OLK-5.10 2799/2799] block/bio.c:412: warning: Function parameter or member 'nr_iovecs_int' not described in 'bio_alloc_bioset'
by kernel test robot 10 Mar '25
by kernel test robot 10 Mar '25
10 Mar '25
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: 2c111a42444b16dfa7f0081facc22e382988eacc
commit: 6381672514c4d94637cd4db830b8644440abe99a [2799/2799] block: fix kabi broken
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20250310/202503101424.uyjkGNSl-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/20250310/202503101424.uyjkGNSl-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/202503101424.uyjkGNSl-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> block/bio.c:412: warning: Function parameter or member 'nr_iovecs_int' not described in 'bio_alloc_bioset'
>> block/bio.c:412: warning: Excess function parameter 'nr_iovecs' description in 'bio_alloc_bioset'
vim +412 block/bio.c
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 374
^1da177e4c3f415 fs/bio.c Linus Torvalds 2005-04-16 375 /**
^1da177e4c3f415 fs/bio.c Linus Torvalds 2005-04-16 376 * bio_alloc_bioset - allocate a bio for I/O
519c8e9ffd86143 block/bio.c Randy Dunlap 2017-10-16 377 * @gfp_mask: the GFP_* mask given to the slab allocator
^1da177e4c3f415 fs/bio.c Linus Torvalds 2005-04-16 378 * @nr_iovecs: number of iovecs to pre-allocate
db18efac0bd644e fs/bio.c Jaak Ristioja 2010-01-15 379 * @bs: the bio_set to allocate from.
^1da177e4c3f415 fs/bio.c Linus Torvalds 2005-04-16 380 *
^1da177e4c3f415 fs/bio.c Linus Torvalds 2005-04-16 381 * Description:
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 382 * If @bs is NULL, uses kmalloc() to allocate the bio; else the allocation is
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 383 * backed by the @bs's mempool.
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 384 *
d0164adc89f6bb3 block/bio.c Mel Gorman 2015-11-06 385 * When @bs is not NULL, if %__GFP_DIRECT_RECLAIM is set then bio_alloc will
d0164adc89f6bb3 block/bio.c Mel Gorman 2015-11-06 386 * always be able to allocate a bio. This is due to the mempool guarantees.
d0164adc89f6bb3 block/bio.c Mel Gorman 2015-11-06 387 * To make this work, callers must never allocate more than 1 bio at a time
d0164adc89f6bb3 block/bio.c Mel Gorman 2015-11-06 388 * from this pool. Callers that need to allocate more than 1 bio must always
d0164adc89f6bb3 block/bio.c Mel Gorman 2015-11-06 389 * submit the previously allocated bio for IO before attempting to allocate
d0164adc89f6bb3 block/bio.c Mel Gorman 2015-11-06 390 * a new one. Failure to do so can cause deadlocks under memory pressure.
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 391 *
ed00aabd5eb9fb4 block/bio.c Christoph Hellwig 2020-07-01 392 * Note that when running under submit_bio_noacct() (i.e. any block
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 393 * driver), bios are not submitted until after you return - see the code in
ed00aabd5eb9fb4 block/bio.c Christoph Hellwig 2020-07-01 394 * submit_bio_noacct() that converts recursion into iteration, to prevent
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 395 * stack overflows.
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 396 *
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 397 * This would normally mean allocating multiple bios under
ed00aabd5eb9fb4 block/bio.c Christoph Hellwig 2020-07-01 398 * submit_bio_noacct() would be susceptible to deadlocks, but we have
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 399 * deadlock avoidance code that resubmits any blocked bios from a rescuer
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 400 * thread.
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 401 *
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 402 * However, we do not guarantee forward progress for allocations from other
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 403 * mempools. Doing multiple allocations from the same mempool under
ed00aabd5eb9fb4 block/bio.c Christoph Hellwig 2020-07-01 404 * submit_bio_noacct() should be avoided - instead, use bio_set's front_pad
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 405 * for per bio allocations.
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 406 *
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 407 * RETURNS:
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 408 * Pointer to new bio on success, NULL on failure.
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 409 */
6381672514c4d94 block/bio.c Li Lingfeng 2025-02-10 410 struct bio *bio_alloc_bioset(gfp_t gfp_mask, unsigned int nr_iovecs_int,
7a88fa191944589 block/bio.c Dan Carpenter 2017-03-23 411 struct bio_set *bs)
^1da177e4c3f415 fs/bio.c Linus Torvalds 2005-04-16 @412 {
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 413 gfp_t saved_gfp = gfp_mask;
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 414 unsigned front_pad;
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 415 unsigned inline_vecs;
34053979fb1d923 fs/bio.c Ingo Molnar 2009-02-21 416 struct bio_vec *bvl = NULL;
451a9ebf653d283 fs/bio.c Tejun Heo 2009-04-15 417 struct bio *bio;
451a9ebf653d283 fs/bio.c Tejun Heo 2009-04-15 418 void *p;
6381672514c4d94 block/bio.c Li Lingfeng 2025-02-10 419 unsigned short nr_iovecs = (unsigned short)nr_iovecs_int;
0a0d96b03a1f3bf fs/bio.c Jens Axboe 2008-09-11 420
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 421 if (!bs) {
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 422 if (nr_iovecs > UIO_MAXIOV)
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 423 return NULL;
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 424
1f4fe21cf45c799 block/bio.c Gustavo A. R. Silva 2020-06-19 425 p = kmalloc(struct_size(bio, bi_inline_vecs, nr_iovecs), gfp_mask);
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 426 front_pad = 0;
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 427 inline_vecs = nr_iovecs;
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 428 } else {
d8f429e1669b970 block/bio.c Junichi Nomura 2014-10-03 429 /* should not use nobvec bioset for nr_iovecs > 0 */
8aa6ba2f6e3deaf block/bio.c Kent Overstreet 2018-05-08 430 if (WARN_ON_ONCE(!mempool_initialized(&bs->bvec_pool) &&
8aa6ba2f6e3deaf block/bio.c Kent Overstreet 2018-05-08 431 nr_iovecs > 0))
d8f429e1669b970 block/bio.c Junichi Nomura 2014-10-03 432 return NULL;
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 433 /*
ed00aabd5eb9fb4 block/bio.c Christoph Hellwig 2020-07-01 434 * submit_bio_noacct() converts recursion to iteration; this
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 435 * means if we're running beneath it, any bios we allocate and
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 436 * submit will not be submitted (and thus freed) until after we
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 437 * return.
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 438 *
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 439 * This exposes us to a potential deadlock if we allocate
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 440 * multiple bios from the same bio_set() while running
ed00aabd5eb9fb4 block/bio.c Christoph Hellwig 2020-07-01 441 * underneath submit_bio_noacct(). If we were to allocate
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 442 * multiple bios (say a stacking block driver that was splitting
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 443 * bios), we would deadlock if we exhausted the mempool's
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 444 * reserve.
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 445 *
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 446 * We solve this, and guarantee forward progress, with a rescuer
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 447 * workqueue per bio_set. If we go to allocate and there are
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 448 * bios on current->bio_list, we first try the allocation
d0164adc89f6bb3 block/bio.c Mel Gorman 2015-11-06 449 * without __GFP_DIRECT_RECLAIM; if that fails, we punt those
d0164adc89f6bb3 block/bio.c Mel Gorman 2015-11-06 450 * bios we would be blocking to the rescuer workqueue before
d0164adc89f6bb3 block/bio.c Mel Gorman 2015-11-06 451 * we retry with the original gfp_flags.
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 452 */
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 453
f5fe1b51905df7c block/bio.c NeilBrown 2017-03-10 454 if (current->bio_list &&
f5fe1b51905df7c block/bio.c NeilBrown 2017-03-10 455 (!bio_list_empty(¤t->bio_list[0]) ||
47e0fb461fca1a6 block/bio.c NeilBrown 2017-06-18 456 !bio_list_empty(¤t->bio_list[1])) &&
47e0fb461fca1a6 block/bio.c NeilBrown 2017-06-18 457 bs->rescue_workqueue)
d0164adc89f6bb3 block/bio.c Mel Gorman 2015-11-06 458 gfp_mask &= ~__GFP_DIRECT_RECLAIM;
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 459
8aa6ba2f6e3deaf block/bio.c Kent Overstreet 2018-05-08 460 p = mempool_alloc(&bs->bio_pool, gfp_mask);
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 461 if (!p && gfp_mask != saved_gfp) {
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 462 punt_bios_to_rescuer(bs);
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 463 gfp_mask = saved_gfp;
8aa6ba2f6e3deaf block/bio.c Kent Overstreet 2018-05-08 464 p = mempool_alloc(&bs->bio_pool, gfp_mask);
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 465 }
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 466
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 467 front_pad = bs->front_pad;
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 468 inline_vecs = BIO_INLINE_VECS;
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 469 }
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 470
451a9ebf653d283 fs/bio.c Tejun Heo 2009-04-15 471 if (unlikely(!p))
451a9ebf653d283 fs/bio.c Tejun Heo 2009-04-15 472 return NULL;
^1da177e4c3f415 fs/bio.c Linus Torvalds 2005-04-16 473
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 474 bio = p + front_pad;
3a83f4677539bce block/bio.c Ming Lei 2016-11-22 475 bio_init(bio, NULL, 0);
34053979fb1d923 fs/bio.c Ingo Molnar 2009-02-21 476
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 477 if (nr_iovecs > inline_vecs) {
ed996a52c868b62 block/bio.c Christoph Hellwig 2016-07-19 478
958384da6a734eb block/bio.c Christoph Hellwig 2025-02-10 479 bvl = bvec_alloc(&bs->bvec_pool, &nr_iovecs, gfp_mask);
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 480 if (!bvl && gfp_mask != saved_gfp) {
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 481 punt_bios_to_rescuer(bs);
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 482 gfp_mask = saved_gfp;
958384da6a734eb block/bio.c Christoph Hellwig 2025-02-10 483 bvl = bvec_alloc(&bs->bvec_pool, &nr_iovecs, gfp_mask);
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 484 }
df2cb6daa4cbc34 fs/bio.c Kent Overstreet 2012-09-10 485
34053979fb1d923 fs/bio.c Ingo Molnar 2009-02-21 486 if (unlikely(!bvl))
34053979fb1d923 fs/bio.c Ingo Molnar 2009-02-21 487 goto err_free;
a38352e0ac02dbb fs/bio.c Kent Overstreet 2012-05-25 488
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 489 } else if (nr_iovecs) {
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 490 bvl = bio->bi_inline_vecs;
392ddc32982a5c6 fs/bio.c Jens Axboe 2008-12-23 491 }
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 492
3f86a82aeb03e61 fs/bio.c Kent Overstreet 2012-09-06 493 bio->bi_pool = bs;
392ddc32982a5c6 fs/bio.c Jens Axboe 2008-12-23 494 bio->bi_max_vecs = nr_iovecs;
^1da177e4c3f415 fs/bio.c Linus Torvalds 2005-04-16 495 bio->bi_io_vec = bvl;
^1da177e4c3f415 fs/bio.c Linus Torvalds 2005-04-16 496 return bio;
34053979fb1d923 fs/bio.c Ingo Molnar 2009-02-21 497
34053979fb1d923 fs/bio.c Ingo Molnar 2009-02-21 498 err_free:
8aa6ba2f6e3deaf block/bio.c Kent Overstreet 2018-05-08 499 mempool_free(p, &bs->bio_pool);
34053979fb1d923 fs/bio.c Ingo Molnar 2009-02-21 500 return NULL;
^1da177e4c3f415 fs/bio.c Linus Torvalds 2005-04-16 501 }
a112a71d45b5e40 fs/bio.c H Hartley Sweeten 2009-09-26 502 EXPORT_SYMBOL(bio_alloc_bioset);
^1da177e4c3f415 fs/bio.c Linus Torvalds 2005-04-16 503
:::::: The code at line 412 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds(a)ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds(a)ppc970.osdl.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0
From: "Matthew Wilcox (Oracle)" <willy(a)infradead.org>
mainline inclusion
from mainline-v6.14-rc1
commit 2b4c2094da6d84e69b843dd3317902e977bf64bd
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBPC8H
CVE: CVE-2024-58001
Reference: https://git.kernel.org/stable/c/2b4c2094da6d84e69b843dd3317902e977bf64bd
--------------------------------
Patch series "Convert ocfs2 to use folios".
Mark did a conversion of ocfs2 to use folios and sent it to me as a
giant patch for review ;-)
So I've redone it as individual patches, and credited Mark for the patches
where his code is substantially the same. It's not a bad way to do it;
his patch had some bugs and my patches had some bugs. Hopefully all our
bugs were different from each other. And hopefully Mark likes all the
changes I made to his code!
This patch (of 23):
If we can't read the buffer, be sure to unlock the page before returning.
Link: https://lkml.kernel.org/r/20241205171653.3179945-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20241205171653.3179945-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy(a)infradead.org>
Reviewed-by: Joseph Qi <joseph.qi(a)linux.alibaba.com>
Cc: Mark Fasheh <mark(a)fasheh.com>
Cc: Joel Becker <jlbec(a)evilplan.org>
Cc: Junxiao Bi <junxiao.bi(a)oracle.com>
Cc: Changwei Ge <gechangwei(a)live.cn>
Cc: Jun Piao <piaojun(a)huawei.com>
Cc: Mark Tinguely <mark.tinguely(a)oracle.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Luo Gengkun <luogengkun2(a)huawei.com>
---
fs/ocfs2/symlink.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c
index 94cfacc9bad7..f3e80c00ca69 100644
--- a/fs/ocfs2/symlink.c
+++ b/fs/ocfs2/symlink.c
@@ -66,7 +66,7 @@ static int ocfs2_fast_symlink_readpage(struct file *unused, struct page *page)
if (status < 0) {
mlog_errno(status);
- return status;
+ goto out;
}
fe = (struct ocfs2_dinode *) bh->b_data;
@@ -77,9 +77,10 @@ static int ocfs2_fast_symlink_readpage(struct file *unused, struct page *page)
memcpy(kaddr, link, len + 1);
kunmap_atomic(kaddr);
SetPageUptodate(page);
+out:
unlock_page(page);
brelse(bh);
- return 0;
+ return status;
}
const struct address_space_operations ocfs2_fast_symlink_aops = {
--
2.34.1
2
1

10 Mar '25
From: Xinghai Cen <cenxinghai(a)h-partners.com>
Some bug fix patches for OLK-5.10 hns RoCE:
Junxian Huang (5):
RDMA/hns: Change mtr member to pointer in hns QP/CQ/MR/SRQ/EQ struct
RDMA/hns: Move mtr_node into the mtr struct
RDMA/hns: Fix delayed destruction of db not taking effect
RDMA/hns: Fix delay-destruction mechanism not processing kernel db
RDMA/hns: Fix soft lockup by adding cond_resched() to bt pages loop
Xinghai Cen (1):
RDMA/hns: Fix unmatched kmalloc and kvfree
Yuyu Li (1):
RDMA/hns: Fix ifnullfree static warning
drivers/infiniband/hw/hns/hns_roce_cq.c | 35 ++---
drivers/infiniband/hw/hns/hns_roce_db.c | 86 +++++++----
drivers/infiniband/hw/hns/hns_roce_dca.c | 6 +-
drivers/infiniband/hw/hns/hns_roce_device.h | 69 ++++-----
drivers/infiniband/hw/hns/hns_roce_ext.c | 3 +-
drivers/infiniband/hw/hns/hns_roce_hem.c | 17 ++-
drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 82 +++++-----
drivers/infiniband/hw/hns/hns_roce_main.c | 14 +-
drivers/infiniband/hw/hns/hns_roce_mr.c | 144 ++++++++----------
drivers/infiniband/hw/hns/hns_roce_qp.c | 35 ++---
drivers/infiniband/hw/hns/hns_roce_restrack.c | 4 +-
drivers/infiniband/hw/hns/hns_roce_srq.c | 63 +++-----
12 files changed, 271 insertions(+), 287 deletions(-)
--
2.33.0
2
8

[PATCH OLK-5.10] NFC: nci: Add bounds checking in nci_hci_create_pipe()
by Yang Yingliang 10 Mar '25
by Yang Yingliang 10 Mar '25
10 Mar '25
From: Dan Carpenter <dan.carpenter(a)linaro.org>
mainline inclusion
from mainline-v6.14-rc1
commit 110b43ef05342d5a11284cc8b21582b698b4ef1c
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBPC8J
CVE: CVE-2025-21735
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
The "pipe" variable is a u8 which comes from the network. If it's more
than 127, then it results in memory corruption in the caller,
nci_hci_connect_gate().
Cc: stable(a)vger.kernel.org
Fixes: a1b0b9415817 ("NFC: nci: Create pipe on specific gate in nci_hci_connect_gate")
Signed-off-by: Dan Carpenter <dan.carpenter(a)linaro.org>
Reviewed-by: Simon Horman <horms(a)kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski(a)linaro.org>
Link: https://patch.msgid.link/bcf5453b-7204-4297-9c20-4d8c7dacf586@stanley.mount…
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
Signed-off-by: Yang Yingliang <yangyingliang(a)huawei.com>
---
net/nfc/nci/hci.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c
index 4fe336ff2bfa..f8140488b08a 100644
--- a/net/nfc/nci/hci.c
+++ b/net/nfc/nci/hci.c
@@ -548,6 +548,8 @@ static u8 nci_hci_create_pipe(struct nci_dev *ndev, u8 dest_host,
pr_debug("pipe created=%d\n", pipe);
+ if (pipe >= NCI_HCI_MAX_PIPES)
+ pipe = NCI_HCI_INVALID_PIPE;
return pipe;
}
--
2.25.1
2
1
From: "Matthew Wilcox (Oracle)" <willy(a)infradead.org>
stable inclusion
from stable-v6.6.78
commit b6833b38984d1e9f20dd80f9ec9050c10d687f30
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBPC8H
CVE: CVE-2024-58001
Reference: https://git.kernel.org/stable/c/b6833b38984d1e9f20dd80f9ec9050c10d687f30
--------------------------------
commit 2b4c2094da6d84e69b843dd3317902e977bf64bd upstream.
Patch series "Convert ocfs2 to use folios".
Mark did a conversion of ocfs2 to use folios and sent it to me as a
giant patch for review ;-)
So I've redone it as individual patches, and credited Mark for the patches
where his code is substantially the same. It's not a bad way to do it;
his patch had some bugs and my patches had some bugs. Hopefully all our
bugs were different from each other. And hopefully Mark likes all the
changes I made to his code!
This patch (of 23):
If we can't read the buffer, be sure to unlock the page before returning.
Link: https://lkml.kernel.org/r/20241205171653.3179945-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20241205171653.3179945-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy(a)infradead.org>
Reviewed-by: Joseph Qi <joseph.qi(a)linux.alibaba.com>
Cc: Mark Fasheh <mark(a)fasheh.com>
Cc: Joel Becker <jlbec(a)evilplan.org>
Cc: Junxiao Bi <junxiao.bi(a)oracle.com>
Cc: Changwei Ge <gechangwei(a)live.cn>
Cc: Jun Piao <piaojun(a)huawei.com>
Cc: Mark Tinguely <mark.tinguely(a)oracle.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Luo Gengkun <luogengkun2(a)huawei.com>
---
fs/ocfs2/symlink.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c
index d4c5fdcfa1e4..f5cf2255dc09 100644
--- a/fs/ocfs2/symlink.c
+++ b/fs/ocfs2/symlink.c
@@ -65,7 +65,7 @@ static int ocfs2_fast_symlink_read_folio(struct file *f, struct folio *folio)
if (status < 0) {
mlog_errno(status);
- return status;
+ goto out;
}
fe = (struct ocfs2_dinode *) bh->b_data;
@@ -76,9 +76,10 @@ static int ocfs2_fast_symlink_read_folio(struct file *f, struct folio *folio)
memcpy(kaddr, link, len + 1);
kunmap_atomic(kaddr);
SetPageUptodate(page);
+out:
unlock_page(page);
brelse(bh);
- return 0;
+ return status;
}
const struct address_space_operations ocfs2_fast_symlink_aops = {
--
2.34.1
2
1
From: "Matthew Wilcox (Oracle)" <willy(a)infradead.org>
mainline inclusion
from mainline-v6.14-rc1
commit b6833b38984d1e9f20dd80f9ec9050c10d687f30
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBPC8H
CVE: CVE-2024-58001
Reference: https://git.kernel.org/stable/c/b6833b38984d1e9f20dd80f9ec9050c10d687f30
--------------------------------
commit 2b4c2094da6d84e69b843dd3317902e977bf64bd upstream.
Patch series "Convert ocfs2 to use folios".
Mark did a conversion of ocfs2 to use folios and sent it to me as a
giant patch for review ;-)
So I've redone it as individual patches, and credited Mark for the patches
where his code is substantially the same. It's not a bad way to do it;
his patch had some bugs and my patches had some bugs. Hopefully all our
bugs were different from each other. And hopefully Mark likes all the
changes I made to his code!
This patch (of 23):
If we can't read the buffer, be sure to unlock the page before returning.
Link: https://lkml.kernel.org/r/20241205171653.3179945-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20241205171653.3179945-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy(a)infradead.org>
Reviewed-by: Joseph Qi <joseph.qi(a)linux.alibaba.com>
Cc: Mark Fasheh <mark(a)fasheh.com>
Cc: Joel Becker <jlbec(a)evilplan.org>
Cc: Junxiao Bi <junxiao.bi(a)oracle.com>
Cc: Changwei Ge <gechangwei(a)live.cn>
Cc: Jun Piao <piaojun(a)huawei.com>
Cc: Mark Tinguely <mark.tinguely(a)oracle.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Luo Gengkun <luogengkun2(a)huawei.com>
---
fs/ocfs2/symlink.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c
index 94cfacc9bad7..f3e80c00ca69 100644
--- a/fs/ocfs2/symlink.c
+++ b/fs/ocfs2/symlink.c
@@ -66,7 +66,7 @@ static int ocfs2_fast_symlink_readpage(struct file *unused, struct page *page)
if (status < 0) {
mlog_errno(status);
- return status;
+ goto out;
}
fe = (struct ocfs2_dinode *) bh->b_data;
@@ -77,9 +77,10 @@ static int ocfs2_fast_symlink_readpage(struct file *unused, struct page *page)
memcpy(kaddr, link, len + 1);
kunmap_atomic(kaddr);
SetPageUptodate(page);
+out:
unlock_page(page);
brelse(bh);
- return 0;
+ return status;
}
const struct address_space_operations ocfs2_fast_symlink_aops = {
--
2.34.1
2
1

[openeuler:openEuler-1.0-LTS 1473/1473] drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:72:28: sparse: sparse: symbol 'nic_cmd_support_vf' was not declared. Should it be static?
by kernel test robot 10 Mar '25
by kernel test robot 10 Mar '25
10 Mar '25
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 1584a68cf2ef23ac87ba506e8ab8ca7e261813c1
commit: 746ea35981b1f77e988d48642409d73f0470b3eb [1473/1473] net: hinic: Add Hardware Abstract Layer
config: arm64-randconfig-r132-20250309 (https://download.01.org/0day-ci/archive/20250310/202503101044.1ARqFaAp-lkp@…)
compiler: aarch64-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20250310/202503101044.1ARqFaAp-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/202503101044.1ARqFaAp-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:72:28: sparse: sparse: symbol 'nic_cmd_support_vf' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:398:5: sparse: sparse: symbol 'hinic_hiovs_set_cpath_vlan' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:424:5: sparse: sparse: symbol 'hinic_hiovs_del_cpath_vlan' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1541:30: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] group_index @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1541:30: sparse: expected unsigned int [usertype] group_index
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1541:30: sparse: got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1544:23: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] size @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1544:23: sparse: expected unsigned int [usertype] size
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1544:23: sparse: got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1546:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] ctx @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1546:22: sparse: expected unsigned int [usertype] ctx
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1546:22: sparse: got restricted __be32 [usertype]
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1728:32: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] group_index @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1728:32: sparse: expected unsigned int [usertype] group_index
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1728:32: sparse: got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1735:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1735:31: sparse: expected unsigned int [usertype]
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1735:31: sparse: got restricted __be32 [usertype]
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1742:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] size @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1742:25: sparse: expected unsigned int [usertype] size
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1742:25: sparse: got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1754:27: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] offset @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1754:27: sparse: expected unsigned int [usertype] offset
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1754:27: sparse: got restricted __be32 [usertype]
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1755:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] size @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1755:25: sparse: expected unsigned int [usertype] size
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:1755:25: sparse: got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:2349:5: sparse: sparse: symbol 'nic_pf_mbox_handler' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:3237:5: sparse: sparse: symbol 'hw_speed_convert' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:398:5: warning: no previous prototype for 'hinic_hiovs_set_cpath_vlan' [-Wmissing-prototypes]
398 | int hinic_hiovs_set_cpath_vlan(void *hwdev, u16 vlan_id, u16 pf_id)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:424:5: warning: no previous prototype for 'hinic_hiovs_del_cpath_vlan' [-Wmissing-prototypes]
424 | int hinic_hiovs_del_cpath_vlan(void *hwdev, u16 vlan_id, u16 pf_id)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c:2349:5: warning: no previous prototype for 'nic_pf_mbox_handler' [-Wmissing-prototypes]
2349 | int nic_pf_mbox_handler(void *hwdev, u16 vf_id, u8 cmd, void *buf_in,
| ^~~~~~~~~~~~~~~~~~~
--
>> drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:346:6: sparse: sparse: symbol 'hinic_qp_prepare_cmdq_header' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:379:24: sparse: sparse: cast to restricted __be64
>> drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:365:6: sparse: sparse: symbol 'hinic_sq_prepare_ctxt' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:441:24: sparse: sparse: cast to restricted __be64
>> drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:427:6: sparse: sparse: symbol 'hinic_rq_prepare_ctxt' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:843:16: sparse: sparse: cast to restricted __be16
>> drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:913:23: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [addressable] [usertype] db_info @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:913:23: sparse: expected unsigned int [addressable] [usertype] db_info
drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:913:23: sparse: got restricted __be32 [usertype]
drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:917:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:917:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got unsigned long long [usertype] * @@
drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:917:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:917:9: sparse: got unsigned long long [usertype] *
>> drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:974:27: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] @@ got restricted __be16 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:974:27: sparse: expected unsigned short [usertype]
drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:974:27: sparse: got restricted __be16 [usertype]
drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:346:6: warning: no previous prototype for 'hinic_qp_prepare_cmdq_header' [-Wmissing-prototypes]
346 | void hinic_qp_prepare_cmdq_header(struct hinic_qp_ctxt_header *qp_ctxt_hdr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:365:6: warning: no previous prototype for 'hinic_sq_prepare_ctxt' [-Wmissing-prototypes]
365 | void hinic_sq_prepare_ctxt(struct hinic_sq *sq, u16 global_qpn,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_nic_io.c:427:6: warning: no previous prototype for 'hinic_rq_prepare_ctxt' [-Wmissing-prototypes]
427 | void hinic_rq_prepare_ctxt(struct hinic_rq *rq, struct hinic_rq_ctxt *rq_ctxt)
| ^~~~~~~~~~~~~~~~~~~~~
--
>> drivers/net/ethernet/huawei/hinic/hinic_nic_dbg.c:100:24: sparse: sparse: incorrect type in return expression (different base types) @@ expected unsigned short @@ got restricted __be16 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_nic_dbg.c:100:24: sparse: expected unsigned short
drivers/net/ethernet/huawei/hinic/hinic_nic_dbg.c:100:24: sparse: got restricted __be16 [usertype]
drivers/net/ethernet/huawei/hinic/hinic_nic_dbg.c:159:22: sparse: sparse: cast removes address space '__iomem' of expression
--
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:37:16: sparse: sparse: cast to restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse: sparse: cast from restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse: expected unsigned int [usertype] val
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse: got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse: sparse: cast from restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse: sparse: cast from restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse: sparse: cast from restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:43:9: sparse: sparse: cast from restricted __be32
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:552:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] [usertype] __iomem *cfg_regs_base @@ got void *cfg_reg_base @@
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:552:29: sparse: expected unsigned char [noderef] [usertype] __iomem *cfg_regs_base
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:552:29: sparse: got void *cfg_reg_base
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:553:30: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] [usertype] __iomem *intr_regs_base @@ got void *intr_reg_base @@
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:553:30: sparse: expected unsigned char [noderef] [usertype] __iomem *intr_regs_base
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:553:30: sparse: got void *intr_reg_base
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:557:23: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] [usertype] __iomem *db_base @@ got void *db_base @@
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:557:23: sparse: expected unsigned char [noderef] [usertype] __iomem *db_base
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:557:23: sparse: got void *db_base
>> drivers/net/ethernet/huawei/hinic/hinic_hwif.c:558:28: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] __iomem *dwqe_mapping @@ got void *dwqe_mapping @@
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:558:28: sparse: expected void [noderef] __iomem *dwqe_mapping
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:558:28: sparse: got void *dwqe_mapping
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:620:65: sparse: sparse: incorrect type in argument 4 (different base types) @@ expected restricted gfp_t [usertype] flag @@ got unsigned int flag @@
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:620:65: sparse: expected restricted gfp_t [usertype] flag
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:620:65: sparse: got unsigned int flag
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:635:65: sparse: sparse: incorrect type in argument 4 (different base types) @@ expected restricted gfp_t [usertype] flag @@ got unsigned int flag @@
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:635:65: sparse: expected restricted gfp_t [usertype] flag
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:635:65: sparse: got unsigned int flag
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:52: warning: Function parameter or member 'hwdev' not described in 'hwif_ready'
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:52: warning: Excess function parameter 'hwif' description in 'hwif_ready'
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Function parameter or member 'hwdev' not described in 'hinic_init_hwif'
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Function parameter or member 'cfg_reg_base' not described in 'hinic_init_hwif'
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Function parameter or member 'intr_reg_base' not described in 'hinic_init_hwif'
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Function parameter or member 'db_base_phy' not described in 'hinic_init_hwif'
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Function parameter or member 'db_base' not described in 'hinic_init_hwif'
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Function parameter or member 'dwqe_mapping' not described in 'hinic_init_hwif'
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Excess function parameter 'hwif' description in 'hinic_init_hwif'
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:541: warning: Excess function parameter 'pdev' description in 'hinic_init_hwif'
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:607: warning: Function parameter or member 'hwdev' not described in 'hinic_free_hwif'
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:607: warning: Excess function parameter 'hwif' description in 'hinic_free_hwif'
drivers/net/ethernet/huawei/hinic/hinic_hwif.c:607: warning: Excess function parameter 'pdev' description in 'hinic_free_hwif'
--
>> drivers/net/ethernet/huawei/hinic/hinic_eqs.c:418:29: sparse: sparse: cast to restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_eqs.c:426:39: sparse: sparse: mixing different enum types:
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:426:39: sparse: unsigned int enum hinic_aeq_type
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:426:39: sparse: unsigned int enum hinic_ucode_event_type
>> drivers/net/ethernet/huawei/hinic/hinic_eqs.c:431:37: sparse: sparse: cast to restricted __be64
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:479:24: sparse: sparse: cast to restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_eqs.c:765:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:765:25: sparse: expected unsigned int [usertype]
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:765:25: sparse: got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_eqs.c:783:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] desc @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:783:28: sparse: expected unsigned int [usertype] desc
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:783:28: sparse: got restricted __be32 [usertype]
drivers/net/ethernet/huawei/hinic/hinic_eqs.c: In function 'aeq_irq_handler':
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:426:37: warning: implicit conversion from 'enum hinic_aeq_type' to 'enum hinic_ucode_event_type' [-Wenum-conversion]
426 | ucode_event = event;
| ^
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:238: warning: Function parameter or member 'hwdev' not described in 'hinic_aeq_register_hw_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:238: warning: Function parameter or member 'hwe_cb' not described in 'hinic_aeq_register_hw_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:238: warning: Excess function parameter 'eqs' description in 'hinic_aeq_register_hw_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:238: warning: Excess function parameter 'handle' description in 'hinic_aeq_register_hw_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:238: warning: Excess function parameter 'hw_cb' description in 'hinic_aeq_register_hw_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:258: warning: Function parameter or member 'hwdev' not described in 'hinic_aeq_unregister_hw_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:258: warning: Excess function parameter 'eqs' description in 'hinic_aeq_unregister_hw_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:280: warning: Function parameter or member 'hwdev' not described in 'hinic_aeq_register_swe_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:280: warning: Function parameter or member 'aeq_swe_cb' not described in 'hinic_aeq_register_swe_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:280: warning: Excess function parameter 'eqs' description in 'hinic_aeq_register_swe_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:280: warning: Excess function parameter 'handle' description in 'hinic_aeq_register_swe_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:280: warning: Excess function parameter 'sw_cb' description in 'hinic_aeq_register_swe_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:300: warning: Function parameter or member 'hwdev' not described in 'hinic_aeq_unregister_swe_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:300: warning: Excess function parameter 'eqs' description in 'hinic_aeq_unregister_swe_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:322: warning: Function parameter or member 'hwdev' not described in 'hinic_ceq_register_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:322: warning: Function parameter or member 'callback' not described in 'hinic_ceq_register_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:322: warning: Excess function parameter 'ceqs' description in 'hinic_ceq_register_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:322: warning: Excess function parameter 'handle' description in 'hinic_ceq_register_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:322: warning: Excess function parameter 'ceq_cb' description in 'hinic_ceq_register_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:342: warning: Function parameter or member 'hwdev' not described in 'hinic_ceq_unregister_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:342: warning: Excess function parameter 'ceqs' description in 'hinic_ceq_unregister_cb'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:361: warning: Function parameter or member 'arm_state' not described in 'set_eq_cons_idx'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:382: warning: Function parameter or member 'ceqs' not described in 'ceq_event_handler'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:382: warning: Excess function parameter 'eqs' description in 'ceq_event_handler'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:954: warning: Function parameter or member 'hwdev' not described in 'init_eq'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:954: warning: Excess function parameter 'hwif' description in 'init_eq'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:954: warning: Excess function parameter 'page_size' description in 'init_eq'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1084: warning: Function parameter or member 'hwdev' not described in 'hinic_aeqs_init'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1084: warning: Function parameter or member 'num_aeqs' not described in 'hinic_aeqs_init'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1084: warning: Excess function parameter 'aeqs' description in 'hinic_aeqs_init'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1084: warning: Excess function parameter 'hwif' description in 'hinic_aeqs_init'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1084: warning: Excess function parameter 'num_ceqs' description in 'hinic_aeqs_init'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1084: warning: Excess function parameter 'q_len' description in 'hinic_aeqs_init'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1084: warning: Excess function parameter 'page_size' description in 'hinic_aeqs_init'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1139: warning: Function parameter or member 'hwdev' not described in 'hinic_aeqs_free'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1139: warning: Excess function parameter 'aeqs' description in 'hinic_aeqs_free'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1171: warning: Function parameter or member 'hwdev' not described in 'hinic_ceqs_init'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1171: warning: Excess function parameter 'ceqs' description in 'hinic_ceqs_init'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1171: warning: Excess function parameter 'hwif' description in 'hinic_ceqs_init'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1171: warning: Excess function parameter 'q_len' description in 'hinic_ceqs_init'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1171: warning: Excess function parameter 'page_size' description in 'hinic_ceqs_init'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1222: warning: Function parameter or member 'hwdev' not described in 'hinic_ceqs_free'
drivers/net/ethernet/huawei/hinic/hinic_eqs.c:1222: warning: Excess function parameter 'ceqs' description in 'hinic_ceqs_free'
--
>> drivers/net/ethernet/huawei/hinic/hinic_mbox.c:735:5: sparse: sparse: symbol 'set_vf_mbox_random_id' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_mbox.c:813:21: sparse: sparse: cast to restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_mbox.c:787:6: sparse: sparse: symbol 'check_vf_mbox_random_id' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:893:54: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got unsigned char [usertype] * @@
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:893:54: sparse: expected void volatile [noderef] __iomem *addr
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:893:54: sparse: got unsigned char [usertype] *
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:909:58: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got unsigned char [usertype] * @@
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:909:58: sparse: expected void volatile [noderef] __iomem *addr
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:909:58: sparse: got unsigned char [usertype] *
>> drivers/net/ethernet/huawei/hinic/hinic_mbox.c:947:6: sparse: sparse: symbol 'dump_mox_reg' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_mbox.c:962:22: sparse: sparse: cast to restricted __be64
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:1450:25: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [usertype] *data @@ got unsigned char [noderef] [usertype] __iomem * @@
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:1450:25: sparse: expected unsigned char [usertype] *data
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:1450:25: sparse: got unsigned char [noderef] [usertype] __iomem *
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:735:5: warning: no previous prototype for 'set_vf_mbox_random_id' [-Wmissing-prototypes]
735 | int set_vf_mbox_random_id(struct hinic_hwdev *hwdev, u16 func_id)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:787:6: warning: no previous prototype for 'check_vf_mbox_random_id' [-Wmissing-prototypes]
787 | bool check_vf_mbox_random_id(struct hinic_mbox_func_to_func *func_to_func,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:947:6: warning: no previous prototype for 'dump_mox_reg' [-Wmissing-prototypes]
947 | void dump_mox_reg(struct hinic_hwdev *hwdev)
| ^~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:265: warning: Function parameter or member 'hwdev' not described in 'hinic_register_ppf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:265: warning: Excess function parameter 'func_to_func' description in 'hinic_register_ppf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:287: warning: Function parameter or member 'hwdev' not described in 'hinic_register_pf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:287: warning: Excess function parameter 'func_to_func' description in 'hinic_register_pf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:309: warning: Function parameter or member 'hwdev' not described in 'hinic_register_vf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:309: warning: Excess function parameter 'func_to_func' description in 'hinic_register_vf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:331: warning: Function parameter or member 'hwdev' not described in 'hinic_register_ppf_to_pf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:331: warning: Excess function parameter 'func_to_func' description in 'hinic_register_ppf_to_pf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:350: warning: Function parameter or member 'hwdev' not described in 'hinic_unregister_ppf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:350: warning: Excess function parameter 'func_to_func' description in 'hinic_unregister_ppf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:364: warning: Function parameter or member 'hwdev' not described in 'hinic_unregister_pf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:364: warning: Excess function parameter 'func_to_func' description in 'hinic_unregister_pf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:378: warning: Function parameter or member 'hwdev' not described in 'hinic_unregister_vf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:378: warning: Excess function parameter 'func_to_func' description in 'hinic_unregister_vf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:392: warning: Function parameter or member 'hwdev' not described in 'hinic_unregister_ppf_to_pf_mbox_cb'
drivers/net/ethernet/huawei/hinic/hinic_mbox.c:392: warning: Excess function parameter 'func_to_func' description in 'hinic_unregister_ppf_to_pf_mbox_cb'
--
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:160:31: sparse: sparse: cast to restricted __be64
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:241:20: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] @@ got restricted __be64 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:241:20: sparse: expected unsigned long long [usertype]
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:241:20: sparse: got restricted __be64 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:302:20: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] desc @@ got restricted __be64 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:302:20: sparse: expected unsigned long long [usertype] desc
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:302:20: sparse: got restricted __be64 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:353:20: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:357:25: sparse: sparse: cast to restricted __be64
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:417:31: sparse: sparse: cast to restricted __be64
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:776:41: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] hw_cmd_paddr @@ got restricted __be64 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:776:41: sparse: expected unsigned long long [usertype] hw_cmd_paddr
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:776:41: sparse: got restricted __be64 [usertype]
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:782:42: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] hw_cmd_paddr @@ got restricted __be64 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:782:42: sparse: expected unsigned long long [usertype] hw_cmd_paddr
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:782:42: sparse: got restricted __be64 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:809:37: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] hw_wb_resp_paddr @@ got restricted __be64 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:809:37: sparse: expected unsigned long long [usertype] hw_wb_resp_paddr
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:809:37: sparse: got restricted __be64 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:887:43: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] next_cell_paddr @@ got restricted __be64 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:887:43: sparse: expected unsigned long long [usertype] next_cell_paddr
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:887:43: sparse: got restricted __be64 [usertype]
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:930:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] next_cell_paddr @@ got restricted __be64 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:930:31: sparse: expected unsigned long long [usertype] next_cell_paddr
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:930:31: sparse: got restricted __be64 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:999:47: sparse: sparse: incorrect type in argument 4 (different base types) @@ expected unsigned int flag @@ got restricted gfp_t @@
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:999:47: sparse: expected unsigned int flag
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:999:47: sparse: got restricted gfp_t
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:515:17: sparse: sparse: context imbalance in 'api_cmd' - different lock contexts for basic block
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c: In function 'api_chain_init':
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:1033:41: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
1033 | sema_deinit(&chain->sem);
| ^
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c: In function 'api_chain_free':
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:1056:41: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
1056 | sema_deinit(&chain->sem);
| ^
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:197: warning: Function parameter or member 'cmd_size' not described in 'get_cell_data_size'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:411: warning: Function parameter or member 'ctxt' not described in 'wait_for_resp_polling'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:411: warning: Excess function parameter 'chain' description in 'wait_for_resp_polling'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:443: warning: Function parameter or member 'ctxt' not described in 'wait_for_api_cmd_completion'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:443: warning: Function parameter or member 'ack' not described in 'wait_for_api_cmd_completion'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:443: warning: Function parameter or member 'ack_size' not described in 'wait_for_api_cmd_completion'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:502: warning: Function parameter or member 'cmd_size' not described in 'api_cmd'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:502: warning: Function parameter or member 'ack' not described in 'api_cmd'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:502: warning: Function parameter or member 'ack_size' not described in 'api_cmd'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:502: warning: Excess function parameter 'size' description in 'api_cmd'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:565: warning: Function parameter or member 'cmd_chain' not described in 'api_cmd_hw_restart'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:565: warning: Excess function parameter 'chain' description in 'api_cmd_hw_restart'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:1068: warning: Function parameter or member 'cmd_chain' not described in 'api_cmd_create_chain'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:1068: warning: Excess function parameter 'chain' description in 'api_cmd_create_chain'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:1132: warning: Function parameter or member 'hwdev' not described in 'hinic_api_cmd_init'
drivers/net/ethernet/huawei/hinic/hinic_api_cmd.c:1132: warning: Excess function parameter 'hwif' description in 'hinic_api_cmd_init'
--
>> drivers/net/ethernet/huawei/hinic/hinic_wq.c:208:55: sparse: sparse: incorrect type in argument 4 (different base types) @@ expected unsigned int flag @@ got restricted gfp_t @@
drivers/net/ethernet/huawei/hinic/hinic_wq.c:208:55: sparse: expected unsigned int flag
drivers/net/ethernet/huawei/hinic/hinic_wq.c:208:55: sparse: got restricted gfp_t
>> drivers/net/ethernet/huawei/hinic/hinic_wq.c:214:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] @@ got restricted __be64 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_wq.c:214:24: sparse: expected unsigned long long [usertype]
drivers/net/ethernet/huawei/hinic/hinic_wq.c:214:24: sparse: got restricted __be64 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_wq.c:587:16: sparse: sparse: cast to restricted __be64
--
>> drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:366:20: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [addressable] [usertype] db_info @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:366:20: sparse: expected unsigned int [addressable] [usertype] db_info
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:366:20: sparse: got restricted __be32 [usertype]
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:369:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:369:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got unsigned char [usertype] * @@
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:369:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:369:9: sparse: got unsigned char [usertype] *
>> drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:511:31: sparse: sparse: cast to restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:517:40: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] @@ got restricted __be64 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:517:40: sparse: expected unsigned long long [usertype]
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:517:40: sparse: got restricted __be64 [usertype]
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:531:21: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1080:27: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1151:25: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1217:37: sparse: sparse: cast to restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1245:31: sparse: sparse: cast to restricted __be64
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1315:26: sparse: sparse: cast removes address space '__iomem' of expression
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1315:23: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [noderef] [usertype] __iomem *db_base @@ got unsigned char [usertype] * @@
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1315:23: sparse: expected unsigned char [noderef] [usertype] __iomem *db_base
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1315:23: sparse: got unsigned char [usertype] *
>> drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1334:5: sparse: sparse: symbol 'hinic_set_cmdq_ctxts' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_cmdq.c:1334:5: warning: no previous prototype for 'hinic_set_cmdq_ctxts' [-Wmissing-prototypes]
1334 | int hinic_set_cmdq_ctxts(struct hinic_hwdev *hwdev)
| ^~~~~~~~~~~~~~~~~~~~
--
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:223:5: sparse: sparse: symbol 'hinic_hw_rx_buf_size' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:629:28: sparse: sparse: symbol 'hw_cmd_support_vf' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:659:30: sparse: sparse: symbol 'mgmt_status_log' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:722:6: sparse: sparse: symbol 'hinic_print_status_info' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1039:5: sparse: sparse: symbol 'hinic_msg_to_mgmt_no_ack' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1106:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1106:22: sparse: expected unsigned int [usertype]
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1106:22: sparse: got restricted __be32 [usertype]
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1128:24: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1826:5: sparse: sparse: symbol 'hinic_sync_heartbeat_status' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1928:5: sparse: sparse: symbol 'comm_pf_mbox_handler' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2617:5: sparse: sparse: symbol 'ppf_ht_gpa_set' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2663:5: sparse: sparse: symbol 'hinic_ppf_ht_gpa_init' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2709:6: sparse: sparse: symbol 'hinic_ppf_ht_gpa_deinit' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4205:6: sparse: sparse: symbol 'pf_fault_event_handler' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4213:6: sparse: sparse: symbol 'mgmt_watchdog_event_handler' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4220:6: sparse: sparse: symbol 'mgmt_fmw_act_event_handler' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4227:6: sparse: sparse: symbol 'mgmt_pcie_dfx_event_handler' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4234:6: sparse: sparse: symbol 'mgmt_get_mctp_event_handler' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4517:5: sparse: sparse: symbol '_set_led_status' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4603:5: sparse: sparse: symbol 'hinic_get_phy_init_status' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4807:5: sparse: sparse: symbol 'hinic_read_reg' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4985:23: sparse: sparse: cast to restricted __be32
>> drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4991:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [addressable] [assigned] [usertype] val @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4991:21: sparse: expected unsigned int [addressable] [assigned] [usertype] val
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4991:21: sparse: got restricted __be32 [usertype]
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:722:6: warning: no previous prototype for 'hinic_print_status_info' [-Wmissing-prototypes]
722 | void hinic_print_status_info(void *hwdev, enum hinic_mod_type mod, u8 cmd,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1039:5: warning: no previous prototype for 'hinic_msg_to_mgmt_no_ack' [-Wmissing-prototypes]
1039 | int hinic_msg_to_mgmt_no_ack(void *hwdev, enum hinic_mod_type mod, u8 cmd,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1826:5: warning: no previous prototype for 'hinic_sync_heartbeat_status' [-Wmissing-prototypes]
1826 | int hinic_sync_heartbeat_status(struct hinic_hwdev *hwdev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1928:5: warning: no previous prototype for 'comm_pf_mbox_handler' [-Wmissing-prototypes]
1928 | int comm_pf_mbox_handler(void *handle, u16 vf_id, u8 cmd, void *buf_in,
| ^~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2617:5: warning: no previous prototype for 'ppf_ht_gpa_set' [-Wmissing-prototypes]
2617 | int ppf_ht_gpa_set(struct hinic_hwdev *hwdev, struct hinic_page_addr *pg0,
| ^~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2663:5: warning: no previous prototype for 'hinic_ppf_ht_gpa_init' [-Wmissing-prototypes]
2663 | int hinic_ppf_ht_gpa_init(struct hinic_hwdev *hwdev)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2709:6: warning: no previous prototype for 'hinic_ppf_ht_gpa_deinit' [-Wmissing-prototypes]
2709 | void hinic_ppf_ht_gpa_deinit(struct hinic_hwdev *hwdev)
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2786:5: warning: no previous prototype for 'mqm_eqm_try_alloc_mem' [-Wmissing-prototypes]
2786 | int mqm_eqm_try_alloc_mem(struct hinic_hwdev *hwdev, u32 page_size,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2823:5: warning: no previous prototype for 'mqm_eqm_alloc_page_mem' [-Wmissing-prototypes]
2823 | int mqm_eqm_alloc_page_mem(struct hinic_hwdev *hwdev)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2848:6: warning: no previous prototype for 'mqm_eqm_free_page_mem' [-Wmissing-prototypes]
2848 | void mqm_eqm_free_page_mem(struct hinic_hwdev *hwdev)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2864:5: warning: no previous prototype for 'mqm_eqm_set_cfg_2_hw' [-Wmissing-prototypes]
2864 | int mqm_eqm_set_cfg_2_hw(struct hinic_hwdev *hwdev, u32 valid)
| ^~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2889:5: warning: no previous prototype for 'mqm_eqm_set_page_2_hw' [-Wmissing-prototypes]
2889 | int mqm_eqm_set_page_2_hw(struct hinic_hwdev *hwdev)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:2967:5: warning: no previous prototype for 'mqm_eqm_init' [-Wmissing-prototypes]
2967 | int mqm_eqm_init(struct hinic_hwdev *hwdev)
| ^~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:3030:6: warning: no previous prototype for 'mqm_eqm_deinit' [-Wmissing-prototypes]
3030 | void mqm_eqm_deinit(struct hinic_hwdev *hwdev)
| ^~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:3932:6: warning: no previous prototype for 'print_hilink_info' [-Wmissing-prototypes]
3932 | void print_hilink_info(struct hinic_hwdev *hwdev,
| ^~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4205:6: warning: no previous prototype for 'pf_fault_event_handler' [-Wmissing-prototypes]
4205 | void pf_fault_event_handler(void *hwdev,
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4213:6: warning: no previous prototype for 'mgmt_watchdog_event_handler' [-Wmissing-prototypes]
4213 | void mgmt_watchdog_event_handler(void *hwdev, void *buf_in, u16 in_size,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4220:6: warning: no previous prototype for 'mgmt_fmw_act_event_handler' [-Wmissing-prototypes]
4220 | void mgmt_fmw_act_event_handler(void *hwdev, void *buf_in, u16 in_size,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4227:6: warning: no previous prototype for 'mgmt_pcie_dfx_event_handler' [-Wmissing-prototypes]
4227 | void mgmt_pcie_dfx_event_handler(void *hwdev, void *buf_in, u16 in_size,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4234:6: warning: no previous prototype for 'mgmt_get_mctp_event_handler' [-Wmissing-prototypes]
4234 | void mgmt_get_mctp_event_handler(void *hwdev, void *buf_in, u16 in_size,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4517:5: warning: no previous prototype for '_set_led_status' [-Wmissing-prototypes]
4517 | int _set_led_status(struct hinic_hwdev *hwdev, u8 port,
| ^~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4603:5: warning: no previous prototype for 'hinic_get_phy_init_status' [-Wmissing-prototypes]
4603 | int hinic_get_phy_init_status(void *hwdev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4807:5: warning: no previous prototype for 'hinic_read_reg' [-Wmissing-prototypes]
4807 | int hinic_read_reg(void *hwdev, u32 reg_addr, u32 *val)
| ^~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4894:5: warning: no previous prototype for 'hinic_register_fault_recover' [-Wmissing-prototypes]
4894 | int hinic_register_fault_recover(void *hwdev, void *pri_handle,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:4916:5: warning: no previous prototype for 'hinic_unregister_fault_recover' [-Wmissing-prototypes]
4916 | int hinic_unregister_fault_recover(void *hwdev)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c: In function '__print_cable_info.isra':
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:3849:29: warning: ', Temperature: ' directive output may be truncated writing 15 bytes into a region of size between 0 and 511 [-Wformat-truncation=]
3849 | "%s, Temperature: %u", tmp_str,
| ^~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:3849:26: note: directive argument in the range [0, 255]
3849 | "%s, Temperature: %u", tmp_str,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:3848:17: note: 'snprintf' output between 17 and 530 bytes into a destination of size 511
3848 | snprintf(tmp_str, sizeof(tmp_str) - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3849 | "%s, Temperature: %u", tmp_str,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3850 | info->cable_temp);
| ~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:3848:17: warning: 'snprintf' argument 4 overlaps destination object 'tmp_str' [-Wrestrict]
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:3812:14: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
3812 | char tmp_str[512] = {0};
| ^~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1721: warning: Function parameter or member 'hwdev' not described in 'set_pf_dma_attr_entry'
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1721: warning: Excess function parameter 'hwif' description in 'set_pf_dma_attr_entry'
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1780: warning: Function parameter or member 'hwdev' not described in 'dma_attr_table_init'
drivers/net/ethernet/huawei/hinic/hinic_hwdev.c:1780: warning: Excess function parameter 'hwif' description in 'dma_attr_table_init'
--
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:41:6: sparse: sparse: symbol 'g_test_qpc_num' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:42:6: sparse: sparse: symbol 'g_test_qpc_resvd_num' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:43:6: sparse: sparse: symbol 'g_test_pagesize_reorder' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:44:6: sparse: sparse: symbol 'g_test_xid_alloc_mode' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:45:6: sparse: sparse: symbol 'g_test_gpa_check_enable' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:46:6: sparse: sparse: symbol 'g_test_qpc_alloc_mode' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:47:6: sparse: sparse: symbol 'g_test_scqc_alloc_mode' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:48:6: sparse: sparse: symbol 'g_test_max_conn' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:49:6: sparse: sparse: symbol 'g_test_max_cache_conn' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:50:6: sparse: sparse: symbol 'g_test_scqc_num' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:51:6: sparse: sparse: symbol 'g_test_mpt_num' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:52:6: sparse: sparse: symbol 'g_test_mpt_resvd' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:53:6: sparse: sparse: symbol 'g_test_scq_resvd' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:54:6: sparse: sparse: symbol 'g_test_hash_num' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:55:6: sparse: sparse: symbol 'g_test_reorder_num' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1411:5: sparse: sparse: symbol 'init_cfg_mgmt' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1458:6: sparse: sparse: symbol 'free_cfg_mgmt' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1493:5: sparse: sparse: symbol 'init_capability' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1522:6: sparse: sparse: symbol 'free_capability' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1732:5: sparse: sparse: symbol 'cfg_set_func_sf_en' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1770:5: sparse: sparse: symbol 'cfg_get_func_sf_en' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1096:5: warning: no previous prototype for 'hinic_vector_to_irq' [-Wmissing-prototypes]
1096 | int hinic_vector_to_irq(void *hwdev, enum hinic_service_type type, int vector)
| ^~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1411:5: warning: no previous prototype for 'init_cfg_mgmt' [-Wmissing-prototypes]
1411 | int init_cfg_mgmt(struct hinic_hwdev *dev)
| ^~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1458:6: warning: no previous prototype for 'free_cfg_mgmt' [-Wmissing-prototypes]
1458 | void free_cfg_mgmt(struct hinic_hwdev *dev)
| ^~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1493:5: warning: no previous prototype for 'init_capability' [-Wmissing-prototypes]
1493 | int init_capability(struct hinic_hwdev *dev)
| ^~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1522:6: warning: no previous prototype for 'free_capability' [-Wmissing-prototypes]
1522 | void free_capability(struct hinic_hwdev *dev)
| ^~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1732:5: warning: no previous prototype for 'cfg_set_func_sf_en' [-Wmissing-prototypes]
1732 | int cfg_set_func_sf_en(void *hwdev, u32 enbits, u32 enmask)
| ^~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_cfg.c:1770:5: warning: no previous prototype for 'cfg_get_func_sf_en' [-Wmissing-prototypes]
1770 | int cfg_get_func_sf_en(void *hwdev, u32 *enbits)
| ^~~~~~~~~~~~~~~~~~
--
drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:66:6: sparse: sparse: symbol 'get_slave_host_enable' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:589:6: sparse: sparse: symbol 'comm_ppf_to_pf_handler' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:607:5: sparse: sparse: symbol 'hinic_nic_ppf_mbox_handler' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:616:6: sparse: sparse: symbol 'hinic_nic_ppf_to_pf_handler' was not declared. Should it be static?
>> drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:625:5: sparse: sparse: symbol 'hinic_register_slave_ppf' was not declared. Should it be static?
drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:66:6: warning: no previous prototype for 'get_slave_host_enable' [-Wmissing-prototypes]
66 | bool get_slave_host_enable(struct hinic_hwdev *hwdev, u8 host_id)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:209:5: warning: no previous prototype for '__mbox_to_host' [-Wmissing-prototypes]
209 | int __mbox_to_host(struct hinic_hwdev *hwdev, enum hinic_mod_type mod,
| ^~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:483:5: warning: no previous prototype for 'sw_func_ppf_mbox_handler' [-Wmissing-prototypes]
483 | int sw_func_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u8 cmd,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:506:5: warning: no previous prototype for '__ppf_process_mbox_msg' [-Wmissing-prototypes]
506 | int __ppf_process_mbox_msg(struct hinic_hwdev *hwdev, u16 pf_idx, u16 vf_id,
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:580:5: warning: no previous prototype for 'comm_ppf_mbox_handler' [-Wmissing-prototypes]
580 | int comm_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u8 cmd,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:589:6: warning: no previous prototype for 'comm_ppf_to_pf_handler' [-Wmissing-prototypes]
589 | void comm_ppf_to_pf_handler(void *handle, u8 cmd,
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:598:5: warning: no previous prototype for 'hilink_ppf_mbox_handler' [-Wmissing-prototypes]
598 | int hilink_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u8 cmd,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:607:5: warning: no previous prototype for 'hinic_nic_ppf_mbox_handler' [-Wmissing-prototypes]
607 | int hinic_nic_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u8 cmd,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:616:6: warning: no previous prototype for 'hinic_nic_ppf_to_pf_handler' [-Wmissing-prototypes]
616 | void hinic_nic_ppf_to_pf_handler(void *handle, u8 cmd,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:625:5: warning: no previous prototype for 'hinic_register_slave_ppf' [-Wmissing-prototypes]
625 | int hinic_register_slave_ppf(struct hinic_hwdev *hwdev, bool registered)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/hinic/hinic_multi_host_mgmt.c:686:5: warning: no previous prototype for 'set_slave_func_nic_state' [-Wmissing-prototypes]
686 | int set_slave_func_nic_state(struct hinic_hwdev *hwdev, u16 func_idx, u8 en)
| ^~~~~~~~~~~~~~~~~~~~~~~~
vim +/nic_cmd_support_vf +72 drivers/net/ethernet/huawei/hinic/hinic_nic_cfg.c
71
> 72 struct vf_cmd_check_handle nic_cmd_support_vf[] = {
73 {HINIC_PORT_CMD_VF_REGISTER, NULL},
74 {HINIC_PORT_CMD_VF_UNREGISTER, NULL},
75
76 {HINIC_PORT_CMD_CHANGE_MTU, hinic_mbox_check_func_id_8B},
77
78 {HINIC_PORT_CMD_ADD_VLAN, hinic_mbox_check_func_id_8B},
79 {HINIC_PORT_CMD_DEL_VLAN, hinic_mbox_check_func_id_8B},
80
81 {HINIC_PORT_CMD_SET_MAC, hinic_mbox_check_func_id_8B},
82 {HINIC_PORT_CMD_GET_MAC, hinic_mbox_check_func_id_8B},
83 {HINIC_PORT_CMD_DEL_MAC, hinic_mbox_check_func_id_8B},
84
85 {HINIC_PORT_CMD_SET_RX_MODE, hinic_mbox_check_func_id_8B},
86
87 {HINIC_PORT_CMD_GET_PAUSE_INFO, hinic_mbox_check_func_id_8B},
88
89 {HINIC_PORT_CMD_GET_LINK_STATE, hinic_mbox_check_func_id_8B},
90 {HINIC_PORT_CMD_SET_LRO, hinic_mbox_check_func_id_8B},
91 {HINIC_PORT_CMD_SET_RX_CSUM, hinic_mbox_check_func_id_8B},
92 {HINIC_PORT_CMD_SET_RX_VLAN_OFFLOAD, hinic_mbox_check_func_id_8B},
93
94 {HINIC_PORT_CMD_GET_VPORT_STAT, hinic_mbox_check_func_id_8B},
95 {HINIC_PORT_CMD_CLEAN_VPORT_STAT, hinic_mbox_check_func_id_8B},
96
97 {HINIC_PORT_CMD_GET_RSS_TEMPLATE_INDIR_TBL,
98 hinic_mbox_check_func_id_8B},
99 {HINIC_PORT_CMD_SET_RSS_TEMPLATE_INDIR_TBL,
100 hinic_mbox_check_func_id_8B},
101 {HINIC_PORT_CMD_SET_RSS_TEMPLATE_TBL, hinic_mbox_check_func_id_8B},
102 {HINIC_PORT_CMD_GET_RSS_TEMPLATE_TBL, hinic_mbox_check_func_id_8B},
103 {HINIC_PORT_CMD_SET_RSS_HASH_ENGINE, hinic_mbox_check_func_id_8B},
104 {HINIC_PORT_CMD_GET_RSS_HASH_ENGINE, hinic_mbox_check_func_id_8B},
105 {HINIC_PORT_CMD_GET_RSS_CTX_TBL, hinic_mbox_check_func_id_8B},
106 {HINIC_PORT_CMD_SET_RSS_CTX_TBL, hinic_mbox_check_func_id_8B},
107 {HINIC_PORT_CMD_RSS_TEMP_MGR, hinic_mbox_check_func_id_8B},
108 {HINIC_PORT_CMD_RSS_CFG, hinic_mbox_check_func_id_8B},
109
110 {HINIC_PORT_CMD_INIT_FUNC, check_func_table},
111 {HINIC_PORT_CMD_SET_LLI_PRI, hinic_mbox_check_func_id_8B},
112
113 {HINIC_PORT_CMD_GET_MGMT_VERSION, NULL},
114 {HINIC_PORT_CMD_GET_BOOT_VERSION, NULL},
115 {HINIC_PORT_CMD_GET_MICROCODE_VERSION, NULL},
116
117 {HINIC_PORT_CMD_GET_VPORT_ENABLE, hinic_mbox_check_func_id_8B},
118 {HINIC_PORT_CMD_SET_VPORT_ENABLE, hinic_mbox_check_func_id_8B},
119
120 {HINIC_PORT_CMD_GET_LRO, hinic_mbox_check_func_id_8B},
121 {HINIC_PORT_CMD_GET_GLOBAL_QPN, hinic_mbox_check_func_id_8B},
122
123 {HINIC_PORT_CMD_SET_TSO, hinic_mbox_check_func_id_8B},
124 {HINIC_PORT_CMD_SET_RQ_IQ_MAP, hinic_mbox_check_func_id_8B},
125 {HINIC_PORT_CMD_LINK_STATUS_REPORT, hinic_mbox_check_func_id_8B},
126 {HINIC_PORT_CMD_UPDATE_MAC, hinic_mbox_check_func_id_8B},
127
128 {HINIC_PORT_CMD_GET_PORT_INFO, hinic_mbox_check_func_id_8B},
129
130 {HINIC_PORT_CMD_SET_IPSU_MAC, hinic_mbox_check_func_id_10B},
131 {HINIC_PORT_CMD_GET_IPSU_MAC, hinic_mbox_check_func_id_10B},
132
133 {HINIC_PORT_CMD_GET_LINK_MODE, hinic_mbox_check_func_id_8B},
134
135 {HINIC_PORT_CMD_CLEAR_SQ_RES, hinic_mbox_check_func_id_8B},
136 {HINIC_PORT_CMD_SET_SUPER_CQE, hinic_mbox_check_func_id_8B},
137
138 {HINIC_PORT_CMD_GET_VF_COS, NULL},
139 {HINIC_PORT_CMD_SET_VHD_CFG, hinic_mbox_check_func_id_8B},
140
141 {HINIC_PORT_CMD_SET_VLAN_FILTER, hinic_mbox_check_func_id_8B},
142 };
143
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

10 Mar '25
From: Zheng Yejian <zhengyejian1(a)huawei.com>
stable inclusion
from stable-v4.19.253
commit eb622d5580b9e2ff694f62da6410618bd73853cb
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBP6IV
CVE: CVE-2022-49648
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
commit 7edc3945bdce9c39198a10d6129377a5c53559c2 upstream.
This reverts commit 46bbe5c671e06f070428b9be142cc4ee5cedebac.
As commit 46bbe5c671e0 ("tracing: fix double free") said, the
"double free" problem reported by clang static analyzer is:
> In parse_var_defs() if there is a problem allocating
> var_defs.expr, the earlier var_defs.name is freed.
> This free is duplicated by free_var_defs() which frees
> the rest of the list.
However, if there is a problem allocating N-th var_defs.expr:
+ in parse_var_defs(), the freed 'earlier var_defs.name' is
actually the N-th var_defs.name;
+ then in free_var_defs(), the names from 0th to (N-1)-th are freed;
IF ALLOCATING PROBLEM HAPPENED HERE!!! -+
\
|
0th 1th (N-1)-th N-th V
+-------------+-------------+-----+-------------+-----------
var_defs: | name | expr | name | expr | ... | name | expr | name | ///
+-------------+-------------+-----+-------------+-----------
These two frees don't act on same name, so there was no "double free"
problem before. Conversely, after that commit, we get a "memory leak"
problem because the above "N-th var_defs.name" is not freed.
If enable CONFIG_DEBUG_KMEMLEAK and inject a fault at where the N-th
var_defs.expr allocated, then execute on shell like:
$ echo 'hist:key=call_site:val=$v1,$v2:v1=bytes_req,v2=bytes_alloc' > \
/sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
Then kmemleak reports:
unreferenced object 0xffff8fb100ef3518 (size 8):
comm "bash", pid 196, jiffies 4295681690 (age 28.538s)
hex dump (first 8 bytes):
76 31 00 00 b1 8f ff ff v1......
backtrace:
[<0000000038fe4895>] kstrdup+0x2d/0x60
[<00000000c99c049a>] event_hist_trigger_parse+0x206f/0x20e0
[<00000000ae70d2cc>] trigger_process_regex+0xc0/0x110
[<0000000066737a4c>] event_trigger_write+0x75/0xd0
[<000000007341e40c>] vfs_write+0xbb/0x2a0
[<0000000087fde4c2>] ksys_write+0x59/0xd0
[<00000000581e9cdf>] do_syscall_64+0x3a/0x80
[<00000000cf3b065c>] entry_SYSCALL_64_after_hwframe+0x46/0xb0
Link: https://lkml.kernel.org/r/20220711014731.69520-1-zhengyejian1@huawei.com
Cc: stable(a)vger.kernel.org
Fixes: 46bbe5c671e0 ("tracing: fix double free")
Reported-by: Hulk Robot <hulkci(a)huawei.com>
Suggested-by: Steven Rostedt <rostedt(a)goodmis.org>
Reviewed-by: Tom Zanussi <tom.zanussi(a)linux.intel.com>
Signed-off-by: Zheng Yejian <zhengyejian1(a)huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt(a)goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Li Huafei <lihuafei1(a)huawei.com>
---
kernel/trace/trace_events_hist.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 638566ea7839..2f57eb241ac9 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -4155,6 +4155,8 @@ static int parse_var_defs(struct hist_trigger_data *hist_data)
s = kstrdup(field_str, GFP_KERNEL);
if (!s) {
+ kfree(hist_data->attrs->var_defs.name[n_vars]);
+ hist_data->attrs->var_defs.name[n_vars] = NULL;
ret = -ENOMEM;
goto free;
}
--
2.25.1
2
1

[openeuler:OLK-6.6 2007/2007] kernel/kexec_core.c:1066: undefined reference to `machine_crash_shutdown'
by kernel test robot 09 Mar '25
by kernel test robot 09 Mar '25
09 Mar '25
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 944ce05f6b83ba40c4382c6b90b7b94f529118d3
commit: 47ff774cbb440dfc3cf5d5bc7cf82b41d4d99966 [2007/2007] x86, crash: wrap crash dumping code into crash related ifdefs
config: x86_64-randconfig-r121-20250309 (https://download.01.org/0day-ci/archive/20250309/202503091909.W4esTcVo-lkp@…)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250309/202503091909.W4esTcVo-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/202503091909.W4esTcVo-lkp@intel.com/
All errors (new ones prefixed by >>):
ld: kernel/kexec_core.o: in function `__crash_kexec':
>> kernel/kexec_core.c:1066: undefined reference to `machine_crash_shutdown'
ld: kernel/kexec.o: in function `do_kexec_load':
>> kernel/kexec.c:105: undefined reference to `arch_kexec_unprotect_crashkres'
>> ld: kernel/kexec.c:166: undefined reference to `arch_kexec_protect_crashkres'
ld: kernel/kexec_file.o: in function `__do_sys_kexec_file_load':
>> kernel/kexec_file.c:350: undefined reference to `arch_kexec_unprotect_crashkres'
>> ld: kernel/kexec_file.c:415: undefined reference to `arch_kexec_protect_crashkres'
vim +1066 kernel/kexec_core.c
7e99f8b69c11c1 Ricardo Ribalda 2023-01-04 1044
7bbee5ca3896f6 Hidehiro Kawai 2015-12-14 1045 /*
7bbee5ca3896f6 Hidehiro Kawai 2015-12-14 1046 * No panic_cpu check version of crash_kexec(). This function is called
7bbee5ca3896f6 Hidehiro Kawai 2015-12-14 1047 * only when panic_cpu holds the current CPU number; this is the only CPU
7bbee5ca3896f6 Hidehiro Kawai 2015-12-14 1048 * which processes crash_kexec routines.
7bbee5ca3896f6 Hidehiro Kawai 2015-12-14 1049 */
c207aee48037ab Josh Poimboeuf 2017-06-28 1050 void __noclone __crash_kexec(struct pt_regs *regs)
2965faa5e03d1e Dave Young 2015-09-09 1051 {
05c6257433b721 Valentin Schneider 2022-06-30 1052 /* Take the kexec_lock here to prevent sys_kexec_load
2965faa5e03d1e Dave Young 2015-09-09 1053 * running on one cpu from replacing the crash kernel
2965faa5e03d1e Dave Young 2015-09-09 1054 * we are using after a panic on a different cpu.
2965faa5e03d1e Dave Young 2015-09-09 1055 *
2965faa5e03d1e Dave Young 2015-09-09 1056 * If the crash kernel was not located in a fixed area
2965faa5e03d1e Dave Young 2015-09-09 1057 * of memory the xchg(&kexec_crash_image) would be
2965faa5e03d1e Dave Young 2015-09-09 1058 * sufficient. But since I reuse the memory...
2965faa5e03d1e Dave Young 2015-09-09 1059 */
05c6257433b721 Valentin Schneider 2022-06-30 1060 if (kexec_trylock()) {
2965faa5e03d1e Dave Young 2015-09-09 1061 if (kexec_crash_image) {
2965faa5e03d1e Dave Young 2015-09-09 1062 struct pt_regs fixed_regs;
2965faa5e03d1e Dave Young 2015-09-09 1063
2965faa5e03d1e Dave Young 2015-09-09 1064 crash_setup_regs(&fixed_regs, regs);
2965faa5e03d1e Dave Young 2015-09-09 1065 crash_save_vmcoreinfo();
2965faa5e03d1e Dave Young 2015-09-09 @1066 machine_crash_shutdown(&fixed_regs);
2965faa5e03d1e Dave Young 2015-09-09 1067 machine_kexec(kexec_crash_image);
2965faa5e03d1e Dave Young 2015-09-09 1068 }
05c6257433b721 Valentin Schneider 2022-06-30 1069 kexec_unlock();
2965faa5e03d1e Dave Young 2015-09-09 1070 }
2965faa5e03d1e Dave Young 2015-09-09 1071 }
c207aee48037ab Josh Poimboeuf 2017-06-28 1072 STACK_FRAME_NON_STANDARD(__crash_kexec);
2965faa5e03d1e Dave Young 2015-09-09 1073
:::::: The code at line 1066 was first introduced by commit
:::::: 2965faa5e03d1e71e9ff9aa143fff39e0a77543a kexec: split kexec_load syscall from kexec core code
:::::: TO: Dave Young <dyoung(a)redhat.com>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0