qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/2] Libslirp patches
@ 2021-05-29 18:55 marcandre.lureau
  2021-05-29 18:55 ` [PULL 1/2] Update libslirp to v4.5.0 marcandre.lureau
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: marcandre.lureau @ 2021-05-29 18:55 UTC (permalink / raw)
  To: peter.maydell, qemu-devel; +Cc: samuel.thibault, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The following changes since commit 62c0ac5041e9130b041adfa13a41583d3c3ddd24:

  Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210526' into staging (2021-05-28 16:25:21 +0100)

are available in the Git repository at:

  git@github.com:elmarco/qemu.git tags/libslirp-pull-request

for you to fetch changes up to b060428091c758781acc4d42849accc036d3c816:

  build-sys: make libslirp a meson subproject (2021-05-29 22:52:37 +0400)

----------------------------------------------------------------
Update libslirp & make it a subproject

----------------------------------------------------------------

Marc-André Lureau (2):
  Update libslirp to v4.5.0
  build-sys: make libslirp a meson subproject

 configure            |  2 +-
 meson.build          | 63 +++-----------------------------------------
 .gitmodules          |  4 +--
 slirp                |  1 -
 subprojects/libslirp |  1 +
 5 files changed, 8 insertions(+), 63 deletions(-)
 delete mode 160000 slirp
 create mode 160000 subprojects/libslirp

-- 
2.29.0




^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PULL 1/2] Update libslirp to v4.5.0
  2021-05-29 18:55 [PULL 0/2] Libslirp patches marcandre.lureau
@ 2021-05-29 18:55 ` marcandre.lureau
  2021-06-18 16:01   ` Doug Evans
  2021-05-29 18:55 ` [PULL 2/2] build-sys: make libslirp a meson subproject marcandre.lureau
  2021-06-01  9:10 ` [PULL 0/2] Libslirp patches Peter Maydell
  2 siblings, 1 reply; 17+ messages in thread
From: marcandre.lureau @ 2021-05-29 18:55 UTC (permalink / raw)
  To: peter.maydell, qemu-devel; +Cc: samuel.thibault, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Switch from stable-4.2 branch to upstream v4.5.0 release.

## [4.5.0] - 2021-05-18

### Added

 - IPv6 forwarding. !62 !75 !77
 - slirp_neighbor_info() to dump the ARP/NDP tables. !71

### Changed

 - Lazy guest address resolution for IPv6. !81
 - Improve signal handling when spawning a child. !61
 - Set macOS deployment target to macOS 10.4. !72
 - slirp_add_hostfwd: Ensure all error paths set errno. !80
 - More API documentation.

### Fixed

 - Assertion failure on unspecified IPv6 address. !86
 - Disable polling for PRI on MacOS, fixing some closing streams issues. !73
 - Various memory leak fixes on fastq/batchq. !68
 - Memory leak on IPv6 fast-send. !67
 - Slow socket response on Windows. !64
 - Misc build and code cleanups. !60 !63 !76 !79 !84

## [4.4.0] - 2020-12-02

### Added

 - udp, udp6, icmp: handle TTL value. !48
 - Enable forwarding ICMP errors. !49
 - Add DNS resolving for iOS. !54

### Changed

 - Improve meson subproject() support. !53
 - Removed Makefile-based build system. !56

### Fixed

 - socket: consume empty packets. !55
 - check pkt_len before reading protocol header (CVE-2020-29129). !57
 - ip_stripoptions use memmove (fixes undefined behaviour). !47
 - various Coverity-related changes/fixes.

## [4.3.1] - 2020-07-08

### Changed

 - A silent truncation could occur in `slirp_fmt()`, which will now print a
   critical message. See also #22.

### Fixed

 - CVE-2020-10756 - Drop bogus IPv6 messages that could lead to data leakage.
   See !44 and !42.
 - Fix win32 builds by using the SLIRP_PACKED definition.
 - Various coverity scan errors fixed. !41
 - Fix new GCC warnings. !43

## [4.3.0] - 2020-04-22

### Added

 - `SLIRP_VERSION_STRING` macro, with the git sha suffix when building from git
 - `SlirpConfig.disable_dns`, to disable DNS redirection #16

### Changed

 - `slirp_version_string()` now has the git sha suffix when building form git
 - Limit DNS redirection to port 53 #16

### Fixed

 - Fix build regression with mingw & NetBSD
 - Fix use-afte-free in `ip_reass()` (CVE-2020-1983)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Doug Evans <dje@google.com>
---
 slirp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/slirp b/slirp
index 8f43a99191..a62890e711 160000
--- a/slirp
+++ b/slirp
@@ -1 +1 @@
-Subproject commit 8f43a99191afb47ca3f3c6972f6306209f367ece
+Subproject commit a62890e71126795ca593affa747f669bed88e89c
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PULL 2/2] build-sys: make libslirp a meson subproject
  2021-05-29 18:55 [PULL 0/2] Libslirp patches marcandre.lureau
  2021-05-29 18:55 ` [PULL 1/2] Update libslirp to v4.5.0 marcandre.lureau
@ 2021-05-29 18:55 ` marcandre.lureau
  2021-06-01  9:10 ` [PULL 0/2] Libslirp patches Peter Maydell
  2 siblings, 0 replies; 17+ messages in thread
From: marcandre.lureau @ 2021-05-29 18:55 UTC (permalink / raw)
  To: peter.maydell, qemu-devel; +Cc: samuel.thibault, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Remove the manual build.

Moving projects to subprojects/ is required when using meson
subproject():
https://mesonbuild.com/Subprojects.html#why-must-all-subprojects-be-inside-a-single-directory

Tested-by: Joelle van Dyne <j@getutm.app>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure                     |  2 +-
 meson.build                   | 63 +++--------------------------------
 .gitmodules                   |  4 +--
 slirp => subprojects/libslirp |  0
 4 files changed, 7 insertions(+), 62 deletions(-)
 rename slirp => subprojects/libslirp (100%)

diff --git a/configure b/configure
index 90c0807347..b59ec8bd39 100755
--- a/configure
+++ b/configure
@@ -5279,7 +5279,7 @@ fi
 case "$slirp" in
   auto | enabled | internal)
     # Simpler to always update submodule, even if not needed.
-    git_submodules="${git_submodules} slirp"
+    git_submodules="${git_submodules} subprojects/libslirp"
     ;;
 esac
 
diff --git a/meson.build b/meson.build
index 20d7035e44..3bf0686985 100644
--- a/meson.build
+++ b/meson.build
@@ -1513,7 +1513,7 @@ slirp_opt = 'disabled'
 if have_system
   slirp_opt = get_option('slirp')
   if slirp_opt in ['enabled', 'auto', 'system']
