All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: sound/soc/sof/ipc4-mtrace.c:359 sof_ipc4_priority_mask_dfs_write() warn: potential spectre issue 'priv->state_info.logs_priorities_mask' [w] (local cap)
Date: Thu, 23 Mar 2023 11:49:35 +0800	[thread overview]
Message-ID: <202303231129.YxVuUvO2-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
CC: Mark Brown <broonie@kernel.org>
CC: Rander Wang <rander.wang@intel.com>
CC: Bard Liao <yung-chuan.liao@linux.intel.com>
CC: "Pierre-Louis Bossart" <pierre-louis.bossart@linux.intel.com>
CC: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fff5a5e7f528b2ed2c335991399a766c2cf01103
commit: f4ea22f7aa7536560097d765be56445933d07e0d ASoC: SOF: ipc4: Add support for mtrace log extraction
date:   6 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 6 months ago
config: s390-randconfig-m031-20230321 (https://download.01.org/0day-ci/archive/20230323/202303231129.YxVuUvO2-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Link: https://lore.kernel.org/r/202303231129.YxVuUvO2-lkp@intel.com/

smatch warnings:
sound/soc/sof/ipc4-mtrace.c:359 sof_ipc4_priority_mask_dfs_write() warn: potential spectre issue 'priv->state_info.logs_priorities_mask' [w] (local cap)

vim +359 sound/soc/sof/ipc4-mtrace.c

f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  326  
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  327  static ssize_t sof_ipc4_priority_mask_dfs_write(struct file *file,
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  328  						const char __user *from,
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  329  						size_t count, loff_t *ppos)
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  330  {
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  331  	struct sof_mtrace_priv *priv = file->private_data;
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  332  	int id, ret;
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  333  	char *buf;
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  334  	u32 mask;
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  335  
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  336  	/*
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  337  	 * To update Nth mask entry, write:
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  338  	 * "N,0x1234" or "N,1234" to the debugfs file
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  339  	 * The mask will be interpreted as hexadecimal number
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  340  	 */
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  341  	buf = memdup_user_nul(from, count);
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  342  	if (IS_ERR(buf))
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  343  		return PTR_ERR(buf);
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  344  
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  345  	ret = sscanf(buf, "%d,0x%x", &id, &mask);
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  346  	if (ret != 2) {
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  347  		ret = sscanf(buf, "%d,%x", &id, &mask);
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  348  		if (ret != 2) {
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  349  			ret = -EINVAL;
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  350  			goto out;
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  351  		}
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  352  	}
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  353  
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  354  	if (id >= MAX_ALLOWED_LIBRARIES) {
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  355  		ret = -EINVAL;
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  356  		goto out;
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  357  	}
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  358  
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09 @359  	priv->state_info.logs_priorities_mask[id] = mask;
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  360  	ret = count;
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  361  
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  362  out:
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  363  	kfree(buf);
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  364  	return ret;
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  365  }
f4ea22f7aa7536 Peter Ujfalusi 2022-09-09  366  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

                 reply	other threads:[~2023-03-23  3:50 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=202303231129.YxVuUvO2-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.