NetBSD Problem Report #58797

From www@netbsd.org  Thu Oct 31 19:46:03 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id D41BF1A9238
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 31 Oct 2024 19:46:02 +0000 (UTC)
Message-Id: <20241031194601.E71991A923B@mollari.NetBSD.org>
Date: Thu, 31 Oct 2024 19:46:01 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: build lacks automatic check for /bin programs linked against /usr/lib libraries
X-Send-Pr-Version: www-1.0

>Number:         58797
>Category:       toolchain
>Synopsis:       build lacks automatic check for /bin programs linked against /usr/lib libraries
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 31 19:50:01 +0000 2024
>Originator:     Taylor R Campbell
>Release:        current, 10, 9, ...
>Organization:
The /binBSD Foundation
>Environment:
>Description:
Since netbsd-9, we have inadvertently shipped a /bin/tar that is linked against libarchive.so.N, which lives in /usr/lib, unless you use a custom build with MKBSDTAR=no.  Hence /bin/tar is nonfunctional on systems without /usr mounted (PR bin/58187: /bin/tar does not work without mounted /usr, https://gnats.netbsd.org/58187).

Nothing in the build automatically detects or avoids this scenario.
>How-To-Repeat:
run tar without /usr mounted
>Fix:
Obvious approaches:

1. teach ld to exclude /usr/lib from the list of libraries when linking /bin (and /sbin and /libexec and ...)
2. add a post-link pass to verify anything installed outside /usr only depends on things outside /usr

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.