From patchwork Fri Apr 24 21:04:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 11509487 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49C0B912 for ; Fri, 24 Apr 2020 21:10:56 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C6C8D20781 for ; Fri, 24 Apr 2020 21:10:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="VN1nTHMU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6C8D20781 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS5b4-0000QU-FK for patchwork-qemu-devel@patchwork.kernel.org; Fri, 24 Apr 2020 17:10:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43860) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS5V9-0006r7-9Y for qemu-devel@nongnu.org; Fri, 24 Apr 2020 17:04:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jS5Uu-0002xP-5X for qemu-devel@nongnu.org; Fri, 24 Apr 2020 17:04:47 -0400 Received: from mout.gmx.net ([212.227.17.20]:50179) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jS5Ut-0002ud-Jb for qemu-devel@nongnu.org; Fri, 24 Apr 2020 17:04:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1587762263; bh=3rs3X4Ir6G+PDtHXU0JI9XQJTg3I84lLoA6Z50WgLz8=; h=X-UI-Sender-Class:Date:From:To:Subject; b=VN1nTHMUrsyyYMOehDKYOycQjtYuV0KxsYGZKEaSBe3eo+ZOsQKF9mJd1wUWzqW7S Ryt9aHG+eip9TgGXvT+Wx3fuWl7LvRUqb6fxIcbnYPLEIv3yazvrcgEDiz3TeKOURg wyTkaKIkharl25LcLRa+AR/WzfaUjthWwC7OY6qo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from ls3530.fritz.box ([92.116.144.192]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N6bfq-1j8vov2pTy-0185bp; Fri, 24 Apr 2020 23:04:23 +0200 Date: Fri, 24 Apr 2020 23:04:22 +0200 From: Helge Deller To: Riku Voipio , Laurent Vivier , qemu-devel@nongnu.org Subject: [PATCH] linux-user: Drop unnecessary check in signalfd4 syscall Message-ID: <20200424210422.GB26282@ls3530.fritz.box> MIME-Version: 1.0 Content-Disposition: inline X-Provags-ID: V03:K1:15ZIqvKIg3XIgFP/CbI9vHxcyKpVGGeF6FlNylICx3R7+Hz5OQ4 imEF5OEbizyeyYHVyKFUsaVxeRoSBOH0HlTKJd0K5arF5klR4xtC4UvYe8AiHyq4rLUUlI6 eCg7+FHMCvq/LOwgmm6TUu6e9rRUgvMx7nxKiq+yBp3lw8bQQ5c7Y6sXjKvOr1PVP7o4ry7 XVKH6ZNMzPoxVQ5O5UQHQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:3titibExSQo=:FfLBx+nJKjwC/j9Il6I10R rFGQmqYaugt3INW9bwEfv0J42G6llq5DUgETCnY+DQWBNq28Rn6a7Ee7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LojhpefqZ6GzntUUTO/oAE3+aw2NfNcc/3wfBIN+JvPvGOA2kPV KSfWHXKiGDEb+/IOMM3kA3IZ++Hgi/mJ5K9qqZBLUzBKQDmcMgORDAx95ReBioF5eDO8anr8X Nrzd735+2i3h5CFYB Received-SPF: pass client-ip=212.227.17.20; envelope-from=deller@gmx.de; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/24 17:04:29 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Received-From: 212.227.17.20 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" The signalfd4() syscall takes optional O_NONBLOCK and O_CLOEXEC fcntl flags. If the user gave any other invalid flags, the host syscall will return correct error codes, so simply drop the extra check here. Signed-off-by: Helge Deller diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 05f03919ff..ebf0d38321 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7176,9 +7176,6 @@ static abi_long do_signalfd4(int fd, abi_long mask, int flags) sigset_t host_mask; abi_long ret; - if (flags & ~(TARGET_O_NONBLOCK | TARGET_O_CLOEXEC)) { - return -TARGET_EINVAL; - } if (!lock_user_struct(VERIFY_READ, target_mask, mask, 1)) { return -TARGET_EFAULT; }