From: selinux770@tortenboxer.de
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: selinux@tycho.nsa.gov
Subject: Re: wrong magic number (using old sources)
Date: Thu, 16 Aug 2007 10:05:23 +0200 [thread overview]
Message-ID: <20070816080523.135750@gmx.net> (raw)
In-Reply-To: <1187202831.20485.66.camel@moss-spartans.epoch.ncsc.mil>
> I suspect that what we are doing isn't safe/portable.
>
> The corresponding kernel code was converted a while back to avoid
> unaligned access problems, so possibly a similar transformation should
> happen here.
>
> See:
> http://marc.info/?l=selinux&m=110252376515271&w=2
>
> As a simple test of whether this is related, you might try the following
> patch for libsepol (and then rebuild checkpolicy against the updated
> libsepol) and see if it gets you past the magic number check. If so,
> then the next step would be to apply the same change to the entire
> policydb_read code.
That's it. After applying the changes in source code i get past the magic number check. Now, my policyversion number is wrong but i would suggest, that this error is related to the problem you described. I included also a printf for buf2[] to check the values after conversion:
# make
( cd domains/program/ ; for n in *.te ; do echo "define(\`$n')"; done ) > tmp/program_used_flags.te.tmp
( cd domains/misc/ ; for n in *.te ; do echo "define(\`$n')"; done ) >> tmp/program_used_flags.te.tmp
mv tmp/program_used_flags.te.tmp tmp/program_used_flags.te
Building policy.conf ...
[...] > policy.conf.tmp
Building file contexts files...
/usr/bin/checkpolicy -o policy.20 policy.conf
/usr/bin/checkpolicy: loading policy configuration from policy.conf
/usr/bin/checkpolicy: policy configuration loaded
/usr/bin/checkpolicy: writing binary representation (version 21) to policy.20
Validating file contexts files ...
/usr/sbin/setfiles -q -c policy.20 file_contexts/file_contexts
buf2[0]: f97cff8c
buf2[1]: 8
buf2[2]: bea60574
buf2[3]: bea60560
buf2[4]: 4004a304
buf2[5]: 400469a4
buf2[6]: 0
buf2[7]: 400a26f0
libsepol.policydb_read: policydb version 352321536 does not match my version range 15-21
libsepol.sepol_set_policydb_from_file: can't read binary policy: Success
Error reading policy policy.20: Success
make: *** [policy.20] Error 1
I think it is only necessary to declare unint32_t buf2[] of size 2 and not 8, isn't it?
--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2007-08-16 8:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-10 10:10 wrong magic number (using old sources) selinux770
2007-08-10 11:45 ` Stephen Smalley
2007-08-10 11:55 ` Stephen Smalley
2007-08-10 12:12 ` selinux770
2007-08-10 12:21 ` Stephen Smalley
2007-08-10 13:07 ` "Björn Vogel"
2007-08-10 13:19 ` Stephen Smalley
2007-08-10 14:12 ` selinux770
2007-08-11 18:07 ` selinux770
2007-08-13 12:55 ` Stephen Smalley
2007-08-15 15:44 ` selinux770
2007-08-15 18:33 ` Stephen Smalley
2007-08-16 8:05 ` selinux770 [this message]
2007-08-16 12:59 ` Stephen Smalley
2007-08-16 15:14 ` selinux770
2007-08-21 17:05 ` [patch] libsepol: eliminate unaligned accesses (Was: Re: wrong magic number (using old sources)) Stephen Smalley
2007-08-21 19:21 ` Eric Paris
2007-08-21 19:33 ` Stephen Smalley
2007-08-23 15:08 ` Stephen Smalley
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=20070816080523.135750@gmx.net \
--to=selinux770@tortenboxer.de \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.