From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10963 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: Need to zero pads in msghdr Date: Wed, 25 Jan 2017 20:40:23 +0100 Message-ID: <20170125194023.GQ17692@port70.net> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1485373254 10399 195.159.176.226 (25 Jan 2017 19:40:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 25 Jan 2017 19:40:54 +0000 (UTC) User-Agent: Mutt/1.6.0 (2016-04-01) To: musl@lists.openwall.com, Andrei Vagin Original-X-From: musl-return-10978-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jan 25 20:40:49 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1cWTQm-00012u-IX for gllmg-musl@m.gmane.org; Wed, 25 Jan 2017 20:40:32 +0100 Original-Received: (qmail 28347 invoked by uid 550); 25 Jan 2017 19:40:35 -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 28312 invoked from network); 25 Jan 2017 19:40:35 -0000 Mail-Followup-To: musl@lists.openwall.com, Andrei Vagin Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:10963 Archived-At: * Andrei Vagin [2017-01-25 10:56:22 -0800]: > On Wed, Jan 25, 2017 at 8:42 AM, Andrei Vagin wrote: > > In this patch > > http://git.musl-libc.org/cgit/musl/commit/arch/x86_64/bits/socket.h?id=7168790763cdeb794df52be6e3b39fbb021c5a64 > > you suppose that the kernel ignores the upper 32 bits of msg_iovlen, > > but it doesn't, so pads in msghdr structures have to be zeroed before > > calling sendmsg and recvmsg syscalls. > > Actually the problem is a bit different. In CRIU we use the msghdr > structure from musl-libc, but in some cases we have to call raw system > calls. We don't expect to have pads in structures and so we don't zero > them. why do you need a raw syscall? (i think if you do raw syscalls you should use your own linux syscall wrappers including typedefs and macro defines, not libc ones, because the libc can and does do all sorts of remapping of things to workaround various mismatches between the posix library api it provides and the linux syscall abi)