Bug#972185: libre0: stack smashing detected in v1.1.0

2020-10-15 Thread Bernhard Übelacker
Hello Kevin,
I don't know the details, but I guess there will no automatic
rebuild of baresip triggered on migration.
As far as I see [1], the only users of libre0 are
baresip and librem0, so I guess both might need a rebuild.
Maybe someone with more shared library packaging knowledge
might give some pointers what steps need to be taken now?

Kind regards,
Bernhard

[1] `apt-cache rdepends libre0` in an unstable VM.



Bug#972185: libre0: stack smashing detected in v1.1.0

2020-10-14 Thread Kevin Otte
Thanks for the additional eyes. Should I file a bug against baresip to
have it rebuilt for testing, or will that be triggered automatically
when libre migrates?

On 10/14/20 12:40 PM, Bernhard Übelacker wrote:
> Dear Maintainer,
> I could reproduce the issue and it looks like there is a ABI break
> of libre0 because the size of struct sip_addr has changed
> from 152 bytes to 168, and therefore overwrites the stack canary here [1].
> 
> A baresip built agains libre0 1.1.0-1 did not show this problem.
> 
> Kind regards,
> Bernhard



Bug#972185: libre0: stack smashing detected in v1.1.0

2020-10-14 Thread Bernhard Übelacker
Dear Maintainer,
I could reproduce the issue and it looks like there is a ABI break
of libre0 because the size of struct sip_addr has changed
from 152 bytes to 168, and therefore overwrites the stack canary here [1].

A baresip built agains libre0 1.1.0-1 did not show this problem.

Kind regards,
Bernhard


[1]
(rr) bt
#0  0x7f9dc0bf22eb in memset (__len=168, __ch=0, __dest=0x7fff4bc3ae80) at 
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:71
#1  sip_addr_decode (addr=addr@entry=0x7fff4bc3ae80, 
pl=pl@entry=0x7fff4bc3af50) at src/sip/addr.c:32
#2  0x556a958a831c in call_connect (call=0x556a95dbb7a0, 
paddr=paddr@entry=0x7fff4bc3af50) at src/call.c:932
#3  0x556a958b635c in ua_connect (ua=0x556a95db6940, callp=callp@entry=0x0, 
from_uri=from_uri@entry=0x0, req_uri=req_uri@entry=0x556a95dbd5a0 "sip:", '0' 
, "@fritz.box", vmode=vmode@entry=VIDMODE_ON) at src/ua.c:928
#4  0x7f9dc02a5e1f in dial_handler (pf=, arg=0x7fff4bc3b030) 
at modules/menu/menu.c:266
#5  0x556a9586 in cmd_report (data=0x0, mb=, 
pf=0x7f9dc0c66020 , cmd=0x7f9dc02aa8c0 ) at src/cmd.c:293
#6  cmd_process_edit (commands=, ctxp=, 
key=, pf=, data=0x0) at src/cmd.c:389
#7  0x556a958aaf74 in cmd_process (commands=, 
ctxp=, key=, pf=pf@entry=0x7f9dc0c66020 
, data=data@entry=0x0) at src/cmd.c:539
#8  0x556a958b7fe0 in ui_input_key (uis=, key=key@entry=10 
'\n', pf=pf@entry=0x7f9dc0c66020 ) at src/ui.c:66
#9  0x7f9dc0c6348a in report_key (ui=, key=10 '\n') at 
modules/stdio/stdio.c:66
#10 ui_fd_handler (flags=, arg=) at 
modules/stdio/stdio.c:90
#11 0x7f9dc0c312dc in fd_poll (re=re@entry=0x7f9dc0c5d0e0 ) at 
src/main/main.c:896
#12 0x7f9dc0c31d52 in re_main (signalh=0x556a958babd0 ) at 
src/main/main.c:1030
#13 0x556a958a052f in main (argc=, argv=) at 
src/main.c:301


# Unstable amd64 qemu VM 2020-10-14


apt update
apt dist-upgrade


apt install systemd-coredump mc htop fakeroot gdb rr baresip 
baresip-core-dbgsym libre0-dbgsym
apt build-dep libre0
apt build-dep baresip
echo 1 > /proc/sys/kernel/perf_event_paranoid




