From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6855 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: pthreads broken (freeradius testcase) Date: Fri, 16 Jan 2015 11:25:05 -0500 Message-ID: <20150116162505.GW4574@brightrain.aerifal.cx> References: <54B844B4.1000500@dd-wrt.com> <20150116082000.57abc5c9@ncopa-desktop.alpinelinux.org> <54B8F9B3.4030809@dd-wrt.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1421425523 15101 80.91.229.3 (16 Jan 2015 16:25:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Jan 2015 16:25:23 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6868-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jan 16 17:25:23 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YC9i4-0006jq-T0 for gllmg-musl@m.gmane.org; Fri, 16 Jan 2015 17:25:20 +0100 Original-Received: (qmail 29961 invoked by uid 550); 16 Jan 2015 16:25:18 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 29950 invoked from network); 16 Jan 2015 16:25:18 -0000 Content-Disposition: inline In-Reply-To: <54B8F9B3.4030809@dd-wrt.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:6855 Archived-At: On Fri, Jan 16, 2015 at 12:44:51PM +0100, Sebastian Gottschall wrote: > Am 16.01.2015 um 08:20 schrieb Natanael Copa: > >On Thu, 15 Jan 2015 23:52:36 +0100 > >Sebastian Gottschall 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 Could you report where the hang is occurring (using gdb backtrace) now with the setuid support disabled? Rich