From nobody Tue Apr 30 00:55:05 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 4VT1vF4p8bz5HkQ8; Tue, 30 Apr 2024 00:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VT1vF2rVfz4QTW; Tue, 30 Apr 2024 00:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lbjgztLBhRJy5F23L30uSHt3Daw79nv5VWfSWxRQks8=; b=hHrUNepB66PaMPQBK9i/g+MIrDDRIWT/aPkhcRy3XWwUVynDmMuDD19DxRInH3+F41c9XN 6euCzTYJoFzD0jB7RwVgkHxxKH+sk8KZnLrM9/6zaB/45/umLizgyYm5/Z9OyrasXU6Y6d uODV9pXatPUF2mKrXoSTmzIl5OV6RYh0zv5ixZui0hm5d92kjjaLwamqf09dN9FnKPPJ8L /JUBREh/NOlzrqsbMulKFhjLsBIk6BPeSlBuGdAST9t6vklja9k8m0tCetwYwZhfuqvWfi leaAjsqvYQhczOj2w4eJK6wO1HuBt+inwG/8Epn8NgrhKyULI/Y6DPzaROSPZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438505; a=rsa-sha256; cv=none; b=q6JZ3x5gi5tHbsgspRsvfxhiw32p2x52JflASaJWVu+dNpTDOQrn39PRmfCahj88XxamI1 zqgSuOweP3YdGBExxlmxE7LDxuM6slKmBPr/SL+UxbTLDiCv6fJIF/wbv1TKuLSqqQs9tP wyHJyd9umjC9XqQo1JlAMFSEQHjrV/ZLBbbQO+g5iYenlok9UklkGSU82b1plQs2U9aofY 50Z/tX2sLoPzo9LxKwk3SIEdti90Wn8ZVG1MtnVIjRmtye8RZmWN5MZVQ3ffIM7PdeWyi/ u77yIRXtyFnmIweIIWq8I16StGcbRkt6t2M0DaIi0hGJwvW+27fLvL4aWr9BEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lbjgztLBhRJy5F23L30uSHt3Daw79nv5VWfSWxRQks8=; b=pJ1ZRNFn3Sss98UwfcvyMyNcd2ceSWT0boYgyTaWZwHxomEX0hIin+O/ETMMdbuUkbRy6C j5V7JnEe3DkBEqbmrUQAb7J6ZhlN0OoB2p+w0JhIfwBBP6R+KXSd352HJ5FHzHOhJXBALF 03ydWkiD5NwX6L/a7zXkgeNGUezP1X2ALrZ4w6gKg2G3oD1l+d44NzhrsbT3vo3z0kMz0F lJTwQ7LjymaHgOXo3Dvqq3WvHtzFKiq6BR6rOHxqpgeU5Ptz5DqyUAlkpoteyuEU2BKs+M HNja50/1uioyKS1WAZJLJrshkf0itZznzXr8ZlGMs74hvWYpsGnK61P1ZmBjTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VT1vF2RfBzDkb; Tue, 30 Apr 2024 00:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43U0t5x2030844; Tue, 30 Apr 2024 00:55:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0t55g030841; Tue, 30 Apr 2024 00:55:05 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:55:05 GMT Message-Id: <202404300055.43U0t55g030841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ef2694f368ce - main - rtld direct exec: make -u behavior match the description 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef2694f368cee5957ee44b0298da88ff8360d561 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ef2694f368cee5957ee44b0298da88ff8360d561 commit ef2694f368cee5957ee44b0298da88ff8360d561 Author: Konstantin Belousov AuthorDate: 2024-04-28 20:57:54 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:26:49 +0000 rtld direct exec: make -u behavior match the description Instead of only ignoring insecure env vars, clear them all. Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44999 --- libexec/rtld-elf/rtld.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index f5a2eeb37f10..5743bbdd6f61 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6189,7 +6189,10 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, } else if (opt == 'p') { *use_pathp = true; } else if (opt == 'u') { - trust = false; + u_int ll; + + for (ll = 0; ll < nitems(ld_env_vars); ll++) + ld_env_vars[ll].val = NULL; } else if (opt == 'v') { machine[0] = '\0'; mib[0] = CTL_HW;