mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/net/ethernet/netronome/nfp/devlink_param.c:101 nfp_devlink_param_u8_get() warn: potential spectre issue 'arg->hi_to_dl' (local cap)
@ 2020-08-14  1:51 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-08-14  1:51 UTC (permalink / raw)
  To: Dirk van der Merwe; +Cc: kbuild-all, linux-kernel, Jakub Kicinski, Simon Horman

[-- 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 --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-14  1:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-14  1:51 drivers/net/ethernet/netronome/nfp/devlink_param.c:101 nfp_devlink_param_u8_get() warn: potential spectre issue 'arg->hi_to_dl' (local cap) kernel test robot

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®