From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12159 invoked from network); 8 Sep 2021 01:13:08 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Sep 2021 01:13:08 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1631063588; b=pJuZg+J2Nj0HRQGx4QEAcBh2nWrieqfqYYhsJbv0sVuTRXiMJzEbEuR2jtwa9m0ZKLayvCc6TR 8rxfbA4tzQuoYL9GUCXDt5NAfaRXlpOMgMHWP2czagSwtC+486PfwxRAa6k5HYnsuI00wC9z9D 6yONR9qTGkKjEySqOkoxo0V6QljDzZnztk4eAQeV3M5Qvbvpz3bz5LnUDjUBmPtUOsA2Vb8Ijf l+ihMrvnblXHbdarSg9blWUb2mnT8V0U73iacqM6aSieqSmlvGPZdIXOHkk4qvC+kJ34viMe24 FPzdn+Btnmd3kmYSwGDw9Yol6c2XRg3eFjE64BojLi5B0Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1631063588; bh=Fitx/hhAkbe/OcJjPGiBvISjHU9MjcrH/up6qDE1ETQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:Subject:Cc:To:From:Date:DKIM-Signature; b=MXdS/shU9/RAQb1QtKTElEc4iouVHAB/VRRhaoZg/3q+TBHcHXVR6PKjB2ax21xCEwIEOUZRbd Cj8ifcdvMS9iqQ0cywP6neiSH5RhcK1gFOjcW9zsI3duFPwOaORnzGOaW9SBxKNoqomTpAm8ji y6F0V8kG8XNS2UNHpx6Ah/hsdaU7+e4GN1cQjw6yt2qn/ODMxAPX4s8PuJsir5hX8JLCMXjxkJ K+Zk0Luioupwq9O84H+iuM1B182dVGRf9gm3dSLfmNzb62j/dA14q1JMOg3Wh9Uo3N8IewCAwU MFwY1iWpaBONrpThH/EAbMfgmRoimBYA8QxqBND4GLpJ6g==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=vpOWuBhencB9U3+d2oBPPwy40KnB/RmNKGXo0AGfzFA=; b=V5cgzgztcrLbErnccaHXaqQPUT j00nPCFDGSZ2EE3Z0P9wBXeO0ITGjrpgUSEpr6XEpldnHx+mxrUDKv4XU4cBVtCs/SoqWL076K7es By6xYMNV70kO2hk5XOEtbeAhO9ORFQr1lP+Z3KD/cHQjFUYisw8rKJtULkLmRzuZGpS0nrl7ECDe8 eKDRRJ0evCOhSK4Cftjynf3FAx9b25cK9JIE+d79yBJpVPHa57x1jQoYNjKYmZTfdTYAlYo5nt/Vx 9S/h4qKzUjuPeho63zSCBhkpqfTUJUqSgyTL81PpFChlLKrxMa0tf/yFFETpJKSbYuqVWy5ax+tEr LTBv5VeQ==; Received: from authenticated user by zero.zsh.org with local id 1mNm9E-000KXd-FZ; Wed, 08 Sep 2021 01:13:08 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:33936) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mNm8z-000KDf-3H; Wed, 08 Sep 2021 01:12:53 +0000 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id E96EF10B; Wed, 8 Sep 2021 03:12:51 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id AE65FC20B0B; Wed, 8 Sep 2021 03:12:51 +0200 (CEST) Date: Wed, 8 Sep 2021 03:12:51 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Cc: 993843@bugs.debian.org Subject: [BUG] With --disable-dynamic-nss, not all functions calls are protected Message-ID: <20210908011251.GA2387366@zira.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org, 993843@bugs.debian.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.1.2+54 (f0ff78a5) vl-138565 (2021-08-25) X-Seq: 49392 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: [Posted to zsh-workers, with a Cc to the Debian bug.] While looking at Debian bug 993843 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993843 (zsh-static segfaults immediately) I can notice the following warnings: gcc -static -o zsh main.o `cat stamp-modobjs` -lgdbm -lpcre -lcap -lncursesw -ltinfo -ltinfo -lrt -lm -lc /usr/bin/ld: options.o: in function `dosetopt': ./obj-static/Src/../../Src/options.c:830: warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/bin/ld: Modules/parameter.o: in function `get_all_groups': ./obj-static/Src/Modules/../../../Src/Modules/parameter.c:2058: warning: Using 'getgrgid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/bin/ld: Modules/files.o: in function `bin_chown': ./obj-static/Src/Modules/../../../Src/Modules/files.c:763: warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/bin/ld: params.o: in function `usernamesetfn': ./obj-static/Src/../../Src/params.c:4420: warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/bin/ld: options.o: in function `dosetopt': ./obj-static/Src/../../Src/options.c:822: warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking This is exactly the issue we are seeing in Debian: zsh-static segfaults after upgrading glibc, and this issue disappears after rebuilding zsh-static with the new glibc. And I could see in the strace output that the shared C library libc.so.6 is read, while zsh-static should entirely be static. However, --disable-dynamic-nss is used to build zsh-static, so that the above functions should not be called. I can see that Src/zsh_system.h has #if defined(HAVE_INITGROUPS) && !defined(DISABLE_DYNAMIC_NSS) # define USE_INITGROUPS #endif #if defined(HAVE_GETGRGID) && !defined(DISABLE_DYNAMIC_NSS) # define USE_GETGRGID #endif #if defined(HAVE_GETGRNAM) && !defined(DISABLE_DYNAMIC_NSS) # define USE_GETGRNAM #endif #if defined(HAVE_GETPWENT) && !defined(DISABLE_DYNAMIC_NSS) # define USE_GETPWENT #endif #if defined(HAVE_GETPWNAM) && !defined(DISABLE_DYNAMIC_NSS) # define USE_GETPWNAM #endif #if defined(HAVE_GETPWUID) && !defined(DISABLE_DYNAMIC_NSS) # define USE_GETPWUID #endif But concerning the first warning, Src/options.c contains # ifdef HAVE_INITGROUPS I suppose that the test should have been # ifdef USE_INITGROUPS like in Src/params.c, which has # ifdef USE_INITGROUPS initgroups(x, pswd->pw_gid); # endif I suspect that there is the same issue with the other warnings. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)