bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Andrii Nakryiko <andriin@fb.com>
Cc: John Fastabend <john.fastabend@gmail.com>,
	"ast@kernel.org" <ast@kernel.org>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Subject: Re: [bpf-next PATCH] bpf: libbpf, add kernel version section parsing back
Date: Fri, 18 Oct 2019 21:41:12 -0700	[thread overview]
Message-ID: <5daa93e8bfc26_3a012ad7c9bb25bca6@john-XPS-13-9370.notmuch> (raw)
In-Reply-To: <CAADnVQLyi9os2FK9OSiZ2CMKtEd7NOR=P_Q-Qd9_0Lu9dn63kw@mail.gmail.com>

Alexei Starovoitov wrote:
> On Fri, Oct 18, 2019 at 9:52 AM Andrii Nakryiko <andriin@fb.com> wrote:
> >
> > On 10/18/19 7:41 AM, John Fastabend wrote:
> > > With commit "libbpf: stop enforcing kern_version,..." we removed the
> > > kernel version section parsing in favor of querying for the kernel
> > > using uname() and populating the version using the result of the
> > > query. After this any version sections were simply ignored.
> > >
> > > Unfortunately, the world of kernels is not so friendly. I've found some
> > > customized kernels where uname() does not match the in kernel version.
> > > To fix this so programs can load in this environment this patch adds
> > > back parsing the section and if it exists uses the user specified
> > > kernel version to override the uname() result. However, keep most the
> > > kernel uname() discovery bits so users are not required to insert the
> > > version except in these odd cases.
> > >
> > > Fixes: 5e61f27070292 ("libbpf: stop enforcing kern_version, populate it for users")
> > > Signed-off-by: John Fastabend <john.fastabend@gmail.com>
> > > ---
> >
> > In the name of not breaking users of weird kernels :)
> >
> > Acked-by: Andrii Nakryiko <andriin@fb.com>
> 
> What does it mean that uname is cheated?
> Can libbpf read it from /proc/sys/kernel/osrelease ?
> or /proc/version?
> Is that read only or user space can somehow overwrite it?

In this case LINUX_VERSION_CODE as shown in version.h from linux-headers
does not much what is being reported by /proc/version or osrelease.

So its a bit surprising to me as well but I haven't got to the bottom
of it. Maybe something to do with how proc is mounted in this kubernetes
setup?

  reply	other threads:[~2019-10-19  4:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18 14:41 John Fastabend
2019-10-18 16:51 ` Andrii Nakryiko
2019-10-19  1:33   ` Alexei Starovoitov
2019-10-19  4:41     ` John Fastabend [this message]
2019-10-18 19:11 ` Daniel Borkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5daa93e8bfc26_3a012ad7c9bb25bca6@john-XPS-13-9370.notmuch \
    --to=john.fastabend@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [bpf-next PATCH] bpf: libbpf, add kernel version section parsing back' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).