From nobody Wed Nov 27 12:29:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1698444775; cv=none; d=zohomail.com; s=zohoarc; b=HBRRHyKpKq5j47+u38I8z44tB+RUpm7PDehUpPm20UoWj68uY1JIx1CewMXNNj+ZCNIYcQhxHxgB9nGrymWxRJqireLHjCijg20IQu2NBZvDGhSVzDORWe+hyZbLYuUsMpkKoRqzwxvHjG0pqBT8LZ7pjYAyk5RILA8o+xhqhfs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698444775; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sRY84Su7XMV7uRNIb1/RJ3dBq2s8KkQA/2NcctEFcXo=; b=ctFz2rTt+NAhQvvCBbZRN551cXBWOzVErGc0vKHPsO3GraKgp24B8OTmI3mxmzod9hPcP1SqKzbLn/49oULfZMdbM+tgHv7D8+KsbXR88t58M9rMusdVZjw0+wQIpPKg5dwMvqx9igoXyH5UZfgEGfHzGxhwlpcxNoCFi96KxYo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698444775396222.40908920278946; Fri, 27 Oct 2023 15:12:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwV3c-0007RL-4S; Fri, 27 Oct 2023 18:11:56 -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 1qwV3b-0007RD-8t for qemu-devel@nongnu.org; Fri, 27 Oct 2023 18:11:55 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwV3Z-0003on-IW for qemu-devel@nongnu.org; Fri, 27 Oct 2023 18:11:55 -0400 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-27d3ede72f6so2172800a91.1 for ; Fri, 27 Oct 2023 15:11:52 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id p20-20020a17090ad31400b0026cecddfc58sm3674768pju.42.2023.10.27.15.11.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 15:11:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698444711; x=1699049511; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sRY84Su7XMV7uRNIb1/RJ3dBq2s8KkQA/2NcctEFcXo=; b=CkJ3PrmOwVwHnUHbYDQHbsZHMxxnXDLyQKZYW5bG1DDr28Pe8wHLkMaxlrFm2H6FqU jkoK8lAQkI6c/rx2vwaWps8eginno/bQDiE+TQEJFyo8puDfw3grZkjrF9TLj1F45K5E Tbotf++4YB2YGzhZVZDH3olJ2skoiYiK0+irNj3/+hzwVfEnF/LQBsoQq1q9WUG4FVIu YGsYHA3RQuLUvDcdVs80JqwFnoqTmz35gHOWerGaB+TDSla/mxsnp0gBsSE8awf/R5np XFdj7HNTnvulPpcV0gTm8njcF7gH4GfEGpMtaoMPHvm3O8vIUU97QwKmMC5U9iSq0R21 TdTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698444711; x=1699049511; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sRY84Su7XMV7uRNIb1/RJ3dBq2s8KkQA/2NcctEFcXo=; b=O37hPHEV4W4j1S+yj9uVb02EVrLHV1KQvzbYU7/0KzLUuAwLd2pM2w9ntrHQIb5yZd J7bPbAXxBLEkghOuYi8eVLHhtdP3X4s/l0HxCyvaFrM7+p0scnEgOEJX5iIFvJslmieh eggE2YAnI1I1+MoGRc0ieTQPvuSvfgCsfUt3V5WvgaCNk4oHbRkaNhDHEiDphPObYJ3p 4polCOuu+cacM59h2FNdkOvAQSs5zsY9oix/EYsaInOz1J1NLufEUDA++QCqoNCQRFhs GSAGwgyS2JBRVvMinjlOQm/KYNj7ROZLP05dOEDVP0yBKOqrVOvEZBkcXItGEGAouo4p smpw== X-Gm-Message-State: AOJu0YwS2dILzNka4YURG8oWnMqIJ3/E4zuoQcCD9TSOUUU8aj7y9aFT ea9TopU+PdlGMR9E8MkhDPoLKCpf03VjQpbK2mA= X-Google-Smtp-Source: AGHT+IEAklOCwC6Fwq1iOyPfqqcwcx8jc9BlL6V3jVJdIsRUPFfvkajMXL7Evs3NDO29mrpqrx//GA== X-Received: by 2002:a17:90b:f06:b0:27d:694f:195d with SMTP id br6-20020a17090b0f0600b0027d694f195dmr3890744pjb.6.1698444711449; Fri, 27 Oct 2023 15:11:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: christophe.lyon@linaro.org, laurent@vivier.eu Subject: [PATCH] linux-user: Fix guest signal remapping after adjusting SIGABRT Date: Fri, 27 Oct 2023 15:11:50 -0700 Message-Id: <20231027221150.19807-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1698444775957100001 Content-Type: text/plain; charset="utf-8" The arithmetic within the loop was not adjusted properly after SIGRTMIN was stolen for the guest SIGABRT. The effect was that the guest libc could not send itself __SIGRTMIN to wake sleeping threads. Fixes: 38ee0a7dfb4b ("linux-user: Remap guest SIGABRT") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1967 Signed-off-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e --- linux-user/signal.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 3b8efec89f..b35d1e512f 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -536,11 +536,10 @@ static void signal_table_init(void) host_to_target_signal_table[SIGABRT] =3D 0; host_to_target_signal_table[hsig++] =3D TARGET_SIGABRT; =20 - for (; hsig <=3D SIGRTMAX; hsig++) { - tsig =3D hsig - SIGRTMIN + TARGET_SIGRTMIN; - if (tsig <=3D TARGET_NSIG) { - host_to_target_signal_table[hsig] =3D tsig; - } + for (tsig =3D TARGET_SIGRTMIN; + hsig <=3D SIGRTMAX && tsig <=3D TARGET_NSIG; + hsig++, tsig++) { + host_to_target_signal_table[hsig] =3D tsig; } =20 /* Invert the mapping that has already been assigned. */ --=20 2.34.1