From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9859 Path: news.gmane.org!not-for-mail From: Sebastian Gottschall Newsgroups: gmane.linux.lib.musl.general Subject: Re: recvmsg/sendmsg broken on mips64 Date: Thu, 7 Apr 2016 13:42:17 +0200 Message-ID: References: <20160331203004.GX21636@brightrain.aerifal.cx> <76c20e67-4d62-a929-9f1d-a3fc63758426@dd-wrt.com> <20160401094919.GT9862@port70.net> <02844173-9671-d0e9-a291-764b27899f44@dd-wrt.com> <20160401113146.GU9862@port70.net> <91bfe81c-73c4-9b25-6d9b-a97d4ee54e89@dd-wrt.com> <20160401131712.GV9862@port70.net> <4445e7a7-19f3-aa7c-04dc-3e329ef7fdac@dd-wrt.com> <20160407094806.GE9862@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1460029359 11523 80.91.229.3 (7 Apr 2016 11:42:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Apr 2016 11:42:39 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9872-gllmg-musl=m.gmane.org@lists.openwall.com Thu Apr 07 13:42:38 2016 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 1ao8KY-000639-Oy for gllmg-musl@m.gmane.org; Thu, 07 Apr 2016 13:42:34 +0200 Original-Received: (qmail 17800 invoked by uid 550); 7 Apr 2016 11:42:32 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 17768 invoked from network); 7 Apr 2016 11:42:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dd-wrt.com; s=mikd; h=Subject:Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To; bh=3bnOoblJsyYUvPwPCEJLHG1PSA9nemXLXqOUz32k00o=; b=J3MjUhq+5qkOjBu/APgkNlxlyPrQBR2FJNBoZiXsEoKjZVfD4gBUXiWlsevcX5XEZy3N+rUpkAVi9xBNGPfEjzRFTsMpRbCItZXs4GWAPpEjUpQrnFXdybJoDL0IzXLWsVbswAyheVRwStTgTohpuknFQByTQ9L+cuUG+pNVEFU=; User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: <20160407094806.GE9862@port70.net> X-SA-Exim-Connect-IP: 79.204.133.64 X-SA-Exim-Mail-From: s.gottschall@dd-wrt.com X-Spam-Checker-Version: SpamAssassin 3.1.9 (2007-02-13) on webmail.newmedia-net.de X-Spam-Level: X-Spam-Status: No, score=-2.5 required=4.0 tests=ALL_TRUSTED,BAYES_00, DNS_FROM_AHBL_RHSBL,RATWARE_GECKO_BUILD autolearn=no version=3.1.9, No X-SA-Exim-Version: 4.2.1 (built Thu, 26 May 2011 15:22:33 +0200) X-SA-Exim-Scanned: Yes (on webmail.newmedia-net.de) X-NMN-MailScanner-Information: Please contact the ISP for more information X-NMN-MailScanner-ID: 1ao8KE-0002vJ-97 X-NMN-MailScanner: Found to be clean X-NMN-MailScanner-From: s.gottschall@dd-wrt.com X-Received: from [79.204.133.64] (helo=[172.29.0.169]) by webmail.newmedia-net.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.72) (envelope-from ) id 1ao8KE-0002vJ-97 for musl@lists.openwall.com; Thu, 07 Apr 2016 13:42:15 +0200 Xref: news.gmane.org gmane.linux.lib.musl.general:9859 Archived-At: > ok so the failure is in sendmsg and in the msg_control copy. > > does the call fail with ENOMEM (because >1024 bytes of ancillary data)? > that would be easy to fix.. > > (libc has to make a copy, the struct is const and might be in > readonly memory. a detailed bug report of the failure would > be more useful than speculations about broken compilers.. > e.g. strace log with and without the msg_control copying.) how to make a more detailed report than just that all netlink operations in iproute2 fail. so the whole ip command doesnt work. i tracked it down to recvmsg / sendmsg which do not return in success for some reason. if i send it more detailed, which means i debug out the real cause would also mean submit a better patch. just had no time yet to care about since my hack works. but does not fit to your philosophy. its easy to reproduce on any octeon device using musl and iproute2. > >> #if LONG_MAX > INT_MAX >> struct msghdr h; >> struct cmsghdr chbuf[1024/sizeof(struct cmsghdr)+1], *c; >> if (msg) { >> h = *msg; >> h.__pad1 = h.__pad2 = 0; >> msg = &h; >> if (h.msg_controllen) { >> if (h.msg_controllen > 1024) { >> errno = ENOMEM; >> return -1; >> } >> memcpy(chbuf, h.msg_control, h.msg_controllen); >> h.msg_control = chbuf; >> for (c=CMSG_FIRSTHDR(&h); c; c=CMSG_NXTHDR(&h,c)) >> c->__pad1 = 0; >> } >> } >> #endif