Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp54482imc; Fri, 15 Mar 2019 14:51:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAG6DERmcgt0wr72AA5muEIuyMu7Fs2pBXChSsUKj6ixWhkaqr7Op5nogxX78iF/IZn7QD X-Received: by 2002:a17:902:362:: with SMTP id 89mr6281733pld.172.1552686699681; Fri, 15 Mar 2019 14:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552686699; cv=none; d=google.com; s=arc-20160816; b=ouQOedobXJjEuMLWev9u4eBCxvfyGkWWi2MEclrueWDyKFjzfA3d7IgLAByfdlRcUa HjWxJeAEtv5eLwKDWOwKauKV5pZKjt4tZgcCaQkMANNVMBC1Hlb+dn1EW3G5QII+tbG6 g89s24rYvd3/sTfTr5SfdpMeE3UDSFTsT0SG/6NoA6HxUCmSNkxQy5oEr20TsmHqX2F9 f9aEajpYea0St5hjCKrz2wgvTklRjbLSYtbkVnloVXAMVEIO/kv8wmFtRQDGjxP3mLOH KDjU7kHXnBr0yfY0wa2leipIXGkRIBUbStTMTNoQ4OviB2gFea5HrB/wknl3/Au7Q0JD m/8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=znFH5MhJHtvxUJUkTet0XA/4SGN3txQ6Mhgyi12eYik=; b=yNlQWsGz9NUB0n3Oy6eBHkDEi4qt2aUOonTVssb0VwdKwMLbhANkAbo7HGCILQD8H8 9FjJzwSE1y2/zk+dcBjcI68x51koaUHm4f+/GIKzm/OsZgdEk82XT8xe1jV2erZInMla XEecJ9HKwOmAAEhgN4/i17Uf4/O55k8xZhTiuTDvicjNsYxkfvqbYgKReAFT9zw3C9Ae nVQIdJfQMQzvB3luBareq8BteBD6hiYc0mAXtzjF337NarnD2NoM1C8FPtUQPANakAo7 T9jNwpD/ZqDe2C/oVd4n48O0MfDG9HYJAMIpgfPtrp6kAO02a9vqLxTMSNvJCHT2zn4c WInw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k16si2893426pfj.174.2019.03.15.14.51.23; Fri, 15 Mar 2019 14:51:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726693AbfCOVus (ORCPT + 99 others); Fri, 15 Mar 2019 17:50:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38880 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbfCOVur (ORCPT ); Fri, 15 Mar 2019 17:50:47 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 607E120B01; Fri, 15 Mar 2019 21:50:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3F1275D6A6; Fri, 15 Mar 2019 21:50:47 +0000 (UTC) Received: from zmail17.collab.prod.int.phx2.redhat.com (zmail17.collab.prod.int.phx2.redhat.com [10.5.83.19]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 039FC4A460; Fri, 15 Mar 2019 21:50:46 +0000 (UTC) Date: Fri, 15 Mar 2019 17:50:46 -0400 (EDT) From: Ivan Vecera To: Stanislav Fomichev Cc: netdev@vger.kernel.org, Shuah Khan , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , "open list:KERNEL SELFTEST FRAMEWORK" , "open list:BPF (Safe dynamic programs and tools)" , open list Message-ID: <1595006055.9467881.1552686646726.JavaMail.zimbra@redhat.com> In-Reply-To: <20190315205652.GD5481@mini-arch.hsd1.ca.comcast.net> References: <20190315200414.32346-1-ivecera@redhat.com> <20190315200847.GC5481@mini-arch.hsd1.ca.comcast.net> <2dcdc11c-4d04-4b0e-ddb7-04d969d04651@redhat.com> <20190315205652.GD5481@mini-arch.hsd1.ca.comcast.net> Subject: Re: [PATCH net-next] selftests: bpf: modify urandom_read and link it non-statically MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [188.244.50.158, 10.4.196.22, 10.5.100.50, 10.4.195.27] Thread-Topic: selftests: bpf: modify urandom_read and link it non-statically Thread-Index: 8ouH4th4W02vJUN2Ljh3x8PAlDjAWw== X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 15 Mar 2019 21:50:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- Stanislav Fomichev wrote: > On 03/15, Ivan Vecera wrote: > > On 15. 03. 19 21:08, Stanislav Fomichev wrote: > > > On 03/15, Ivan Vecera wrote: > > > > After some experiences I found that urandom_read does not need to be > > > > linked statically. When the 'read' syscall call is moved to separate > > > > non-inlined function then bpf_get_stackid() is able to find > > > > the executable in stack trace and extract its build_id from it. > > > But why? Do you have some problems with it being linked statically? > > > > > Dependency... you don't need to install static glibc to compile the bpf > > samples. Shared libc is available everytime. > Oh, the distros that do -devel _and_ -static packages :-) > > So your patch essentially adds a call, that leaves a trace on the stack > with our build-id. I guess that works as well. Without that additional call this does not work and build_id selftest fails. I.