mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jon Hunter <jonathanh@nvidia.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Thierry Reding <treding@nvidia.com>
Subject: drivers/firmware/tegra/bpmp-debugfs.c:335:11-18: WARNING opportunity for memdup_user
Date: Sat, 8 Aug 2020 01:14:28 +0800	[thread overview]
Message-ID: <202008080124.yAQ037y0%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1626 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   86cfccb66937dd6cbf26ed619958b9e587e6a115
commit: 5e37b9c137ee5a3a9dc2815ca51f71746c2609a6 firmware: tegra: Add support for in-band debug
date:   3 weeks ago
config: arm64-randconfig-c003-20200807 (attached as .config)
compiler: aarch64-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>


coccinelle warnings: (new ones prefixed by >>)

>> drivers/firmware/tegra/bpmp-debugfs.c:335:11-18: WARNING opportunity for memdup_user

vim +335 drivers/firmware/tegra/bpmp-debugfs.c

   320	
   321	static ssize_t bpmp_debug_store(struct file *file, const char __user *buf,
   322			size_t count, loff_t *f_pos)
   323	{
   324		struct inode *inode = file_inode(file);
   325		struct tegra_bpmp *bpmp = inode->i_private;
   326		char *databuf = NULL;
   327		char fnamebuf[256];
   328		const char *filename;
   329		ssize_t err;
   330	
   331		filename = get_filename(bpmp, file, fnamebuf, sizeof(fnamebuf));
   332		if (!filename)
   333			return -ENOENT;
   334	
 > 335		databuf = kmalloc(count, GFP_KERNEL);
   336		if (!databuf)
   337			return -ENOMEM;
   338	
   339		if (copy_from_user(databuf, buf, count)) {
   340			err = -EFAULT;
   341			goto free_ret;
   342		}
   343	
   344		err = mrq_debug_write(bpmp, filename, databuf, count);
   345	
   346	free_ret:
   347		kfree(databuf);
   348	
   349		return err ?: count;
   350	}
   351	

---
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: 35153 bytes --]

                 reply	other threads:[~2020-08-07 17:39 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=202008080124.yAQ037y0%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jonathanh@nvidia.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=treding@nvidia.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®