-    have_internal = fs.exists(meson.current_source_dir() / 'slirp/meson.build')
+    have_internal = fs.exists(meson.current_source_dir() / 'subprojects/libslirp/meson.build')
     slirp = dependency('slirp', kwargs: static_kwargs,
                        method: 'pkg-config',
                        required: slirp_opt == 'system' or
@@ -1527,64 +1527,9 @@ if have_system
     endif
   endif
   if slirp_opt == 'internal'
-    slirp_deps = []
-    if targetos == 'windows'
-      slirp_deps = cc.find_library('iphlpapi')
-    endif
-    slirp_conf = configuration_data()
-    slirp_conf.set('SLIRP_MAJOR_VERSION', meson.project_version().split('.')[0])
-    slirp_conf.set('SLIRP_MINOR_VERSION', meson.project_version().split('.')[1])
-    slirp_conf.set('SLIRP_MICRO_VERSION', meson.project_version().split('.')[2])
-    slirp_conf.set_quoted('SLIRP_VERSION_STRING', meson.project_version())
-    slirp_cargs = ['-DG_LOG_DOMAIN="Slirp"']
-    slirp_files = [
-      'slirp/src/arp_table.c',
-      'slirp/src/bootp.c',
-      'slirp/src/cksum.c',
-      'slirp/src/dhcpv6.c',
-      'slirp/src/dnssearch.c',
-      'slirp/src/if.c',
-      'slirp/src/ip6_icmp.c',
-      'slirp/src/ip6_input.c',
-      'slirp/src/ip6_output.c',
-      'slirp/src/ip_icmp.c',
-      'slirp/src/ip_input.c',
-      'slirp/src/ip_output.c',
-      'slirp/src/mbuf.c',
-      'slirp/src/misc.c',
-      'slirp/src/ncsi.c',
-      'slirp/src/ndp_table.c',
-      'slirp/src/sbuf.c',
-      'slirp/src/slirp.c',
-      'slirp/src/socket.c',
-      'slirp/src/state.c',
-      'slirp/src/stream.c',
-      'slirp/src/tcp_input.c',
-      'slirp/src/tcp_output.c',
-      'slirp/src/tcp_subr.c',
-      'slirp/src/tcp_timer.c',
-      'slirp/src/tftp.c',
-      'slirp/src/udp.c',
-      'slirp/src/udp6.c',
-      'slirp/src/util.c',
-      'slirp/src/version.c',
-      'slirp/src/vmstate.c',
-    ]
-
-    configure_file(
-      input : 'slirp/src/libslirp-version.h.in',
-      output : 'libslirp-version.h',
-      configuration: slirp_conf)
-
-    slirp_inc = include_directories('slirp', 'slirp/src')
-    libslirp = static_library('slirp',
-                              build_by_default: false,
-                              sources: slirp_files,
-                              c_args: slirp_cargs,
-                              include_directories: slirp_inc)
-    slirp = declare_dependency(link_with: libslirp,
-                               dependencies: slirp_deps,
-                               include_directories: slirp_inc)
+    libslirp = subproject('libslirp',
+                          default_options: ['default_library=static'])
+    slirp = libslirp.get_variable('libslirp_dep')
   endif
 endif
 
diff --git a/.gitmodules b/.gitmodules
index 08b1b48a09..447bb3a4df 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -49,8 +49,8 @@
 [submodule "roms/edk2"]
 	path = roms/edk2
 	url = https://gitlab.com/qemu-project/edk2.git
-[submodule "slirp"]
-	path = slirp
+[submodule "subprojects/libslirp"]
+	path = subprojects/libslirp
 	url = https://gitlab.com/qemu-project/libslirp.git
 [submodule "roms/opensbi"]
 	path = roms/opensbi
diff --git a/slirp b/subprojects/libslirp
similarity index 100%
rename from slirp
rename to subprojects/libslirp
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PULL 0/2] Libslirp patches
  2021-05-29 18:55 [PULL 0/2] Libslirp patches marcandre.lureau
  2021-05-29 18:55 ` [PULL 1/2] Update libslirp to v4.5.0 marcandre.lureau
  2021-05-29 18:55 ` [PULL 2/2] build-sys: make libslirp a meson subproject marcandre.lureau
@ 2021-06-01  9:10 ` Peter Maydell
  2021-06-01 11:01   ` Marc-André Lureau
  2 siblings, 1 reply; 17+ messages in thread
From: Peter Maydell @ 2021-06-01  9:10 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Samuel Thibault, QEMU Developers

On Sat, 29 May 2021 at 19:55, <marcandre.lureau@redhat.com> wrote:
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> The following changes since commit 62c0ac5041e9130b041adfa13a41583d3c3ddd24:
>
>   Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210526' into staging (2021-05-28 16:25:21 +0100)
>
> are available in the Git repository at:
>
>   git@github.com:elmarco/qemu.git tags/libslirp-pull-request
>
> for you to fetch changes up to b060428091c758781acc4d42849accc036d3c816:
>
>   build-sys: make libslirp a meson subproject (2021-05-29 22:52:37 +0400)
>
> ----------------------------------------------------------------
> Update libslirp & make it a subproject
>
> ----------------------------------------------------------------

All hosts, odd warnings on checkout and running configure:

warning: unable to rmdir 'slirp': Directory not empty
make: Entering directory '/home/pm/qemu/build/all'
config-host.mak is out-of-date, running configure
  GIT     ui/keycodemapdb meson tests/fp/berkeley-testfloat-3
tests/fp/berkeley-softfloat-3 dtc capstone slirp
warn: ignoring non-existent submodule slirp

BSD VMs: error message just before launching the VM (though the VM did
seem to then launch OK):

Found ninja-1.8.2 at /usr/bin/ninja
ninja: no work to do.
(GIT="git" "/home/peter.maydell/qemu-netbsd/scripts/git-submodule.sh"
update ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/be
rkeley-softfloat-3 dtc capstone slirp)
warn: ignoring non-existent submodule slirp
/usr/bin/python3 -B /home/peter.maydell/qemu-netbsd/tests/vm/netbsd
--debug  --jobs 8 --verbose    --image
"/home/peter.maydell/.cache/qemu
-vm/images/netbsd.img"  --snapshot --build-qemu
/home/peter.maydell/qemu-netbsd --
DEBUG:root:Creating archive
/home/peter.maydell/qemu-netbsd/build/vm-test-6kefrq76.tmp/data-f706c.tar
for src_dir dir: /home/peter.maydell/q
emu-netbsd
error: pathspec 'slirp' did not match any file(s) known to git.

clang sanitizer build: link failure:
subprojects/libslirp/libslirp.so.0.3.0.p/src_arp_table.c.o: In
function `arp_table_add':
/home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
undefined reference to `__ubsan_handle_type_mismatch_v1'
/home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
undefined reference to `__ubsan_handle_type_mismatch_v1'
/home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
undefined reference to `__ubsan_handle_type_mismatch_v1'
/home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:34:
undefined reference to `__ubsan_handle_type_mismatch_v1'
/home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:34:
undefined reference to `__ubsan_handle_type_mismatch_v1'
(and lots more similar)

OSX: linker warnings linking libslirp.0.dylib:


[34/1977] Linking target subprojects/libslirp/libslirp.0.dylib
ld: warning: dylib
(/usr/local/Cellar/glib/2.68.0/lib/libgthread-2.0.dylib) was built for
newer macOS version (10.15) than being linked (10.4)
ld: warning: dylib
(/usr/local/Cellar/glib/2.68.0/lib/libglib-2.0.dylib) was built for
newer macOS version (10.15) than being linked (10.4)
ld: warning: dylib (/usr/local/opt/gettext/lib/libintl.dylib) was
built for newer macOS version (10.14) than being linked (10.4)

-- PMM


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PULL 0/2] Libslirp patches
  2021-06-01  9:10 ` [PULL 0/2] Libslirp patches Peter Maydell
@ 2021-06-01 11:01   ` Marc-André Lureau
  2021-06-07 12:16     ` Peter Maydell
  0 siblings, 1 reply; 17+ messages in thread
From: Marc-André Lureau @ 2021-06-01 11:01 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Samuel Thibault, QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 4717 bytes --]

Hi Peter

On Tue, Jun 1, 2021 at 1:17 PM Peter Maydell <peter.maydell@linaro.org>
wrote:

> On Sat, 29 May 2021 at 19:55, <marcandre.lureau@redhat.com> wrote:
> >
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > The following changes since commit
> 62c0ac5041e9130b041adfa13a41583d3c3ddd24:
> >
> >   Merge remote-tracking branch
> 'remotes/rth-gitlab/tags/pull-tcg-20210526' into staging (2021-05-28
> 16:25:21 +0100)
> >
> > are available in the Git repository at:
> >
> >   git@github.com:elmarco/qemu.git tags/libslirp-pull-request
> >
> > for you to fetch changes up to b060428091c758781acc4d42849accc036d3c816:
> >
> >   build-sys: make libslirp a meson subproject (2021-05-29 22:52:37 +0400)
> >
> > ----------------------------------------------------------------
> > Update libslirp & make it a subproject
> >
> > ----------------------------------------------------------------
>
> All hosts, odd warnings on checkout and running configure:
>
> warning: unable to rmdir 'slirp': Directory not empty
>

This one is from git itself. It doesn't clean up old submodule locations,
even though they are actually "clean". git submodule "(re)move" has its
limits I guess.

make: Entering directory '/home/pm/qemu/build/all'
> config-host.mak is out-of-date, running configure
>   GIT     ui/keycodemapdb meson tests/fp/berkeley-testfloat-3
> tests/fp/berkeley-softfloat-3 dtc capstone slirp
> warn: ignoring non-existent submodule slirp
>

 However, I don't get this when simply running make. Maybe you run make in
parallel, and config-host.mak didn't have the time to regenerate with a new
GIT_SUBMODULES.

I wonder if we miss a dependency like "git-submodule-update:
config-host.mak" ?

Running configure before make should also prevent this from happening.


> BSD VMs: error message just before launching the VM (though the VM did
> seem to then launch OK):
>
> Found ninja-1.8.2 at /usr/bin/ninja
> ninja: no work to do.
> (GIT="git" "/home/peter.maydell/qemu-netbsd/scripts/git-submodule.sh"
> update ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/be
> rkeley-softfloat-3 dtc capstone slirp)
> warn: ignoring non-existent submodule slirp
> /usr/bin/python3 -B /home/peter.maydell/qemu-netbsd/tests/vm/netbsd
> --debug  --jobs 8 --verbose    --image
> "/home/peter.maydell/.cache/qemu
> -vm/images/netbsd.img"  --snapshot --build-qemu
> /home/peter.maydell/qemu-netbsd --
> DEBUG:root:Creating archive
> /home/peter.maydell/qemu-netbsd/build/vm-test-6kefrq76.tmp/data-f706c.tar
> for src_dir dir: /home/peter.maydell/q
> emu-netbsd
> error: pathspec 'slirp' did not match any file(s) known to git.
>

> clang sanitizer build: link failure:
> subprojects/libslirp/libslirp.so.0.3.0.p/src_arp_table.c.o: In
> function `arp_table_add':
>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
> undefined reference to `__ubsan_handle_type_mismatch_v1'
>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
> undefined reference to `__ubsan_handle_type_mismatch_v1'
>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
> undefined reference to `__ubsan_handle_type_mismatch_v1'
>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:34:
> undefined reference to `__ubsan_handle_type_mismatch_v1'
>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:34:
> undefined reference to `__ubsan_handle_type_mismatch_v1'
> (and lots more similar)
>
>
I don't get this  when running make vm-build-netbsd. What else am I missing?

>

> OSX: linker warnings linking libslirp.0.dylib:
>
>
> [34/1977] Linking target subprojects/libslirp/libslirp.0.dylib
> ld: warning: dylib
> (/usr/local/Cellar/glib/2.68.0/lib/libgthread-2.0.dylib) was built for
> newer macOS version (10.15) than being linked (10.4)
> ld: warning: dylib
> (/usr/local/Cellar/glib/2.68.0/lib/libglib-2.0.dylib) was built for
> newer macOS version (10.15) than being linked (10.4)
> ld: warning: dylib (/usr/local/opt/gettext/lib/libintl.dylib) was
> built for newer macOS version (10.14) than being linked (10.4)
>
>
This looks related to:
https://gitlab.freedesktop.org/slirp/libslirp/-/commit/410e296a52fb274648f8ecf53561eaab4b33c52c

It could be that we need to use the version information from glib (or from
any libraries used).

It looks safe to ignore although I re-opened:
 https://gitlab.freedesktop.org/slirp/libslirp/-/issues/36#note_940695

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 6672 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PULL 0/2] Libslirp patches
  2021-06-01 11:01   ` Marc-André Lureau
@ 2021-06-07 12:16     ` Peter Maydell
  2021-06-08 15:55       ` Marc-André Lureau
  0 siblings, 1 reply; 17+ messages in thread
From: Peter Maydell @ 2021-06-07 12:16 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Samuel Thibault, QEMU Developers

On Tue, 1 Jun 2021 at 12:01, Marc-André Lureau
<marcandre.lureau@gmail.com> wrote:
>
> Hi Peter
>
> On Tue, Jun 1, 2021 at 1:17 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>>
>> On Sat, 29 May 2021 at 19:55, <marcandre.lureau@redhat.com> wrote:
>> >
>> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
>> >
>> > The following changes since commit 62c0ac5041e9130b041adfa13a41583d3c3ddd24:
>> >
>> >   Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210526' into staging (2021-05-28 16:25:21 +0100)
>> >
>> > are available in the Git repository at:
>> >
>> >   git@github.com:elmarco/qemu.git tags/libslirp-pull-request
>> >
>> > for you to fetch changes up to b060428091c758781acc4d42849accc036d3c816:
>> >
>> >   build-sys: make libslirp a meson subproject (2021-05-29 22:52:37 +0400)
>> >
>> > ----------------------------------------------------------------
>> > Update libslirp & make it a subproject
>> >
>> > ----------------------------------------------------------------
>>
>> All hosts, odd warnings on checkout and running configure:
>>
>> warning: unable to rmdir 'slirp': Directory not empty
>
>
> This one is from git itself. It doesn't clean up old submodule locations, even though they are actually "clean". git submodule "(re)move" has its limits I guess.

Yeah, I guess we have to live with this one.

>> make: Entering directory '/home/pm/qemu/build/all'
>> config-host.mak is out-of-date, running configure
>>   GIT     ui/keycodemapdb meson tests/fp/berkeley-testfloat-3
>> tests/fp/berkeley-softfloat-3 dtc capstone slirp
>> warn: ignoring non-existent submodule slirp
>
>
>  However, I don't get this when simply running make. Maybe you run make in parallel, and config-host.mak didn't have the time to regenerate with a new GIT_SUBMODULES.
>
> I wonder if we miss a dependency like "git-submodule-update: config-host.mak" ?

Something looks like it's still using an old list of submodules.

> Running configure before make should also prevent this from happening.

Incremental build needs to keep working.

>>
>> BSD VMs: error message just before launching the VM (though the VM did
>> seem to then launch OK):
>>
>> Found ninja-1.8.2 at /usr/bin/ninja
>> ninja: no work to do.
>> (GIT="git" "/home/peter.maydell/qemu-netbsd/scripts/git-submodule.sh"
>> update ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/be
>> rkeley-softfloat-3 dtc capstone slirp)
>> warn: ignoring non-existent submodule slirp
>> /usr/bin/python3 -B /home/peter.maydell/qemu-netbsd/tests/vm/netbsd
>> --debug  --jobs 8 --verbose    --image
>> "/home/peter.maydell/.cache/qemu
>> -vm/images/netbsd.img"  --snapshot --build-qemu
>> /home/peter.maydell/qemu-netbsd --
>> DEBUG:root:Creating archive
>> /home/peter.maydell/qemu-netbsd/build/vm-test-6kefrq76.tmp/data-f706c.tar
>> for src_dir dir: /home/peter.maydell/q
>> emu-netbsd
>> error: pathspec 'slirp' did not match any file(s) known to git.


Maybe this is something needing updating in the "create the archive"
script?

>>
>> clang sanitizer build: link failure:
>> subprojects/libslirp/libslirp.so.0.3.0.p/src_arp_table.c.o: In
>> function `arp_table_add':
>> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
>> undefined reference to `__ubsan_handle_type_mismatch_v1'
>> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
>> undefined reference to `__ubsan_handle_type_mismatch_v1'
>> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
>> undefined reference to `__ubsan_handle_type_mismatch_v1'
>> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:34:
>> undefined reference to `__ubsan_handle_type_mismatch_v1'
>> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:34:
>> undefined reference to `__ubsan_handle_type_mismatch_v1'
>> (and lots more similar)

