From: kernel test robot <lkp@intel.com>
To: yanfei.xu@windriver.com, gregkh@linuxfoundation.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: core: limit access to rawdescriptors which were not allocated
Date: Wed, 26 Aug 2020 05:35:05 +0800 [thread overview]
Message-ID: <202008260522.hjjt3Qro%lkp@intel.com> (raw)
In-Reply-To: <20200825161659.19008-1-yanfei.xu@windriver.com>
[-- Attachment #1: Type: text/plain, Size: 3383 bytes --]
Hi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on usb/usb-testing]
[also build test ERROR on balbi-usb/testing/next peter.chen-usb/ci-for-usb-next v5.9-rc2 next-20200825]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/yanfei-xu-windriver-com/USB-core-limit-access-to-rawdescriptors-which-were-not-allocated/20200826-002050
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: arm-randconfig-r015-20200826 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 77e5a195f818b9ace91f7b12ab948b21d7918238)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> drivers/usb/core/sysfs.c:899:12: error: use of undeclared identifier 'USB_MAXCONFIG'
cfgno < USB_MAXCONFIG; ++cfgno) {
^
1 error generated.
# https://github.com/0day-ci/linux/commit/dda85cff0852edc4723d1175486a50024ee7289a
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review yanfei-xu-windriver-com/USB-core-limit-access-to-rawdescriptors-which-were-not-allocated/20200826-002050
git checkout dda85cff0852edc4723d1175486a50024ee7289a
vim +/USB_MAXCONFIG +899 drivers/usb/core/sysfs.c
880
881 static ssize_t
882 read_descriptors(struct file *filp, struct kobject *kobj,
883 struct bin_attribute *attr,
884 char *buf, loff_t off, size_t count)
885 {
886 struct device *dev = kobj_to_dev(kobj);
887 struct usb_device *udev = to_usb_device(dev);
888 size_t nleft = count;
889 size_t srclen, n;
890 int cfgno;
891 void *src;
892
893 /* The binary attribute begins with the device descriptor.
894 * Following that are the raw descriptor entries for all the
895 * configurations (config plus subsidiary descriptors).
896 */
897 for (cfgno = -1; cfgno < udev->descriptor.bNumConfigurations &&
898 nleft > 0 &&
> 899 cfgno < USB_MAXCONFIG; ++cfgno) {
900 if (cfgno < 0) {
901 src = &udev->descriptor;
902 srclen = sizeof(struct usb_device_descriptor);
903 } else {
904 src = udev->rawdescriptors[cfgno];
905 srclen = __le16_to_cpu(udev->config[cfgno].desc.
906 wTotalLength);
907 }
908 if (off < srclen) {
909 n = min(nleft, srclen - (size_t) off);
910 memcpy(buf, src + off, n);
911 nleft -= n;
912 buf += n;
913 off = 0;
914 } else {
915 off -= srclen;
916 }
917 }
918 return count - nleft;
919 }
920
---
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: 34853 bytes --]
prev parent reply other threads:[~2020-08-25 21:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-25 16:16 yanfei.xu
2020-08-25 17:56 ` kernel test robot
2020-08-25 18:00 ` Alan Stern
2020-08-26 6:56 ` Xu, Yanfei
2020-08-25 21:35 ` kernel test robot [this message]
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=202008260522.hjjt3Qro%lkp@intel.com \
--to=lkp@intel.com \
--cc=clang-built-linux@googlegroups.com \
--cc=gregkh@linuxfoundation.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=yanfei.xu@windriver.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®