Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6729299rdb; Fri, 15 Dec 2023 07:00:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFh7R/nX6URDnyjQcxVTBMyFUUu2F3sBaOqPBAAHdWKM1/hPmQYBvMHVCd+Gpk6Qcrl7ptG X-Received: by 2002:a17:902:e789:b0:1d0:b8dc:ec90 with SMTP id cp9-20020a170902e78900b001d0b8dcec90mr7439349plb.64.1702652422786; Fri, 15 Dec 2023 07:00:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702652422; cv=none; d=google.com; s=arc-20160816; b=jx/iv98NnBY97DRqhCWA4ng/zwicx1yYdU0vM8hSqbYqN2dyJvg5Iqml0RJB/JKEN3 QOAqwy4CLvcw/Tk9/cstg+IpzRd/ycES7gSggpTQkVgRYSw6LydQWifmu/e7QMYnELx6 GnLKFHl+tnE3VT98EIpOGABarNOmFmOBBtMeZEYvEk4nS/YAt+j49PXHxpArBIjr3XDM +uwMjyyqEQDDEM9zypmGZCh0/ZDGW2tFskRzAjIJbTaLyHDOrfR+P04qYGyRZV0iyynL 4YMMsy1Jzp4raaeCd+lIAdQ2igBCERryv4AnkFOiG4Eiz+5jT7rjac+BMXlsm/Y/vS0X IqtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2YNsFtnWoGzBInsPukYo1tsObKlejhB0j28WkqJmzOk=; fh=2cOLKalsvJWgp6X/iQQOoa8XWKauU+XcecEfmW3UZwY=; b=iU+3nUnP5J13MnXXEgCmVBHCBettIz6qQa3HVot6b9vo0rKZHUG7WtovBtQyk2NE5a s0LFgloM5fPd+vKRr+H2Sf/WOWNIOeH7hfAxb7RjmlZ/0YI67+hnptJUMhX95eT0sPab NE4DQDv/y1qqg74Qfw2gtceB31N42VNiXDlq4egbIltvMzmnHFCKUSwCuVj1ilhYWrA6 qO8IWIi8atH7luzoUO839An/3Zu9VW5Jj8NNgjYLkl7hK50BRWCUBqaEinWdZS84ZP8L Gj3F/Xpmt8R3dBzDN9Zs+mMu4fmUZx1Wtc8IM7cnwgDPiyK2uHadMauM20QzLjhue/7X ZEVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ThF3UUWw; spf=pass (google.com: domain of linux-kernel+bounces-1142-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1142-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d4-20020a170902cec400b001d0d312bc13si2007899plg.401.2023.12.15.07.00.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 07:00:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1142-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ThF3UUWw; spf=pass (google.com: domain of linux-kernel+bounces-1142-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1142-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 236FE2831BA for ; Fri, 15 Dec 2023 15:00:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B728735F03; Fri, 15 Dec 2023 15:00:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ThF3UUWw" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0B6235884; Fri, 15 Dec 2023 15:00:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8CD3C433C8; Fri, 15 Dec 2023 14:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702652405; bh=422PM3fDIpd8XBwXAF/Vr2Tijy2/V6yIm6WwhsorExQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ThF3UUWwGr5c0gG18awOx5DrQRxAPwOOshZh7SWrhMEjGtlJQKezv414UMUQWtogg HnsI2tu59s1B5g7ry0ZQTMiQwmrK95OYjW9JiQ6MubAahf8tnoIGHG4ZF1g5MM51Ho Fuyd5f95QOR67Xo2K1+5IQcrm/42yldE3jy4DNl4ppdU048EmnGGuL8meF1yRhb1Vb LrNl4xg5kA7VxTmTD6d5xMpK4G8SinhZgdQ+byz8MwpizJS6XNp+ezD/RlY5hnqPb5 M/qJhGhNwfiuAs4wEKcr3OTh/1Lt7WuUVP/7vAsp3W1EZLiIXddMPg4h2ayPqcPZD9 deK0um1LZe7kA== Date: Fri, 15 Dec 2023 14:59:51 +0000 From: Mark Brown To: Thiago Jung Bauermann Cc: Catalin Marinas , Will Deacon , Jonathan Corbet , Andrew Morton , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Arnd Bergmann , Oleg Nesterov , Eric Biederman , Kees Cook , Shuah Khan , "Rick P. Edgecombe" , Deepak Gupta , Ard Biesheuvel , Szabolcs Nagy , "H.J. Lu" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Florian Weimer , Christian Brauner , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v7 34/39] kselftest/arm64: Add a GCS test program built with the system libc Message-ID: <485b6454-135c-4dd4-b38e-8fb8a02779cd@sirena.org.uk> References: <20231122-arm64-gcs-v7-0-201c483bd775@kernel.org> <20231122-arm64-gcs-v7-34-201c483bd775@kernel.org> <875y1089i4.fsf@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="M02qk/d68kwsaj1P" Content-Disposition: inline In-Reply-To: <875y1089i4.fsf@linaro.org> X-Cookie: PARDON me, am I speaking ENGLISH? --M02qk/d68kwsaj1P Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 14, 2023 at 11:50:11PM -0300, Thiago Jung Bauermann wrote: > Mark Brown writes: > > + ret =3D process_vm_writev(child, &local_iov, 1, &remote_iov, 1, 0); > > + if (ret =3D=3D -1) > > + ksft_print_msg("process_vm_readv() failed: %s (%d)\n", > > + strerror(errno), errno); > The comment and the error message say "process_vm_readv()", but the > function actually called is process_vm_writev(). Is this intended? No, that's a rebasing issue. > If I swap process_vm_readv() and process_vm_writev(), then the read > succeeds but the write fails: >=20 > # RUN global.ptrace_read_write ... > # Child: 1996 > # Child GCSPR 0xffffa7fcffd8, flags 1, locked 0 > # process_vm_writev() failed: Bad address (14) > # libc-gcs.c:291:ptrace_read_write:Expected ret (-1) =3D=3D sizeof(rval) = (8) > # libc-gcs.c:293:ptrace_read_write:Expected val (281473500358268) =3D=3D = ptrace(PTRACE_PEEKDATA, child, (void *)gcspr, NULL) (0) > # ptrace_read_write: Test failed at step #1 > # FAIL global.ptrace_read_write > not ok 4 global.ptrace_read_write Yeah, I did notice something had happened with the writes but didn't investigate yet. > Also, it's strange that the tests defined after map_gcs.stack_overflow > don't run when I execute this test program. I'm doing: > $ ./run_kselftest.sh -t arm64:libc-gcs > I.e., these tests aren't being run in my FVP: > > +FIXTURE_VARIANT_ADD(map_invalid_gcs, too_small) > > +FIXTURE_VARIANT_ADD(map_invalid_gcs, unligned_1) > > +FIXTURE_VARIANT_ADD(map_invalid_gcs, unligned_2) > > +FIXTURE_VARIANT_ADD(map_invalid_gcs, unligned_3) > > +FIXTURE_VARIANT_ADD(map_invalid_gcs, unligned_4) > > +FIXTURE_VARIANT_ADD(map_invalid_gcs, unligned_5) > > +FIXTURE_VARIANT_ADD(map_invalid_gcs, unligned_6) > > +FIXTURE_VARIANT_ADD(map_invalid_gcs, unligned_7) > > +TEST_F(map_invalid_gcs, do_map) > > +FIXTURE_VARIANT_ADD(invalid_mprotect, exec) > > +FIXTURE_VARIANT_ADD(invalid_mprotect, bti) > > +FIXTURE_VARIANT_ADD(invalid_mprotect, exec_bti) > > +TEST_F(invalid_mprotect, do_map) > > +TEST_F(invalid_mprotect, do_map_read) I'm seeing all of those appearing. I'm not sure what to say there - that's all kselftest framework stuff, I'd expect the framework to say something about what it's doing if it decides to skip and I can't think why it would decide to skip. --M02qk/d68kwsaj1P Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmV8aecACgkQJNaLcl1U h9Cx7Qf+NstvmUJDmhKZCiSXybEblR3UfKc2ERXjiJRyMZJYWGE59Aqau43rUxYz 4oELXv45Jxb9fBX19Ap6W19TxDrGHMHoCW6fuIiqeTu9L1798R0lJi1TuUxnoX2t t/s1MqP87pbwKNs60ne9ezvagfQhFFBAYyUepAxrvfPkeUakOwLgsHRwx2bEVsXv 6SsJJ9hRz7N2FvlP487cWfC5VQkyYjefXQHi/1OrZw1hSkS9a5Hb/Y1vBzacFUbS YDYZszJexTXkcRjAngFzHsCBCakK3xpFB1uRPMhrAOj51UDJHHwE4+nX7DUWZaxT delEJTYjMd7cGaEpGyDdMnkhQVyM4g== =fKsW -----END PGP SIGNATURE----- --M02qk/d68kwsaj1P--