From: Paul Moore <paul@paul-moore.com>
To: Dominick Grift <dac.override@gmail.com>
Cc: Richard Haines <richard_c_haines@btinternet.com>,
selinux@vger.kernel.org, tkjos@google.com
Subject: Re: [PATCH 1/1] selinux-testsuite: Update binder test applications
Date: Wed, 17 Apr 2019 11:27:40 -0400 [thread overview]
Message-ID: <CAHC9VhSCLJBMjor5VQoS9=dFyQsd4sR+icKrB_ygmZBkgP23gA@mail.gmail.com> (raw)
In-Reply-To: <CAHC9VhRhngMQLubtymTx1fV=6vJjoTPCEBF_JKtY9qMqF=EyVg@mail.gmail.com>
On Fri, Apr 12, 2019 at 6:02 PM Paul Moore <paul@paul-moore.com> wrote:
> On Fri, Apr 12, 2019 at 3:31 PM Dominick Grift <dac.override@gmail.com> wrote:
> > Paul Moore <paul@paul-moore.com> writes:
> >
> > > On Fri, Apr 12, 2019 at 12:37 PM Richard Haines
> > > <richard_c_haines@btinternet.com> wrote:
> > >> On Fri, 2019-04-12 at 10:46 -0400, Paul Moore wrote:
> > >> > On Thu, Apr 11, 2019 at 6:07 PM Paul Moore <paul@paul-moore.com>
> > >> > wrote:
> > >> > > On the negative side I realized when playing with your test changes
> > >> > > that I wasn't building BINDERFS in my test kernels - oops. I'm
> > >> > > fixing
> > >> > > that now, but I might not get a chance to do another test until
> > >> > > tomorrow; at least I can verify that your BINDERFS testing logic
> > >> > > works
> > >> > > :)
> > >> >
> > >> > I rebuilt my test kernel (the latest "secnext" builds have it) with
> > >> > BINDERFS only to realize that Fedora Rawhide doesn't seem to ship
> > >> > /usr/include/linux/android/binderfs.h so I manually copied the file
> > >> > from the kernel-devel package only to run into this when building the
> > >> > new binder tests:
> > >> >
> > >> > # make
> > >> > cc -DHAVE_BINDERFS check_binder.c binder_common.c binder_common.h
> > >> > -lselinux -lrt -o check_binder
> > >> > binder_common.c: In function ‘cmd_name’:
> > >> > binder_common.c:35:7: error: ‘BR_TRANSACTION_SEC_CTX’ undeclared
> > >> > (first use in t
> > >> > his function); did you mean ‘BC_TRANSACTION_SG’?
> > >> > 35 | case BR_TRANSACTION_SEC_CTX:
> > >> > | ^~~~~~~~~~~~~~~~~~~~~~
> > >> > | BC_TRANSACTION_SG
> > >> > binder_common.c:35:7: note: each undeclared identifier is reported
> > >> > only once for
> > >> > each function it appears in
> > >> > binder_common.c: In function ‘print_trans_data’:
> > >> > binder_common.c:126:23: error: ‘FLAT_BINDER_FLAG_TXN_SECURITY_CTX’
> > >> > undeclared (f
> > >> > irst use in this function)
> > >> > 126 | obj->flags & FLAT_BINDER_FLAG_TXN_SECURITY_CTX ?
> > >> > "YES" : "NO");
> > >> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >> > make: *** [<builtin>: check_binder] Error 1
> > >> > # grep "BR_TRANSACTION_SEC_CTX" *
> > >> > binder_common.c: case BR_TRANSACTION_SEC_CTX:
> > >> > binder_common.c: return "BR_TRANSACTION_SEC_CTX";
> > >> > service_provider.c: case BR_TRANSACTION_SEC_CTX: {
> > >> > # grep "BR_TRANSACTION_SEC_CTX" /usr/include/linux/android/binderfs.h
> > >> > # grep "BR_TRANSACTION_SEC_CTX" /usr/include/linux/android/binder.h
> > >> >
> > >> > ... and that's when I stopped playing with this. If it helps, I
> > >> > pulled my binderfs.h file from a current Rawhide kernel. What are
> > >> > you
> > >> > using to run these tests?
> > >> >
> > >> > At the very least, I'm thinking we'll also want to include some notes
> > >> > in the README.md file under the "Optional Prerequisites" section
> > >> > about
> > >> > how to get this running with BINDERFS.
> > >>
> > >> The BR_TRANSACTION_SEC_CTX is defined in an updated binder.h file, so
> > >> you need both binder.h and binderfs.h from devel.
> > >>
> > >> I guess I must have copied them over by hand as I tested on rawhide.
> > >> I'll add a note in the README.md file.
> > >
> > > Okay, that solved the problem, thanks.
> > >
> > > I just noticed that the kernel-headers package on my Rawhide systems
> > > are *really* old. I suspect this may be due to the fact that I'm not
> > > running Fedora Rawhide kernels and thus my currently installed kernel
> > > packages don't match what is present in the main Rawhide repos; this
> > > problem might be limited to just me (and anyone exclusively running
> > > the secnext kernels on their system).
> > >
> > > Can anyone with a Rawhide system confirm if they have the
> > > /usr/include/linux/android/binderfs.h header file?
> >
> > [root@brutus ~]# rpm -qf /usr/include/linux/android/binderfs.h
> > kernel-headers-5.1.0-0.rc2.git1.1.fc31.x86_64
>
> Thanks.
>
> I realized today that last summer Fedora changed how they package the
> kernel headers and thus I need to update how I build my test kernels.
> As an aside, I don't get why the change was made, this new process for
> building the kernel-headers package is *really* convoluted ... and
> broken if you are using a custom %buildid (which I do for "secnext"
> builds), but that's a different issue.
With the header issue sorted out, the tests is now running clean for
me so I just merged it into the selinux-testsuite master branch.
Thanks for your patience on this.
--
paul moore
www.paul-moore.com
prev parent reply other threads:[~2019-04-17 15:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-03 12:26 [PATCH 1/1] selinux-testsuite: Update binder test applications Richard Haines
2019-04-10 15:35 ` Paul Moore
2019-04-10 17:04 ` Richard Haines
2019-04-10 23:43 ` Paul Moore
2019-04-11 11:48 ` Richard Haines
2019-04-11 22:07 ` Paul Moore
2019-04-12 14:46 ` Paul Moore
2019-04-12 16:37 ` Richard Haines
2019-04-12 19:20 ` Paul Moore
2019-04-12 19:28 ` Stephen Smalley
2019-04-12 19:31 ` Dominick Grift
2019-04-12 22:02 ` Paul Moore
2019-04-17 15:27 ` Paul Moore [this message]
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='CAHC9VhSCLJBMjor5VQoS9=dFyQsd4sR+icKrB_ygmZBkgP23gA@mail.gmail.com' \
--to=paul@paul-moore.com \
--cc=dac.override@gmail.com \
--cc=richard_c_haines@btinternet.com \
--cc=selinux@vger.kernel.org \
--cc=tkjos@google.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).