]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: fix endianness bug in network node address handling
authorStephen Smalley <sds@tycho.nsa.gov>
Thu, 5 Jun 2008 13:48:51 +0000 (09:48 -0400)
committerJames Morris <jmorris@namei.org>
Mon, 14 Jul 2008 05:01:54 +0000 (15:01 +1000)
commitf60c7dc8b5cfe76ce50b92cb3a5520320e8a8e0e
tree7027450aa23e7f25a67e5cd9a7686e013956ac61
parent9626afa019a9ab056ef5bfa2b84f7f4a9560ea2e
selinux: fix endianness bug in network node address handling

Fix an endianness bug in the handling of network node addresses by
SELinux.  This yields no change on little endian hardware but fixes
the incorrect handling on big endian hardware.  The network node
addresses are stored in network order in memory by checkpolicy, not in
cpu/host order, and thus should not have cpu_to_le32/le32_to_cpu
conversions applied upon policy write/read unlike other data in the
policy.

Bug reported by John Weeks of Sun, who noticed that binary policy
files built from the same policy source on x86 and sparc differed and
tracked it down to the ipv4 address handling in checkpolicy.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
security/selinux/ss/policydb.c