From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10964 Path: news.gmane.org!.POSTED!not-for-mail From: Andrei Vagin Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: Need to zero pads in msghdr Date: Wed, 25 Jan 2017 11:46:44 -0800 Message-ID: References: <20170125194023.GQ17692@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1485373621 20724 195.159.176.226 (25 Jan 2017 19:47:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 25 Jan 2017 19:47:01 +0000 (UTC) To: musl@lists.openwall.com, Andrei Vagin Original-X-From: musl-return-10979-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jan 25 20:46:55 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 1cWTWv-0004mA-GE for gllmg-musl@m.gmane.org; Wed, 25 Jan 2017 20:46:53 +0100 Original-Received: (qmail 7680 invoked by uid 550); 25 Jan 2017 19:46:57 -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 7649 invoked from network); 25 Jan 2017 19:46:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=RCa7phIRXMvflG4hRzG2PZIfpM8GsU3e81Nq8W3pGCo=; b=NfBHdjD24ZQMnj7409Uu3Il26MmeiKAcPGN4RJJ3gSiJe8D37t0rgKMZXF6PTWQRyj tVpsd5dRtuM4JEMVzIh+aNRFT7JAlm7ik7UMEFB4zninHLVBwrDeyLcYzqSOgvPnrJQi xKBJUiNz3v80jdxH/8aUe4ZrW7BNJ+GkYH0XOH5egVBV5AGsHEsS+oaVAywf/yX2qNwX EqfeO1lmUwlUSZ+qk1eOEZHyWMhdBPX19DkBBI55xJ2FP+XFBcXzuSPfRkcaL8LrJSC/ a+UsSBj7jeNIkqgPXB0A9o1SzP1LgCITj4vWBw1pGq3hx7D5jAha9u+BdLIiqH8zDmmI 9f9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=RCa7phIRXMvflG4hRzG2PZIfpM8GsU3e81Nq8W3pGCo=; b=F+CQhl/3vA/7+JkCgg5JVeM8dkDafMumc3S/HI4lDuN5ws62i5kTJchwLV7/i61dxl J7fjY25Ags4wAsEXkT17TJW44V5GtWwiQrNhFnBYGPPRf5Taa0YqATwlGmjlIgkRjK66 8n34M9OaVqD7UUldRL9eGf/78tPw4MmwVvp7L8Y3fb2hxylBWbrzFETIfPvN6vNzW5WY xMw7iRGYCGhlUGhRk2pyQ9MtAsVZDJPgRWZQEkdWZZ99Rbff3gaIOYHlFv7hTwaJvZBI 78IQL8iB9qDY1dnyhkoGAXlX7ou24YNhX6dO7CR/vjRxfavuhqhCeTGeOKFM50GnIRqf JchQ== X-Gm-Message-State: AIkVDXJWgnhhLYb/WYIzkM6HmDoXMdDZ6hakY5pnhnv+Xf/AAbR31aw6npoi/K/6lqbotIFKoq2kVFgyIoGIaQ== X-Received: by 10.202.117.76 with SMTP id q73mr21170021oic.1.1485373604459; Wed, 25 Jan 2017 11:46:44 -0800 (PST) In-Reply-To: <20170125194023.GQ17692@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:10964 Archived-At: On Wed, Jan 25, 2017 at 11:40 AM, Szabolcs Nagy wrote: > * 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? We inject our code into processes which are going to be dumped: https://criu.org/Parasite_code And on restore we have to unmap old libc to restore process mappings. > > (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) We know about this risk, but before this day we executed out test for glibc and it worked for everyone. Now we need think how to resolve the problem.