From nobody Thu Jul 31 18:46:16 2025 X-Original-To: dev-commits-src-main@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 4btJ2Q0Bh6z62vGM; Thu, 31 Jul 2025 18:46:22 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btJ2P5CKqz3lKc; Thu, 31 Jul 2025 18:46:21 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-4ab3802455eso16181351cf.2; Thu, 31 Jul 2025 11:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753987580; x=1754592380; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=KHPF9ytN7OMFf2tov2SVG9KZVsALcC8IXi7zaU3KEFo=; b=hinjmMrKPcO/l/JkQ3/RKrwXC13Osl31WQiX3bq7urKR8/bgEFPsiFVMd8z4yqIzRO 16pJhS7nuxi/OIiWKvekUpLJxIL2RidOwNe56HoyQZqEUrH7WchiJyTv3nqZnAQs8Ywl tY2mn9GZlR4qHA53oPjQaYcQYc2CB+nSJoeoHiZHspWG51BU2rNBVjPv/w8NZloGl+kE Q+Py+hbA762fkCIpYsQhuxw2/LEWCIA07uU7W3zuPdpUU14w9OajpsNqaK3gzYE37JcK Dc5BulJ1po5YDG6cFyQrmSgqyX/SyZsFVHmZK4YL8OwgG+zgFyRBWw940jf+6Pot8Jgu 1TBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753987580; x=1754592380; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KHPF9ytN7OMFf2tov2SVG9KZVsALcC8IXi7zaU3KEFo=; b=NNhWNyndLmGJ34HVaPzVIQNrVsQuPadBOm5x3SB4/VA86eeL1G3Aj/ZBpyr0dRL7YC hmp9bq3ksMvU9VjKAsvGkdlvdBIpS2lduSCgBFNXMfViRvmiiNURz55ZtzZQz/zBemR1 WmouxwIPrNUGliQvgvxRWV2TSL7U044OvdiLhk3fplYyC9FzdGmLYCB0uagD6APq0855 d+dvdfdsy5JTuQQnYPz6iyDqAe1Yzs0+A1LW2m2qBu1Kmee6HbUbAG4q18RYdRj+IQG3 ivuUv/DylE0znlKzkDj/aGone6cux1HnxXIfG3dyxom9I3KkvaIu9I2lHs56DUPZBsL0 nliw== X-Forwarded-Encrypted: i=1; AJvYcCU3e5kg/M9I3IPCtQCBG083L19LXfLrq+ry+eO/dpz194EkGARgKSA+rR/OHenQRbGgT1H7606Ao80O6jGFsJwfGyEg@freebsd.org, AJvYcCUbX4huBzt98vLrpsCMzLK/aRFroJ8vHSlasQ64cwORgsULd4dWCj+hN31WJUflEkV5ZPsriQoHH1LoJ0uMqOLAxnHHgIU=@freebsd.org, AJvYcCVJ5vdSjrbDLC3yk2W7V/GWgXSbjd4O1KF+xbwOuT9yrbyKgTzSKiOdOTlDiJ7jsVbFjAKnjg==@freebsd.org X-Gm-Message-State: AOJu0YwINr5L5jPB1b9KG9P/V0IMuulnxbDoVT4gMOtG5rlduKUNtSdE MJBcsKf3GQHw0J+aJnuFYr+4tFYDs38DNTi/tse3IunJ1PGpWDCYC/C65hSIKP4E X-Gm-Gg: ASbGncvVpQir9qRevAgHBGMJPECgXnX/7oRnPla6L+AcqwePqjg6o9285w765sxXMQc NQKvec0DrdBl4mCyiNI5dqKiveYJvILLefXHu6ZulCkMJuNoLnoLOsFlKlFjTxfz8MO/PFfdY95 GhLy1EWg3A/TV4SnEj5KhlpadoeRCzhm/YUvclAgeE3P78KihNCfr9it77fQtrlU/m6takF1IZx qQAVwUwZzzcmUbqsohdvaxU/ImjdMomd1Vpm99EGgzEhcJOxoRE8UHuPYwH/gEuIVfd8fR/2bKA O1gk88VtSAI+SNN23xVij8CtDTzfqxZIqbpe4aBT/+YRGcgx9/CRf5WRhueYjtVMeNPjOOp+NT+ z1X/VVas50SfVs6kDXSpWfaWJSO/XPsgxJdon X-Google-Smtp-Source: AGHT+IEHKm8U5+Fa37hijiiRbviBF20tSVycQTe8atHTV/fz3R1zJ0MIf+G1B9NfTWpAb+a9Qfynqg== X-Received: by 2002:ac8:57d5:0:b0:4ab:63f7:9a80 with SMTP id d75a77b69052e-4aedb986770mr149197671cf.13.1753987579484; Thu, 31 Jul 2025 11:46:19 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4aeeebde17fsm12179181cf.1.2025.07.31.11.46.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Jul 2025 11:46:19 -0700 (PDT) Date: Thu, 31 Jul 2025 14:46:16 -0400 From: Mark Johnston To: Kyle Evans , olce@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: be1f7435ef21 - main - kern: start tracking cr_gid outside of cr_groups[] Message-ID: References: <202507310444.56V4icA3054832@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202507310444.56V4icA3054832@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4btJ2P5CKqz3lKc X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Thu, Jul 31, 2025 at 04:44:38AM +0000, Kyle Evans wrote: > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=be1f7435ef218b1df35aebf3b90dd65ffd8bbe51 > > commit be1f7435ef218b1df35aebf3b90dd65ffd8bbe51 > Author: Kyle Evans > AuthorDate: 2025-07-31 04:44:11 +0000 > Commit: Kyle Evans > CommitDate: 2025-07-31 04:44:11 +0000 > > kern: start tracking cr_gid outside of cr_groups[] > > This is the (mostly) kernel side of de-conflating cr_gid and the > supplemental groups. The pre-existing behavior for getgroups() and > setgroups() is retained to keep the user <-> kernel boundary > functionally the same while we audit use of these syscalls, but we can > remove a lot of the internal special-casing just by reorganizing ucred > like this. > > struct xucred has been altered because the cr_gid macro becomes > problematic if ucred has a real cr_gid member but xucred does not. Most > notably, they both also have cr_groups[] members, so the definition > means that we could easily have situations where we end up using the > first supplemental group as the egid in some places. We really can't > change the ABI of xucred, so instead we alias the first member to the > `cr_gid` name and maintain the status quo. > > This also fixes the Linux setgroups(2)/getgroups(2) implementation to > more cleanly preserve the group set, now that we don't need to special > case cr_groups[0]. > > __FreeBSD_version bumped for the `struct ucred` ABI break. > > For relnotes: downstreams and out-of-tree modules absolutely must fix > any references to cr_groups[0] in their code. These are almost > exclusively incorrect in the new world, and cr_gid should be used > instead. There is a cr_gid macro available in earlier FreeBSD versions > that can be used to avoid having version-dependant conditionals to refer > to the effective group id. Surrounding code may need adjusted if it > peels off the first element of cr_groups and uses the others as the > supplemental groups, since the supplemental groups start at cr_groups[0] > now if &cr_groups[0] != &cr_gid. > > Relnotes: yes (see last paragraph) > Co-authored-by: olce > Differential Revision: https://reviews.freebsd.org/D51489 This syzbot report looks like it might be related to this change: https://syzkaller.appspot.com/bug?extid=4e68da43c26f357a2b7e No reproducer yet, but sometimes it takes a little while.