* Re: [PATCH] loop: reject binding to procfs and sysfs files
[not found] <148efba2-a0b6-47d7-ac76-b19d2f4b696c@I-love.SAKURA.ne.jp>
@ 2026-05-30 19:48 ` kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-05-30 19:48 UTC (permalink / raw)
To: Tetsuo Handa, Jens Axboe, linux-block, LKML
Cc: llvm, oe-kbuild-all, Bart Van Assche, Andrew Morton,
Linux Memory Management List, Ming Lei, Damien Le Moal,
Christoph Hellwig, Qu Wenruo, Hillf Danton
Hi Tetsuo,
kernel test robot noticed the following build errors:
[auto build test ERROR on axboe/for-next]
[also build test ERROR on linus/master v7.1-rc5 next-20260529]
[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/Tetsuo-Handa/loop-reject-binding-to-procfs-and-sysfs-files/20260530-214900
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git for-next
patch link: https://lore.kernel.org/r/148efba2-a0b6-47d7-ac76-b19d2f4b696c%40I-love.SAKURA.ne.jp
patch subject: [PATCH] loop: reject binding to procfs and sysfs files
config: um-x86_64_defconfig (https://download.01.org/0day-ci/archive/20260531/202605310318.dbidMe6W-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 9409c07de6378507397ecdb6f05f628f58110112)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260531/202605310318.dbidMe6W-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605310318.dbidMe6W-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/block/loop.c:504:7: error: use of undeclared identifier 'PROC_SUPER_MAGIC'
504 | case PROC_SUPER_MAGIC: /* e.g. "losetup -f /proc/sys/kernel/version" */
| ^~~~~~~~~~~~~~~~
>> drivers/block/loop.c:505:7: error: use of undeclared identifier 'SYSFS_MAGIC'
505 | case SYSFS_MAGIC: /* e.g. "losetup -f /sys/power/state" */
| ^~~~~~~~~~~
2 errors generated.
vim +/PROC_SUPER_MAGIC +504 drivers/block/loop.c
478
479 static int loop_validate_file(struct file *file, struct block_device *bdev)
480 {
481 struct inode *inode = file->f_mapping->host;
482 struct file *f = file;
483
484 /* Avoid recursion */
485 while (is_loop_device(f)) {
486 struct loop_device *l;
487
488 lockdep_assert_held(&loop_validate_mutex);
489 if (f->f_mapping->host->i_rdev == bdev->bd_dev)
490 return -EBADF;
491
492 l = I_BDEV(f->f_mapping->host)->bd_disk->private_data;
493 if (l->lo_state != Lo_bound)
494 return -EINVAL;
495 /* Order wrt setting lo->lo_backing_file in loop_configure(). */
496 rmb();
497 f = l->lo_backing_file;
498 }
499 if (S_ISBLK(inode->i_mode))
500 return 0;
501 if (!S_ISREG(inode->i_mode))
502 return -EINVAL;
503 switch (inode->i_sb->s_magic) {
> 504 case PROC_SUPER_MAGIC: /* e.g. "losetup -f /proc/sys/kernel/version" */
> 505 case SYSFS_MAGIC: /* e.g. "losetup -f /sys/power/state" */
506 return -EINVAL;
507 }
508 return 0;
509 }
510
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-30 19:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <148efba2-a0b6-47d7-ac76-b19d2f4b696c@I-love.SAKURA.ne.jp>
2026-05-30 19:48 ` [PATCH] loop: reject binding to procfs and sysfs files kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox