From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=fail reason="key not found in DNS" header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202312 header.b=BUzjKl0F; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 44B995A004E for ; Tue, 20 Aug 2024 02:49:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1724114993; bh=yR5guVbUUFaGQPyAuGFWea/EwrxEyg6WeiYVV6JKcGU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BUzjKl0F6JT1nLZRU8X5bvovDTDl6UOAhvcTHfHcvfQrt7kRUS8WLWYc4CHxWeJLm lSrp9KchdxJkHIjpAy6Mq82976PZ9wGMaifTpI2Hq2omuZ8MbvtmFGsRcl3r7HgSG2 D80HW91NaqoLAhfBdELG08OyHBZNlrqL6xErRXSuJWspzWjLVH7jegLlF/mP5Qrata W903kaw1FtSaFOrIe/uM4QDYqyQcXUbVgfo/NEYUE/RxF24RfQkGWX6rgAx767VuWW Hzfl2tPXITgY/hOgzdZ1kt6SInGFzXKYcY6nyGkzWLKEG4+guw1XvCS3fyqP0LeOZg pFKDfAb/VgJYw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4WnrTY3ScJz4wd6; Tue, 20 Aug 2024 10:49:53 +1000 (AEST) Date: Tue, 20 Aug 2024 10:44:10 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] treewide: Allow additional system calls for i386/i686 Message-ID: References: <20240819231407.1481337-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="H3OO61rGSS2Z/hax" Content-Disposition: inline In-Reply-To: <20240819231407.1481337-1-sbrivio@redhat.com> Message-ID-Hash: B53NB4RY3VDDLEUAOJLIVMCZL5VH3IVH X-Message-ID-Hash: B53NB4RY3VDDLEUAOJLIVMCZL5VH3IVH X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, =?utf-8?B?VXJvxaEgS251cGxlxaE=?= , Faidon Liambotis X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --H3OO61rGSS2Z/hax Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 20, 2024 at 01:14:07AM +0200, Stefano Brivio wrote: > I haven't tested i386 for a long time (after playing with some > openSUSE i586 image a couple of years ago). It turns out that a number > of system calls we actually need were denied by the seccomp filter, > and not even basic functionality works. >=20 > Add some system calls that glibc started using with the 64-bit time > ("t64") transition, see also: >=20 > https://wiki.debian.org/ReleaseGoals/64bit-time >=20 > that is: clock_gettime64, timerfd_gettime64, fcntl64, and > recvmmsg_time64. >=20 > Add further system calls that are needed regardless of time_t width, > that is, mmap2 (valgrind profile only), _llseek and sigreturn (common > outside x86_64), and socketcall (same as s390x). >=20 > I validated this against an almost full run of the test suite, with > just a few selected tests skipped. Fixes needed to run most tests on > i386/i686, and other assorted fixes for tests, are included in > upcoming patches. >=20 > Reported-by: Uro=C5=A1 Knuple=C5=A1 > Analysed-by: Faidon Liambotis > Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D1078981 > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > Makefile | 2 +- > log.c | 2 +- > passt.c | 6 +++--- > pasta.c | 2 +- > tcp.c | 2 +- > tcp_splice.c | 2 +- > udp.c | 2 +- > udp_flow.c | 2 +- > 8 files changed, 10 insertions(+), 10 deletions(-) >=20 > diff --git a/Makefile b/Makefile > index b6329e3..01fada4 100644 > --- a/Makefile > +++ b/Makefile > @@ -129,7 +129,7 @@ qrap: $(QRAP_SRCS) passt.h > =20 > valgrind: EXTRA_SYSCALLS +=3D rt_sigprocmask rt_sigtimedwait rt_sigactio= n \ > rt_sigreturn getpid gettid kill clock_gettime mmap \ > - munmap open unlink gettimeofday futex > + mmap2 munmap open unlink gettimeofday futex > valgrind: FLAGS +=3D -g -DVALGRIND > valgrind: all > =20 > diff --git a/log.c b/log.c > index e7202d0..433b552 100644 > --- a/log.c > +++ b/log.c > @@ -98,7 +98,7 @@ const char *logfile_prefix[] =3D { > * @fd: Log file descriptor > * @now: Current timestamp > * > - * #syscalls lseek ppc64le:_llseek ppc64:_llseek arm:_llseek > + * #syscalls lseek ppc64le:_llseek ppc64:_llseek arm:_llseek i686:_llseek > */ > static void logfile_rotate_fallocate(int fd, const struct timespec *now) > { > diff --git a/passt.c b/passt.c > index 4b3c306..f9670b3 100644 > --- a/passt.c > +++ b/passt.c > @@ -191,11 +191,11 @@ void exit_handler(int signal) > * Return: non-zero on failure > * > * #syscalls read write writev > - * #syscalls socket bind connect getsockopt setsockopt s390x:socketcall = close > - * #syscalls recvfrom sendto shutdown > + * #syscalls socket getsockopt setsockopt s390x:socketcall i686:socketca= ll close > + * #syscalls bind connect recvfrom sendto shutdown > * #syscalls arm:recv ppc64le:recv arm:send ppc64le:send > * #syscalls accept4|accept listen epoll_ctl epoll_wait|epoll_pwait epol= l_pwait > - * #syscalls clock_gettime arm:clock_gettime64 > + * #syscalls clock_gettime arm:clock_gettime64 i686:clock_gettime64 > */ > int main(int argc, char **argv) > { > diff --git a/pasta.c b/pasta.c > index 1142f03..49b56db 100644 > --- a/pasta.c > +++ b/pasta.c > @@ -13,7 +13,7 @@ > * > * #syscalls:pasta clone waitid exit exit_group rt_sigprocmask > * #syscalls:pasta rt_sigreturn|sigreturn > - * #syscalls:pasta arm:sigreturn ppc64:sigreturn s390x:sigreturn > + * #syscalls:pasta arm:sigreturn ppc64:sigreturn s390x:sigreturn i686:si= greturn > */ > =20 > #include > diff --git a/tcp.c b/tcp.c > index c0820ce..c542a78 100644 > --- a/tcp.c > +++ b/tcp.c > @@ -2143,7 +2143,7 @@ cancel: > * @c: Execution context > * @ref: epoll reference of timer (not connection) > * > - * #syscalls timerfd_gettime > + * #syscalls timerfd_gettime i686:timerfd_gettime64 > */ > void tcp_timer_handler(struct ctx *c, union epoll_ref ref) > { > diff --git a/tcp_splice.c b/tcp_splice.c > index 483e45d..9f5cc27 100644 > --- a/tcp_splice.c > +++ b/tcp_splice.c > @@ -28,7 +28,7 @@ > * - FIN_SENT_0: FIN (write shutdown) sent to accepted socket > * - FIN_SENT_1: FIN (write shutdown) sent to target socket > * > - * #syscalls:pasta pipe2|pipe fcntl arm:fcntl64 ppc64:fcntl64 > + * #syscalls:pasta pipe2|pipe fcntl arm:fcntl64 ppc64:fcntl64 i686:fcntl= 64 > */ > =20 > #include > diff --git a/udp.c b/udp.c > index 7731257..851881e 100644 > --- a/udp.c > +++ b/udp.c > @@ -460,7 +460,7 @@ static bool udp_sock_recverr(int s) > * @events: epoll events bitmap > * @mmh mmsghdr array to receive into > * > - * #syscalls recvmmsg > + * #syscalls recvmmsg i686:recvmmsg_time64 > */ > static int udp_sock_recv(const struct ctx *c, int s, uint32_t events, > struct mmsghdr *mmh) > diff --git a/udp_flow.c b/udp_flow.c > index 8b25ad1..b1133c0 100644 > --- a/udp_flow.c > +++ b/udp_flow.c > @@ -174,7 +174,7 @@ cancel: > * @s_in: Source socket address, filled in by recvmmsg() > * @now: Timestamp > * > - * #syscalls fcntl > + * #syscalls fcntl arm:fcntl64 ppc64:fcntl64 i686:fcntl64 > * > * Return: sidx for the destination side of the flow for this packet, or > * FLOW_SIDX_NONE if we couldn't find or create a flow. --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --H3OO61rGSS2Z/hax Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmbD5tkACgkQzQJF27ox 2GetAg/8CKnYDbF1hxXiVlUWZQgY/edgL9FZBcGI5uHktGCGPlDANEnAD5Dom7kd J2z802n2ivQE9ajackTiSGkm7db04oO7HeewA3ko5HLr5VXdZjNbErh3SGsbr5iI lmjlStb1USzmKei4bLeYpyc1jzniPptXF4eMFJp0xQg8HA4JjQBaDfi1EUThHrkg /r4w4YQG11Y/ASfYhcxcdIBOpchdF5LBeWaUQADe84MJ1pNsDgg4eOOvoo9iPWqA VCF443SaMyok/WLkoZpd/pdLsV4gQ5EtHA+vhw5OSYnqmEO1YtAmn1ISnJiYNzpL twmRh8gOAcQcDaFhsBt3ORf03b3Hy5g/xjEvRa4WJV0Fz7nE/IGc2+aqWuo2FD48 3KexGDZJU8eLu29Kc7pqoUArsAX+qkdKa/fS/GKsMoQXWWaVPBCjCQJEq6LLvsQx TJR2Ui3x95PNfN8ymMHnkuhjLf3WNRVphE644i1IrBP+d7Ou4snlfhD/J6jyH8F+ eXayeVVt7LOI2CQ0MUEYGR8T+35aKtmoH8Iq8mSu5/kcAuEju9hL7qICn3WpwKkw rIkzjrrbtCLqW1/m0iWxJ72Y/Jk+3UTYaBkwI1JbQqImd7Vp7Va+OIQGxNNrtoF7 dvboERZdhIK3dOtxuw5dXNHi21qnAuCDzJVb3UO03r8HRDQ7Q10= =ScdF -----END PGP SIGNATURE----- --H3OO61rGSS2Z/hax--