Re: [PATCH] Sanitize set_task_ioprio() permission checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Chen,

kernel test robot noticed the following build errors:

[auto build test ERROR on axboe-block/for-next]
[also build test ERROR on linus/master v6.17-rc4 next-20250904]
[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/Chen-Yufeng/Sanitize-set_task_ioprio-permission-checks/20250904-112027
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
patch link:    https://lore.kernel.org/r/20250904031312.887-1-chenyufeng%40iie.ac.cn
patch subject: [PATCH] Sanitize set_task_ioprio() permission checks
config: x86_64-allnoconfig (https://download.01.org/0day-ci/archive/20250905/202509050122.1DzOHKji-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250905/202509050122.1DzOHKji-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/202509050122.1DzOHKji-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> block/blk-ioc.c:249:7: error: call to undeclared function 'ptrace_may_access'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     249 |         if (!ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS)) {
         |              ^
>> block/blk-ioc.c:249:31: error: use of undeclared identifier 'PTRACE_MODE_READ_REALCREDS'
     249 |         if (!ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS)) {
         |                                      ^
   2 errors generated.


vim +/ptrace_may_access +249 block/blk-ioc.c

   243	
   244	int set_task_ioprio(struct task_struct *task, int ioprio)
   245	{
   246		int err;
   247	
   248		rcu_read_lock();
 > 249		if (!ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS)) {
   250			rcu_read_unlock();
   251			return -EPERM;
   252		}
   253		rcu_read_unlock();
   254	
   255		err = security_task_setioprio(task, ioprio);
   256		if (err)
   257			return err;
   258	
   259		task_lock(task);
   260		if (unlikely(!task->io_context)) {
   261			struct io_context *ioc;
   262	
   263			task_unlock(task);
   264	
   265			ioc = alloc_io_context(GFP_ATOMIC, NUMA_NO_NODE);
   266			if (!ioc)
   267				return -ENOMEM;
   268	
   269			task_lock(task);
   270			if (task->flags & PF_EXITING) {
   271				kmem_cache_free(iocontext_cachep, ioc);
   272				goto out;
   273			}
   274			if (task->io_context)
   275				kmem_cache_free(iocontext_cachep, ioc);
   276			else
   277				task->io_context = ioc;
   278		}
   279		task->io_context->ioprio = ioprio;
   280	out:
   281		task_unlock(task);
   282		return 0;
   283	}
   284	EXPORT_SYMBOL_GPL(set_task_ioprio);
   285	

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




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux