Bug 978 - sudo is giving error
sudo is giving error
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.9.7
HP HP-UX
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-06-03 04:25 MDT by Praveen
Modified: 2021-09-11 15:54 MDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Praveen 2021-06-03 04:25:28 MDT
uxadmin1@hupa28:/etc # sudo ls
Memory fault(coredump)
Comment 1 Praveen 2021-06-03 04:27:50 MDT
only version working is for this server is 
4280320 Mar 31 09:33 ixSudo_ixSudo_A.20.00-1.8.6p3.001_HP-UX_B.11.31_IA_PA.depot
Comment 2 Todd C. Miller 2021-06-03 07:45:25 MDT
Can you try sudo 1.9.7?  It contains a datasize resource limit fix for HP-UX that may be relevant here.
Comment 3 Praveen 2021-06-03 08:24:01 MDT
uxadmin1@hupa28:/var/adm/crash/venkatc/software # sudo -V
Sudo version 1.9.7
Sudoers policy plugin version 1.9.7
Sudoers file grammar version 48
Sudoers I/O plugin version 1.9.7
Sudoers audit plugin version 1.9.7
uxadmin1@hupa28:/var/adm/crash/venkatc/software # sudo ls
Memory fault(coredump)
uxadmin1@hupa28:/var/adm/crash/venkatc/software # which sudo
/usr/bin/sudo1
uxadmin1@hupa28:/var/adm/crash/venkatc/software # ls -ltr /usr/bin/sudo1
lrwx------   1 root       sys             19 Jun  3 18:19 /usr/bin/sudo1 -> /usr/local/bin/sudo
uxadmin1@hupa28:/var/adm/crash/venkatc/software #
Comment 4 Todd C. Miller 2021-06-03 11:22:55 MDT
Please add the following to /etc/sudo.conf (you may need to create this file if it doesn't already exist).

Debug sudoers.so /var/adm/sudoers_debug all@debug

Then run "sudo -ls" on that system.  That should create the file /var/adm/sudoers_debug with debugging data to help me understand where the problem is.

You can either attach that file to this bug or, if you'd prefer, email it to sudo@sudo.ws and I will analyze it.
Comment 5 Praveen 2021-06-03 21:08:32 MDT
I have emailed debug info pls help me analyze, thanks
Comment 6 Praveen 2021-06-08 04:31:49 MDT
$./getgids root
Memory fault(coredump) 

$ pstack ./getgids core
unable to find (static?) executable /usr/bin/
./getgids:      /usr/bin/

core:   getgids

--------------------------------  lwpid : 5499156   -------------------------------

 0: c000000000039e40 : _nss_compat_constr() + 0x5b0 (/usr/lib/hpux64/libnss_compat.so.1)
 1: c000000000614d30 : nss_search() at ../../../../../core/libs/libc/shared_em_64_perf/../net/net/nss_common.c:513
 2: 4000000000004fe0 : sudo_getgrouplist2_v1() at getgrouplist.c:415
 3: 4000000000004b20 : main() at getgids.c:73
 4: c00000000006fd50 : main_opd_entry() + 0x50 (/usr/lib/hpux64/dld.so)
 5: c000000000039e70 : _nss_compat_constr() + 0x5e0 (/usr/lib/hpux64/libnss_compat.so.1)
 6: 9fffffffbf6f8c68 : (unknown) () (unknown)


$ id -G root
3
$ sudo id -G root
3 0 1 2 4 5 6 7 20
Comment 7 Todd C. Miller 2021-06-08 10:51:32 MDT
It looks like the crash is happening inside the nsswitch code.  Can you share the nsswitch.conf group line?  E.g.

$ grep group /etc/nsswitch.conf
Comment 8 Todd C. Miller 2021-06-08 12:58:00 MDT
I can reproduce the problem with the nsswitch.conf line:

group: compat

but not with:

group: files nis

Now that I can reproduce the problem I should be able to get to the bottom of it.
Comment 9 Praveen 2021-06-08 18:28:41 MDT
grep group /etc/nsswitch.conf
group:        compat
netgroup:     nis [NOTFOUND=return] files
Comment 10 Todd C. Miller 2021-06-11 15:45:22 MDT
I was not able to find the cause of the crash inside the HP-UX nss_compat moddule.  There is probably some mismatch between the data structures sudo is using for nss_search and the HP-UX implementation.  Unfortunately, HP doesn't ship the header files like Solaris does.

For sudo 1.9.7p1 (available now) I have disabled the use of nss_search() on HP-UX.  Sudo will fall back to using getgrent() to find a user's groups.  This may be slower but it does not cause a crash for "group: compat".