[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on tip/x86/core linus/master v5.4 v5.4-rc8 v5.4-rc7 
next-20191202 v5.4 next-20191202]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    
https://github.com/0day-ci/linux/commits/Gage-Eads/hqm-add-HQM-device-driver/20191203-031540
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 
b78cda795ac83333293f1bfa3165572a47e550c2

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <l...@intel.com>
Reported-by: Dan Carpenter <dan.carpen...@oracle.com>

smatch warnings:
drivers/misc/hqm/hqm_ioctl.c:114 hqm_domain_ioctl_enable_ldb_port() warn: 
potential spectre issue 'dev->intr.ldb_cq_intr' [w]
drivers/misc/hqm/hqm_ioctl.c:160 hqm_domain_ioctl_enable_dir_port() warn: 
potential spectre issue 'dev->intr.dir_cq_intr' [w]
drivers/misc/hqm/hqm_ioctl.c:209 hqm_domain_ioctl_disable_ldb_port() warn: 
potential spectre issue 'dev->intr.ldb_cq_intr' [w]
drivers/misc/hqm/hqm_ioctl.c:259 hqm_domain_ioctl_disable_dir_port() warn: 
potential spectre issue 'dev->intr.dir_cq_intr' [w]
drivers/misc/hqm/hqm_ioctl.c:390 hqm_domain_ioctl_create_ldb_port() warn: check 
that 'response.id' doesn't leak information
drivers/misc/hqm/hqm_ioctl.c:512 hqm_domain_ioctl_create_dir_port() warn: check 
that 'response.id' doesn't leak information
drivers/misc/hqm/hqm_ioctl.c:555 hqm_domain_ioctl_block_on_cq_interrupt() warn: 
check that 'response.id' doesn't leak information
drivers/misc/hqm/hqm_ioctl.c:725 hqm_ioctl_create_sched_domain() warn: check 
that 'response.id' doesn't leak information
drivers/misc/hqm/hqm_ioctl.c:824 hqm_ioctl_sample_perf_counters() warn: check 
that 'response.id' doesn't leak information
drivers/misc/hqm/hqm_ioctl.c:869 hqm_ioctl_set_sn_allocation() warn: check that 
'response.id' doesn't leak information
drivers/misc/hqm/hqm_ioctl.c:951 hqm_ioctl_measure_sched_count() warn: check 
that 'response.id' doesn't leak information

# 
https://github.com/0day-ci/linux/commit/1be16002886fcd7cfd7989b781bde70e76ee1b48
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 1be16002886fcd7cfd7989b781bde70e76ee1b48
vim +114 drivers/misc/hqm/hqm_ioctl.c

1be16002886fcd Gage Eads 2019-12-02   86  static int 
hqm_domain_ioctl_enable_ldb_port(struct hqm_dev *dev,
1be16002886fcd Gage Eads 2019-12-02   87                                        
    struct hqm_status *status,
1be16002886fcd Gage Eads 2019-12-02   88                                        
    unsigned long user_arg,
1be16002886fcd Gage Eads 2019-12-02   89                                        
    u32 domain_id)
1be16002886fcd Gage Eads 2019-12-02   90  {
1be16002886fcd Gage Eads 2019-12-02   91        struct hqm_enable_ldb_port_args 
arg;
1be16002886fcd Gage Eads 2019-12-02   92        struct hqm_cmd_response 
response = {0};
1be16002886fcd Gage Eads 2019-12-02   93        int ret;
1be16002886fcd Gage Eads 2019-12-02   94  
1be16002886fcd Gage Eads 2019-12-02   95        response.status = 0;
1be16002886fcd Gage Eads 2019-12-02   96  
1be16002886fcd Gage Eads 2019-12-02   97        HQM_INFO(dev->hqm_device, 
"Entering %s()\n", __func__);
1be16002886fcd Gage Eads 2019-12-02   98  
1be16002886fcd Gage Eads 2019-12-02   99        if (copy_from_user(&arg,
1be16002886fcd Gage Eads 2019-12-02  100                           (void  
__user *)user_arg,
1be16002886fcd Gage Eads 2019-12-02  101                           
sizeof(struct hqm_enable_ldb_port_args))) {
1be16002886fcd Gage Eads 2019-12-02  102                HQM_ERR(dev->hqm_device,
1be16002886fcd Gage Eads 2019-12-02  103                        "[%s()] Invalid 
ioctl argument pointer\n",
1be16002886fcd Gage Eads 2019-12-02  104                        __func__);
1be16002886fcd Gage Eads 2019-12-02  105                return -EFAULT;
1be16002886fcd Gage Eads 2019-12-02  106        }
1be16002886fcd Gage Eads 2019-12-02  107  
1be16002886fcd Gage Eads 2019-12-02  108        
mutex_lock(&dev->resource_mutex);
1be16002886fcd Gage Eads 2019-12-02  109  
1be16002886fcd Gage Eads 2019-12-02  110        ret = 
dev->ops->enable_ldb_port(&dev->hw, domain_id, &arg, &response);
1be16002886fcd Gage Eads 2019-12-02  111  
1be16002886fcd Gage Eads 2019-12-02  112        /* Allow threads to block on 
this port's CQ interrupt */
1be16002886fcd Gage Eads 2019-12-02  113        if (!ret)
1be16002886fcd Gage Eads 2019-12-02 @114                
WRITE_ONCE(dev->intr.ldb_cq_intr[arg.port_id].disabled, false);

Smatch thinks we need to have a write barrier in dev->ops->enable_ldb_port()
I guess...

The info leak warnings are more interesting but I don't have the code
for those functions so I'm reporting them blind.  :P

regards,
dan carpenter

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org Intel Corporation
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lists.01.org

Reply via email to