From patchwork Wed May 31 13:08:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 9757003 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4EE51602F0 for ; Wed, 31 May 2017 13:12:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 494DC281F9 for ; Wed, 31 May 2017 13:12:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BBDF2836F; Wed, 31 May 2017 13:12:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 319C9281F9 for ; Wed, 31 May 2017 13:12:32 +0000 (UTC) Received: from localhost ([::1]:59336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG3QN-0001KZ-5u for patchwork-qemu-devel@patchwork.kernel.org; Wed, 31 May 2017 09:12:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG3Mk-0007Zy-S0 for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dG3Mj-0003ex-PS for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:46 -0400 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]:34477) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dG3Mj-0003ee-IZ for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:45 -0400 Received: by mail-lf0-x230.google.com with SMTP id 99so8621455lfu.1 for ; Wed, 31 May 2017 06:08:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VG4eZNogBzxWH3wtW9iYiZOiLLqqSsAUGrFh7oRbYWY=; b=HIZSg1YGdt5FguNo102SDpzJezuVdKbUFbLxaAjvLZBn9MGFhTxb4WWtZY5axM7wDb 97CUL21/knpKT8+MNnmgjN4bercHzSURIOvuN8clllherOiraeTututW8mtGp2etDxF4 rAUvXJMInV6RznuhGeKdy9DBltqNnE/rrntHw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VG4eZNogBzxWH3wtW9iYiZOiLLqqSsAUGrFh7oRbYWY=; b=muWtUTjI6gaxdefIbou9nm1cJn3JwGkfoAgmut0mg5296vF1NovDIO1OJ0UARel0e4 Iz/DMhW9lakkubxoH44k1O/EVmxNe9Nd+/EZ+y/IPI7RhMew6RS8ffVoOF0KvpHrr2Kz hU9Eqy6tKY6ZkWNC6aWnpN55+vG2Dea8Ovvjzkm4wIeylbXsZLIevRwJZLFMaSSf7XvE /npczWJCWrlvBwAgwe/00jqcdfYInoW7FWGSELCv457szfZVjp1EDJGFq0Dhen/1hnJc x/SP7V6OZbD31FEkdkUCE5bXgxfI4JPeLH1HmAUbrJZO9JT3ZvMezIYQZhOqMEAs+lTY pYmA== X-Gm-Message-State: AODbwcBu+bwRTk++1zNOhx0bkayNTMoozcRYXN0Hz84MZrhJuoh1iG2X G22C08G7ILl9sbetpDUz8A== X-Received: by 10.25.79.3 with SMTP id d3mr7431103lfb.179.1496236124130; Wed, 31 May 2017 06:08:44 -0700 (PDT) Received: from localhost.localdomain (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id o101sm3741766lfg.3.2017.05.31.06.08.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 May 2017 06:08:43 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 31 May 2017 16:08:21 +0300 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::230 Subject: [Qemu-devel] [PULL 09/15] linux-user: fix ssetmask() system call X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Milo=C5=A1=20Stojanovi=C4=87?= , stefanha@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Miloš Stojanović Fix the ssetmask() system call by removing the invocation of sigorset(). The ssetmask() system call should replace the old signal mask with the new and return the old mask. It shouldn't combine the old and the new mask with sigorset(). Fetching the old mask for sigorset() is also no longer needed. The problem was detected after running LTP test group syscalls for the MIPS EL 32 R2 architecture where the test ssetmask01 failed with exit code 1. The test passes now that the ssetmask() system call is fixed. Signed-off-by: Miloš Stojanović Signed-off-by: Riku Voipio --- linux-user/syscall.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 909dde6de6..93bc6f679e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8621,17 +8621,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #ifdef TARGET_NR_ssetmask /* not on alpha */ case TARGET_NR_ssetmask: { - sigset_t set, oset, cur_set; + sigset_t set, oset; abi_ulong target_set = arg1; - /* We only have one word of the new mask so we must read - * the rest of it with do_sigprocmask() and OR in this word. - * We are guaranteed that a do_sigprocmask() that only queries - * the signal mask will not fail. - */ - ret = do_sigprocmask(0, NULL, &cur_set); - assert(!ret); target_to_host_old_sigset(&set, &target_set); - sigorset(&set, &set, &cur_set); ret = do_sigprocmask(SIG_SETMASK, &set, &oset); if (!ret) { host_to_target_old_sigset(&target_set, &oset);