> I don't get this  when running make vm-build-netbsd. What else am I missing?

This isn't NetBSD related, it's just a clang sanitizer build on Linux.

>> OSX: linker warnings linking libslirp.0.dylib:
>>
>>
>> [34/1977] Linking target subprojects/libslirp/libslirp.0.dylib
>> ld: warning: dylib
>> (/usr/local/Cellar/glib/2.68.0/lib/libgthread-2.0.dylib) was built for
>> newer macOS version (10.15) than being linked (10.4)
>> ld: warning: dylib
>> (/usr/local/Cellar/glib/2.68.0/lib/libglib-2.0.dylib) was built for
>> newer macOS version (10.15) than being linked (10.4)
>> ld: warning: dylib (/usr/local/opt/gettext/lib/libintl.dylib) was
>> built for newer macOS version (10.14) than being linked (10.4)
>>
>
> This looks related to:
> https://gitlab.freedesktop.org/slirp/libslirp/-/commit/410e296a52fb274648f8ecf53561eaab4b33c52c
>
> It could be that we need to use the version information from glib (or from any libraries used).
>
> It looks safe to ignore although I re-opened:
>  https://gitlab.freedesktop.org/slirp/libslirp/-/issues/36#note_940695

I'm not generally a fan of ignoring warnings. I would prefer it if
we understood why it was happening and how shared libraries are
supposed to be being built.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PULL 0/2] Libslirp patches
  2021-06-07 12:16     ` Peter Maydell
@ 2021-06-08 15:55       ` Marc-André Lureau
  2021-06-08 16:55         ` Peter Maydell
  2021-07-05 16:47         ` Paolo Bonzini
  0 siblings, 2 replies; 17+ messages in thread
From: Marc-André Lureau @ 2021-06-08 15:55 UTC (permalink / raw)
  To: Peter Maydell, Paolo Bonzini; +Cc: Samuel Thibault, QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 6518 bytes --]

Hi

On Mon, Jun 7, 2021 at 4:17 PM Peter Maydell <peter.maydell@linaro.org>
wrote:

> On Tue, 1 Jun 2021 at 12:01, Marc-André Lureau
> <marcandre.lureau@gmail.com> wrote:
> >
> > Hi Peter
> >
> > On Tue, Jun 1, 2021 at 1:17 PM Peter Maydell <peter.maydell@linaro.org>
> wrote:
> >>
> >> On Sat, 29 May 2021 at 19:55, <marcandre.lureau@redhat.com> wrote:
> >> >
> >> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >> >
> >> > The following changes since commit
> 62c0ac5041e9130b041adfa13a41583d3c3ddd24:
> >> >
> >> >   Merge remote-tracking branch
> 'remotes/rth-gitlab/tags/pull-tcg-20210526' into staging (2021-05-28
> 16:25:21 +0100)
> >> >
> >> > are available in the Git repository at:
> >> >
> >> >   git@github.com:elmarco/qemu.git tags/libslirp-pull-request
> >> >
> >> > for you to fetch changes up to
> b060428091c758781acc4d42849accc036d3c816:
> >> >
> >> >   build-sys: make libslirp a meson subproject (2021-05-29 22:52:37
> +0400)
> >> >
> >> > ----------------------------------------------------------------
> >> > Update libslirp & make it a subproject
> >> >
> >> > ----------------------------------------------------------------
> >>
> >> All hosts, odd warnings on checkout and running configure:
> >>
> >> warning: unable to rmdir 'slirp': Directory not empty
> >
> >
> > This one is from git itself. It doesn't clean up old submodule
> locations, even though they are actually "clean". git submodule "(re)move"
> has its limits I guess.
>
> Yeah, I guess we have to live with this one.
>
> >> make: Entering directory '/home/pm/qemu/build/all'
> >> config-host.mak is out-of-date, running configure
> >>   GIT     ui/keycodemapdb meson tests/fp/berkeley-testfloat-3
> >> tests/fp/berkeley-softfloat-3 dtc capstone slirp
> >> warn: ignoring non-existent submodule slirp
> >
> >
> >  However, I don't get this when simply running make. Maybe you run make
> in parallel, and config-host.mak didn't have the time to regenerate with a
> new GIT_SUBMODULES.
> >
> > I wonder if we miss a dependency like "git-submodule-update:
> config-host.mak" ?
>
> Something looks like it's still using an old list of submodules.
>

Yes, but I don't see how I could tell git-submodule-update until after
config-host.mak is regenerated and read again.

Paolo, any idea?

It's a transient issue, similar to the git warning.


> > Running configure before make should also prevent this from happening.
>
> Incremental build needs to keep working.
>
>
Sure, but one-step warnings during incremental build are blockers?


> >>
> >> BSD VMs: error message just before launching the VM (though the VM did
> >> seem to then launch OK):
> >>
> >> Found ninja-1.8.2 at /usr/bin/ninja
> >> ninja: no work to do.
> >> (GIT="git" "/home/peter.maydell/qemu-netbsd/scripts/git-submodule.sh"
> >> update ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/be
> >> rkeley-softfloat-3 dtc capstone slirp)
> >> warn: ignoring non-existent submodule slirp
> >> /usr/bin/python3 -B /home/peter.maydell/qemu-netbsd/tests/vm/netbsd
> >> --debug  --jobs 8 --verbose    --image
> >> "/home/peter.maydell/.cache/qemu
> >> -vm/images/netbsd.img"  --snapshot --build-qemu
> >> /home/peter.maydell/qemu-netbsd --
> >> DEBUG:root:Creating archive
> >>
> /home/peter.maydell/qemu-netbsd/build/vm-test-6kefrq76.tmp/data-f706c.tar
> >> for src_dir dir: /home/peter.maydell/q
> >> emu-netbsd
> >> error: pathspec 'slirp' did not match any file(s) known to git.
>
>
> Maybe this is something needing updating in the "create the archive"
> script?
>

Correct, my bad. No idea why I couldn't reproduce this before..

I guess we should run scripts/archive-source.sh in CI.


> >>
> >> clang sanitizer build: link failure:
> >> subprojects/libslirp/libslirp.so.0.3.0.p/src_arp_table.c.o: In
> >> function `arp_table_add':
> >>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
> >>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
> >>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
> >>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:34:
> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
> >>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:34:
> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
> >> (and lots more similar)
>
> > I don't get this  when running make vm-build-netbsd. What else am I
> missing?
>
>
This isn't NetBSD related, it's just a clang sanitizer build on Linux.
>


I am running configure with '--enable-sanitizers' --cc=clang --cxx=clang++
--host-cc=clang, I can't reproduce.

What's your distro? (or meson + clang versions)


> >> OSX: linker warnings linking libslirp.0.dylib:
> >>
> >>
> >> [34/1977] Linking target subprojects/libslirp/libslirp.0.dylib
> >> ld: warning: dylib
> >> (/usr/local/Cellar/glib/2.68.0/lib/libgthread-2.0.dylib) was built for
> >> newer macOS version (10.15) than being linked (10.4)
> >> ld: warning: dylib
> >> (/usr/local/Cellar/glib/2.68.0/lib/libglib-2.0.dylib) was built for
> >> newer macOS version (10.15) than being linked (10.4)
> >> ld: warning: dylib (/usr/local/opt/gettext/lib/libintl.dylib) was
> >> built for newer macOS version (10.14) than being linked (10.4)
> >>
> >
> > This looks related to:
> >
> https://gitlab.freedesktop.org/slirp/libslirp/-/commit/410e296a52fb274648f8ecf53561eaab4b33c52c
> >
> > It could be that we need to use the version information from glib (or
> from any libraries used).
> >
> > It looks safe to ignore although I re-opened:
> >  https://gitlab.freedesktop.org/slirp/libslirp/-/issues/36#note_940695
>
> I'm not generally a fan of ignoring warnings. I would prefer it if
> we understood why it was happening and how shared libraries are
> supposed to be being built.
>


I reverted the change. MacOS build can override the macosx-version-min with
CFLAGS.
See also https://gitlab.freedesktop.org/slirp/libslirp/-/issues/36 why this
was introduced.

thanks

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 9484 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PULL 0/2] Libslirp patches
  2021-06-08 15:55       ` Marc-André Lureau
