From patchwork Sun Aug 22 03:55:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 501396 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp1058346jab; Sat, 21 Aug 2021 20:56:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyK9qz4TLJ0TPo+Fa/26rKGRVglGdhtV5spqY3my/06EluOREozR6qlohS9l2TppKJHuPf+ X-Received: by 2002:a05:6638:2712:: with SMTP id m18mr23953654jav.76.1629604612889; Sat, 21 Aug 2021 20:56:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629604612; cv=none; d=google.com; s=arc-20160816; b=MmCcTntgJWl368gEuf9PL2DECnR0Csrf6nv7xEpWlswc02pSd4YYB47l5DTzd6mFY3 JpxYGhV9a3m3o1NfVt8x00gECO5opic/wVQZAMcN/fOp6/9gUMCsCY3JKk47K2JzMIMd f7FxUSXdqaAXzq/nmi3INijYlZCSPhfaMR/P38buk2nMFrdPCNYToicb4+SeiMF76FoF k9KPuTrotyZq51Y7M7KuKc9+94Oel0mVeFweInqZcNeME6nbiQPwAMq6JEr1gaqWOVde swEoUhFQlTEuifHtepYn6JTRzjb4cMC1ArQ558s5u6QhRRAylXstWgGxpKqxwcm2Tf6q mR6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=BtM7var2ggs0sC3CkTYi8ly4990ZgrcQeQZtuDarh58=; b=tXtFLXZoJYHAPG4+IRnOVp+pCZ2hCeYorSzuff4viP+4V9ErFOYPnX7ZfuECC71MNw /eUOWm7l6g/Ho+yqsxhk9epsThirg+Swjv/Rm2fUaFoqSHkOUKesOu1xwdXvdZBjY2G/ WoGMaz/mUXIRCqkmKEghp6CfGYKLdiALq2SiMmlguyNX8mbj4hcP9/WbY0xeQjfe/BFx gDPrguujmJ4aC55D5QbNCT2UAbtHWFBbwLiRxLt08pPJ7lO82lPOweZkCWAmVAVjDKqc a/6UON2HP4uAnpgpWI7+5PGJO9U12FKMT59A3qH39aLeqTNYAS252oPIRsjqbjLOt1Aq bmzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L2j01erI; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l15si14006449ios.94.2021.08.21.20.56.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Aug 2021 20:56:52 -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=L2j01erI; 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 Received: from localhost ([::1]:37218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHebM-0007iv-D7 for patch@linaro.org; Sat, 21 Aug 2021 23:56:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHeaG-0007gT-DA for qemu-devel@nongnu.org; Sat, 21 Aug 2021 23:55:44 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:36494) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mHeaE-0000aG-Rs for qemu-devel@nongnu.org; Sat, 21 Aug 2021 23:55:44 -0400 Received: by mail-pl1-x633.google.com with SMTP id f1so1365725plg.3 for ; Sat, 21 Aug 2021 20:55:42 -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=BtM7var2ggs0sC3CkTYi8ly4990ZgrcQeQZtuDarh58=; b=L2j01erIoPdFBFriRxhnvxopl6a3DUivI6y6/350cFG8fO6eUlEoFJqZ6uxsMl5r0Y CgMaVDitjhaM1LN+17BcHiKzNagTyKOIlYf5pEbUzrRV4Yw494Vxh2XIbmUyI1bkytfa exkJ11I87RDhDm0jRt6962ivO4LSKEaCGt7BaTe8MmcXwXhVu9e7ANcXkHXNuWd0wiUm boZiIopLEWHR3GjK1W2e0T4MbcWHrjnIPjC4Kx9FMY0nNPcFVx4gdRp6Rc6MLa3SND6j 6q24JFcuRCr2boV1iGsY+amfWbwaKpxz4b2N+2xlmtDIb1OO+zpkYnAlMaezcEAyJff0 3OCg== 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=BtM7var2ggs0sC3CkTYi8ly4990ZgrcQeQZtuDarh58=; b=bqASQUt0VCUhS+5Dse3OOFcUacqxkg9IUh5mu5IV2HiSi/5XXQiP40NVUlGZC9Z848 jezNnbgaI3m8divJbuVM+D8aUabkXtbjjjSmkFmyzFqLZ3rjvA9At3kbvALY0TpX6/rv Myxpup27weYoqPWwWGOuS2ESVL+TzmF6nTNhDHPS7Ic9EVIs79rMjjXpARmkMd0tgDm0 a0Sjw702dP9Uwh5wTo/86FcWPjdwVwAeY7LAdXxY0Sr4HSy2SgTF62m+DZFBAbx3TVs1 m6F8hD8bB3JEgyrLR4+mPItdNoVb4l3dhuEpZ3lIzK1cgTDvpzZkGNYDK/1WlT3yOCq/ UPTQ== X-Gm-Message-State: AOAM531l3W8uswwYvfG2IYx4uczxoauFMeKJ5pl+u8ijcrP+gorwWyT1 qy0K7nRrLXIZpQhHqgei4/x7hxn9qaClGg== X-Received: by 2002:a17:90a:9292:: with SMTP id n18mr12881447pjo.120.1629604541385; Sat, 21 Aug 2021 20:55:41 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id x12sm11560533pfu.21.2021.08.21.20.55.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Aug 2021 20:55:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 04/30] linux-user: Zero out target_siginfo_t in force_sig() Date: Sat, 21 Aug 2021 20:55:11 -0700 Message-Id: <20210822035537.283193-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210822035537.283193-1-richard.henderson@linaro.org> References: <20210822035537.283193-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell The target_siginfo_t we populate in force_sig() will eventually get copied onto the target's stack. Zero it out so that any extra padding in the sifields union is consistently zero when the guest sees it. Signed-off-by: Peter Maydell Message-Id: <20210813131809.28655-5-peter.maydell@linaro.org> Signed-off-by: Richard Henderson --- linux-user/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/linux-user/signal.c b/linux-user/signal.c index a8faea6f09..fd3c6a3e60 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -636,7 +636,7 @@ void force_sig(int sig) { CPUState *cpu = thread_cpu; CPUArchState *env = cpu->env_ptr; - target_siginfo_t info; + target_siginfo_t info = {}; info.si_signo = sig; info.si_errno = 0;