selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Richard Haines <richard_c_haines@btinternet.com>
Cc: selinux@vger.kernel.org, tkjos@google.com
Subject: Re: [PATCH 1/1] selinux-testsuite: Update binder test applications
Date: Fri, 12 Apr 2019 15:20:46 -0400	[thread overview]
Message-ID: <CAHC9VhTUSm1vx_TtmrX+VRd5C56=tKOt8dP2MYwFGsKwCRfKPw@mail.gmail.com> (raw)
In-Reply-To: <05b9c3920262f93f8f7af0058821a5301b138526.camel@btinternet.com>

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?

-- 
paul moore
www.paul-moore.com

  reply	other threads:[~2019-04-12 19:21 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 [this message]
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

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='CAHC9VhTUSm1vx_TtmrX+VRd5C56=tKOt8dP2MYwFGsKwCRfKPw@mail.gmail.com' \
    --to=paul@paul-moore.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).