@ 2021-06-08 16:55         ` Peter Maydell
  2021-06-08 20:35           ` Marc-André Lureau
  2021-07-05 16:47         ` Paolo Bonzini
  1 sibling, 1 reply; 17+ messages in thread
From: Peter Maydell @ 2021-06-08 16:55 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Paolo Bonzini, QEMU Developers, Samuel Thibault

On Tue, 8 Jun 2021 at 16:55, Marc-André Lureau
<marcandre.lureau@gmail.com> wrote:
>
> Hi
>
> On Mon, Jun 7, 2021 at 4:17 PM Peter Maydell <peter.maydell@linaro.org> wrote:

>> >> clang sanitizer build: link failure:
>> >> subprojects/libslirp/libslirp.so.0.3.0.p/src_arp_table.c.o: In
>> >> function `arp_table_add':
>> >> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
>> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
>> >> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
>> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
>> >> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
>> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
>> >> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:34:
>> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
>> >> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:34:
>> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
>> >> (and lots more similar)
>>
>> > I don't get this  when running make vm-build-netbsd. What else am I missing?
>>
>>
>> This isn't NetBSD related, it's just a clang sanitizer build on Linux.
>
>
>
> I am running configure with '--enable-sanitizers' --cc=clang --cxx=clang++ --host-cc=clang, I can't reproduce.
>
> What's your distro? (or meson + clang versions)

Ubuntu 18.04.5 LTS (bionic); configure arguments
'--cc=clang' '--cxx=clang++' '--enable-gtk'
'--extra-cflags=-fsanitize=undefined  -fno-sanitize=shift-base
-Werror'
clang version 6.0.0-1ubuntu2

-- PMM


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PULL 0/2] Libslirp patches
  2021-06-08 16:55         ` Peter Maydell
@ 2021-06-08 20:35           ` Marc-André Lureau
  2021-07-05 10:31             ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 17+ messages in thread
From: Marc-André Lureau @ 2021-06-08 20:35 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Paolo Bonzini, QEMU Developers, Samuel Thibault

