Re: [PATCH] misc: fastrpc: fix UAF and kernel panic during cleanup on process abort

From: kernel test robot

Date: Wed Apr 29 2026 - 17:47:35 EST


Hi Jianping,

kernel test robot noticed the following build errors:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on char-misc/char-misc-next char-misc/char-misc-linus linus/master v7.1-rc1 next-20260429]
[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/Jianping-Li/misc-fastrpc-fix-UAF-and-kernel-panic-during-cleanup-on-process-abort/20260428-043358
base: char-misc/char-misc-testing
patch link: https://lore.kernel.org/r/20260427105310.4056-1-jianping.li%40oss.qualcomm.com
patch subject: [PATCH] misc: fastrpc: fix UAF and kernel panic during cleanup on process abort
config: csky-randconfig-001-20260430 (https://download.01.org/0day-ci/archive/20260430/202604300523.sGVh9WHp-lkp@xxxxxxxxx/config)
compiler: csky-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260430/202604300523.sGVh9WHp-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/202604300523.sGVh9WHp-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

drivers/misc/fastrpc.c: In function 'fastrpc_buf_free':
>> drivers/misc/fastrpc.c:437:35: error: implicit declaration of function 'FASTRPC_PHYS' [-Wimplicit-function-declaration]
437 | FASTRPC_PHYS(buf->phys));
| ^~~~~~~~~~~~
>> drivers/misc/fastrpc.c:437:51: error: 'struct fastrpc_buf' has no member named 'phys'
437 | FASTRPC_PHYS(buf->phys));
| ^~
drivers/misc/fastrpc.c: In function '__fastrpc_buf_alloc':
drivers/misc/fastrpc.c:465:82: error: 'struct fastrpc_buf' has no member named 'phys'
465 | buf->virt = dma_alloc_coherent(dev, buf->size, (dma_addr_t *)&buf->phys, GFP_KERNEL);
| ^~


vim +/FASTRPC_PHYS +437 drivers/misc/fastrpc.c

427
428 static void fastrpc_buf_free(struct fastrpc_buf *buf)
429 {
430 struct fastrpc_user *fl = buf->fl;
431
432 if (!fl)
433 return;
434 mutex_lock(&fl->sctx->mutex);
435 if (fl->sctx->dev) {
436 dma_free_coherent(buf->dev, buf->size, buf->virt,
> 437 FASTRPC_PHYS(buf->phys));
438 kfree(buf);
439 }
440 mutex_unlock(&fl->sctx->mutex);
441 }
442

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