Hi Moshe,
[FYI, it's a private test report for your RFC patch.]
url:
https://github.com/0day-ci/linux/commits/Moshe-Shemesh/Add-devlink-reload...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
0f091e43310f5c292b7094f9f115e651358e8053
config: i386-randconfig-m021-20200830 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
net/core/devlink.c:507 devlink_nl_fill() error: buffer overflow
'devlink->reload_actions_cnts' 3 <= 3
Old smatch warnings:
net/core/devlink.c:5356 devlink_fmsg_prepare_skb() error: uninitialized symbol
'err'.
include/linux/u64_stats_sync.h:128 u64_stats_update_begin() warn: statement has no effect
31
#
https://github.com/0day-ci/linux/commit/009b615f56e566df8c2712eb3b126c619...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Moshe-Shemesh/Add-devlink-reload-action-option/20200830-233543
git checkout 009b615f56e566df8c2712eb3b126c61959549d4
vim +507 net/core/devlink.c
bfcd3a466172094 Jiri Pirko 2016-02-26 476 static int devlink_nl_fill(struct sk_buff
*msg, struct devlink *devlink,
bfcd3a466172094 Jiri Pirko 2016-02-26 477 enum devlink_command cmd, u32
portid,
bfcd3a466172094 Jiri Pirko 2016-02-26 478 u32 seq, int flags)
bfcd3a466172094 Jiri Pirko 2016-02-26 479 {
009b615f56e566d Moshe Shemesh 2020-08-30 480 struct nlattr *reload_actions_cnts,
*reload_action_cnt;
bfcd3a466172094 Jiri Pirko 2016-02-26 481 void *hdr;
009b615f56e566d Moshe Shemesh 2020-08-30 482 int i;
bfcd3a466172094 Jiri Pirko 2016-02-26 483
bfcd3a466172094 Jiri Pirko 2016-02-26 484 hdr = genlmsg_put(msg, portid, seq,
&devlink_nl_family, flags, cmd);
bfcd3a466172094 Jiri Pirko 2016-02-26 485 if (!hdr)
bfcd3a466172094 Jiri Pirko 2016-02-26 486 return -EMSGSIZE;
bfcd3a466172094 Jiri Pirko 2016-02-26 487
bfcd3a466172094 Jiri Pirko 2016-02-26 488 if (devlink_nl_put_handle(msg, devlink))
bfcd3a466172094 Jiri Pirko 2016-02-26 489 goto nla_put_failure;
2670ac2625f9855 Jiri Pirko 2019-09-12 490 if (nla_put_u8(msg,
DEVLINK_ATTR_RELOAD_FAILED, devlink->reload_failed))
2670ac2625f9855 Jiri Pirko 2019-09-12 491 goto nla_put_failure;
bfcd3a466172094 Jiri Pirko 2016-02-26 492
009b615f56e566d Moshe Shemesh 2020-08-30 493 if (devlink_reload_supported(devlink)) {
009b615f56e566d Moshe Shemesh 2020-08-30 494 reload_actions_cnts = nla_nest_start(msg,
DEVLINK_ATTR_RELOAD_ACTIONS_CNTS);
009b615f56e566d Moshe Shemesh 2020-08-30 495 if (!reload_actions_cnts)
009b615f56e566d Moshe Shemesh 2020-08-30 496 goto nla_put_failure;
009b615f56e566d Moshe Shemesh 2020-08-30 497
009b615f56e566d Moshe Shemesh 2020-08-30 498 for (i = 0; i <=
DEVLINK_RELOAD_ACTION_MAX; i++) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
i is 0-3, I guess. Should this be < instead of <=?
009b615f56e566d Moshe Shemesh 2020-08-30 499 if
(!devlink_reload_action_is_supported(devlink, i))
009b615f56e566d Moshe Shemesh 2020-08-30 500 continue;
009b615f56e566d Moshe Shemesh 2020-08-30 501 reload_action_cnt = nla_nest_start(msg,
DEVLINK_ATTR_RELOAD_ACTION_CNT);
009b615f56e566d Moshe Shemesh 2020-08-30 502 if (!reload_action_cnt)
009b615f56e566d Moshe Shemesh 2020-08-30 503 goto reload_actions_cnts_nest_cancel;
009b615f56e566d Moshe Shemesh 2020-08-30 504 if (nla_put_u8(msg,
DEVLINK_ATTR_RELOAD_ACTION, i))
009b615f56e566d Moshe Shemesh 2020-08-30 505 goto reload_action_cnt_nest_cancel;
009b615f56e566d Moshe Shemesh 2020-08-30 506 if (nla_put_u8(msg,
DEVLINK_ATTR_RELOAD_ACTION_CNT_VALUE,
009b615f56e566d Moshe Shemesh 2020-08-30 @507
devlink->reload_actions_cnts[i]))
^^^
009b615f56e566d Moshe Shemesh 2020-08-30 508 goto reload_action_cnt_nest_cancel;
009b615f56e566d Moshe Shemesh 2020-08-30 509 nla_nest_end(msg, reload_action_cnt);
009b615f56e566d Moshe Shemesh 2020-08-30 510 }
009b615f56e566d Moshe Shemesh 2020-08-30 511 nla_nest_end(msg, reload_actions_cnts);
009b615f56e566d Moshe Shemesh 2020-08-30 512 }
009b615f56e566d Moshe Shemesh 2020-08-30 513
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org