-
Notifications
You must be signed in to change notification settings - Fork 1.3k
sys/linux/test: add landlock_fs_disconnected #6164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This test triggers the |
Different parameters, probably? Do you set exactly the same |
I guess you mean I removed syscall filtering and don't have any |
Yes, I meant If these are similar to what One more way to spot the difference(s) would be to run both tools with the Also, did you use the runtest mode of |
I didn't know about this run-tests mode, that helped, thanks. I now see that syz-manager skips this test because of However, this highlight an inconsistency between syz-manager and syz-execprog. Could that be a default syscall filter? Shouldn't syz-manager replace renameat with renameat2 instead of ignoring all tests with renameat? |
This test triggers a WARN_ON_ONCE() in current kernel code, but I'm working on a fix that should be merged in a few weeks. In fact, I wrote this test after we found the issue, in the hope that this will improve fuzzing coverage. When this test will be merged in syzkaller, will syzbot report this WARN_ON_ONCE() issue? If that's the case, I guess we should wait for the fix to be merged first to avoid creating artificial syzbot report, right? |
Happy to hear that you have found the problem! Is syzkaller/sys/linux/sys.txt.const Line 781 in 4f67c4a
Apparently, it still worked when Overall, I think it's probably okay that syzkaller/tools/syz-execprog/execprog.go Line 213 in 4f67c4a
In the fuzzing mode, syz-manager cuts all calls that are not in the list of the enabled ones. So, without the syzkaller/pkg/manager/seeds.go Lines 304 to 315 in 4f67c4a
|
If syz-manager can now trigger the issue locally, it should definitely be able to trigger it on syzbot as well. If you now also observe the crash during corpus triage each syzkaller restart, waiting a bit until the fix patch has reaches the kernel is probably a good idea. |
Yes 🤷 |
I updated the tests to improve coverage with the latest patch series, and it works as expected when I run it with However, running it with
The
|
Test access through disconnected directory. This test should trigger a warning without this patch: https://lore.kernel.org/all/[email protected]/ An ongoing kernel patch series will be applied to change handling of disconnected directories: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Mickaël Salaün <[email protected]>
I get the same error when I run
The umount is coming from this common code in syz-executor: syzkaller/executor/common_linux.h Lines 4587 to 4592 in af30dea
Specifically, from this line, I think syzkaller/executor/common_linux.h Lines 4677 to 4678 in af30dea
Given that it's called right between executing the program and reporting the result, there's a chance that the umount failure is indeed breaking the test. syzkaller/executor/executor_runner.h Lines 794 to 801 in af30dea
Still, it's weird to see it return errno 22. Apparently, in this case, from unlink's |
Unsharing the mount namespace in the test avoids this error, but the test is still not used by syz-manager, or at least it doesn't show in the coverage. 🤔 |
Unsharing the mount namespace in the test itself is unfortunately not the most sustainable approach here - You have likely created such a situation with these mounts that our existing executor code is just unable to properly handle it :)
You could run Did you see new coverage when you ran the test with |
Yes, it works. I tested with a |
Yes, it won't list the tests directly, but it does list everything it has executed (alongside with debug info), and you test must have been somewhere in that big output.
Could you please point to the kernel code that must have become covered, but didn't? |
Regarding the So, your test
We then fail both to delete There's no mount record for
|
You'll find the kernel source I'm using, with the addition of the |
I have built Linux from https://github.com/l0kod/linux/commits/landlock-syzkaller-debug-disco/ (using this config) and syzkaller from https://github.com/l0kod/syzkaller/tree/disconnected at c355bf8 and I get tons of crashes at
Same for 19973b5. |
Test access through disconnected directory.
This test should trigger a warning without this patch: https://lore.kernel.org/all/[email protected]/
An ongoing kernel patch series will be applied to change handling of disconnected directories:
https://lore.kernel.org/all/[email protected]/