From nobody Sat Sep 20 03:45:35 2025 X-Original-To: freebsd-current@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 4cTFdX4PMlz6889L for ; Sat, 20 Sep 2025 03:45:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cTFdX3fR1z3MWb; Sat, 20 Sep 2025 03:45:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758339936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iNahbaGnH6/JYr9EFachP3xHvTue2kCa5xAyaRU8Obs=; b=Pwxa7eh9P/sfz0BOFwNTTpHNOugumNTAxtyxBPCOaB/Lo4ed/gQFiq5qng/9bf5PAjJn9l mB0IN3+qnbvvphWj9239uviWjAc42Yd5UnjHVSa0eetMJiYKo2VXV3eMQnkO8vB/u/XGxq leXHRj6y5aKSyfETtZWfqHLQDYPdoSwj7EnqXZm+UC76hFIbTg4h6Gtjs9upluk7vm7i0m HygfgcOgmeJ0/qigAeLha9PiPfnStxGINGkEguYGPJz5xstqwrzM1ZxT17Fg125QC+Ethg ReNp92vnLvrRUm0/hx1yZxK226TFYlihKBWm8nXhp6fwnOFCvr4ppz9T8VMjGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758339936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iNahbaGnH6/JYr9EFachP3xHvTue2kCa5xAyaRU8Obs=; b=EVazCdJFwhfOV16Qm+PDr08kqrIht5DSv5zwmO2A2fWeXU4ZCZuZBcBQ9prv8bv+VakegU PaGKp59vojqnvaa14tPvzJyj0qd+EFXuZ2j3mjyNiMJp5hCpYPeIMUylNDC6JU8V718DHZ lwPaegXQGaOUwfa2E0MeO4wVE+KFs4OFKLsbWxoyPPoOqZ0hxnt7ck+/40DceKwlwzKqZi yRAPJg+5+XkmYk43uU2JSqBvTDX6OcDMgfCKP8rU5KwpFsTdvPYhAekR4YQMTJVPFOpUuL PAnimqkKBDP4IoUHalEYwcsAM5hWblHLnGOlsVaUeWWT34YVuWG1DtdITHKm6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758339936; a=rsa-sha256; cv=none; b=rvzkqp9Mqa5mrGSWsVB4cTcG0IMY/+glWfHUtPrGy4ZRDrg3JZdx37bxAf3DlcwoXQ52Jj qTw1pLbd8jEJLxpQH8fArAoHhcMTrqzCWeNZAYioxAmovsSz7GLQ4G2QODF30/hQUtReXX xHfHVM+zuaM3wQG4H1qwcZMqQNqxieNoYoNBT6P76/tCaPuUDxq0/Ix/W5QbjrOJNzuX8B 6JNrXd62WrNyrAKBq53zZNZNdP/7djsJQ9WifT4S235+emL8M6ULB/Gt1HCIuyLUyxiL7N 7l0nqWAQGyr9F/EBPvc+71zKGh8Bl0w6zJtIsoZo5SjBUUciFGeVcjFCCVCLLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [10.9.4.95] (unknown [209.182.120.176]) (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 did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cTFdX18LszJn1; Sat, 20 Sep 2025 03:45:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <332dadd2-5f70-4945-acc2-a7b1b874e66d@FreeBSD.org> Date: Fri, 19 Sep 2025 22:45:35 -0500 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Possible incompatible change with initgroups(3)? To: freebsd-current@freebsd.org References: <20250920.080248.183796883139076827.yasu@FreeBSD.org> <20250920084357.32586ee5@darrin.worldsmith.org> <20250920.084312.1821713565920964352.yasu@FreeBSD.org> <20250920105317.41007477@darrin.worldsmith.org> Content-Language: en-US Cc: Olivier Certner , Konstantin Belousov From: Kyle Evans In-Reply-To: <20250920105317.41007477@darrin.worldsmith.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 9/19/25 20:23, Darrin Smith wrote: > On Sat, 20 Sep 2025 08:43:12 +0900 (JST) > Yasuhiro Kimura wrote: > >> From: Kyle Evans >> Subject: Re: Possible incompatible change with initgroups(3)? >> Date: Fri, 19 Sep 2025 18:35:29 -0500 >> >>> Are you folks using GENERIC, or a custom kernel config? The more >>> interesting >>> commit here is 9dc1ac8691966480ff8bd9c37dd405b981b41dd5, which would >>> surface a >>> problem fixed by a rebuild if you're using a custom kernel that does >>> not have >>> COMPAT_FREEBSD14 enabled. I don't think I'd quite expect that >>> failure mode, >>> though, so maybe not. >>> >> >> I use GENERIC kernel. >> >> --- >> Yasuhiro Kimura >> > > GENERIC here also. > Yikes- the compat initgroups is broken by some botched symbol resolution, and I'm not really sure the ideal solution. The below patch functions as a stop-gap, but I'm not sure that it's ideal. The problem is that freebsd14_setgroups is only defined as a weak alias for the FBSD_1.0 version of setgroups in lib/libc/include/compat.h via __sym_compat(). A simple ktrace shows that it's ultimately getting resolved to accept(), for whatever reason, and thus we end up with the nonsensical error for anything trying to take the legacy initgroups() path. Thanks, Kyle Evans diff --git a/lib/libc/gen/gen-compat.h b/lib/libc/gen/gen-compat.h index dac8f54b45a2..8cd5a79b3ff7 100644 --- a/lib/libc/gen/gen-compat.h +++ b/lib/libc/gen/gen-compat.h @@ -52,6 +52,7 @@ int freebsd11_getmntinfo(struct freebsd11_statfs **, int); char *freebsd11_devname(__uint32_t dev, __mode_t type); char *freebsd11_devname_r(__uint32_t dev, __mode_t type, char *buf, int len); -int freebsd14_setgroups(int gidsize, const __gid_t *gidset); +int freebsd14_setgroups(int gidsize, const __gid_t *gidset) + __asm__("setgroups@FBSD_1.0"); #endif /* _GEN_COMPAT_H_ */