From nobody Thu Oct 16 16:58:28 2025 X-Original-To: dev-commits-src-branches@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 4cnZ0P256dz6CntM; Thu, 16 Oct 2025 16:58:29 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cnZ0N2FKWz3k12; Thu, 16 Oct 2025 16:58:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760633908; 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=zGneb186piDI1FwN1XS7rHh2KHppfg+SoHrlU7ya7Kk=; b=DJ1G17Zsp+81jQ0b5sT4Ft3SqYpegxQegYqjhTvj19fHpCAGZ1RVqVQm6t+zOxiG5FeHgk R4DmhXJWqtNjRToj02GXWyuKH9wKqnxLwsxhWPmth9lXJw0zr6mp0USAtr1+1aAdCwCn3y IKdZ3uH21ofy1TgW9ND52tq2nBbDBCtkRkv3rGp5skQydqX65ZjTuSvwLzppoo7m7klRPB G94gmZn4WgP0CDZ8+ISem73GkTIDkV6RpsOzSm2LlhXKDb8KF47sjsRrNH158FRCgjcmhb jYRorZlCY4AqHF9wpqE7n8mA92pk/cqeifvjTIHrKNSWz/xDKWACwj0mu7hndQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760633908; 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=zGneb186piDI1FwN1XS7rHh2KHppfg+SoHrlU7ya7Kk=; b=VeCpKk9mhwbeGP3XN9K6Fx4SO2Wk4FNiu22862XXRJLd63PlxqxiA0fZe3haoGUtJHsRFH qU6zcOovsdn6FepJDUOfkQDTKhxNvZpgbj2/T71BGeZP4F32f8b++7OERtUTXjq1OY2eEv OeORLsrLEolyiMTpj4TOnSWbvFZAKPfGXUSKS8L1qc9RTJYqP2J7tU9Gu/TKON/lemR/iW GkvgYyCjQmadcx493ylCbaX6aqda1dML+URZBgcBNOBx0DjfZOkVDNDg53Qlz4WSDKRRyK OXuzAbjKHt//hI1Z2JCc290Sjnb1JUWXXIropZ0NdZOMALq2Iz0slonXqCYTFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760633908; a=rsa-sha256; cv=none; b=w7fk/QmSWWqL5oGkkt8jJ216opCz+RNmoHIlxaiqb6FNZYymHLLefEwGGabJe/XfVPlcwY PiqYLANFuPFZxzicHpEd0YnKxwVYDkOnS0IW/ZnmuEZuz2PCuyQafM2OvpXIIghIuAD4ZQ pcN+PqIpDiE38PIpqonKl4e0J/GQLOxSmmvY4WLnAaBalgr3THWBHJSz3jbFYHYFCtbtoo FpcYRS80ABC3j2oeASW5k4rEelJYg/jXu27QlaSwJS/KhawYpZ9aowpRl8gtUe78OrTcIl qJjDLn3fhYx0VhOEZ/HSVK+lBW0TydhxdASa/LKBis3L8Am/6Ppnbf6ZnW56OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cnZ0N1FKvz2Cf; Thu, 16 Oct 2025 16:58:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59GGwS85055981; Thu, 16 Oct 2025 16:58:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59GGwSwr055978; Thu, 16 Oct 2025 16:58:28 GMT (envelope-from git) Date: Thu, 16 Oct 2025 16:58:28 GMT Message-Id: <202510161658.59GGwSwr055978@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: fb8a978ebfeb - stable/15 - sys/rpc: UNIX auth: Do not log on bogus AUTH_SYS messages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: fb8a978ebfeb5522123e3afcbcd5dc36591dce31 Auto-Submitted: auto-generated The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=fb8a978ebfeb5522123e3afcbcd5dc36591dce31 commit fb8a978ebfeb5522123e3afcbcd5dc36591dce31 Author: Olivier Certner AuthorDate: 2025-10-14 12:54:55 +0000 Commit: Olivier Certner CommitDate: 2025-10-16 16:57:46 +0000 sys/rpc: UNIX auth: Do not log on bogus AUTH_SYS messages Remove the printf() stances added in commit d4cc791f3b2e ("sys/rpc: UNIX auth: Fix OOB reads on too short message"). Even if it can be helpful to know why an authentication message is rejected, printing explanatory messages on each request attempt is a remote log filler that could be triggered by accident, and the generic RPC code generally does not do that. These printf() calls should be restored only after some limiting or configuration mechanism is devised. MFC with: d4cc791f3b2e ("sys/rpc: UNIX auth: Fix OOB reads on too short message") Sponsored by: The FreeBSD Foundation (cherry picked from commit 2110ae0ef9d6ca8cf52b29fcaf926c4343f56826) --- sys/rpc/svc_auth_unix.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/sys/rpc/svc_auth_unix.c b/sys/rpc/svc_auth_unix.c index 9e4b0b8483b5..aa0fc585865f 100644 --- a/sys/rpc/svc_auth_unix.c +++ b/sys/rpc/svc_auth_unix.c @@ -41,7 +41,6 @@ */ #include -#include #include #include @@ -70,11 +69,8 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) const uint32_t min_len = 5 * BYTES_PER_XDR_UNIT; uint32_t str_len, supp_ngroups; - if (auth_len < min_len) { - (void)printf("AUTH_SYS: Too short credentials (%u)\n", - auth_len); + if (auth_len < min_len) goto badcred; - } time = IXDR_GET_UINT32(buf); str_len = IXDR_GET_UINT32(buf); if (str_len > AUTH_SYS_MAX_HOSTNAME) @@ -85,12 +81,8 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) * 'str_len' (and that it won't cause an overflow in additions * below) to protect access to the credentials part. */ - if (auth_len < min_len + str_len) { - (void)printf("AUTH_SYS: Inconsistent credentials and " - "host name lengths (%u, %u)\n", - auth_len, str_len); + if (auth_len < min_len + str_len) goto badcred; - } buf += str_len / sizeof (int32_t); xcr->cr_uid = IXDR_GET_UINT32(buf); xcr->cr_gid = IXDR_GET_UINT32(buf); @@ -108,14 +100,8 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) * read in total. */ if (auth_len < min_len + str_len + - supp_ngroups * BYTES_PER_XDR_UNIT) { - (void)printf("AUTH_SYS: Inconsistent lengths " - "(credentials %u, machine name %u, " - "supplementary groups %u)\n", - auth_len, str_len, - supp_ngroups * BYTES_PER_XDR_UNIT); + supp_ngroups * BYTES_PER_XDR_UNIT) goto badcred; - } /* * Note that 'xcr' is a 'struct xucred', which still has the