From nobody Tue Jan 02 00:37:20 2024 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 4T3v7h52s6z55yWx; Tue, 2 Jan 2024 00:37:20 +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 4T3v7h3HDnz3HQs; Tue, 2 Jan 2024 00:37:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704155840; 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=WkAVW1qrxbcXfGCQE9QzdhPNIS5P2eFELKNMGSjiZk8=; b=rvsQbAE3GTYno7XvV+Cm65XojmmhZSNATkAAff+j6WGdwF6nWLdLX2z396gc/PYIbnWwF2 /8RCnqkUozKHd//VC2YV2wr25caSsGSKKwAxX8y1wTIiv4n+RvrGKvLdsdmPi6zpDsZ8nD Oedmf7Gn6xi99W71SDgin/UfZ0Re6egmfJH9Z4UhJPTINFbXUXI/+PD2dM5UQsAt54kUTd E+rMR1QEFoW9Da3DCbltyUFkmmhvY92UHCimPkUxtbGaD4Ygz5O96sIMT4oneyW4l9zWEn u5VTreNwycI3iltRFk3DljFQFejc7ZpQ5Em3iG1PqWQJVZbBisCQqVOcr3opxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704155840; a=rsa-sha256; cv=none; b=ngIvuwZ7rUD6ODcFZkDUaqQVBJKNq81oswTY/3X3jSt1SNcCfdaqM9MRJY+xNBxrIcE09w aA/RolOjwKwKOnoS2biO+quYY6rh6C0+Hdi4Umey6pQDBcKU3/MxkgrAzGAqDxSMwAsuLQ 1fJwh30scL+7UC4GLM6kYDJWX45FAs70iPJkjp7ytqPxZcgioBkkJCTK/DrdkWPxO7vBJ1 R/ceQ+zUJJUSJH1aSdCMzLTpcLrlx8IDMU+pE8u129BUXr8Eq1WUiUn4oafmLSMUY/Gjny ogWR+OmUdgMSUmG0lenEdYr9QkqVz4MRa2tlOnuLxT7tRk9LR3JtPvHMnLw3NQ== 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=1704155840; 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=WkAVW1qrxbcXfGCQE9QzdhPNIS5P2eFELKNMGSjiZk8=; b=DV0Kh5bwZbNPBNk/Vpjo6lOL8HBP2T2MLtm48P9dop3lC/luteQBtktCY7Eh+3Uk4Ome3m J8QRFzTudDK9hygPtKZ4WRXiKSuly8n+zFkGp17+yvkJiubXF2ee7ENauFe/4J0DO/+Qnc aGVzsq2WAVkzPYFYGU50MCkAOPyFGVn+ADRSHHADY7uKd9+5+T96yufRIOsqyhTvNNsPxJ AX0GtL7uUD0NIgQRwhKq5C37+wpPLvrYYk8217kdXk3BLEVzD/rR8s89bpUC6rMm604mU5 bdeiw2/TwyyyUgwlSqC3qCB4kZW08ySOmX4EZUFyarjZsyNziwQpbJq1SduRVA== 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 4T3v7h1x8VzfqW; Tue, 2 Jan 2024 00:37: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 4020bK7q085286; Tue, 2 Jan 2024 00:37:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4020bKjD085283; Tue, 2 Jan 2024 00:37:20 GMT (envelope-from git) Date: Tue, 2 Jan 2024 00:37:20 GMT Message-Id: <202401020037.4020bKjD085283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c8fdf4b88e02 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: c8fdf4b88e026640e082536c12da33288922a04d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c8fdf4b88e026640e082536c12da33288922a04d commit c8fdf4b88e026640e082536c12da33288922a04d Author: Mark Johnston AuthorDate: 2023-12-26 01:40:05 +0000 Commit: Mark Johnston CommitDate: 2024-01-02 00:29:49 +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 (cherry picked from commit 3fde275167ce1f1455a03586d29840546d06d97a) --- 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); }