Dan Carpenter
2020-Sep-09 17:23 UTC
[PATCH] vhost: new vhost_vdpa SET/GET_BACKEND_FEATURES handlers
Hi Zhu, url: https://github.com/0day-ci/linux/commits/Zhu-Lingshan/vhost-new-vhost_vdpa-SET-GET_BACKEND_FEATURES-handlers/20200909-115726 base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next config: parisc-randconfig-m031-20200909 (attached as .config) compiler: hppa-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp at intel.com> Reported-by: Dan Carpenter <dan.carpenter at oracle.com> New smatch warnings: drivers/vhost/vdpa.c:356 vhost_vdpa_get_backend_features() warn: maybe return -EFAULT instead of the bytes remaining? # https://github.com/0day-ci/linux/commit/f2da8fc35b4ef003de7d559a8c7730fedf9926f8 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Zhu-Lingshan/vhost-new-vhost_vdpa-SET-GET_BACKEND_FEATURES-handlers/20200909-115726 git checkout f2da8fc35b4ef003de7d559a8c7730fedf9926f8 vim +356 drivers/vhost/vdpa.c f2da8fc35b4ef0 Zhu Lingshan 2020-09-09 348 static long vhost_vdpa_get_backend_features(void __user *argp) f2da8fc35b4ef0 Zhu Lingshan 2020-09-09 349 { f2da8fc35b4ef0 Zhu Lingshan 2020-09-09 350 u64 features = VHOST_VDPA_BACKEND_FEATURES; f2da8fc35b4ef0 Zhu Lingshan 2020-09-09 351 u64 __user *featurep = argp; f2da8fc35b4ef0 Zhu Lingshan 2020-09-09 352 long r; f2da8fc35b4ef0 Zhu Lingshan 2020-09-09 353 f2da8fc35b4ef0 Zhu Lingshan 2020-09-09 354 r = copy_to_user(featurep, &features, sizeof(features)); f2da8fc35b4ef0 Zhu Lingshan 2020-09-09 355 f2da8fc35b4ef0 Zhu Lingshan 2020-09-09 @356 return r; copy_to_user() returns the number of bytes remaining. I haven't looked at how this is called but it should probably return negative error codes on error: if (copy_to_user(featurep, &features, sizeof(features))) return -EFAULT; return 0; f2da8fc35b4ef0 Zhu Lingshan 2020-09-09 357 } --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all at lists.01.org -------------- next part -------------- A non-text attachment was scrubbed... Name: .config.gz Type: application/gzip Size: 30628 bytes Desc: not available URL: <http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20200909/11eddb06/attachment-0001.gz>