From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB9E9C83F17 for ; Tue, 29 Aug 2023 23:23:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qb7nw-0001ux-4n; Tue, 29 Aug 2023 19:07:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb62T-0000cA-UC for qemu-devel@nongnu.org; Tue, 29 Aug 2023 17:14:20 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb62Q-0004Bv-RO for qemu-devel@nongnu.org; Tue, 29 Aug 2023 17:14:17 -0400 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-99c1d03e124so632701466b.2 for ; Tue, 29 Aug 2023 14:14:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693343652; x=1693948452; darn=nongnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=u6UPXPIoAhAVR22uu9vDmx+zm3ew0X6QqFlB6xZqMjA=; b=iIjzSZFO39aRTZMXdo4qv/AUKU8MNck8rD3cB7oMbCFmJ+F73G7uo+5AeUaB+5zuGv BpiPUa+f54iOn0hZXHY82P9CimysB1jUyw2ygEasbt9n/wWqvkPHEmkZpVBi+H/QHons A90nb6+CFJemzvDyuRsnemJnY+1fog00TcVguqvJqQtqtcJJ9Q6k3YbdZar3RbmhmbBQ JFdmLBu3YO9Kf0uX4pE7A2FjAUwIIomDqb3/FEW8nP1JMz8FJfYd+XvR9OuYviWu6IRG vm0IbRR05vFhZ9A7xPXy/MIed41L7LtP3dp4hgTjPs2L6xEFCdDz00jAZ0RHcO0CkOYB RxgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693343652; x=1693948452; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=u6UPXPIoAhAVR22uu9vDmx+zm3ew0X6QqFlB6xZqMjA=; b=bHh5oBred50N8N98t5W3s3WzbKrkDRH3pSthxQv6Fq40B8FdFCnPgOr3dQL3zhZSD0 sXgHTVrOTpaGalhXlV6I7Hxrno/cCqk9/vwa0p+qUaOBKPyETV5J48MImlPp00u5T8jU pJO2ki8QhTI9lMPBd8LWHx7R5G4QFmKbPS3MM1sUJRk0+QXrpxKm0I0dYp4vI51HHOQP mcdfrzmgBmSVh6Ci9Qa6GQ4Cf1f1c54m09EG63UvDEQ0TmcH2K9MpAEIeI8M3aMuhYIa snnb3YovG4tfsYpDrJ9T0Q1h3JKA51AVHULRBXpZdBVSLhVYROIUhtXbo58NwOrGgCXw XfTA== X-Gm-Message-State: AOJu0YxLZnSHXJ804wWlZDbdoaWGpz4Oh5rnXYJOXD4/Vrrpihfhjupo 0YD6/cnd61LQlxLVWRbRbr3RYXJ8d774Aq6obnjKlA== X-Google-Smtp-Source: AGHT+IHq8ck0zK8dTOEchF1gOkJpn76T2/cbabQ9CbrMSJz3bOl9opT8pyAxlbjQHOTn5KYZxmGcDCt2+IoQcxtokuc= X-Received: by 2002:a17:906:1cf:b0:99d:ec81:df58 with SMTP id 15-20020a17090601cf00b0099dec81df58mr138207ejj.19.1693343652336; Tue, 29 Aug 2023 14:14:12 -0700 (PDT) MIME-Version: 1.0 References: <20230827155746.84781-1-kariem.taha2.7@gmail.com> <20230827155746.84781-30-kariem.taha2.7@gmail.com> In-Reply-To: From: Warner Losh Date: Tue, 29 Aug 2023 15:14:01 -0600 Message-ID: Subject: Re: [PATCH 29/32] bsd-user: Implement pdgetpid(2) and the undocumented setugid. To: Richard Henderson Cc: Karim Taha , qemu-devel@nongnu.org, Stacey Son Content-Type: multipart/alternative; boundary="000000000000e16a840604164ad4" Received-SPF: none client-ip=2a00:1450:4864:20::631; envelope-from=wlosh@bsdimp.com; helo=mail-ej1-x631.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org --000000000000e16a840604164ad4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Aug 29, 2023 at 2:36=E2=80=AFPM Richard Henderson < richard.henderson@linaro.org> wrote: > On 8/27/23 08:57, Karim Taha wrote: > > From: Stacey Son > > > > Signed-off-by: Stacey Son > > Signed-off-by: Karim Taha > > --- > > bsd-user/freebsd/os-proc.h | 23 +++++++++++++++++++++++ > > bsd-user/freebsd/os-syscall.c | 8 ++++++++ > > 2 files changed, 31 insertions(+) > > Reviewed-by: Richard Henderson > > > +/* undocumented __setugid */ > > +static inline abi_long do_freebsd___setugid(abi_long arg1) > > +{ > > + return get_errno(__setugid(arg1)); > > +} > > Given that this is > > #ifdef REGRESSION > ... > #else /* !REGRESSION */ > return (ENOSYS); > #endif /* REGRESSION */ > > in current freebsd, we could probably just stub this out? > I agree... The REGRESSION kernel option exists only so that the tools/regression/security/proc_to_proc tests can run. this is an interesting set of tests, but hasn't been updated since 2004, except for the usual 'churn' commits required by sweeps for new-compiler things, or project policy changes. So it's not even clear if this specific regression test is still interesting (though there are many other tests in the tree that are recent and under active development). So it's irrelevant to the bsd-user emulator, and returning ENOSYS will match perfectly what almost any kernel deployed will do. Warner --000000000000e16a840604164ad4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Aug 29, 2023 at 2:36=E2=80=AF= PM Richard Henderson <ri= chard.henderson@linaro.org> wrote:
On 8/27/23 08:57, Karim Taha wrote:
> From: Stacey Son <sson@FreeBSD.org>
>
> Signed-off-by: Stacey Son <sson@FreeBSD.org>
> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
> ---
>=C2=A0 =C2=A0bsd-user/freebsd/os-proc.h=C2=A0 =C2=A0 | 23 +++++++++++++= ++++++++++
>=C2=A0 =C2=A0bsd-user/freebsd/os-syscall.c |=C2=A0 8 ++++++++
>=C2=A0 =C2=A02 files changed, 31 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

> +/* undocumented __setugid */
> +static inline abi_long do_freebsd___setugid(abi_long arg1)
> +{
> +=C2=A0 =C2=A0 return get_errno(__setugid(arg1));
> +}

Given that this is

#ifdef REGRESSION
...
#else /* !REGRESSION */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (ENOSYS);
#endif /* REGRESSION */

in current freebsd, we could probably just stub this out?
<= div>
I agree...

The REGRESSION kerne= l option exists only so that the tools/regression/security/proc_to_proc tes= ts
can run. this is an interesting set of tests, but hasn't b= een updated since 2004, except for the
usual 'churn' comm= its required by sweeps for new-compiler things, or project policy changes.<= /div>
So it's not even clear if this specific regression test is st= ill interesting (though there are many
other tests in the tree th= at are recent and under active development).

So it= 's irrelevant to the bsd-user emulator, and returning ENOSYS will match= perfectly what almost any
kernel deployed will do.
Warner
--000000000000e16a840604164ad4--