From: kernel test robot <lkp@intel.com>
To: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Jakub Kicinski <jakub.kicinski@netronome.com>,
Simon Horman <simon.horman@netronome.com>
Subject: drivers/net/ethernet/netronome/nfp/devlink_param.c:101 nfp_devlink_param_u8_get() warn: potential spectre issue 'arg->hi_to_dl' (local cap)
Date: Fri, 14 Aug 2020 09:51:40 +0800 [thread overview]
Message-ID: <202008140938.TjOQeACu%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2310 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dddcbc139e96bd18d8c65ef7b7e440f0d32457c2
commit: ff04788c5b583d79c5c15e28c4ae7b876e69d00c nfp: devlink: add 'fw_load_policy' support
date: 11 months ago
config: ia64-randconfig-m031-20200811 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
smatch warnings:
drivers/net/ethernet/netronome/nfp/devlink_param.c:101 nfp_devlink_param_u8_get() warn: potential spectre issue 'arg->hi_to_dl' [r] (local cap)
vim +101 drivers/net/ethernet/netronome/nfp/devlink_param.c
56
57 static int
58 nfp_devlink_param_u8_get(struct devlink *devlink, u32 id,
59 struct devlink_param_gset_ctx *ctx)
60 {
61 const struct nfp_devlink_param_u8_arg *arg;
62 struct nfp_pf *pf = devlink_priv(devlink);
63 struct nfp_nsp *nsp;
64 char hwinfo[32];
65 long value;
66 int err;
67
68 if (id >= ARRAY_SIZE(nfp_devlink_u8_args))
69 return -EOPNOTSUPP;
70
71 arg = &nfp_devlink_u8_args[id];
72
73 nsp = nfp_nsp_open(pf->cpp);
74 if (IS_ERR(nsp)) {
75 err = PTR_ERR(nsp);
76 nfp_warn(pf->cpp, "can't access NSP: %d\n", err);
77 return err;
78 }
79
80 snprintf(hwinfo, sizeof(hwinfo), arg->hwinfo_name);
81 err = nfp_nsp_hwinfo_lookup_optional(nsp, hwinfo, sizeof(hwinfo),
82 arg->default_hi_val);
83 if (err) {
84 nfp_warn(pf->cpp, "HWinfo lookup failed: %d\n", err);
85 goto exit_close_nsp;
86 }
87
88 err = kstrtol(hwinfo, 0, &value);
89 if (err || value < 0 || value > arg->max_hi_val) {
90 nfp_warn(pf->cpp, "HWinfo '%s' value %li invalid\n",
91 arg->hwinfo_name, value);
92
93 if (arg->invalid_dl_val >= 0)
94 ctx->val.vu8 = arg->invalid_dl_val;
95 else
96 err = arg->invalid_dl_val;
97
98 goto exit_close_nsp;
99 }
100
> 101 ctx->val.vu8 = arg->hi_to_dl[value];
102
103 exit_close_nsp:
104 nfp_nsp_close(nsp);
105 return err;
106 }
107
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31205 bytes --]
reply other threads:[~2020-08-14 1:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202008140938.TjOQeACu%lkp@intel.com \
--to=lkp@intel.com \
--cc=dirk.vandermerwe@netronome.com \
--cc=jakub.kicinski@netronome.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=simon.horman@netronome.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®