From nobody Tue Jan 02 01:13:16 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 4T3vx90HXKz563Gk; Tue, 2 Jan 2024 01:13:17 +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 4T3vx84lc9z3bGK; Tue, 2 Jan 2024 01:13:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704157996; 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=tJo6EoB+Ama6o/U8iHcyvsVxi7Q07kq5xSrxgrkxu70=; b=Lh6Mw6xVVDdJbpSqt7/6/z/Z3NmaAtEek3UIWTNQwBkcjF+2yhnGPGvNprR2KM7txBND48 cICgu6DhU0hyaCvJtOxM/ByfepWlm4Wt2pzyHUuGYxxU8LnfcWcAkfhMGkKQp1M0pVxnJ+ kJaHXkVVj7wSczS+IEOxU3OS9t1niXk7jMBRMc5KNSC/X/ZrFew9Ok53AwbO9ZZY2I80E4 cdfoAhpt+Z0SyPUH9NPKtsIMrB47as/zbEM6sNG6tolJyIviWiDZsCB+HhP6V8T1eWsBw6 dZ/Gh54Jfc6uLc54mgTqB0dTqTfbKv64L221fv87MhWmUdYKyquZR9QGCXjFag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704157996; a=rsa-sha256; cv=none; b=jcel5FYYj0XsEkZquzdHEA9Bh/tN8xwXD5SYwT3fIsHr71QtQMvLX/gslTy3h1HbRv+uaP Sqos+GXhujkGLr4+D0rWeg1tI2LgaHVnGgKsS9XYJD7cRcGFwu+OikBcg22Det/mWWNSn+ Vh0eErrBw/+w4S70LCfwqSkA2MMAPjg4AccqWmiRoxKtSKiAfCGoYUUANhOWdMun3xiabl fisSjFVOPPKQhtcLkHUI5XYexyj7DbB5gbG6cJxxFPro5ctHO6vbD9FZeiOdhg0kRQmaI4 t8g0vLLGhDZYLKwQqfa1Yx4W7s7kyY65utFnDxuYgl+uWXmj/u6YVGx5ePWS1A== 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=1704157996; 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=tJo6EoB+Ama6o/U8iHcyvsVxi7Q07kq5xSrxgrkxu70=; b=F16vjIXy/N0sCraX03osHzn9suSjbm9GIqbMSpsEOUffQiEu5I71Gh36g+UpK4CqNV3gqI 0SRW2GgqhcVwTVluNuVu3FEML2Wb41d+h9UlBwQIG9EwGbddOuFKr2ZGfbYRywknW/H/AI ao3B+q8bqIrS8yGodtRkOaO08n9fP3X/8YGzTKi4cziLHuXgH+N3PWKsab222ryaiJQG9c LDw5sVj8Cdx+Jaa9Qezfl26WM/AdN2xAe+5mzjZrvSLWUA8OFZJLIITkq7grBs2JUcwRo7 GDo5mVmq8nx+4W21FxnVzZT8XV7T8kQa9/ykaGiBccAmDzXC0KYXD+iDcEIO8Q== 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 4T3vx83ryfzggB; Tue, 2 Jan 2024 01:13:16 +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 4021DGgb055546; Tue, 2 Jan 2024 01:13:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4021DGf2055543; Tue, 2 Jan 2024 01:13:16 GMT (envelope-from git) Date: Tue, 2 Jan 2024 01:13:16 GMT Message-Id: <202401020113.4021DGf2055543@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: 736f172567be - stable/13 - compat_freebsd4: Fix handling of errors from subyte() 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: 736f172567be5f984f1202b388a798b8345d06ad Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=736f172567be5f984f1202b388a798b8345d06ad commit 736f172567be5f984f1202b388a798b8345d06ad Author: Mark Johnston AuthorDate: 2023-12-26 01:43:38 +0000 Commit: Mark Johnston CommitDate: 2024-01-02 01:12:45 +0000 compat_freebsd4: Fix handling of errors from subyte() Upon failure, subyte() returns -1, not an errno value. MFC after: 1 week (cherry picked from commit c38df501ce2ed7da128448f815ec627c39fd3bad) --- sys/kern/kern_xxx.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c index 8674dbf61361..ae88fc90eb7c 100644 --- a/sys/kern/kern_xxx.c +++ b/sys/kern/kern_xxx.c @@ -374,13 +374,11 @@ freebsd4_uname(struct thread *td, struct freebsd4_uname_args *uap) for(s = version; *s && *s != '#'; s++); for(us = uap->name->version; *s && *s != ':'; s++) { - error = subyte( us++, *s); - if (error) - return (error); + if (subyte(us++, *s) != 0) + return (EFAULT); } - error = subyte( us++, 0); - if (error) - return (error); + if (subyte(us++, 0) != 0) + return (EFAULT); name[0] = CTL_HW; name[1] = HW_MACHINE;