Re: [PATCH] HSI: ssi_protocol: Fix use after free vulnerability in ssi_protocol Driver Due to Race Condition

From: kernel test robot
Date: Fri Sep 13 2024 - 02:42:47 EST


Hi Kaixin,

kernel test robot noticed the following build errors:

[auto build test ERROR on sre-hsi/for-next]
[also build test ERROR on linus/master v6.11-rc7 next-20240912]
[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#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Kaixin-Wang/HSI-ssi_protocol-Fix-use-after-free-vulnerability-in-ssi_protocol-Driver-Due-to-Race-Condition/20240911-232206
base: https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi.git for-next
patch link: https://lore.kernel.org/r/20240911151915.844957-1-kxwang23%40m.fudan.edu.cn
patch subject: [PATCH] HSI: ssi_protocol: Fix use after free vulnerability in ssi_protocol Driver Due to Race Condition
config: arm-allmodconfig (https://download.01.org/0day-ci/archive/20240913/202409131457.oUtHawfD-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240913/202409131457.oUtHawfD-lkp@xxxxxxxxx/reproduce)

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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409131457.oUtHawfD-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

drivers/hsi/clients/ssi_protocol.c: In function 'ssi_protocol_remove':
>> drivers/hsi/clients/ssi_protocol.c:1158:37: error: expected ';' before 'kfree'
1158 | cancel_work_sync(&ssi->work)
| ^
| ;
1159 | kfree(ssi);
| ~~~~~


vim +1158 drivers/hsi/clients/ssi_protocol.c

1148
1149 static int ssi_protocol_remove(struct device *dev)
1150 {
1151 struct hsi_client *cl = to_hsi_client(dev);
1152 struct ssi_protocol *ssi = hsi_client_drvdata(cl);
1153
1154 list_del(&ssi->link);
1155 unregister_netdev(ssi->netdev);
1156 ssip_free_cmds(ssi);
1157 hsi_client_set_drvdata(cl, NULL);
> 1158 cancel_work_sync(&ssi->work)
1159 kfree(ssi);
1160
1161 return 0;
1162 }
1163

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki