Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3511672ybk; Tue, 19 May 2020 06:31:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLzefeuBM6AZ+3SzCapVvW+Qo0hdE1h+g7FKQlwG4pkR5U6dPtZ65cdYzM70/Qt0t/sTCt X-Received: by 2002:a17:906:bce3:: with SMTP id op3mr19254959ejb.230.1589895108356; Tue, 19 May 2020 06:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589895108; cv=none; d=google.com; s=arc-20160816; b=1FgM9Od8Drgb2KvEoUvZBzPnHKBtgYxsxtucWJEgqghQGj+/coWyRxzws3MLME5LQO Dze+9u6Li9tHvh31K9FDK7rW9PCpTCyKYVsPKC96qPOGbmO5MsiG5jr1mcUibL+85OSh bk4baJ7fWuZbuNRRdOtdGoqBN5fyXy5eIabUafx/kIrPslQ7bqqLTImYgHQwmH2Ylui0 2ivf9BdkNjSeX/hQFXE9aQoYGWhnZ72X0fhQhb7qHLNWDht/UEt6opg0qsdIptVjRGVT /EeN+CnShonDnENubStd73FWxuLdg7zn1nNILZ+eNvfIOgTAYE+QNR0Serj5sTJg1jnB Sp6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=kKdLMA4k7XzwNsXLlQ+t+1CFUAbMOMj23t6ppG2H79o=; b=W4NFqG4JlI1szg08eftWt315AecKm19vsRpBmfnZi+L7PRfA0b2LLtUHgM/YEG2Krg nfKdVkONkOg4RkPL/dsxhSoEOqzLn5kOrahkKdy5P+HEkfVqSpflkHrZaqckEgD8h7aM rOJXCIEs2iNyI5lRYbtXONwb8KjV2/iyM3xr4fQH26y2qsqeTwPImR9kFkQS1qvtA511 eq7ugleepHubtsT8NZ7c9kjeI1L/LL2cqkdzpMwYbi64VAMQA+r61adfeDzK1C7h7YZK vpfGz/yGiI0uuvTmj3Qz1+t2su42DSm2c1JNSmvc4Z/ZBfy9lWGI6wiDfvY1IedvGCnW nlow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n15si788997ejd.527.2020.05.19.06.31.23; Tue, 19 May 2020 06:31:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728894AbgESN3x (ORCPT + 99 others); Tue, 19 May 2020 09:29:53 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:47777 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727057AbgESN3x (ORCPT ); Tue, 19 May 2020 09:29:53 -0400 Received: from ip5f5af183.dynamic.kabel-deutschland.de ([95.90.241.131] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jb2JJ-0001zu-98; Tue, 19 May 2020 13:29:33 +0000 Date: Tue, 19 May 2020 15:29:31 +0200 From: Christian Brauner To: "Eric W. Biederman" Cc: Andreas Schwab , Jann Horn , Kees Cook , Al Viro , Andrew Morton , Tetsuo Handa , Eric Biggers , Dmitry Vyukov , linux-fsdevel , linux-security-module , Linux API , kernel list Subject: Re: [PATCH 1/4] exec: Change uselib(2) IS_SREG() failure to EACCES Message-ID: <20200519132931.3b7yugfv2ajry6y7@wittgenstein> References: <20200518055457.12302-1-keescook@chromium.org> <20200518055457.12302-2-keescook@chromium.org> <20200518130251.zih2s32q2rxhxg6f@wittgenstein> <20200518144627.sv5nesysvtgxwkp7@wittgenstein> <87blmk3ig4.fsf@x220.int.ebiederm.org> <87mu64uxq1.fsf@igel.home> <87sgfwuoi3.fsf@x220.int.ebiederm.org> <87eergunqs.fsf@igel.home> <87ftbwun0h.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87ftbwun0h.fsf@x220.int.ebiederm.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 19, 2020 at 07:28:46AM -0500, Eric W. Biederman wrote: > Andreas Schwab writes: > > > On Mai 19 2020, Eric W. Biederman wrote: > > > >> I am wondering if there are source trees for libc4 or libc5 around > >> anywhere that we can look at to see how usage of uselib evolved. > > > > libc5 is available from archive.debian.org. > > > > http://archive.debian.org/debian-archive/debian/pool/main/libc/libc/libc_5.4.46.orig.tar.gz > > Interesting. > > It appears that the old a.out code to make use of uselib remained in > the libc5 sources but it was all conditional on the being compiled not > to use ELF. > > libc5 did provide a wrapper for the uselib system call. > > It appears glibc also provides a wrapper for the uselib system call > named: uselib@GLIBC_2.2.5. > > I don't see a glibc header file that provides a declaration for uselib > though. > > So the question becomes did anyone use those glibc wrappers. The only software I could find was ski, the ia64 instruction set emulator, which apparently used to make use of this and when glibc removed they did: #define uselib(libname) syscall(__NR_uselib, libname) but they only define it for the sake of the internal syscall list they maintain so not actively using it. I just checked, ski is available on Fedora 31 and Fedora has USELIB disabled. Codesearch on Debian yields no users that actively use the syscall for anything. Christian