From nobody Tue Dec 26 02:04:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SzdPK18Q1z55KH2; Tue, 26 Dec 2023 02:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SzdPJ5BgVz4KMK; Tue, 26 Dec 2023 02:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703556260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z9qEd56wPslnMG+Ve9t0OBWatQ50HfMDQRLxBwtZ/8o=; b=gdOEuXMG3mHIruJBB/Lj85s7MTJ2itfcl8t32TY9CCWNuCctSKcT9NmC+CLDuRktuGVOCn qYI3ixLOjp/s+toswuWGivLFZ/xlTv54Qw9RejuzbAAlTAjYCnpWoEBceCBT86yGaMFrxZ w22MXXG+uzsdbqETktohsep7JPiIo6A5zVzgkWJLrpINKyakyVfSGJ9Bjc152WFstBXmFi 5RdrlfMVk5p4XLaH+vsef2bR0713LLYh4KIh7bEDEKryS/b/jqH+8HrwmUMS72Y/2a6nbx Dty0N2/kHBasi1ob1J2x0C2q2tduxkI9TCYgavGcFVO3f3NycGLjoWqKwYdHJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703556260; a=rsa-sha256; cv=none; b=sxEOsknbAFFRBJ6ppEkbHJ1XAt0tkdmteEX6JqpscoclqICuxX/NETYyB2ySeCeMhY8sda fQZvnJ2f2bc1ifNjKxSlYDxa08MNKj27bOan2N8Y0gSYOS9N6nRv4Urw6IgYrM+KqSafWt uOdIlt4zi7+PSUvwj/Df5X+PeIboFtueMB10C7U/GUPMI1aH0yZOiVBA0GTAE9Mx78nTCS nOPAvTL96dkagfIiktVSW03LDI4hB9SzP/WBfpUw4jHythHA0p90e1kQzHhWFIiQTTU5Q/ wsRhzoKQLc/FEDRT1Mei+Xs8mDju7csQXgHHdUnVByV0ZZsJvzypSn5h32RAEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703556260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z9qEd56wPslnMG+Ve9t0OBWatQ50HfMDQRLxBwtZ/8o=; b=iPaGqN2QFyXuu3aURXe214KgTSuSrR3UXqn07LV3NoL6u605o8BVCMQib7QyoVg09KE1h3 ZyjQ2mtZL+ONG/1GdfqU26z+uaeHvCHukKUQd0hePfkTWeCK6zGyEdcuFZN2CR1ECbrC+I to4QTKvyIpIwWf3gnCUt1ktqd6O5K6hH6Ghg6qW1i+79Wt5qUug08fPvpZ665TsWO6x1QL R+Ufi784JgPlERIDOC4rD8cHmMIh9JKQHWq1Mi4/gsz0iFrr8+njzZGVwGLOZZ//rVkR0a qvJxdYcssNygFgFLnfKLFusZF0hxcuhANBdqyu+uY84UnJkKm+qvYR+p1wuRjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SzdPJ4Hg7zbhB; Tue, 26 Dec 2023 02:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BQ24Keh003053; Tue, 26 Dec 2023 02:04:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BQ24KUu003050; Tue, 26 Dec 2023 02:04:20 GMT (envelope-from git) Date: Tue, 26 Dec 2023 02:04:20 GMT Message-Id: <202312260204.3BQ24KUu003050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 3fde275167ce - main - linux: Check for copyout errors in linux_fixup() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fde275167ce1f1455a03586d29840546d06d97a Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3fde275167ce1f1455a03586d29840546d06d97a commit 3fde275167ce1f1455a03586d29840546d06d97a Author: Mark Johnston AuthorDate: 2023-12-26 01:40:05 +0000 Commit: Mark Johnston CommitDate: 2023-12-26 02:04:00 +0000 linux: Check for copyout errors in linux_fixup() This is in preparation for annotating copyin() and related functions with __result_use_check. Reviewed by: olce, dchagin MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43104 --- sys/i386/linux/linux_sysvec.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 8990b9b806ca..24f8ec2d7ea8 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -126,11 +126,14 @@ linux_fixup(uintptr_t *stack_base, struct image_params *imgp) argv = base; envp = base + (imgp->args->argc + 1); base--; - suword(base, (intptr_t)envp); + if (suword(base, (intptr_t)envp) != 0) + return (EFAULT); base--; - suword(base, (intptr_t)argv); + if (suword(base, (intptr_t)argv) != 0) + return (EFAULT); base--; - suword(base, imgp->args->argc); + if (suword(base, imgp->args->argc) != 0) + return (EFAULT); *stack_base = (uintptr_t)base; return (0); }