mkdir /home/benutzer/source/libre0/orig -p
cd/home/benutzer/source/libre0/orig
apt source libre0
cd

mkdir /home/benutzer/source/baresip-core/orig -p
cd/home/benutzer/source/baresip-core/orig
apt source baresip-core
cd




baresip
d
sip:...@fritz.box



benutzer@debian:~$ baresip
baresip v1.0.0 Copyright (C) 2010 - 2020 Alfred E. Heggestad et al.
Local network address:  IPv4=ens4|10.0.2.15  IPv6=ens4|fec0::5054:ff:fe12:3456
aucodec: PCMU/8000/1
aucodec: PCMA/8000/1
ausrc: alsa
auplay: alsa
medianat: stun
medianat: turn
medianat: ice
Populated 1 account
Populated 3 contacts
Populated 2 audio codecs
Populated 0 audio filters
Populated 0 video codecs
Populated 0 video filters
baresip is ready.
>sip:...@fritz.box
ua: using best effort AF: af=AF_INET
call: connecting to 'sip:...@fritz.box'..
*** stack smashing detected ***: terminated
Abgebrochen (Speicherabzug geschrieben)



root@debian:~# journalctl -e
...
Okt 14 17:49:57 debian systemd[1]: Started Process Core Dump (PID 11453/UID 0).
Okt 14 17:49:58 debian systemd-coredump[11454]: Process 11451 (baresip) of user 
1000 dumped core.

Stack trace of thread 11451:
#0  0x7f7c802e8c41 
__GI_raise (libc.so.6 + 0x3bc41)
#1  0x7f7c802d2537 
__GI_abort (libc.so.6 + 0x25537)
#2  0x7f7c8032b6c8 
__libc_message (libc.so.6 + 0x7e6c8)
#3  0x7f7c803ba5b2 
__GI___fortify_fail (libc.so.6 + 0x10d5b2)
#4  0x7f7c803ba590 
__stack_chk_fail (libc.so.6 + 0x10d590)
#5  0x55ccf95ed3da 
call_connect (baresip + 0x143da)
#6  0x55ccf95fb35c 
ua_connect (baresip + 0x2235c)
#7  0x7f7c7fdb9e1f n/a 
(menu.so + 0x4e1f)
#8  0x55ccf95efaa6 n/a 
(baresip + 0x16aa6)
#9  0x7f7c8067348a n/a 
(stdio.so + 0x148a)
#10 0x7f7c8063f2dc n/a 
(libre.so.0 + 0x562dc)
#11 0x7f7c8063fd52 re_main 
(libre.so.0 + 0x56d52)
#12 0x55ccf95e552f main 
(baresip + 0xc52f)
#13 0x7f7c802d3cca 
__libc_start_main (libc.so.6 + 0x26cca)
#14 0x55ccf95e56ba _start 
(baresip + 0xc6ba)
Okt 14 17:49:58 debian systemd[1]: systemd-coredump@2-11453-0.service: 
Succeeded.



root@debian:~# coredumpctl lis

Bug#972185: libre0: stack smashing detected in v1.1.0

2020-10-13 Thread Kevin Otte
Package: libre0
Version: 1.1.0-1
Severity: grave
Justification: renders package unusable

Dear Maintainer,

I went ahead and installed version 1.1.0-1 from unstable to go ahead and
test the fix for #971980.

---
kjotte@daedalus:~$ baresip
baresip v1.0.0 Copyright (C) 2010 - 2020 Alfred E. Heggestad et al.
Local network address:
IPv6=enp0s25|2606:a000:a442:9800:efae:2f59:1855:7d4f
...
baresip is ready.
>  142
ua: using best effort AF: af=AF_INET6
call: connecting to 'sip:1...@pbx-int.home.nivex.net'..
*** stack smashing detected ***: terminated
Aborted (core dumped)
---

Not sure if this is a problem in the libre0 build or if baresip needs to
be rebuilt against the new library version.

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 5.8.0-1-amd64 (SMP w/2 CPU threads)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=UTF-8) (ignored: LC_ALL set
to en_US.UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libre0 depends on:
ii  libc6  2.31-3
ii  libssl1.1  1.1.1g-1
ii  zlib1g 1:1.2.11.dfsg-2

libre0 recommends no packages.

libre0 suggests no packages.

-- no debconf information