Bug#1057855: curl: segmentation fault when connecting to LDAP server

2023-12-09 Thread Samuel Henrique
Hello Tianyu,

> When using curl 8.5.0-1 performing a request to ldap://db.debian.org, curl
> received signal SIGSEGV, Segmentation fault.

I have not looked into this yet but our CI test also spotted a regression, the
package won't migrate to testing due to that and it's likely it spotted the
same issue as you.

https://ci.debian.net/packages/c/curl/testing/amd64/40802824/#S13
https://ci.debian.net/packages/c/curl/

Thank you for reporting this.

-- 
Samuel Henrique 



Bug#1057855: curl: segmentation fault when connecting to LDAP server

2023-12-09 Thread Tianyu Chen
Package: curl
Version: 8.5.0-1
Severity: important
X-Debbugs-Cc: Daniel Stenberg , Tianyu Chen 


When using curl 8.5.0-1 performing a request to ldap://db.debian.org, curl
received signal SIGSEGV, Segmentation fault.

Backtrace:

(gdb) bt
#0  0x in ?? ()
#1  0x77f2f33c in ldapsb_tls_write (sbiod=,
buf=, len=) at ./debian/build/lib/openldap.c:1192
#2  0x77546f68 in sb_debug_write (sbiod=0x555f14e0,
buf=0x555f2650, len=39) at ../../../../libraries/liblber/sockbuf.c:854
#3  0x77548181 in ber_int_sb_write (sb=sb@entry=0x555f1330,
buf=0x555f2650, len=len@entry=39) at
../../../../libraries/liblber/sockbuf.c:445
#4  0x77544a63 in ber_flush2 (sb=0x555f1330,
ber=0x555f1730, freeit=freeit@entry=0) at
../../../../libraries/liblber/io.c:249
#5  0x77575b43 in ldap_int_flush_request
(ld=ld@entry=0x555eee00, lr=lr@entry=0x555f17b0) at
../../../../libraries/libldap/request.c:186
#6  0x77575e30 in ldap_send_server_request
(ld=ld@entry=0x555eee00, ber=ber@entry=0x555f1730, msgid=msgid@entry=2,
parentreq=parentreq@entry=0x0, srvlist=srvlist@entry=0x0,
lc=, lc@entry=0x0, bind=0x0, m_noconn=0,
m_res=0) at ../../../../libraries/libldap/request.c:412
#7  0x77576211 in ldap_send_initial_request
(ld=ld@entry=0x555eee00, msgtype=msgtype@entry=99,
dn=dn@entry=0x555f1710 "", ber=0x555f1730, msgid=2)
at ../../../../libraries/libldap/request.c:169
#8  0x775645ec in ldap_pvt_search (ld=0x555eee00,
base=0x555f1710 "", scope=0, filter=0x0, attrs=0x0,
attrsonly=attrsonly@entry=0, sctrls=0x0, cctrls=0x0, timeout=0x0,
sizelimit=0, deref=-1, msgidp=0x7fffd9c4) at
../../../../libraries/libldap/search.c:128
#9  0x775646d0 in ldap_search_ext (ld=,
base=, scope=, filter=,
attrs=, attrsonly=attrsonly@entry=0,
sctrls=0x0, cctrls=0x0, timeout=0x0, sizelimit=0,
msgidp=0x7fffd9c4) at ../../../../libraries/libldap/search.c:69
#10 0x77f30b66 in oldap_do (data=0x555d2390,
done=0x7fffda14) at ./debian/build/lib/openldap.c:895
#11 0x77f2cd7f in multi_do (done=0x7fffda14,
data=) at ./debian/build/lib/multi.c:1558
#12 multi_runsingle (multi=multi@entry=0x555ce130,
nowp=nowp@entry=0x7fffda90, data=data@entry=0x555d2390) at
./debian/build/lib/multi.c:2156
#13 0x77f2de46 in curl_multi_perform
(multi=multi@entry=0x555ce130,
running_handles=running_handles@entry=0x7fffdb98) at
./debian/build/lib/multi.c:2702
#14 0x77f006bb in easy_transfer (multi=) at
./debian/build/lib/easy.c:671
#15 easy_perform (events=false, data=0x555d2390) at
./debian/build/lib/easy.c:761
#16 curl_easy_perform (data=0x555d2390) at
./debian/build/lib/easy.c:780
#17 0x55570b20 in serial_transfers (share=0x555cabb0,
global=0x7fffdd40) at ./debian/build/src/tool_operate.c:2500
#18 run_all_transfers (result=CURLE_OK, share=0x555cabb0,
global=0x7fffdd40) at ./debian/build/src/tool_operate.c:2691
#19 operate (global=global@entry=0x7fffdd40, argc=argc@entry=2,
argv=argv@entry=0x7fffdef8) at ./debian/build/src/tool_operate.c:2807
#20 0xf9f8 in main (argc=2, argv=0x7fffdef8) at
./debian/build/src/tool_main.c:273

ci.debian.net also complains so:
https://ci.debian.net/packages/c/curl/testing/amd64/

Best regrads,
Tianyu Chen


-- System Information:
Debian Release: trixie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.5.0-5-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages curl depends on:
ii  libc6 2.37-13
ii  libcurl4  8.5.0-1
ii  zlib1g1:1.3.dfsg-3

curl recommends no packages.

curl suggests no packages.

-- no debconf information