From nobody Tue Jan 02 00:37:17 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 4T3v7f25Hnz55yjB; Tue, 2 Jan 2024 00:37:18 +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 4T3v7f0l5Gz3HkH; Tue, 2 Jan 2024 00:37:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704155838; 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=+6GaA9OHOlTwX40yxvuRHgY18vmKJdAHC4NuieMljSE=; b=GTkD/Y599X6AJS5yZ+ltXAEV0TQIcO9zyF1cTZq2M/6Ybw0A/Rg0cY39DwejGQdkEFgkk7 3fs3rwU2olZCPJR4FINQUStZM7kNe7wafelik1e6cwLZ1tqbEsIP3m2XXJVdr3XybprLDW 2lPuuMOhggVbAx+5GS4uhwtMZpchIcfSqVoqz9GZl+9xT9furFEzBSmz+nbqFCuY+yVrV+ jF2WwaqylM5tZfdgzRwv/vP6tp55IDlvViPsHKMu7XBqI4lPlqQuZhQ7AUTp3Pg2H/C2mo T8FmXGUB7JSrSZqOJVZlyLWDUT8O9fg0L6y23O4xbNhAlibDM22hKA/dpix36Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704155838; a=rsa-sha256; cv=none; b=DMhif+q9sWDZv/6JemKMJOEWjqv4Q6UPoH5kOZiT+/uop86w7n50HzFxqyoJoLfF33zXAf JpWOLDG3R24MXM03X3QhVdmjbVJQVcSWwEjw2vgtSf8EsEw9d3kpp/AOnqt/FQn6Wv8R+D xkDktZVlugBUb+2t4fQIHgrexZbqIbSbO7sirZLyYwesoG48TIzIV/w4gJIeR6amG4BuDJ nAuaQSLb7L07im+Vw4pT8tOpM47Xbu7iSQZWBAAmRdH39d2H0FN3fb78Cbhxr2yYwr79xg OTCJ4BYR9eJIT4W8VAqd9gXOPtHepCXUIJkZqD3YInWMikrYwvB4v9uZs+TSfQ== 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=1704155838; 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=+6GaA9OHOlTwX40yxvuRHgY18vmKJdAHC4NuieMljSE=; b=dePRM5BxV0KabG6FHVnsM4wyT1rbd1760jInlBaFe3rkR5iKuOZpGuQVgGsOOStrA1rx8c WqyTDsgD1ms45wgkMXRBUN0lbcgpUVzkVJu721+s/imCGlUcg+Cfv27ckr3dDEAC202aOf vMeffdfjfj6gwhKrU68Q0mu5L3BGFBV5hVZhPngtIUa0Fw7D9Bw5JQ9dk6FMeiq3+CiHn7 TPlurrLcPgGTmxEVhliq6AHrEWXv2t641zL6PNsXREXsFkCxHOTcOeU+33FHOyr9KJ1dKQ cfT2jxb5kJ5msjq2o/B8LtkMVkuQ1I7XMuh0OOY6FFFJe40baGiJBn0K5JEbgg== 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 4T3v7d6yfhzfQD; Tue, 2 Jan 2024 00:37:17 +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 4020bH58085182; Tue, 2 Jan 2024 00:37:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4020bHCr085179; Tue, 2 Jan 2024 00:37:17 GMT (envelope-from git) Date: Tue, 2 Jan 2024 00:37:17 GMT Message-Id: <202401020037.4020bHCr085179@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: 81ee40d0a269 - stable/14 - compat_freebsd4: Check for errors from subyte() in freebsd4_uname() 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: 81ee40d0a269f8fb902f79b9e6f018944880ac8f Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=81ee40d0a269f8fb902f79b9e6f018944880ac8f commit 81ee40d0a269f8fb902f79b9e6f018944880ac8f Author: Mark Johnston AuthorDate: 2023-12-26 01:39:21 +0000 Commit: Mark Johnston CommitDate: 2024-01-02 00:29:47 +0000 compat_freebsd4: Check for errors from subyte() in freebsd4_uname() This is in preparation for adding a __result_use_check annotation to copyin() and related functions. Reviewed by: imp, kib, jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43099 (cherry picked from commit 4f35450ce52a7b141e7ae8d37fa257b5f8971dda) --- sys/kern/kern_xxx.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c index 3fe681d0c08e..398ac18c9422 100644 --- a/sys/kern/kern_xxx.c +++ b/sys/kern/kern_xxx.c @@ -327,7 +327,9 @@ freebsd4_uname(struct thread *td, struct freebsd4_uname_args *uap) 1, 0, 0, 0, 0); if (error) return (error); - subyte( uap->name->sysname + sizeof(uap->name->sysname) - 1, 0); + error = subyte(uap->name->sysname + sizeof(uap->name->sysname) - 1, 0); + if (error) + return (EFAULT); name[1] = KERN_HOSTNAME; len = sizeof uap->name->nodename; @@ -335,7 +337,9 @@ freebsd4_uname(struct thread *td, struct freebsd4_uname_args *uap) 1, 0, 0, 0, 0); if (error) return (error); - subyte( uap->name->nodename + sizeof(uap->name->nodename) - 1, 0); + error = subyte(uap->name->nodename + sizeof(uap->name->nodename) - 1, 0); + if (error) + return (EFAULT); name[1] = KERN_OSRELEASE; len = sizeof uap->name->release; @@ -343,7 +347,9 @@ freebsd4_uname(struct thread *td, struct freebsd4_uname_args *uap) 1, 0, 0, 0, 0); if (error) return (error); - subyte( uap->name->release + sizeof(uap->name->release) - 1, 0); + error = subyte(uap->name->release + sizeof(uap->name->release) - 1, 0); + if (error) + return (EFAULT); /* name = KERN_VERSION; @@ -376,7 +382,9 @@ freebsd4_uname(struct thread *td, struct freebsd4_uname_args *uap) 1, 0, 0, 0, 0); if (error) return (error); - subyte( uap->name->machine + sizeof(uap->name->machine) - 1, 0); + error = subyte(uap->name->machine + sizeof(uap->name->machine) - 1, 0); + if (error) + return (EFAULT); return (0); }