[-- Attachment #1: Type: text/plain, Size: 3818 bytes --]

Hi

On Tue, Jun 8, 2021 at 8:55 PM Peter Maydell <peter.maydell@linaro.org>
wrote:

> On Tue, 8 Jun 2021 at 16:55, Marc-André Lureau
> <marcandre.lureau@gmail.com> wrote:
> >
> > Hi
> >
> > On Mon, Jun 7, 2021 at 4:17 PM Peter Maydell <peter.maydell@linaro.org>
> wrote:
>
> >> >> clang sanitizer build: link failure:
> >> >> subprojects/libslirp/libslirp.so.0.3.0.p/src_arp_table.c.o: In
> >> >> function `arp_table_add':
> >> >>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
> >> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
> >> >>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
> >> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
> >> >>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:51:
> >> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
> >> >>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:34:
> >> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
> >> >>
> /home/petmay01/linaro/qemu-for-merges/build/clang/../../subprojects/libslirp/src/arp_table.c:34:
> >> >> undefined reference to `__ubsan_handle_type_mismatch_v1'
> >> >> (and lots more similar)
> >>
> >> > I don't get this  when running make vm-build-netbsd. What else am I
> missing?
> >>
> >>
> >> This isn't NetBSD related, it's just a clang sanitizer build on Linux.
> >
> >
> >
> > I am running configure with '--enable-sanitizers' --cc=clang
> --cxx=clang++ --host-cc=clang, I can't reproduce.
> >
> > What's your distro? (or meson + clang versions)
>
> Ubuntu 18.04.5 LTS (bionic); configure arguments
> '--cc=clang' '--cxx=clang++' '--enable-gtk'
> '--extra-cflags=-fsanitize=undefined  -fno-sanitize=shift-base
> -Werror'
> clang version 6.0.0-1ubuntu2


Per subproject `default_library` was added in 0.54, and we require 0.55.3.
Why is it trying to build libslirp.so?

I tried to make vm-build-ubuntu.i386 with the following changes:

 diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386
index 47681b6f87..21d0b64eb1 100755
--- a/tests/vm/ubuntu.i386
+++ b/tests/vm/ubuntu.i386
@@ -18,7 +18,7 @@ import ubuntuvm
 DEFAULT_CONFIG = {
     'install_cmds' : "apt-get update,"\
                      "apt-get build-dep -y qemu,"\
-                     "apt-get install -y libfdt-dev language-pack-en
ninja-build",
+                     "apt-get install -y libfdt-dev language-pack-en
ninja-build clang",
 }

 class UbuntuX86VM(ubuntuvm.UbuntuVM):
@@ -32,7 +32,7 @@ class UbuntuX86VM(ubuntuvm.UbuntuVM):
         cd $(mktemp -d);
         sudo chmod a+r /dev/vdb;
         tar -xf /dev/vdb;
-        ./configure {configure_opts};
+        ./configure {configure_opts} --cc=clang --cxx=clang++
--host-cc=clang --extra-cflags='-fsanitize=undefined
 -fno-sanitize=shift-base -Werror';
         make --output-sync {target} -j{jobs} {verbose};
     """

(or with EXTRA_CONFIGURE_OPTS)

And it failed with:

[2363/9207] Linking target qemu-system-aarch64
FAILED: qemu-system-aarch64
clang++ @qemu-system-aarch64.rsp
libqemu-aarch64-softmmu.fa.p/accel_tcg_cputlb.c.o: In function
`helper_atomic_cmpxchgq_le_mmu':
/tmp/tmp.VkWONZ62bA/build/../accel/tcg/atomic_template.h:86: undefined
reference to `__atomic_compare_exchange_8'
libqemu-aarch64-softmmu.fa.p/accel_tcg_cputlb.c.o: In function
`helper_atomic_xchgq_le_mmu':
/tmp/tmp.VkWONZ62bA/build/../accel/tcg/atomic_template.h:134: undefined
reference to `__atomic_exchange_8'
libqemu-aarch64-softmmu.fa.p/accel_tcg_cputlb.c.o: In function
`helper_atomic_fetch_addq_le_mmu':

Any idea what I am missing?

thanks

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 5076 bytes --]

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PULL 1/2] Update libslirp to v4.5.0
  2021-05-29 18:55 ` [PULL 1/2] Update libslirp to v4.5.0 marcandre.lureau
@ 2021-06-18 16:01   ` Doug Evans
  2021-06-18 18:14     ` Marc-André Lureau
  0 siblings, 1 reply; 17+ messages in thread
From: Doug Evans @ 2021-06-18 16:01 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Peter Maydell, QEMU Developers, Samuel Thibault

[-- Attachment #1: Type: text/plain, Size: 3006 bytes --]

Hi. Does anything more need to be done here?
I just checked and I don't see this patch in the tree yet but it could have
been due to pilot error.

On Sat, May 29, 2021 at 11:55 AM <marcandre.lureau@redhat.com> wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Switch from stable-4.2 branch to upstream v4.5.0 release.
>
> ## [4.5.0] - 2021-05-18
>
> ### Added
>
>  - IPv6 forwarding. !62 !75 !77
>  - slirp_neighbor_info() to dump the ARP/NDP tables. !71
>
> ### Changed
>
>  - Lazy guest address resolution for IPv6. !81
>  - Improve signal handling when spawning a child. !61
>  - Set macOS deployment target to macOS 10.4. !72
>  - slirp_add_hostfwd: Ensure all error paths set errno. !80
>  - More API documentation.
>
> ### Fixed
>
>  - Assertion failure on unspecified IPv6 address. !86
>  - Disable polling for PRI on MacOS, fixing some closing streams issues.
> !73
>  - Various memory leak fixes on fastq/batchq. !68
>  - Memory leak on IPv6 fast-send. !67
>  - Slow socket response on Windows. !64
>  - Misc build and code cleanups. !60 !63 !76 !79 !84
>
> ## [4.4.0] - 2020-12-02
>
> ### Added
>
>  - udp, udp6, icmp: handle TTL value. !48
>  - Enable forwarding ICMP errors. !49
>  - Add DNS resolving for iOS. !54
>
> ### Changed
>
>  - Improve meson subproject() support. !53
>  - Removed Makefile-based build system. !56
>
> ### Fixed
>
>  - socket: consume empty packets. !55
>  - check pkt_len before reading protocol header (CVE-2020-29129). !57
>  - ip_stripoptions use memmove (fixes undefined behaviour). !47
>  - various Coverity-related changes/fixes.
>
> ## [4.3.1] - 2020-07-08
>
> ### Changed
>
>  - A silent truncation could occur in `slirp_fmt()`, which will now print a
>    critical message. See also #22.
>
> ### Fixed
>
>  - CVE-2020-10756 - Drop bogus IPv6 messages that could lead to data
> leakage.
>    See !44 and !42.
>  - Fix win32 builds by using the SLIRP_PACKED definition.
>  - Various coverity scan errors fixed. !41
>  - Fix new GCC warnings. !43
>
> ## [4.3.0] - 2020-04-22
>
> ### Added
>
>  - `SLIRP_VERSION_STRING` macro, with the git sha suffix when building
> from git
>  - `SlirpConfig.disable_dns`, to disable DNS redirection #16
>
> ### Changed
>
>  - `slirp_version_string()` now has the git sha suffix when building form
> git
>  - Limit DNS redirection to port 53 #16
>
> ### Fixed
>
>  - Fix build regression with mingw & NetBSD
>  - Fix use-afte-free in `ip_reass()` (CVE-2020-1983)
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Doug Evans <dje@google.com>
> ---
>  slirp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/slirp b/slirp
> index 8f43a99191..a62890e711 160000
> --- a/slirp
> +++ b/slirp
> @@ -1 +1 @@
> -Subproject commit 8f43a99191afb47ca3f3c6972f6306209f367ece
> +Subproject commit a62890e71126795ca593affa747f669bed88e89c
> --
> 2.29.0
>
>
>

[-- Attachment #2: Type: text/html, Size: 3858 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PULL 1/2] Update libslirp to v4.5.0
  2021-06-18 16:01   ` Doug Evans
@ 2021-06-18 18:14     ` Marc-André Lureau
  2021-07-27 20:05       ` Doug Evans
  0 siblings, 1 reply; 17+ messages in thread
From: Marc-André Lureau @ 2021-06-18 18:14 UTC (permalink / raw)
  To: Doug Evans; +Cc: Peter Maydell, QEMU Developers, Samuel Thibault

[-- Attachment #1: Type: text/plain, Size: 3605 bytes --]

Hi

On Fri, Jun 18, 2021 at 8:05 PM Doug Evans <dje@google.com> wrote:

> Hi. Does anything more need to be done here?
> I just checked and I don't see this patch in the tree yet but it could
> have been due to pilot error.
>
>
My pull request failed on Peter side for non-obvious reasons:
https://patchew.org/QEMU/20210529185522.78816-1-marcandre.lureau@redhat.com/
.

I can drop the patch for the meson build changes for now (although I would
really like to understand what's missing).

Anyway, we will want to update libslirp copy to 4.6.1 now (current git
master) which has recent CVE fixes.

On Sat, May 29, 2021 at 11:55 AM <marcandre.lureau@redhat.com> wrote:
>
>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>> Switch from stable-4.2 branch to upstream v4.5.0 release.
>>
>> ## [4.5.0] - 2021-05-18
>>
>> ### Added
>>
>>  - IPv6 forwarding. !62 !75 !77
>>  - slirp_neighbor_info() to dump the ARP/NDP tables. !71
>>
>> ### Changed
>>
>>  - Lazy guest address resolution for IPv6. !81
>>  - Improve signal handling when spawning a child. !61
>>  - Set macOS deployment target to macOS 10.4. !72
>>  - slirp_add_hostfwd: Ensure all error paths set errno. !80
>>  - More API documentation.
>>
>> ### Fixed
>>
>>  - Assertion failure on unspecified IPv6 address. !86
>>  - Disable polling for PRI on MacOS, fixing some closing streams issues.
>> !73
>>  - Various memory leak fixes on fastq/batchq. !68
>>  - Memory leak on IPv6 fast-send. !67
>>  - Slow socket response on Windows. !64
>>  - Misc build and code cleanups. !60 !63 !76 !79 !84
>>
>> ## [4.4.0] - 2020-12-02
>>
>> ### Added
>>
>>  - udp, udp6, icmp: handle TTL value. !48
>>  - Enable forwarding ICMP errors. !49
>>  - Add DNS resolving for iOS. !54
>>
>> ### Changed
>>
>>  - Improve meson subproject() support. !53
>>  - Removed Makefile-based build system. !56
>>
>> ### Fixed
>>
>>  - socket: consume empty packets. !55
>>  - check pkt_len before reading protocol header (CVE-2020-29129). !57
>>  - ip_stripoptions use memmove (fixes undefined behaviour). !47
>>  - various Coverity-related changes/fixes.
>>
>> ## [4.3.1] - 2020-07-08
>>
>> ### Changed
>>
>>  - A silent truncation could occur in `slirp_fmt()`, which will now print
>> a
>>    critical message. See also #22.
>>
>> ### Fixed
>>
>>  - CVE-2020-10756 - Drop bogus IPv6 messages that could lead to data
>> leakage.
>>    See !44 and !42.
>>  - Fix win32 builds by using the SLIRP_PACKED definition.
>>  - Various coverity scan errors fixed. !41
>>  - Fix new GCC warnings. !43
>>
>> ## [4.3.0] - 2020-04-22
>>
>> ### Added
>>
>>  - `SLIRP_VERSION_STRING` macro, with the git sha suffix when building
>> from git
>>  - `SlirpConfig.disable_dns`, to disable DNS redirection #16
>>
>> ### Changed
>>
>>  - `slirp_version_string()` now has the git sha suffix when building form
>> git
>>  - Limit DNS redirection to port 53 #16
>>
>> ### Fixed
>>
>>  - Fix build regression with mingw & NetBSD
>>  - Fix use-afte-free in `ip_reass()` (CVE-2020-1983)
>>
>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> Reviewed-by: Doug Evans <dje@google.com>
>> ---
>>  slirp | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/slirp b/slirp
>> index 8f43a99191..a62890e711 160000
>> --- a/slirp
>> +++ b/slirp
>> @@ -1 +1 @@
>> -Subproject commit 8f43a99191afb47ca3f3c6972f6306209f367ece
>> +Subproject commit a62890e71126795ca593affa747f669bed88e89c
>> --
>> 2.29.0
>>
>>
>>

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 4983 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PULL 0/2] Libslirp patches
  2021-06-08 20:35           ` Marc-André Lureau
@ 2021-07-05 10:31             ` Philippe Mathieu-Daudé
  2021-07-05 16:25               ` Stefan Hajnoczi
  0 siblings, 1 reply; 17+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-07-05 10:31 UTC (permalink / raw)
  To: Marc-André Lureau, Peter Maydell, Richard Henderson,
	Stefan Hajnoczi
  Cc: Paolo Bonzini, QEMU Developers, Samuel Thibault

+Richard/Stefan for "atomic" error.

On 6/8/21 10:35 PM, Marc-André Lureau wrote:

> Per subproject `default_library` was added in 0.54, and we require
> 0.55.3. Why is it trying to build libslirp.so?
> 
> I tried to make vm-build-ubuntu.i386 with the following changes:
> 
>  diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386
> index 47681b6f87..21d0b64eb1 100755
> --- a/tests/vm/ubuntu.i386
> +++ b/tests/vm/ubuntu.i386
> @@ -18,7 +18,7 @@ import ubuntuvm
>  DEFAULT_CONFIG = {
>      'install_cmds' : "apt-get update,"\
>                       "apt-get build-dep -y qemu,"\
> -                     "apt-get install -y libfdt-dev language-pack-en
> ninja-build",
> +                     "apt-get install -y libfdt-dev language-pack-en
> ninja-build clang",
>  }
>  
>  class UbuntuX86VM(ubuntuvm.UbuntuVM):
> @@ -32,7 +32,7 @@ class UbuntuX86VM(ubuntuvm.UbuntuVM):
>          cd $(mktemp -d);
>          sudo chmod a+r /dev/vdb;
>          tar -xf /dev/vdb;
> -        ./configure {configure_opts};
> +        ./configure {configure_opts} --cc=clang --cxx=clang++
> --host-cc=clang --extra-cflags='-fsanitize=undefined
>  -fno-sanitize=shift-base -Werror';
>          make --output-sync {target} -j{jobs} {verbose};
>      """
> 
> (or with EXTRA_CONFIGURE_OPTS)
> 
> And it failed with:
> 
> [2363/9207] Linking target qemu-system-aarch64
> FAILED: qemu-system-aarch64
> clang++ @qemu-system-aarch64.rsp
> libqemu-aarch64-softmmu.fa.p/accel_tcg_cputlb.c.o: In function
> `helper_atomic_cmpxchgq_le_mmu':
> /tmp/tmp.VkWONZ62bA/build/../accel/tcg/atomic_template.h:86: undefined
> reference to `__atomic_compare_exchange_8'
> libqemu-aarch64-softmmu.fa.p/accel_tcg_cputlb.c.o: In function
> `helper_atomic_xchgq_le_mmu':
> /tmp/tmp.VkWONZ62bA/build/../accel/tcg/atomic_template.h:134: undefined
> reference to `__atomic_exchange_8'
> libqemu-aarch64-softmmu.fa.p/accel_tcg_cputlb.c.o: In function
> `helper_atomic_fetch_addq_le_mmu':
> 
> Any idea what I am missing?
> 
> thanks
> 
> -- 
> Marc-André Lureau



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PULL 0/2] Libslirp patches
  2021-07-05 10:31             ` Philippe Mathieu-Daudé
@ 2021-07-05 16:25               ` Stefan Hajnoczi
  2021-07-05 16:31                 ` Peter Maydell
  0 siblings, 1 reply; 17+ messages in thread
From: Stefan Hajnoczi @ 2021-07-05 16:25 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Richard Henderson, QEMU Developers,
	Marc-André Lureau, Paolo Bonzini, Samuel Thibault

[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]

On Mon, Jul 05, 2021 at 12:31:01PM +0200, Philippe Mathieu-Daudé wrote:
> +Richard/Stefan for "atomic" error.
...
> > [2363/9207] Linking target qemu-system-aarch64
> > FAILED: qemu-system-aarch64
> > clang++ @qemu-system-aarch64.rsp
> > libqemu-aarch64-softmmu.fa.p/accel_tcg_cputlb.c.o: In function
> > `helper_atomic_cmpxchgq_le_mmu':
> > /tmp/tmp.VkWONZ62bA/build/../accel/tcg/atomic_template.h:86: undefined
> > reference to `__atomic_compare_exchange_8'
> > libqemu-aarch64-softmmu.fa.p/accel_tcg_cputlb.c.o: In function
> > `helper_atomic_xchgq_le_mmu':
> > /tmp/tmp.VkWONZ62bA/build/../accel/tcg/atomic_template.h:134: undefined
> > reference to `__atomic_exchange_8'
> > libqemu-aarch64-softmmu.fa.p/accel_tcg_cputlb.c.o: In function
> > `helper_atomic_fetch_addq_le_mmu':

According to docs/devel/atomics.rst:

  These operations are polymorphic; they operate on any type that is as
  wide as a pointer or smaller.

It looks like the compiler doesn't support 8-bit atomics here?

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PULL 0/2] Libslirp patches
  2021-07-05 16:25               ` Stefan Hajnoczi
@ 2021-07-05 16:31                 ` Peter Maydell
  2021-07-05 16:43                   ` Paolo Bonzini
  0 siblings, 1 reply; 17+ messages in thread
From: Peter Maydell @ 2021-07-05 16:31 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Richard Henderson, QEMU Developers, Marc-André Lureau,
	Paolo Bonzini, Samuel Thibault, Philippe Mathieu-Daudé

On Mon, 5 Jul 2021 at 17:25, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> On Mon, Jul 05, 2021 at 12:31:01PM +0200, Philippe Mathieu-Daudé wrote:
> > +Richard/Stefan for "atomic" error.
> ...
> > > [2363/9207] Linking target qemu-system-aarch64
> > > FAILED: qemu-system-aarch64
> > > clang++ @qemu-system-aarch64.rsp
> > > libqemu-aarch64-softmmu.fa.p/accel_tcg_cputlb.c.o: In function
> > > `helper_atomic_cmpxchgq_le_mmu':
> > > /tmp/tmp.VkWONZ62bA/build/../accel/tcg/atomic_template.h:86: undefined
> > > reference to `__atomic_compare_exchange_8'
> > > libqemu-aarch64-softmmu.fa.p/accel_tcg_cputlb.c.o: In function
> > > `helper_atomic_xchgq_le_mmu':
> > > /tmp/tmp.VkWONZ62bA/build/../accel/tcg/atomic_template.h:134: undefined
> > > reference to `__atomic_exchange_8'
> > > libqemu-aarch64-softmmu.fa.p/accel_tcg_cputlb.c.o: In function
> > > `helper_atomic_fetch_addq_le_mmu':
>
> According to docs/devel/atomics.rst:
>
>   These operations are polymorphic; they operate on any type that is as
>   wide as a pointer or smaller.
>
> It looks like the compiler doesn't support 8-bit atomics here?

8 here means "8 bytes", not "8 bits". And indeed on i386 you can't
do 8-byte atomics with simple insns. The compiler's answer to this
is "emit a call to a helper in libatomic, which will emulate an
atomic access by taking some kind of lock". We don't ever want to
fall back to "take a lock" because sometimes our accesses to the
atomic variables are from TCG generated code -- this is why we
don't link against libatomic. The problem is that we have not
correctly detected that this compiler can't do inline atomics
for 64-bit values and avoided using them. But at least we have
made this a compile failure rather than a silently-wrong-code bug :-)

thanks
-- PMM


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PULL 0/2] Libslirp patches
  2021-07-05 16:31                 ` Peter Maydell
@ 2021-07-05 16:43                   ` Paolo Bonzini
  0 siblings, 0 replies; 17+ messages in thread
From: Paolo Bonzini @ 2021-07-05 16:43 UTC (permalink / raw)
  To: Peter Maydell, Stefan Hajnoczi
  Cc: Marc-André Lureau, Richard Henderson,
	Philippe Mathieu-Daudé,
	QEMU Developers, Samuel Thibault

On 05/07/21 18:31, Peter Maydell wrote:
> 8 here means "8 bytes", not "8 bits". And indeed on i386 you can't
> do 8-byte atomics with simple insns.

You can, there's a cmpxchg8b instruction.  The problem is that somehow 
configure's view of this disagrees with what happens during compilation.

If anybody can send a config.log and make V=1 log, I can look at it.

Paolo

> The compiler's answer to this
> is "emit a call to a helper in libatomic, which will emulate an
> atomic access by taking some kind of lock". We don't ever want to
> fall back to "take a lock" because sometimes our accesses to the
> atomic variables are from TCG generated code -- this is why we
> don't link against libatomic. The problem is that we have not
> correctly detected that this compiler can't do inline atomics
> for 64-bit values and avoided using them. But at least we have
> made this a compile failure rather than a silently-wrong-code bug:-)



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PULL 0/2] Libslirp patches
  2021-06-08 15:55       ` Marc-André Lureau
  2021-06-08 16:55         ` Peter Maydell
@ 2021-07-05 16:47         ` Paolo Bonzini
  1 sibling, 0 replies; 17+ messages in thread
From: Paolo Bonzini @ 2021-07-05 16:47 UTC (permalink / raw)
  To: Marc-André Lureau, Peter Maydell; +Cc: Samuel Thibault, QEMU Developers

On 08/06/21 17:55, Marc-André Lureau wrote:
>      > I wonder if we miss a dependency like "git-submodule-update:
>     config-host.mak" ?

Adding the dependency should work (it doesn't seem to me that it would 
add any dependency loop).

Paolo



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PULL 1/2] Update libslirp to v4.5.0
  2021-06-18 18:14     ` Marc-André Lureau
@ 2021-07-27 20:05       ` Doug Evans
  0 siblings, 0 replies; 17+ messages in thread
