Crash for untrusted ssl certificate

Bug #238529 reported by Martin von Gagern
2
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Medium
Jelmer Vernooij
subversion
New
Undecided
Unassigned

Bug Description

Trying to reproduce https://bugs.launchpad.net/bzr-svn/+bug/235776/comments/8, I got a SIGSEGV:

$ bzr checkout svn+https://guest:@hudson.dev.java.net/svn/hudson/trunk/hudson
Segmentation fault

Running this through gdb:
#0 0x4e44c7a6 in instancemethod_dealloc (im=<value optimized out>)
    at Objects/classobject.c:2307
#1 0x4e48405d in tupledealloc (op=<value optimized out>)
    at Objects/tupleobject.c:169
#2 0x4e44c343 in instancemethod_call (func=<value optimized out>,
    arg=<value optimized out>, kw=<value optimized out>)
    at Objects/classobject.c:2520
#3 0x4e4469f3 in PyObject_Call (func=<value optimized out>,
    arg=<value optimized out>, kw=<value optimized out>)
    at Objects/abstract.c:1864
#4 0x4e446bf0 in call_function_tail (callable=<value optimized out>,
    args=<value optimized out>) at Objects/abstract.c:1896
#5 0x4e446e9f in PyObject_CallFunction (callable=<value optimized out>,
    format=<value optimized out>) at Objects/abstract.c:1920
#6 0xb7bbc282 in svn_swig_py_auth_ssl_server_trust_prompt_func (
    cred=0xbfbf4538, baton=0x8e69cfc,
    realm=0x91d7e70 "https://hudson.dev.java.net:443", failures=8,
    cert_info=0xbfbf45f8, may_save=1, pool=0x91d40d8)
    at /var/tmp/portage/dev-util/subversion-1.5.0_rc9/work/subversion-1.5.0-rc9/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c:2761
#7 0x410610b0 in ssl_server_trust_prompt_first_cred (
    credentials_p=<value optimized out>, iter_baton=Could not find the frame base for "ssl_server_trust_prompt_first_cred".
)
    at subversion/libsvn_subr/ssl_server_trust_providers.c:216

Looks like svn were trying to ask the user whether to accept the ssl certificate permanently, temporarily or not at all. So I guess to reproduce this you should run this command to clear the certificate:

grep -l hudson.dev.java.net ~/.subversion/auth/svn.ssl.server/* | xargs -r rm -v

Related branches

Revision history for this message
Martin von Gagern (gagern) wrote :

Versions involved:
* svn-bzr merge containing r1229 from svn-1.5 branch and r1218 from bug128496 branch
* subversion 1.5.0 RC9
* python 2.5.2
* swig 1.3.35

Revision history for this message
Martin von Gagern (gagern) wrote :

Reference mentioned in IRC: http://thread.gmane.org/gmane.comp.version-control.subversion.devel/98545

One solution would be to attach the python functions to the swig objects that wrap them. I'll attach a branch that demonstrates this for the single described issue of the server trust prompt, but other callbacks would be affected as well. I might expand on this if I find the time.

The solution is generic enough that there should be a way to implement this in the svn python bindings as well, although right now I don't know enough about swig to implement this.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Have you verified that your fix works? When I tried to use this earlier, I couldn't get it to work.

Revision history for this message
Martin von Gagern (gagern) wrote :

Yes, I verified it, worked for me.
What did you try to use earlier? My branch earlier today, or that kind of solution earlier before I submitted this bug?
Can you run your attempt through gdb to ensure it crashes at the same place?

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This is no longer a problem with the new bzr-svn python bindings. Checking out the hudson repository works fine now.

Changed in bzr-svn:
assignee: nobody → jelmer
milestone: none → 0.4.11
status: New → Fix Committed
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.