From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7493 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Static analysis results Date: Thu, 23 Apr 2015 12:41:51 -0400 Message-ID: <20150423164150.GG17573@brightrain.aerifal.cx> References: 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 1429807336 28729 80.91.229.3 (23 Apr 2015 16:42:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Apr 2015 16:42:16 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7506-gllmg-musl=m.gmane.org@lists.openwall.com Thu Apr 23 18:42:06 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 1YlKCS-0005e1-Tk for gllmg-musl@m.gmane.org; Thu, 23 Apr 2015 18:42:05 +0200 Original-Received: (qmail 28506 invoked by uid 550); 23 Apr 2015 16:42:03 -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 28484 invoked from network); 23 Apr 2015 16:42:02 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7493 Archived-At: Aside from regcomp which I want to ask nsz on before committing anything, I believe these are all fixed now by the following commits: On Tue, Apr 21, 2015 at 07:28:30PM +0300, Alexander Monakov wrote: > New round of static analysis results. This time it's mostly opportunities for > very minor cleanups (I'm showing only a few results that I think make sense). > If there's a problem in balance of usefulness vs annoyance, please let me know. > > dynlink.c:343 > 'if (runtime)' is already established as true at line 337 c5ab5bd3be15eb9d49222df132a51ae8e8f78cbc remove always-true conditional in dynamic linker TLSDESC processing > sem_open.c:sem_open > I didn't try to follow the code in detail, but it seems possible that 'goto > fail' can be executed from e.g. line 133 after successful mmap, in which > case the region is not unmapped 086793ad99dc625fd1c47f96fc31ea8aa316b438 fix mmap leak in sem_open failure path for link call > duplocale.c:17 > neither of the conditions cannot hold 873e0ec7fc4d466cfcdec16a7648cc18609ba702 fix duplocale clobbering of new locale struct with memcpy of old > dynlink.c:1503 > the first two conditions cannot hold after check at line 1489 and exit at > line 1501 97b72d22ad53e8f1306bf8e943571b698058f49d remove redundant code in do_dlsym function > fcntl.c:42 > F_SETLKW is already taken care of at line 16 > also, why does this file cast arg to 'void *' in several places? ea1b6bb6123d2177508ddca438669ec96cfa0021 remove dead case for F_SETLKW in fcntl > regcomp.c:2848 > condition 'stack != NULL' cannot hold [open but not a bug] > dynlink.c:428 > on 64-bit arches, multiplication can overflow in 32-bit type before assignment [not considered a bug at this time; see other email] Rich