From patchwork Wed Oct 23 03:34:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 837796 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1f12:b0:37d:45d0:187 with SMTP id hh18csp260977wrb; Tue, 22 Oct 2024 20:38:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXewlcq4iIjIQhYgnutmmhwAhfbDVR8a7azkYAi8DOIokn30B7ggEJubZZWq8OadxljJGjpXQ==@linaro.org X-Google-Smtp-Source: AGHT+IFSxWfixnuoL+FA495k/kX8SbsrQ59mDRMr71W2WfkrSNEpkLGqpQYcfVyXahmI2KKUUXOU X-Received: by 2002:a05:6214:3f92:b0:6cc:3680:d09 with SMTP id 6a1803df08f44-6ce342eb49amr14403806d6.42.1729654724083; Tue, 22 Oct 2024 20:38:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729654724; cv=none; d=google.com; s=arc-20240605; b=V7GkM6LK8jkbwPCoULS22yDX3q4C36ci6K8EG4pVcaanmzsb9F9qBtlW3QztqO7PCi fq+zpFSv/YPZoa2Sb7l9SNzPbJ+I/CboEZTt1AubOUcZuxrxO4mgACJQvhMKmP7m3cUo lDaN8QBEJ/Lq5XPpNdkpvuwZrocVAs7UNWb0984SEqEpjbrtkuZS2bGQqZCQUw4d+nih 8IUbWSG5Kag8sxjjek/i6VpXnWp+35MhkDGeDjVGBbNUyhGC3bsAyFp575g4+q+p38MY b4gYtRiiObbuo+3qq8Fyy92lz4NVy+3xkHuUo1bR+etaq+8zTgv0qxG6qkBgtA7Bc8an 99aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uCKXvUBSkRViX0aZzCD1w905ppkafna+McwzoZP3XIY=; fh=EgBbF4VI39R2frJQ10MQWjr8/7sw/xPcRpI2jYnKVkg=; b=km1vAoZaisBICBHGMAIgDceGT+qu6e1JiuLvy2gbDeTZ/wUdgjjot7HVmxcM1uYzjQ Mm0w/ltXEf8XVzBOuYqaXyTKOrg1Etz8FyUnsfACAGHDk+v3e/lBRCH7MMphZdbCOJ3b N93TBcMB8mDVQ1XUloOI9y5NxTqI+SIfwvy+nOJ18c6NSuu6AEfGfaA0FapyR8f1PFHa CYMsGdSA6ep2fCE/5FoPcVuEya4mHA9F9JOeeEUTmKCiRr3XyLpMgvfbMEwgU3iw6DAm jKSWJdGfZmmxPgZifsodiqyUKmmrQnpy4zGw4nhj10EvuQvzOG/gFzJxBIezHrXVy3Ks pJ1A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dRlKKLHj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6ce009d6ed4si81601116d6.395.2024.10.22.20.38.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Oct 2024 20:38:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dRlKKLHj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3S9b-0007RI-IV; Tue, 22 Oct 2024 23:35:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3S9B-00071t-Rc for qemu-devel@nongnu.org; Tue, 22 Oct 2024 23:34:58 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3S96-0008NT-30 for qemu-devel@nongnu.org; Tue, 22 Oct 2024 23:34:57 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-71ec1216156so2644390b3a.2 for ; Tue, 22 Oct 2024 20:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729654490; x=1730259290; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uCKXvUBSkRViX0aZzCD1w905ppkafna+McwzoZP3XIY=; b=dRlKKLHjkM6+T3YMta8Yo3a/Yj5NirMMxTga43y26lAMsrQFhR+DLdgD+7E4M6oSXd VbZizKUnxrvUV36rgaNrL2CRP5bv1gKqyrLJ0igqKhmzRi4FTKeFCvfT5gJSOUFK3hMY /hG5ed+Z+SewR1rFL9mZNG/BKntvvjTsS9blwaoG1S/NEpCEYXHo8RofYHQPtNaQzFfE VMCUBNXzJmP+XH6A+G25gHxMyXhK/knI9g59PovgbF00Wh3A7y5PpJKsPei1KUOkrEjZ Fgaq0b0szhKGMlCKI5QaJlXa9UeEiwU35KWq5ajEhoByvIf9cyQC8eNWpw/+W5UiF4S6 GAVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729654490; x=1730259290; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uCKXvUBSkRViX0aZzCD1w905ppkafna+McwzoZP3XIY=; b=XlPnGbBTTFI+6lbEWI5TlIAjhtjRNTgYuiCyExpD/OKTVSG8mpXX7ANSRgpPT3kd0j T7aogCuyPJNCWEWiXFUAvBZ4AUyZyRdDwEbkzQepFPwlSQ9e2xDf4/EmwTHL8NFHp2RG Jr0eCdPiUD4qGpHpLBtKu4MQnOpSKfKqylKzfaNtBEhtpEbol3VUFtLZ//uY47JTbHr0 2SucHg3esKJz/eeEA/7VbFspCZ6FncPnugC+T7X8B3xZo+kGFTu4kf9Al6VtB+srKyGF ZEIkwT+B7fzJsegoq5MhHpbzTiFZbSBxvhmwaw4qm9yCqvo6EPmcCZH7nD6lD+nP2DBx 8Fbg== X-Gm-Message-State: AOJu0YwsoPSErz/hYFcA4hkps5zoweOConRAxFf7bJwdNTWyIn+uFCUR mSwtRzQ1ozKbPBBoJmQhNeouQlY2iPs1JVyNxTvx1El70CERPBGHmm0gGyDdtkDCYrMHRu2CTQ7 I X-Received: by 2002:a05:6a00:2ea5:b0:71e:3eed:95c9 with SMTP id d2e1a72fcca58-72030c70a4emr2143538b3a.22.1729654490061; Tue, 22 Oct 2024 20:34:50 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71ec13d73b1sm5438338b3a.105.2024.10.22.20.34.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 20:34:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 21/24] linux-user/ppc: Fix sigmask endianness issue in sigreturn Date: Tue, 22 Oct 2024 20:34:29 -0700 Message-ID: <20241023033432.1353830-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241023033432.1353830-1-richard.henderson@linaro.org> References: <20241023033432.1353830-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Ilya Leoshkevich do_setcontext() copies the target sigmask without endianness handling and then uses target_to_host_sigset_internal(), which expects a byte-swapped one. Use target_to_host_sigset() instead. Fixes: bcd4933a23f1 ("linux-user: ppc signal handling") Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20241017125811.447961-2-iii@linux.ibm.com> Signed-off-by: Richard Henderson --- linux-user/ppc/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/ppc/signal.c b/linux-user/ppc/signal.c index a1d8c0bccc..24e5a02a78 100644 --- a/linux-user/ppc/signal.c +++ b/linux-user/ppc/signal.c @@ -628,7 +628,7 @@ static int do_setcontext(struct target_ucontext *ucp, CPUPPCState *env, int sig) if (!lock_user_struct(VERIFY_READ, mcp, mcp_addr, 1)) return 1; - target_to_host_sigset_internal(&blocked, &set); + target_to_host_sigset(&blocked, &set); set_sigmask(&blocked); restore_user_regs(env, mcp, sig);