Skip to contentSkip to conversation

seccomp: change configure to avoid arm 32 to break

PATCH In review Eduardo Otubo 3 participants 7 messages Nov 5, 2014 – Nov 6, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 seccomp: change configure to avoid arm 32 to break

Right now seccomp is breaking the compilation of Qemu on armv7l due to libsecomp current lack of support for this arch. This problem is already fixed on libseccomp upstream but no release date for that is scheduled to far. This patch disables support for seccomp on armv7l temporarily until libseccomp does a new release. Then I'll remove the hack and update libseccomp dependency on configure script.

Related bug: https://bugs.launchpad.net/qemu/+bug/1363641

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index 2f17bf3..2ec04b0 100755
@@ -1822,7 +1822,7 @@ fi
 ##########################################
 # libseccomp check
 
-if test "$seccomp" != "no" ; then
+if test "$seccomp" != "no" && test "$cpu" != "arm" ; then
     if $pkg_config --atleast-version=2.1.0 libseccomp; then
         libs_softmmu="$libs_softmmu `$pkg_config --libs libseccomp`"
         QEMU_CFLAGS="$QEMU_CFLAGS `$pkg_config --cflags libseccomp`"
Signature · 1 line
1.9.1
#1 lore raw
Quoted 19 lines · Eduardo Otubo

Right now seccomp is breaking the compilation of Qemu on armv7l due to libsecomp current lack of support for this arch. This problem is already fixed on libseccomp upstream but no release date for that is scheduled to far. This patch disables support for seccomp on armv7l temporarily until libseccomp does a new release. Then I'll remove the hack and update libseccomp dependency on configure script.

Related bug: https://bugs.launchpad.net/qemu/+bug/1363641

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +0 -0
index 2f17bf3..2ec04b0 100755

configure fi · line 1828

Quoted 8 lines
configure +1 -1
@@ -1822,7 +1822,7 @@ fi
 ##########################################
 # libseccomp check
 
-if test "$seccomp" != "no" ; then
+if test "$seccomp" != "no" && test "$cpu" != "arm" ; then
     if $pkg_config --atleast-version=2.1.0 libseccomp; then
         libs_softmmu="$libs_softmmu `$pkg_config --libs libseccomp`"
         QEMU_CFLAGS="$QEMU_CFLAGS `$pkg_config --cflags libseccomp`"

Do we really support all the other CPU architectures, or would we be better off with a whitelist like:

if test "$cpu" = i386 || test "$cpu" = x86_64; then

?

It seems to me like you'll have exactly the same problem with any other architecture that happens not to implement a syscall in your list.

