summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2011-10-12 18:50:26 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2011-10-12 18:50:26 +0000
commit12a70b2cf5840738172f68c1881a1e71173f4607 (patch)
tree0e8436f5d357507c7accb2478a3ef9b18a80e833 /app-admin/sudo/files
parentRemove old version. (diff)
downloadgentoo-2-12a70b2cf5840738172f68c1881a1e71173f4607.tar.gz
gentoo-2-12a70b2cf5840738172f68c1881a1e71173f4607.tar.bz2
gentoo-2-12a70b2cf5840738172f68c1881a1e71173f4607.zip
Fixed alignment issue on alpha found by armin76 (fix from upstream).
(Portage version: 2.1.10.11/cvs/Linux x86_64)
Diffstat (limited to 'app-admin/sudo/files')
-rw-r--r--app-admin/sudo/files/sudo-1.8.2-fix-pwutil-alignment.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/app-admin/sudo/files/sudo-1.8.2-fix-pwutil-alignment.patch b/app-admin/sudo/files/sudo-1.8.2-fix-pwutil-alignment.patch
new file mode 100644
index 000000000000..a25871c79d2f
--- /dev/null
+++ b/app-admin/sudo/files/sudo-1.8.2-fix-pwutil-alignment.patch
@@ -0,0 +1,45 @@
+status: upstream
+
+> Program received signal SIGBUS, Bus error.
+> 0x0000020005ff64e0 in make_grlist_item (user=0x120037090 "root", gids=0x120037140, ngids=11) at ./pwutil.c:552
+> 552 grlist->groups[ngroups++] = cp;
+
+Found by armin76.
+
+On alpha gid_t (grlist->gids) is 4-bytes long (and 4-bytes algned)
+while char** (grlist->groups) is 8-bytes aligned.
+Reorder to satisfy both alignmens.
+
+# HG changeset patch
+# User Todd C. Miller <Todd.Miller@courtesan.com>
+# Date 1316193166 14400
+# Branch 1.8
+# Node ID e877c89ae32fc1fa7c3933f9599761d43f79dc96
+# Parent f31543c80b9857cf4d14048be0c3ff34a47201c4
+# Parent c89508c73c46bca11b6b9d3980cd4a511efcde6f
+Fix a crash in make_grlist_item() on 64-bit machines with strict
+alignment.
+
+diff -r f31543c80b98 -r e877c89ae32f plugins/sudoers/pwutil.c
+--- a/plugins/sudoers/pwutil.c Fri Sep 16 13:12:34 2011 -0400
++++ b/plugins/sudoers/pwutil.c Fri Sep 16 13:12:46 2011 -0400
+@@ -508,16 +508,16 @@
+
+ /*
+ * Copy in group list and make pointers relative to space
+- * at the end of the buffer. Note that the gids array must come
++ * at the end of the buffer. Note that the groups array must come
+ * immediately after struct group to guarantee proper alignment.
+ */
+ grlist = (struct group_list *)cp;
+ zero_bytes(grlist, sizeof(struct group_list));
+ cp += sizeof(struct group_list);
++ grlist->groups = (char **)cp;
++ cp += sizeof(char *) * ngids;
+ grlist->gids = (gid_t *)cp;
+ cp += sizeof(gid_t) * ngids;
+- grlist->groups = (char **)cp;
+- cp += sizeof(char *) * ngids;
+
+ /* Set key and datum. */
+ memcpy(cp, user, nsize);