From: Doug Evans @ 2021-07-27 20:05 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Peter Maydell, QEMU Developers, Samuel Thibault

[-- Attachment #1: Type: text/plain, Size: 3951 bytes --]

Hi all.
Just checking in to see where we are.
I just checked and master is still using the older libslirp.

On Fri, Jun 18, 2021 at 11:14 AM Marc-André Lureau <
marcandre.lureau@gmail.com> wrote:

> Hi
>
> On Fri, Jun 18, 2021 at 8:05 PM Doug Evans <dje@google.com> wrote:
>
>> Hi. Does anything more need to be done here?
>> I just checked and I don't see this patch in the tree yet but it could
>> have been due to pilot error.
>>
>>
> My pull request failed on Peter side for non-obvious reasons:
> https://patchew.org/QEMU/20210529185522.78816-1-marcandre.lureau@redhat.com/
> .
>
> I can drop the patch for the meson build changes for now (although I would
> really like to understand what's missing).
>
> Anyway, we will want to update libslirp copy to 4.6.1 now (current git
> master) which has recent CVE fixes.
>
> On Sat, May 29, 2021 at 11:55 AM <marcandre.lureau@redhat.com> wrote:
>>
>>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>>
>>> Switch from stable-4.2 branch to upstream v4.5.0 release.
>>>
>>> ## [4.5.0] - 2021-05-18
>>>
>>> ### Added
>>>
>>>  - IPv6 forwarding. !62 !75 !77
>>>  - slirp_neighbor_info() to dump the ARP/NDP tables. !71
>>>
>>> ### Changed
>>>
>>>  - Lazy guest address resolution for IPv6. !81
>>>  - Improve signal handling when spawning a child. !61
>>>  - Set macOS deployment target to macOS 10.4. !72
>>>  - slirp_add_hostfwd: Ensure all error paths set errno. !80
>>>  - More API documentation.
>>>
>>> ### Fixed
>>>
>>>  - Assertion failure on unspecified IPv6 address. !86
>>>  - Disable polling for PRI on MacOS, fixing some closing streams issues.
>>> !73
>>>  - Various memory leak fixes on fastq/batchq. !68
>>>  - Memory leak on IPv6 fast-send. !67
>>>  - Slow socket response on Windows. !64
>>>  - Misc build and code cleanups. !60 !63 !76 !79 !84
>>>
>>> ## [4.4.0] - 2020-12-02
>>>
>>> ### Added
>>>
>>>  - udp, udp6, icmp: handle TTL value. !48
>>>  - Enable forwarding ICMP errors. !49
>>>  - Add DNS resolving for iOS. !54
>>>
>>> ### Changed
>>>
>>>  - Improve meson subproject() support. !53
>>>  - Removed Makefile-based build system. !56
>>>
>>> ### Fixed
>>>
>>>  - socket: consume empty packets. !55
>>>  - check pkt_len before reading protocol header (CVE-2020-29129). !57
>>>  - ip_stripoptions use memmove (fixes undefined behaviour). !47
>>>  - various Coverity-related changes/fixes.
>>>
>>> ## [4.3.1] - 2020-07-08
>>>
>>> ### Changed
>>>
>>>  - A silent truncation could occur in `slirp_fmt()`, which will now
>>> print a
>>>    critical message. See also #22.
>>>
>>> ### Fixed
>>>
>>>  - CVE-2020-10756 - Drop bogus IPv6 messages that could lead to data
>>> leakage.
>>>    See !44 and !42.
>>>  - Fix win32 builds by using the SLIRP_PACKED definition.
>>>  - Various coverity scan errors fixed. !41
>>>  - Fix new GCC warnings. !43
>>>
>>> ## [4.3.0] - 2020-04-22
>>>
>>> ### Added
>>>
>>>  - `SLIRP_VERSION_STRING` macro, with the git sha suffix when building
>>> from git
>>>  - `SlirpConfig.disable_dns`, to disable DNS redirection #16
>>>
>>> ### Changed
>>>
>>>  - `slirp_version_string()` now has the git sha suffix when building
>>> form git
>>>  - Limit DNS redirection to port 53 #16
>>>
>>> ### Fixed
>>>
>>>  - Fix build regression with mingw & NetBSD
>>>  - Fix use-afte-free in `ip_reass()` (CVE-2020-1983)
>>>
>>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>>> Reviewed-by: Doug Evans <dje@google.com>
>>> ---
>>>  slirp | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/slirp b/slirp
>>> index 8f43a99191..a62890e711 160000
>>> --- a/slirp
>>> +++ b/slirp
>>> @@ -1 +1 @@
>>> -Subproject commit 8f43a99191afb47ca3f3c6972f6306209f367ece
>>> +Subproject commit a62890e71126795ca593affa747f669bed88e89c
>>> --
>>> 2.29.0
>>>
>>>
>>>
>
> --
> Marc-André Lureau
>

[-- Attachment #2: Type: text/html, Size: 5664 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-07-27 20:07 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-29 18:55 [PULL 0/2] Libslirp patches marcandre.lureau
2021-05-29 18:55 ` [PULL 1/2] Update libslirp to v4.5.0 marcandre.lureau
2021-06-18 16:01   ` Doug Evans
2021-06-18 18:14     ` Marc-André Lureau
2021-07-27 20:05       ` Doug Evans
2021-05-29 18:55 ` [PULL 2/2] build-sys: make libslirp a meson subproject marcandre.lureau
2021-06-01  9:10 ` [PULL 0/2] Libslirp patches Peter Maydell
2021-06-01 11:01   ` Marc-André Lureau
2021-06-07 12:16     ` Peter Maydell
2021-06-08 15:55       ` Marc-André Lureau
2021-06-08 16:55         ` Peter Maydell
2021-06-08 20:35           ` Marc-André Lureau
2021-07-05 10:31             ` Philippe Mathieu-Daudé
2021-07-05 16:25               ` Stefan Hajnoczi
2021-07-05 16:31                 ` Peter Maydell
2021-07-05 16:43                   ` Paolo Bonzini
2021-07-05 16:47         ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).