From nobody Fri Jan 19 00:10:00 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 4TGKkZ3Cm0z57Lck; Fri, 19 Jan 2024 00:10:14 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TGKkZ1MBcz4Zc5; Fri, 19 Jan 2024 00:10:14 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6ddeb7b4366so121156a34.2; Thu, 18 Jan 2024 16:10:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705623013; x=1706227813; 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=tlpO9fcvaJ8qp0vscqdK+JkwxzftthaDeEz17JlrV24=; b=W2OvdXfwrjKJq7wNtqpmavUc8x4eh2zrkSyAervGUbDfE2PK52/Xa9QWrA/W607YzI eB2rIoG8vkCd1s4eN3ml/+mLefFSPqSKXP+rw2aEvZomKbTvTjNIR1ViawQnrd+W36Ug iqekmc1XEv5G/WXHKFaY1k7zlTlVVg4Y7qG8B/A7Z7Cz5SRYYKKIPRQV+hz+1N7mi5Ww rhp1LLhBLx3PwFe5PrTojyH3Zgq4sSRtYvOIJ2CDUGeYihI2VFF6a/jMBPnPm9MB1MwG f4xdoMgspTjdE7OPf/AM92R6zw11cmKdMiyTqHfVTcvdA2gEjSd3R/TyhIJXiRhv63zY saRQ== X-Gm-Message-State: AOJu0YyIU9yTdz/69GvQx6IkLEpqZ6ROiR4asNvnWvol3pWP6OEtWZiQ NlnrAoY1ofhYKbKc8GzbDhgmVuiaf6FbvPXPAgBnwb+mPoncK0+eUfN/O5ptpvwWKw== X-Google-Smtp-Source: AGHT+IFdY13jrCHJTvl1WpBmPo9AjqaJ0ieM2MI3sRhHMmhun4IbCM5xGEe/aBj1JxtRcUe54oz6Rg== X-Received: by 2002:a9d:630f:0:b0:6e0:ba99:8e43 with SMTP id q15-20020a9d630f000000b006e0ba998e43mr1566300otk.36.1705623012590; Thu, 18 Jan 2024 16:10:12 -0800 (PST) Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com. [209.85.161.47]) by smtp.gmail.com with ESMTPSA id a5-20020a9d5c85000000b006dbfbdeb12fsm405415oti.10.2024.01.18.16.10.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jan 2024 16:10:12 -0800 (PST) Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-59927972125so103930eaf.3; Thu, 18 Jan 2024 16:10:11 -0800 (PST) X-Received: by 2002:a05:6358:5bc6:b0:175:78e5:5e45 with SMTP id i6-20020a0563585bc600b0017578e55e45mr1917379rwf.29.1705623011709; Thu, 18 Jan 2024 16:10:11 -0800 (PST) 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 References: <202401181523.40IFNvXI077592@gitrepo.freebsd.org> <973524D3-FCB2-47E1-B04F-BB42E18550C5@freebsd.org> <20240118175553.9CC5E19B@slippy.cwsent.com> In-Reply-To: <20240118175553.9CC5E19B@slippy.cwsent.com> From: Alexander Richardson Date: Thu, 18 Jan 2024 16:10:00 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 0990136ed175 - main - kerberos5: Mitigate the possibility of using an old libcrypto To: Cy Schubert Cc: Jessica Clarke , Shawn Webb , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4TGKkZ1MBcz4Zc5 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)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On Thu, 18 Jan 2024 at 10:06, Cy Schubert wrote: > > In message <973524D3-FCB2-47E1-B04F-BB42E18550C5@freebsd.org>, Jessica > Clarke w > rites: > > On 18 Jan 2024, at 17:35, Shawn Webb wrote: > > >=20 > > > On Thu, Jan 18, 2024 at 05:29:47PM +0000, Jessica Clarke wrote: > > >> On 18 Jan 2024, at 15:23, Cy Schubert wrote: > > >>>=20 > > >>> The branch main has been updated by cy: > > >>>=20 > > >>> URL: = > > https://cgit.FreeBSD.org/src/commit/?id=3D0990136ed1753ac7837206f9c5f4b83c= > > cff6c405 > > >>>=20 > > >>> commit 0990136ed1753ac7837206f9c5f4b83ccff6c405 > > >>> Author: Cy Schubert > > >>> AuthorDate: 2024-01-18 08:22:20 +0000 > > >>> Commit: Cy Schubert > > >>> CommitDate: 2024-01-18 15:12:14 +0000 > > >>>=20 > > >>> kerberos5: Mitigate the possibility of using an old libcrypto > > >>>=20 > > >>> By using the full library name (libcrypto.so.30) we avoid the = > > exposure > > >>> of using an old, possibly vulnerable, library. > > >>>=20 > > >>> Reported by: jrtc27 > > >>> MFC after: 3 days > > >>> X-MFC with: 476d63e091c2 > > >>> Fixes: 476d63e091c2 > > >>> --- > > >>> kerberos5/lib/libroken/fbsd_ossl_provider_load.c | 3 ++- > > >>> 1 file changed, 2 insertions(+), 1 deletion(-) > > >>>=20 > > >>> diff --git a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c = > > b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > > >>> index 497b32124f96..2328041bc166 100644 > > >>> --- a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > > >>> +++ b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > > >>> @@ -5,6 +5,7 @@ > > >>> #include > > >>>=20 > > >>> #if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >=3D 3) > > >>> +#define CRYPTO_LIBRARY "/lib/libcrypto.so.30" > > >>=20 > > >> This still assumes the native ABI is in use, i.e. doesn=E2=80=99t = > > account for > > >> libcompat. Can we please just drop the directory, or if it=E2=80=99s = > > really > > >> needed for some reason at least handle the libcompat case? > > >=20 > > > Using relative paths might carry a potential security risk if the > > > LD_LIBRARY_PATH environment variable is set to an attacker-controlled > > > directory. > > > > That=E2=80=99s true for direct linking too, yet we don=E2=80=99t = > > hard-code everything > > everywhere there. What=E2=80=99s special about dlopen? > > The reason for dlopen is to avoid building libcrypto during pre-build. > libcrypto requires TARGET_ENDIANNESS to be defined. It is not defined when > cross building from Linux or MacOS. > > TARGET_ENDIANNESS is defined by bsd.endian.mk, which state: > > # During bootstrapping on !FreeBSD OSes, we need to define some value. > Short of > # having an exhaustive list for all variants of Linux and MacOS we simply > do not > # set TARGET_ENDIANNESS and poison the other variables. They should be > unused > # during the bootstrap phases (apart from one place that's adequately > protected > # in bsd.compiler.mk) where we're building the bootstrap tools. > > To avoid this requirement during we let libroken build as usual during > prebuild and load libcrypto, which is built later, thereby circumventing > the prebuild requirement and avoiding redesigning our prebuild to define > TARGET_ENDIANNESS for non-FreeBSD OSes. If the problem is just missing TARGET_ENDIANESS, we can add something like TARGET_ENDIANESS!=echo "__BYTE_ORDER__" | ${CC} -E -P - for the bootstrapping case. But it seems to me that we just need to define the L_ENDIAN/B_ENDIAN macros, can't that be done using the compiler-provided macros (or endian.h) from some internal config header instead (or even a new file injected via -include)? Alex > > I don't think anyone here is prepared to redesign prebuild for this one > single case. And, since Heimdal will be replaced by MIT, the requirement > for our old Heimdal to work with OpenSSL 3.0 will disappear. > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 > >