* Looks like we have a 64 bit problem on Rawhide.
@ 2007-08-28 16:30 Daniel J Walsh
2007-08-28 16:55 ` Todd Miller
0 siblings, 1 reply; 3+ messages in thread
From: Daniel J Walsh @ 2007-08-28 16:30 UTC (permalink / raw)
To: Stephen Smalley, Karl MacMillan, Joshua Brindle, SE Linux
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
libsepol.module_package_read_offsets: offsets are not increasing (at 2,
offset 61226322186831055 -> 0
rpm -q libsepol
libsepol-2.0.7-1.fc8
Can't update policy on x86_64 machines.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFG1E2ZrlYvE4MpobMRAmIQAJ0dMEFV0P/nx90C9BJu2bo0EcNqcACgvz8S
dTmjmsch2NXl5I8MnEoxlJI=
=vrTF
-----END PGP SIGNATURE-----
--
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Looks like we have a 64 bit problem on Rawhide.
2007-08-28 16:30 Looks like we have a 64 bit problem on Rawhide Daniel J Walsh
@ 2007-08-28 16:55 ` Todd Miller
2007-08-28 17:15 ` Stephen Smalley
0 siblings, 1 reply; 3+ messages in thread
From: Todd Miller @ 2007-08-28 16:55 UTC (permalink / raw)
To: Daniel J Walsh, Stephen Smalley, Karl MacMillan, Joshua Brindle,
SE Linux
Daniel J Walsh wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> libsepol.module_package_read_offsets: offsets are not increasing (at
> 2, offset 61226322186831055 -> 0
>
> rpm -q libsepol
> libsepol-2.0.7-1.fc8
>
> Can't update policy on x86_64 machines.
It looks like "off" in module_package_read_offsets() should
be unsigned, not size_t. Right now there is a 32 vs. 64 bit
mismatch.
- todd
--
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Looks like we have a 64 bit problem on Rawhide.
2007-08-28 16:55 ` Todd Miller
@ 2007-08-28 17:15 ` Stephen Smalley
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Smalley @ 2007-08-28 17:15 UTC (permalink / raw)
To: Todd Miller; +Cc: Daniel J Walsh, Karl MacMillan, Joshua Brindle, SE Linux
On Tue, 2007-08-28 at 12:55 -0400, Todd Miller wrote:
> Daniel J Walsh wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > libsepol.module_package_read_offsets: offsets are not increasing (at
> > 2, offset 61226322186831055 -> 0
> >
> > rpm -q libsepol
> > libsepol-2.0.7-1.fc8
> >
> > Can't update policy on x86_64 machines.
>
> It looks like "off" in module_package_read_offsets() should
> be unsigned, not size_t. Right now there is a 32 vs. 64 bit
> mismatch.
Yep, try this:
Index: libsepol/src/module.c
===================================================================
--- libsepol/src/module.c (revision 2538)
+++ libsepol/src/module.c (working copy)
@@ -353,21 +353,27 @@
struct policy_file *file,
size_t ** offsets, uint32_t * sections)
{
- uint32_t buf[3], nsec;
+ uint32_t *buf = NULL, nsec;
unsigned i;
- size_t *off;
+ size_t *off = NULL;
int rc;
+ buf = malloc(sizeof(uint32_t)*3);
+ if (!buf) {
+ ERR(file->handle, "out of memory");
+ goto err;
+ }
+
rc = next_entry(buf, file, sizeof(uint32_t) * 3);
if (rc < 0) {
ERR(file->handle, "module package header truncated");
- return -1;
+ goto err;
}
if (le32_to_cpu(buf[0]) != SEPOL_MODULE_PACKAGE_MAGIC) {
ERR(file->handle,
"wrong magic number for module package: expected %u, got %u",
SEPOL_MODULE_PACKAGE_MAGIC, le32_to_cpu(buf[0]));
- return -1;
+ goto err;
}
mod->version = le32_to_cpu(buf[1]);
@@ -376,23 +382,29 @@
if (nsec > MAXSECTIONS) {
ERR(file->handle, "too many sections (%u) in module package",
nsec);
- return -1;
+ goto err;
}
off = (size_t *) malloc((nsec + 1) * sizeof(size_t));
if (!off) {
ERR(file->handle, "out of memory");
- return -1;
+ goto err;
}
- rc = next_entry(off, file, sizeof(uint32_t) * nsec);
+ free(buf);
+ buf = malloc(sizeof(uint32_t) * nsec);
+ if (!buf) {
+ ERR(file->handle, "out of memory");
+ goto err;
+ }
+ rc = next_entry(buf, file, sizeof(uint32_t) * nsec);
if (rc < 0) {
ERR(file->handle, "module package offset array truncated");
- return -1;
+ goto err;
}
for (i = 0; i < nsec; i++) {
- off[i] = le32_to_cpu(off[i]);
+ off[i] = le32_to_cpu(buf[i]);
if (i && off[i] < off[i - 1]) {
ERR(file->handle, "offsets are not increasing (at %u, "
"offset %zu -> %zu", i, off[i - 1],
@@ -401,10 +413,15 @@
}
}
-
+ free(buf);
off[nsec] = policy_file_length(file);
*offsets = off;
return 0;
+
+err:
+ free(buf);
+ free(off);
+ return -1;
}
/* Flags for which sections have been seen during parsing of module package. */
--
Stephen Smalley
National Security Agency
--
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-28 17:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-28 16:30 Looks like we have a 64 bit problem on Rawhide Daniel J Walsh
2007-08-28 16:55 ` Todd Miller
2007-08-28 17:15 ` Stephen Smalley
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.