From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eldmr-0005Xp-Iz for qemu-devel@nongnu.org; Tue, 13 Feb 2018 11:50:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eldmq-0003y2-LD for qemu-devel@nongnu.org; Tue, 13 Feb 2018 11:50:33 -0500 Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]:43327) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eldmq-0003xe-G6 for qemu-devel@nongnu.org; Tue, 13 Feb 2018 11:50:32 -0500 Received: by mail-oi0-x234.google.com with SMTP id 4so14341240ois.10 for ; Tue, 13 Feb 2018 08:50:32 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20180128221510.13722-1-richard.henderson@linaro.org> <18af5519-95cd-f00e-1915-75183e94eb38@twiddle.net> From: Peter Maydell Date: Tue, 13 Feb 2018 16:50:11 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [PATCH] linux-user: Use *at functions to implement interp_prefix List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Richard Henderson , Richard Henderson , QEMU Developers On 13 February 2018 at 16:43, Peter Maydell wrote: > OTOH, maybe we should just go ahead without weird games with dup2 and > see whether any real code gets confused... Here's some real-world code that would break with this patch as it stands, though dup2 games wouldn't be the fix in this case: https://github.com/xinetd-org/xinetd/blob/master/xinetd/init.c#L79 (it iterates through all fds above 2 closing them, and we don't protect against the guest being able to perform syscalls on interp_dirfd) thanks -- PMM