diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2011-10-12 18:50:26 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2011-10-12 18:50:26 +0000 |
commit | 6f00cbdf211e1a89369c57d0af6b2ba60f8c60ba (patch) | |
tree | 082e7d9dd2017d67da3574abb99583747b9eece5 /app-admin/sudo/files | |
parent | Remove old version. (diff) | |
download | historical-6f00cbdf211e1a89369c57d0af6b2ba60f8c60ba.tar.gz historical-6f00cbdf211e1a89369c57d0af6b2ba60f8c60ba.tar.bz2 historical-6f00cbdf211e1a89369c57d0af6b2ba60f8c60ba.zip |
Fixed alignment issue on alpha found by armin76 (fix from upstream).
Package-Manager: portage-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.patch | 45 |
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); |