mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Sebastian Gottschall <s.gottschall@dd-wrt.com>
To: Natanael Copa <ncopa@alpinelinux.org>
Cc: musl@lists.openwall.com
Subject: Re: pthreads broken (freeradius testcase)
Date: Fri, 16 Jan 2015 12:44:51 +0100	[thread overview]
Message-ID: <54B8F9B3.4030809@dd-wrt.com> (raw)
In-Reply-To: <20150116082000.57abc5c9@ncopa-desktop.alpinelinux.org>

Am 16.01.2015 um 08:20 schrieb Natanael Copa:
> On Thu, 15 Jan 2015 23:52:36 +0100
> Sebastian Gottschall <s.gottschall@dd-wrt.com> wrote:
>
>> following test case
>>
>> configure freeradius with --with-threads (which is on by default)
>> if you start radiusd with your radius configuration you will see that
>> radius does not listen on any ports. it will hang in the listener thread
>> which creates the socket.
>> if you configure it as --without-threads, it works
>>
>>
>> tested with musl 1.1.6 on a mips (big endian) system using kernel 3.10
>>
>> Sebastian
> What version of freeradius is it?
>
> I have had some interesting threading issues with freeradius 2.2.x.
> Some modules are marked as non-thread safe but will still run in a
> separate thread. It runs main thread + a single non-thread-safe thread.
>
> They used getgrnam and getpwnam in both main thread and in the
> non-thread-safe module so memory got corrupted. (IMHO this should get a
> CVE but upstream disagrees because it only happens on a non-recommended
> config)
>
> They fixed that in 3.x.x but AFAIK they didn't fix it in 2.x.x.
>
> Patches:
> http://git.alpinelinux.org/cgit/aports/tree/main/freeradius/0001-Use-threadsafe-wrapper-for-getpwnam-getgrnam.patch
> http://git.alpinelinux.org/cgit/aports/tree/main/freeradius/0001-use-threadsafe-rad_getgrnam.patch
>
> (upstream patched it differently in 3.x.x branch)
>
> When backporting the fix to 2.x.x I also found that the TLS configure
> test is completely broke in 2.x.x branch too. IIRC it will say "TLS
> found" but behind the scenes it will still disable TLS support.
>
> patch:
> http://git.alpinelinux.org/cgit/aports/tree/main/freeradius/fix-tls-test.patch
>
> This is probably not the related the issue you have have at hand, but
> I'm would not be surprised if musl libc has unmasked another bug in
> freeradius.
i applied all these fixes. the first thread for port 1812 works, the 
second thread for internal tunnel 18120 doesnt work
an hangs again. even if setuid support is disabled
>
>
> -nc
>



  parent reply	other threads:[~2015-01-16 11:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15 22:52 Sebastian Gottschall
2015-01-15 23:10 ` Rich Felker
2015-01-15 23:42   ` Rich Felker
2015-01-15 23:53     ` Sebastian Gottschall
2015-01-16  0:11     ` Sebastian Gottschall
2015-01-16  0:23       ` Rich Felker
2015-01-16  1:53         ` Sebastian Gottschall
2015-01-16  7:20 ` Natanael Copa
2015-01-16  8:07   ` Sebastian Gottschall
2015-01-16 11:44   ` Sebastian Gottschall [this message]
2015-01-16 16:25     ` Rich Felker
2015-01-16 17:57       ` Sebastian Gottschall
2015-01-16 18:09         ` Rich Felker
2015-01-16 21:59           ` Sebastian Gottschall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54B8F9B3.4030809@dd-wrt.com \
    --to=s.gottschall@dd-wrt.com \
    --cc=musl@lists.openwall.com \
    --cc=ncopa@alpinelinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).