lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 13 Jun 2024 21:10:37 +0000
From: Gulam Mohamed <gulam.mohamed@...cle.com>
To: kernel test robot <oliver.sang@...el.com>
CC: "oe-lkp@...ts.linux.dev" <oe-lkp@...ts.linux.dev>,
        "lkp@...el.com"
	<lkp@...el.com>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "ltp@...ts.linux.it" <ltp@...ts.linux.it>,
        "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>,
        "yukuai1@...weicloud.com"
	<yukuai1@...weicloud.com>,
        "hch@....de" <hch@....de>, "axboe@...nel.dk"
	<axboe@...nel.dk>
Subject: RE: [PATCH V4 for-6.10/block] loop: Fix a race between loop detach
 and loop open

Hi,

> -----Original Message-----
> From: kernel test robot <oliver.sang@...el.com>
> Sent: Tuesday, June 11, 2024 8:28 PM
> To: Gulam Mohamed <gulam.mohamed@...cle.com>
> Cc: oe-lkp@...ts.linux.dev; lkp@...el.com; linux-block@...r.kernel.org;
> ltp@...ts.linux.it; linux-kernel@...r.kernel.org; yukuai1@...weicloud.com;
> hch@....de; axboe@...nel.dk; oliver.sang@...el.com
> Subject: Re: [PATCH V4 for-6.10/block] loop: Fix a race between loop detach
> and loop open
> 
> 
> 
> Hello,
> 
> kernel test robot noticed "ltp.ioctl09.fail" on:
> 
> commit: 02ab74c165fb204557fe6cde80eda0633fbc4412 ("[PATCH V4 for-
> 6.10/block] loop: Fix a race between loop detach and loop open")
> url: https://urldefense.com/v3/__https://github.com/intel-lab-
> lkp/linux/commits/Gulam-Mohamed/loop-Fix-a-race-between-loop-detach-
> and-loop-open/20240608-
> 031123__;!!ACWV5N9M2RV99hQ!Niww5tWxpW_rqqBaG_-
> w8CbDvJjcC6AwSb4gYZL3tS7fUrBcYesefSCbVL8GrWLJ0R8W_jyMsgUDi0HVVA
> _7Fk4$
> base:
> https://urldefense.com/v3/__https://git.kernel.org/cgit/linux/kernel/git/axboe
> /linux-block.git__;!!ACWV5N9M2RV99hQ!Niww5tWxpW_rqqBaG_-
> w8CbDvJjcC6AwSb4gYZL3tS7fUrBcYesefSCbVL8GrWLJ0R8W_jyMsgUDi0HVSM
> 8EomQ$  for-next patch link:
> https://urldefense.com/v3/__https://lore.kernel.org/all/20240607190607.177
> 05-1-
> gulam.mohamed@...cle.com/__;!!ACWV5N9M2RV99hQ!Niww5tWxpW_rqq
> BaG_-
> w8CbDvJjcC6AwSb4gYZL3tS7fUrBcYesefSCbVL8GrWLJ0R8W_jyMsgUDi0HVEcY
> Yz3s$
> patch subject: [PATCH V4 for-6.10/block] loop: Fix a race between loop detach
> and loop open
> 
> in testcase: ltp
> version: ltp-x86_64-14c1f76-1_20240608
> with following parameters:
> 
> 	disk: 1HDD
> 	fs: ext4
> 	test: syscalls-03/ioctl09
> 
> 
> 
> compiler: gcc-13
> test machine: 4 threads 1 sockets Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz
> (Ivy Bridge) with 8G memory
> 
> (please refer to attached dmesg/kmsg for entire log/backtrace)
> 
> 
> 
> 
> 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 <oliver.sang@...el.com>
> | Closes:
> | https://urldefense.com/v3/__https://lore.kernel.org/oe-lkp/20240611213
> | 0.a572f72-
> oliver.sang@...el.com__;!!ACWV5N9M2RV99hQ!Niww5tWxpW_rqqBaG_
> | -
> w8CbDvJjcC6AwSb4gYZL3tS7fUrBcYesefSCbVL8GrWLJ0R8W_jyMsgUDi0HVDgL
> 6MVc$
> 
> 
> Running tests.......
> <<<test_start>>>
> tag=ioctl09 stime=1717978971
> cmdline="ioctl09"
> contacts=""
> analysis=exit
> <<<test_output>>>
> tst_test.c:1734: TINFO: LTP version: 20240524-32-ge2c52c5bb
> tst_test.c:1618: TINFO: Timeout per run is 0h 02m 30s
> tst_device.c:96: TINFO: Found free device 0 '/dev/loop0'
> ioctl09.c:48: TPASS: access /sys/block/loop0/loop0p1 succeeds
> ioctl09.c:56: TPASS: access /dev/loop0p1 succeeds
> ioctl09.c:51: TPASS: access /sys/block/loop0/loop0p2 fails
> ioctl09.c:59: TPASS: access /dev/loop0p2 fails
> ioctl09.c:48: TPASS: access /sys/block/loop0/loop0p1 succeeds
> ioctl09.c:56: TPASS: access /dev/loop0p1 succeeds
> ioctl09.c:48: TPASS: access /sys/block/loop0/loop0p2 succeeds
> ioctl09.c:56: TPASS: access /dev/loop0p2 succeeds
> tst_device.c:263: TWARN: ioctl(/dev/loop0, LOOP_CLR_FD, 0) no ENXIO for
> too long
> 
> Summary:
> passed   8
> failed   0
> broken   0
> skipped  0
> warnings 1
> incrementing stop
> <<<execution_status>>>
> initiation_status="ok"
> duration=3 termination_type=exited termination_id=4 corefile=no
> cutime=3 cstime=42
> <<<test_end>>>
> INFO: ltp-pan reported some tests FAIL
> LTP Version: 20240524-32-ge2c52c5bb
> 
> 
> ###############################################################
> 
>             Done executing testcases.
>             LTP Version:  20240524-32-ge2c52c5bb
> 
> ###############################################################
> 
> 
> 
> 
> The kernel config and materials to reproduce are available at:
> https://urldefense.com/v3/__https://download.01.org/0day-
> ci/archive/20240611/202406112130.a572f72-
> oliver.sang@...el.com__;!!ACWV5N9M2RV99hQ!Niww5tWxpW_rqqBaG_-
> w8CbDvJjcC6AwSb4gYZL3tS7fUrBcYesefSCbVL8GrWLJ0R8W_jyMsgUDi0HVsf4L
> rkk$
> 
> 
> 
> --
> 0-DAY CI Kernel Test Service
> https://urldefense.com/v3/__https://github.com/intel/lkp-
> tests/wiki__;!!ACWV5N9M2RV99hQ!Niww5tWxpW_rqqBaG_-
> w8CbDvJjcC6AwSb4gYZL3tS7fUrBcYesefSCbVL8GrWLJ0R8W_jyMsgUDi0HVQRs
> yTxc$

I looked at the LTP test case failure and also the function tst_detach_device_by_fd() which failed. Our kernel patch will defer all the attempts to detach a loop device to the last close, to fix an issue.
The tst_detach_device_by_fd() in LTP test case will open the loop device and repeatedly checks for error code ENXIO. As the new approach, as I mentioned above, will defer the detach to last close and the last close happens *only* when the LTP test function tst_detach_device_by_fd() returns, the test will obviously fail. So, Can you please modify the LTP test case to accommodate the new behaviour of kernel code for loop detach?
Please let us know your comments.

Regards,
Gulam Mohamed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