[sudo-users] sudo command causes a bus error

Todd C. Miller Todd.Miller at courtesan.com
Fri Sep 16 08:24:02 EDT 2011


A bus error is usually an alignment problem.  I can see how this
could happen on 64-bit machines with strict alignment requirements
(such as sparc64).

Can you try the following patch?  You can apply with by running
"patch -p1 filename" from inside the unpacked sudo source tarball.

 - todd

diff -r d161b82321da plugins/sudoers/pwutil.c
--- a/plugins/sudoers/pwutil.c	Thu Sep 15 19:56:34 2011 -0400
+++ b/plugins/sudoers/pwutil.c	Fri Sep 16 08:19:18 2011 -0400
@@ -508,16 +533,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);

On Fri, 16 Sep 2011 12:46:50 +0200, Frans van Berckel wrote:

> Good to know - calling sudo in sid, causes a bus error on Debian
> sparc64-ports, it's based om a Sid setup.
> 
> root at deblnxsrv254:~# sudo
> Bus error
> 
> root at deblnxsrv254:~# gdb /usr/bin/sudo
> GNU gdb (GDB) 7.3-debian
> 
> This GDB was configured as "sparc64-linux-gnu".
> 
> Reading symbols from /usr/bin/sudo...done.
> 
> (gdb) r
> Starting program: /usr/bin/sudo 
> 
> Program received signal SIGBUS, Bus error.
> 0xfffff801008e0420 in make_grlist_item 
> (user=<optimized out>, gids=<optimized out>, ngids=1)
> at /usr/src/sudo-1.8.2/plugins/sudoers/pwutil.c:552
> 552                 grlist->groups[ngroups++] = cp;
> 
> Why is sudoers.so going true it knies? And do you need some more info? Or do 
> you know exactly what goes on and how we can solve the issue?
> 
> The Debian bug post, with more information, is available here ...
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=640304
> 
> Thanks,
> 
> 
> Frans van Berckel
> 
> ____________________________________________________________
> sudo-users mailing list <sudo-users at sudo.ws>
> For list information, options, or to unsubscribe, visit:
> http://www.sudo.ws/mailman/listinfo/sudo-users
> 




More information about the sudo-users mailing list