tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: a2c7a5a53b2787fa56e28a271e9d3894f70e8374 commit: be5ee944496f8e6f9b5d12ef9ce89ab7100fc84a [1590/1590] driver/virt/coco: Add HYGON CSV Guest dirver. config: x86_64-randconfig-121 (https://download.01.org/0day-ci/archive/20241205/202412050642.ZbO2qNHp-lkp@i...) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241205/202412050642.ZbO2qNHp-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202412050642.ZbO2qNHp-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
drivers/virt/coco/csv-guest/csv-guest.c:39:43: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got unsigned char [usertype] *[addressable] report_data @@
drivers/virt/coco/csv-guest/csv-guest.c:39:43: sparse: expected void const [noderef] __user *from drivers/virt/coco/csv-guest/csv-guest.c:39:43: sparse: got unsigned char [usertype] *[addressable] report_data
drivers/virt/coco/csv-guest/csv-guest.c:49:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got unsigned char [usertype] *[addressable] report_data @@
drivers/virt/coco/csv-guest/csv-guest.c:49:29: sparse: expected void [noderef] __user *to drivers/virt/coco/csv-guest/csv-guest.c:49:29: sparse: got unsigned char [usertype] *[addressable] report_data
vim +39 drivers/virt/coco/csv-guest/csv-guest.c
19 20 static long csv_get_report(void __user *argp) 21 { 22 u8 *csv_report; 23 long ret; 24 struct csv_report_req req; 25 26 if (copy_from_user(&req, argp, sizeof(struct csv_report_req))) 27 return -EFAULT; 28 29 if (req.len < CSV_REPORT_INPUT_DATA_LEN) 30 return -EINVAL; 31 32 csv_report = kzalloc(req.len, GFP_KERNEL); 33 if (!csv_report) { 34 ret = -ENOMEM; 35 goto out; 36 } 37 38 /* Save user input data */
39 if (copy_from_user(csv_report, req.report_data, CSV_REPORT_INPUT_DATA_LEN)) {
40 ret = -EFAULT; 41 goto out; 42 } 43 44 /* Generate CSV_REPORT using "KVM_HC_VM_ATTESTATION" VMMCALL */ 45 ret = kvm_hypercall2(KVM_HC_VM_ATTESTATION, __pa(csv_report), req.len); 46 if (ret) 47 goto out; 48
49 if (copy_to_user(req.report_data, csv_report, req.len))
50 ret = -EFAULT; 51 52 out: 53 kfree(csv_report); 54 return ret; 55 } 56