Issue 6862 - Patch - Mozilla NSS - redux: disable pkcs11 fork checking for the software token
Summary: Patch - Mozilla NSS - redux: disable pkcs11 fork checking for the software token
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-10 20:04 UTC by rich.megginson@gmail.com
Modified: 2014-08-01 21:04 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description rich.megginson@gmail.com 2011-03-10 20:04:54 UTC
Full_Name: Rich Megginson
Version: 2.4.24 (current CVS HEAD)
OS: RHEL6
URL: ftp://ftp.openldap.org/incoming/openldap-2.4.24-use-strdup-for-nofork-envvar-20110310.patch
Submission from: (NULL) (76.113.111.209)


There was still a problem with the fix for 
http://www.openldap.org/its/index.cgi?findid=6811

Under certain conditions, and with certain shells, the PR_SetEnv with the
constant string was causing free() assertion failures in unrelated software.

# su - foo
free(0x173bd2) below bottom of memory. (memtop = 0x9898800 membot = 0x973e000)
# gdb /bin/tcsh coredump
(gdb) bt
#0  0x00ed9416 in __kernel_vsyscall ()
#1  0x006e02f1 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0x006e1d5e in abort () at abort.c:92
#3  0x08084e6a in free (cp=0x8f2bd2) at tc.alloc.c:313
#4  0x08063d83 in blkfree (av0=0x9e7d988) at sh.misc.c:158
#5  0x0805af6f in tsetenv (name=0x80a3420 L"GROUP", val=0x9e32608
L"valid_group") at sh.func.c:1725
#6  0x0804d910 in main (argc=<value optimized out>, argv=0xbfa7e4f4) at
sh.c:561

Using PR_SetEnv with a strdup()ed string solved the problem.

These patch files are derived from OpenLDAP Software. All of the
modifications to OpenLDAP Software represented in the following
patch(es) were developed by Red Hat. Red Hat has not assigned rights
and/or interest in this work to any party. I, Rich Megginson am
authorized by Red Hat, my employer, to release this work under the
following terms.

Red Hat hereby place the following modifications to OpenLDAP Software
(and only these modifications) into the public domain. Hence, these
modifications may be freely used and/or redistributed for any purpose
with or without attribution and/or other notice.
Comment 1 Howard Chu 2011-03-15 14:57:00 UTC
rmeggins@redhat.com wrote:
> Full_Name: Rich Megginson
> Version: 2.4.24 (current CVS HEAD)
> OS: RHEL6
> URL: ftp://ftp.openldap.org/incoming/openldap-2.4.24-use-strdup-for-nofork-envvar-20110310.patch
> Submission from: (NULL) (76.113.111.209)
>
>
> There was still a problem with the fix for
> http://www.openldap.org/its/index.cgi?findid=6811
>
> Under certain conditions, and with certain shells, the PR_SetEnv with the
> constant string was causing free() assertion failures in unrelated software.
>
> # su - foo
> free(0x173bd2) below bottom of memory. (memtop = 0x9898800 membot = 0x973e000)
> # gdb /bin/tcsh coredump
> (gdb) bt
> #0  0x00ed9416 in __kernel_vsyscall ()
> #1  0x006e02f1 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> #2  0x006e1d5e in abort () at abort.c:92
> #3  0x08084e6a in free (cp=0x8f2bd2) at tc.alloc.c:313
> #4  0x08063d83 in blkfree (av0=0x9e7d988) at sh.misc.c:158
> #5  0x0805af6f in tsetenv (name=0x80a3420 L"GROUP", val=0x9e32608
> L"valid_group") at sh.func.c:1725
> #6  0x0804d910 in main (argc=<value optimized out>, argv=0xbfa7e4f4) at
> sh.c:561
>
> Using PR_SetEnv with a strdup()ed string solved the problem.

At the expense of a small memory leak. Whatever happened to making PR_SetEnv() 
take care of this itself?

http://osdir.com/ml/mozilla.devel.nspr/2005-02/msg00011.html

I thought the point of NSPR was to provide a consistent cross-platform API. If 
PR_SetEnv() is documented to behave a particular way, and it doesn't, then 
this bug should be fixed in NSPR. If NSPR is unable to provide a consistent API...

I'm getting the feeling that you're plugging an unmaintainable code base in here.
-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 2 Howard Chu 2011-06-21 23:00:50 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 3 Quanah Gibson-Mount 2011-06-22 00:52:03 UTC
changed notes
changed state Test to Release
Comment 4 Quanah Gibson-Mount 2011-07-18 19:52:45 UTC
changed notes
changed state Release to Closed
Comment 5 OpenLDAP project 2014-08-01 21:04:37 UTC
fixed in master
fixed in RE24