From nobody Tue Jan 02 01:13:02 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 4T3vwv2PPHz563Fk; Tue, 2 Jan 2024 01:13:03 +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 4T3vwt6v6Jz3b0K; Tue, 2 Jan 2024 01:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704157983; 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=X9Wdy7S1RPaiiDv2fPcH0GZ7pdA+BNXSSx62RO4pwso=; b=Y2yfJwJ5rd8YLXkq380Y7q1EvT+aCLJszZ3C73YJObL0PnKrwjSNa9MvDseeVqPXX6Zh8P 9a8Oi6BOMUW7jlNLqutF6ffRLVm1ksD9psacarO/JJTdlmvDSHJ/X/R+JJiQq6Gt2uuku4 11KRjlZDI6akXH9HITI3tNYP66QytX47av9oWYC+qdcegSXq5BFgBGNCq7rh80HqtANqc1 gmuyL7rM+nVDrr1CtB4j90Og6tbWFmVBYNb9dpmS+T+Codn4I/H8HOOS19IW9fNHWpkqlX G1nJ1dxSocI3Zt3CkB+jopxdxM/1167IE19lepdKCj8SEecCeeJkq1IHuqDX9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704157983; a=rsa-sha256; cv=none; b=DUreHYm4sHycSZ/PiZgqpuczx/O36n/z7ySFoZY7DWo24D1JsIK5+KBtRceF7tiCGr6mVW nxgGjaEvIcrdUvSmhj4RMVfvpMhYIugdUc4mSUmPKIQR3qSkR5S/3VQoSi8Tos0QubJYxc ow9PQcKlkRtkctEjIX8MHBO1w4LXhwB3TQ9n3lsX+pkv2y1wdk/7HyA+J/dHv6YFABGwH8 ZTzWln33dlEfaY3PBMbFkd3GV4q4H0zb88mlTqjQU91bmBUnOqCmSTVhAAlzT7cClkCZkL sSuoJo6WRsHCETW/uAO6mkQHz/0Til0pjEVYfZAnB29irBh9Cr53NNNRIFgreQ== 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=1704157983; 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=X9Wdy7S1RPaiiDv2fPcH0GZ7pdA+BNXSSx62RO4pwso=; b=UJSJohLn9yHqi77zoy0FoJuX/To5iJ4dAuAUjkt7L5p+y23qqFcb1Rt8jpy1yf8Pwam2Aa VtvdUnDWNaeicdRseq6KyGWC8cURbAQ44CssDmYcFsv0PQhRcuwpSb2BiTB/3w7S+YHrPI brIj+RGiFZX9H8nb1bSeUK+jI8RYePjmOkY06jrDmhMLxCkYoMgrGYP2l7RqDT8cVc+qTH RlwW16yUVT40UySOEyBDMMljdrKGAhRZhmuMOM7weB6g7T2tgmMozQqJNNaCLmWQecbhwG +DxmRVf67nP2tbA4YFlBUWwFyF7ORBTtPWkA7Gwqlce+wqZ3OJPdJ6bseFTloQ== 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 4T3vwt5zq2zgTd; Tue, 2 Jan 2024 01:13:02 +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 4021D2sl054938; Tue, 2 Jan 2024 01:13:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4021D2e3054935; Tue, 2 Jan 2024 01:13:02 GMT (envelope-from git) Date: Tue, 2 Jan 2024 01:13:02 GMT Message-Id: <202401020113.4021D2e3054935@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: 76ecdbce7703 - stable/13 - powerpc: Avoid ignoring copyin()'s return value 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/13 X-Git-Reftype: branch X-Git-Commit: 76ecdbce7703d5a7bae90d53cb612a496c87c261 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=76ecdbce7703d5a7bae90d53cb612a496c87c261 commit 76ecdbce7703d5a7bae90d53cb612a496c87c261 Author: Mark Johnston AuthorDate: 2023-12-26 01:40:16 +0000 Commit: Mark Johnston CommitDate: 2024-01-02 01:12:45 +0000 powerpc: Avoid ignoring copyin()'s return value A recent change made it possible for cpu_set_upcall() to return an error. Do that here instead of ignoring an error from copyin(). Reviewed by: jhibbits MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43105 (cherry picked from commit bdf03b4bcc4a9aa0be503dbc64415e6b0b845fbc) --- sys/powerpc/powerpc/exec_machdep.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c index 341b78b018b6..4c7eba0b2965 100644 --- a/sys/powerpc/powerpc/exec_machdep.c +++ b/sys/powerpc/powerpc/exec_machdep.c @@ -1069,6 +1069,9 @@ cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, { struct trapframe *tf; uintptr_t sp; + #ifdef __powerpc64__ + int error; + #endif tf = td->td_frame; /* align stack and alloc space for frame ptr and saved LR */ @@ -1096,10 +1099,12 @@ cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, tf->srr0 = (register_t)entry; /* ELFv2 ABI requires that the global entry point be in r12. */ tf->fixreg[12] = (register_t)entry; - } - else { + } else { register_t entry_desc[3]; - (void)copyin((void *)entry, entry_desc, sizeof(entry_desc)); + error = copyin((void *)entry, entry_desc, + sizeof(entry_desc)); + if (error != 0) + return (error); tf->srr0 = entry_desc[0]; tf->fixreg[2] = entry_desc[1]; tf->fixreg[11] = entry_desc[2];