(How are upstream proposing to fix this anyway? I couldn't figure that out from the mailing list thread.)

thanks
-- PMM

#2 lore raw
Quoted 9 lines · Peter Maydell
Quoted 8 lines · Eduardo Otubo

Right now seccomp is breaking the compilation of Qemu on armv7l due to libsecomp current lack of support for this arch. This problem is already fixed on libseccomp upstream but no release date for that is scheduled to far. This patch disables support for seccomp on armv7l temporarily until libseccomp does a new release. Then I'll remove the hack and update libseccomp dependency on configure script.

Related bug: https://bugs.launchpad.net/qemu/+bug/1363641

...

Quoted 2 lines

(How are upstream proposing to fix this anyway? I couldn't figure that out from the mailing list thread.)

The problem was that the released version of libseccomp has some "holes" in the internal syscall table for 32-bit ARM with respect to all of the other supported architectures. The current libseccomp upstream has some additional tooling and checks to ensure that the different ABI syscall tables are kept in sync to prevent something like this from happening in the future.

I'm more than happy to discuss how libseccomp handles the different architectures, but that's probably a bit off-topic for this thread.

Signature · 2 lines
paul moore
security and virtualization @ redhat
#3 lore raw
Quoted 13 lines · Paul Moore
Quoted 9 lines · Peter Maydell
Quoted 8 lines · Eduardo Otubo

Right now seccomp is breaking the compilation of Qemu on armv7l due to libsecomp current lack of support for this arch. This problem is already fixed on libseccomp upstream but no release date for that is scheduled to far. This patch disables support for seccomp on armv7l temporarily until libseccomp does a new release. Then I'll remove the hack and update libseccomp dependency on configure script.

Related bug: https://bugs.launchpad.net/qemu/+bug/1363641

...

Quoted 8 lines
Quoted 2 lines

(How are upstream proposing to fix this anyway? I couldn't figure that out from the mailing list thread.)

The problem was that the released version of libseccomp has some "holes" in the internal syscall table for 32-bit ARM with respect to all of the other supported architectures. The current libseccomp upstream has some additional tooling and checks to ensure that the different ABI syscall tables are kept in sync to prevent something like this from happening in the future.

OK. So should we make QEMU say "if x86_64 or i386, require seccomp 2.1 or better, else require 2.2 or better" ? If our current source will build with seccomp 2.2 then that seems like a better check to put in our configure script than a simple disabling of the functionality on ARM hosts; it means that if distros end up with QEMU 2.2 plus seccomp 2.2 the functionality won't be unnecessarily disabled. (Please correct me if I have your next-release numbering wrong!)

Quoted 2 lines

I'm more than happy to discuss how libseccomp handles the different architectures, but that's probably a bit off-topic for this thread.

I guess the only thing that matters for us is that there wasn't an API break required for the fix.

thanks
-- PMM

#4 lore raw
Quoted 25 lines · Peter Maydell
Quoted 16 lines · Paul Moore
Quoted 9 lines · Peter Maydell
Quoted 8 lines · Eduardo Otubo

Right now seccomp is breaking the compilation of Qemu on armv7l due to libsecomp current lack of support for this arch. This problem is already fixed on libseccomp upstream but no release date for that is scheduled to far. This patch disables support for seccomp on armv7l temporarily until libseccomp does a new release. Then I'll remove the hack and update libseccomp dependency on configure script.

Related bug: https://bugs.launchpad.net/qemu/+bug/1363641

...

Quoted 2 lines

(How are upstream proposing to fix this anyway? I couldn't figure that out from the mailing list thread.)

Quoted 7 lines

The problem was that the released version of libseccomp has some "holes" in
the internal syscall table for 32-bit ARM with respect to all of the other supported architectures. The current libseccomp upstream has some additional tooling and checks to ensure that the different ABI syscall tables are kept in sync to prevent something like this from happening in the future.

Quoted 2 lines

OK. So should we make QEMU say "if x86_64 or i386, require seccomp 2.1 or better, else require 2.2 or better"?

I would probably just limit QEMU/seccomp to x86_64 and x86. Once we have the new release that fixes everything we can start worrying about versions and different ABIs.

Quoted 6 lines

If our current source will build with seccomp 2.2 then that seems like a better check to put in our configure script than a simple disabling of the functionality on ARM hosts; it means that if distros end up with QEMU 2.2 plus seccomp 2.2 the functionality won't be unnecessarily disabled. (Please correct me if I have your next-release numbering wrong!)

Well, technically we don't have libseccomp v2.2 yet so I can't say for certain what it will look like and how it will behave.

Quoted 5 lines
Quoted 2 lines

I'm more than happy to discuss how libseccomp handles the different architectures, but that's probably a bit off-topic for this thread.

I guess the only thing that matters for us is that there wasn't an API break required for the fix.

Nope, the API is solid, just some internal fixes.

Signature · 2 lines
paul moore
security and virtualization @ redhat
#5 lore raw
Quoted 26 lines · Paul Moore
Quoted 25 lines · Peter Maydell
Quoted 23 lines · Paul Moore
Quoted 9 lines · Peter Maydell
Quoted 8 lines · Eduardo Otubo

Right now seccomp is breaking the compilation of Qemu on armv7l due to libsecomp current lack of support for this arch. This problem is already fixed on libseccomp upstream but no release date for that is scheduled to far. This patch disables support for seccomp on armv7l temporarily until libseccomp does a new release. Then I'll remove the hack and update libseccomp dependency on configure script.

Related bug: https://bugs.launchpad.net/qemu/+bug/1363641

...

Quoted 2 lines

(How are upstream proposing to fix this anyway? I couldn't figure that out from the mailing list thread.)

The problem was that the released version of libseccomp has some "holes" in
the internal syscall table for 32-bit ARM with respect to all of the other supported architectures. The current libseccomp upstream has some additional tooling and checks to ensure that the different ABI syscall tables are kept in sync to prevent something like this from happening in the future.

Quoted 2 lines
Quoted 2 lines

OK. So should we make QEMU say "if x86_64 or i386, require seccomp 2.1 or better, else require 2.2 or better"?

I don't think it's worth to point to a non existing version right now, it might confuse people.

Quoted 4 lines

I would probably just limit QEMU/seccomp to x86_64 and x86. Once we have the new release that fixes everything we can start worrying about versions and different ABIs.

That's fine for me, since is a temporary fix. I'll just go and rewrite this patch, then.

Paul, do you have any plans for a new libseccomp release?

Regards,

Signature · 2 lines
Eduardo Otubo
ProfitBricks GmbH
#6 lore raw
Quoted 1 line · Eduardo Otubo

Paul, do you have any plans for a new libseccomp release?

Yes, I have plans. Do I have a date, no. ;)

I was trying to sync up with support for a new ABI, but I believe that was pushed to v3.19. I'll need to check on things, but it may be worth doing a new release in the meantime.

Signature · 2 lines
paul moore
security and virtualization @ redhat