Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Regarding the Linux kernel adaptation of Guest OS on S2E platform.

68 views
Skip to first unread message

Jay Ironman

unread,
Jul 28, 2024, 9:38:25 AM7/28/24
to S2E Developer Forum
Hello, I have conducted a series of experiments on Linux 4.9.3, and the following are the experimental results:

1. Compile the Linux 4.9.3 kernel of the old S2E platform (last year's version, Linux 6.8.2 and Ubuntu 24.04 have not been updated yet) and install it in Ubuntu 22.04.2/Ubuntu 22.04.3/Ubuntu 22.04.4. It can be installed normally, but when starting the Linux 4.9.3 kernel, an error message appears: [end kernel panic - not syncing: VFS: Unable to mount root fs on unknown block (0,0)], similar to the following figure:
1.png

2. Compile the new version of S2E platform (this year's version, updated Linux 6.8.2 and Ubuntu 24.04) with Linux 4.9.3 kernel (the corresponding code has been modified according to your prompts) and install it in Ubuntu 22.04.2/Ubuntu 22.04.3/Ubuntu 22.04.4. It can be installed normally, but when the Linux 4.9.3 kernel is started, QEMU crashes directly, and the terminal prints an unseen message: qemu-system-x86_64: terminating on signal 15 from pid 66121 (~/s2e/install/bin/qemu-system-x86_64). I checked the process with pid 66121, but there is no information, similar to the following figure:
2.png

Based on the experimental results above, I have two questions:

1. Has the S2E platform completely stopped supporting the Linux 4.9.3 kernel?

2. How to replace the Guest OS kernel on the S2E platform? Is there any unified method?

Thank you very much for taking the time to review my question amidst your busy schedule. If I could receive your response, I would be extremely grateful.

Vitaly Chipounov

unread,
Jul 28, 2024, 4:12:20 PM7/28/24
to s2e...@googlegroups.com
Hi,

I don't know how you built the kernel, so I can't really help here. The only supported method is through s2e image_build using the official kernel config. Judging from the screenshot, the kernel can't find the root file system. Probably the file system driver is not compiled properly. Please provide *all* commands that you run and everything you changed in the stock repo.

Regarding the terminating on signal 15 error, it appears that you ran S2E directly. Anything could have gone wrong. I only support launching it through launch-s2e.sh or through s2e image_build.

Regarding how to add support for new kernels, please go through the commit history in the guest-images and s2e-linux-kernel repos. You will have a concrete example on how I upgraded the kernel from v4 to v6.

In general, S2E can run any x86 OS. You just need to make some effort to update the tooling to create the guest image automatically.

Vitaly

On Sun, Jul 28, 2024 at 3:36 PM Jay Ironman <ironman...@gmail.com> wrote:
Hello, I have conducted a series of experiments on Linux 4.9.3, and the following are the experimental results:

1. Compile the Linux 4.9.3 kernel of the old S2E platform (last year's version, Linux 6.8.2 and Ubuntu 24.04 have not been updated yet) and install it in Ubuntu 22.04.2/Ubuntu 22.04.3/Ubuntu 22.04.4. It can be installed normally, but when starting the Linux 4.9.3 kernel, an error message appears: [end kernel panic - not syncing: VFS: Unable to mount root fs on unknown block (0,0)], similar to the following figure:
1.png

2. Compile the new version of S2E platform (this year's version, updated Linux 6.8.2 and Ubuntu 24.04) with Linux 4.9.3 kernel (the corresponding code has been modified according to your prompts) and install it in Ubuntu 22.04.2/Ubuntu 22.04.3/Ubuntu 22.04.4. It can be installed normally, but when the Linux 4.9.3 kernel is started, QEMU crashes directly, and the terminal prints an unseen message: qemu-system-x86_64: terminating on signal 15 from pid 66121 (~/s2e/install/bin/qemu-system-x86_64). I checked the process with pid 66121, but there is no information, similar to the following figure:
2.png

Based on the experimental results above, I have two questions:
Has the S2E platform completely stopped supporting the Linux 4.9.3 kernel?

2. How to replace the Guest OS kernel on the S2E platform? Is there any unified method?

Thank you very much for taking the time to review my question amidst your busy schedule. If I could receive your response, I would be extremely grateful.

--
You received this message because you are subscribed to the Google Groups "S2E Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to s2e-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/s2e-dev/6f0b877b-0b91-4078-9a42-697d8da49932n%40googlegroups.com.

Jay Ironman

unread,
Jul 28, 2024, 11:00:21 PM7/28/24
to S2E Developer Forum
Hello, I think there is no problem with my compilation environment. Below, I will show you my entire operation process:
1. Edit the file '~/s2e/source/guest images/Makefile. Linux' and set 'LINUX-VERSION' to 4.9.3
2. Modify the 'include/s2e/s2e. h' file according to the steps in [1], only adding and removing header files
3. Execute the ` s2e image-build ubuntu-22.04-x86_64 ` command to build the Guest OS
4. When the above command is executed until the last snapshot is started, QEMU will be directly killed
Snipaste_2024-07-29_10-58-30.png

Because I haven't encountered this issue before, and the Linux 6.8.2 kernel hasn't encountered this problem either, so I really don't know why.

Vitaly Chipounov

unread,
Jul 29, 2024, 2:49:06 AM7/29/24
to s2e...@googlegroups.com
Hi,

Could you check logs and screenshots in the image build folder?
Alternatively, you could check out the guest-image and s2e-linux-kernel revision just before the upgrade.
You would also need to clean the images folder, including images/.tmp-output.

Vitaly

Jay Ironman

unread,
Jul 29, 2024, 2:57:34 AM7/29/24
to S2E Developer Forum
1. "serial. txt" and "serial.ready. txt" have no output and the file content is empty

2. What do you mean by 'guest image and s2e Linux kernel revision'? I don't quite understand

3. 'images/. tpp output.' must have been cleaned up, and all files that may have an impact should be cleaned up before each build

4. By the way, I used ` -- gui ` to build the Guest OS, so I can clearly see the entire construction process. I can responsibly say that after installing and compiling the Linux 4.9.3 kernel, the situation shown in the picture above will occur.

I personally think it's a kernel issue, but I can't pinpoint where the problem lies? Can you provide some ideas? Or could you please build a Guest OS for Linux 4.9.3?

Vitaly Chipounov

unread,
Jul 29, 2024, 3:30:36 AM7/29/24
to s2e...@googlegroups.com
Hi,

Please try the following, which should bring back S2E to the state it was when Linux 4.9.3 was supported.
$ cd $ENV/source/guest-images
$ git checkout 2eba2ba2a3fe1d5dab21984195f104b3af52763e
$ cd $ENV/source/s2e-linux-kernel
$ git checkout 81dcf04137d1ff68989d7823dc0689751affe3cd
$ cd $ENV/source/s2e
$ get checkout 3063162e19d85dab969e2f9d98cc2916b9a888f4

In general, I don't support anything other than master because I don't have time and resources for that.
In particular, I will not build the old images for you.

Vitaly

Jay Ironman

unread,
Jul 29, 2024, 4:00:18 AM7/29/24
to S2E Developer Forum
Thank you very much, I will give it a try now.
Thank you very much for replying to my question and helping me solve it. By the way, can I simply replace the kernel according to the content in [1]?

[1]  https://github.com/S2E/s2e-linux-kernel/commit/3f91b1d8d70adadd5e8070703b0b7d0797c603fe#diff -a694b8697bb9939882231cb2f899bee316462dd43c5744176d51120c1bf39146L39

Jay Ironman

unread,
Jul 29, 2024, 5:17:16 AM7/29/24
to S2E Developer Forum
The rollback version is fine and can be built normally. Thank you for providing the information. Below, I will compare different versions of the code to consider why the latest version of the code causes the problem in the image above.

Jay Ironman

unread,
Jul 29, 2024, 10:46:07 AM7/29/24
to S2E Developer Forum
I compared the S2E code of different branch versions (supporting Linux 4.9.3 version and the latest code), namely:
1. $ENV/source/guest-images
2. $ENV/source/s2e-linux-kernel
3. $ENV/source/s2e
But due to the large number of modified code files and my lack of experience in replacing the S2E Linux kernel, I don't know where to focus at the moment. Can you help me specify a direction? Because I really want to figure out why the latest version of S2E code does not support Linux 4.9.3.

Jay Ironman

unread,
Jul 29, 2024, 10:53:17 AM7/29/24
to S2E Developer Forum
But I have two doubts:
1. Doubt point: It is an issue with the kernel compilation environment in the Dockerfile.x86_64 file, with one version being higher and the other being lower. Reason for suspicion: Higher version compilation environments print a lot of warning messages when compiling the kernel, while lower version compilation environments do not print any warning messages.
2. Doubt point: System tap version issue. Reason for Doubt: It's purely intuitive and lacks substantial evidence.

Jay Ironman

unread,
Jul 30, 2024, 9:46:10 AM7/30/24
to S2E Developer Forum
After testing, it was found that the Linux 4.9.3 kernel compiled after changing the compilation environment of the Linux kernel can be used normally.
Reply all
Reply to author
Forward
0 new messages