From nobody Tue Nov 26 07:23:40 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=1709681997; cv=none; d=zohomail.com; s=zohoarc; b=Kvklp9Iv38C92RaLSca4QEoDbeSg6DV/wKkZS0plCX3JEXcX4SMSBIapJf+3RTUhHUxVaSa3PSuSHenm+76ZVuVoU9UfxhkJmMlAy/kXiyiX9GoeeKPVqbrCdYR+CofEmJ179y9SFaLjctYyCfnhiOg9tuyTR0qSUGVdytUK17M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709681997; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=GOolTmzYeE12+ps8/v2gwrBliAlhC/9M+kqd6Bq+ehk=; b=iwSuvD7PALhzQZ+XmB1wZw9yiXKLmlikMppMopH2MERe0bRTDHi70h3KKNZF8XTA1wUGv2eGbVgrUeBmai0RMViw2UFArjo5T+Hw3gtbz2Be+e3Jsbq6e0hd4NAtBVrc0uM+yEQKlIgaUyippCskmemTsu3/edoeWFPuzFINIqE= 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 1709681997592638.0555273959898; Tue, 5 Mar 2024 15:39:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rheNp-0006da-Ie; Tue, 05 Mar 2024 18:39:41 -0500 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 1rheNn-0006cq-Kw for qemu-devel@nongnu.org; Tue, 05 Mar 2024 18:39:39 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rheNm-0001WA-44 for qemu-devel@nongnu.org; Tue, 05 Mar 2024 18:39:39 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1dc0e5b223eso53860035ad.1 for ; Tue, 05 Mar 2024 15:39:37 -0800 (PST) Received: from stoup.. (098-147-055-211.res.spectrum.com. [98.147.55.211]) by smtp.gmail.com with ESMTPSA id s12-20020a17090ad48c00b0029aac9c523fsm10047291pju.47.2024.03.05.15.39.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 15:39:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709681976; x=1710286776; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=GOolTmzYeE12+ps8/v2gwrBliAlhC/9M+kqd6Bq+ehk=; b=OFwlLqqj5fnU4z/rv3fuC48dQAnXuMY+fM457ZHeSCyn2+0D7YI2WdQ/fxdneMuUcP O8BvnPA7cy5cQ7lQaUHVnr4YmF60VmBTncILE9V5RRBYlccdC1zTrTZA4/sYDevdjatT SMRYeUU90fx9J+jlDLvp2XEF1+qs5noSnnBaiAodSKfU7AEkdvXdcPmGcl5Tr7Xa9plZ UAtUEsIJptFrGJz7WoEEVHCRdyNJLEFdDJUYBD10abGo/b/IM6lUU8qR4S9c+HS1qP/Q 9gTtcbJaAqhQuK6dJ+7NzbGbGXf8drakd6/RO9ZFvDC3dL5DYH54XZ4mEQVC5SZonetf 3hrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709681977; x=1710286777; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GOolTmzYeE12+ps8/v2gwrBliAlhC/9M+kqd6Bq+ehk=; b=LKuxU47tajWa7KooGMOWEdpbAsYWYKPgbLKE0hUJggCWR9bizNiM9ik4RuycXAFPMu qHuLdUpbi9zxNQwvsI+iZGkMp9Rgop4jaECvssd70gbJIMhsUXgDEOOshLAmyR4yPFxT h7SS+uozJGPHqvzR+aORFNpzA/Sx+sAhhLBT4pXiMi1w9S+e1lUBGabzNnKNpTXtPN+A U1KReXuQJptSOfYP+g3BwdwyoAUr4A0lrUF5IbNvG4xJRgyJsXvoBfc3Bhl0K9/ghyDc jl+ButRBqteIqPOnjPVJ2jazBuGO0ofW1p8NWIx+Ruz/c4kF2wqGvn6gHUeAa5u9njXj PO2g== X-Gm-Message-State: AOJu0Yy2PvON+U0grNxEgMgOW9sTcuBYjpyVhewcxwpV2q+TV3NhZxPQ JiDndHNi1ww9sNkYyC8MR0AFdsKHbQB7H4EOXnK4U8ArBPYqSBw53UecRJ5jMrFxTxvvK+qRctu M X-Google-Smtp-Source: AGHT+IFHsQRY4a0tZJkZsSoaS5BfXGM8ih1sPBX0hcKfsFqj1IlsuBjacH242vfiVFf2qKv84ihfuQ== X-Received: by 2002:a17:903:1209:b0:1dc:4199:a31d with SMTP id l9-20020a170903120900b001dc4199a31dmr3817103plh.53.1709681976682; Tue, 05 Mar 2024 15:39:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/2] linux-user/elfload: Fully initialize struct target_elf_prpsinfo Date: Tue, 5 Mar 2024 13:39:31 -1000 Message-Id: <20240305233931.283629-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240305233931.283629-1-richard.henderson@linaro.org> References: <20240305233931.283629-1-richard.henderson@linaro.org> 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::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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, T_SCC_BODY_TEXT_LINE=-0.01 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: 1709681998816100002 Content-Type: text/plain; charset="utf-8" Fixes Coverity CID: 1534962 Fixes: 243c4706625 ("linux-user/elfload: Write corefile elf header in one b= lock") Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- linux-user/elfload.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 8565b9520a..a9a6f55d6e 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -4204,7 +4204,14 @@ static void fill_prpsinfo_note(void *data, const Tas= kState *ts) * may well have higher alignment requirements, fill locally and * memcpy to the destination afterward. */ - struct target_elf_prpsinfo psinfo; + struct target_elf_prpsinfo psinfo =3D { + .pr_pid =3D getpid(), + .pr_ppid =3D getppid(), + .pr_pgrp =3D getpgrp(), + .pr_sid =3D getsid(0), + .pr_uid =3D getuid(), + .pr_gid =3D getgid(), + }; char *base_filename; size_t len; =20 @@ -4217,13 +4224,6 @@ static void fill_prpsinfo_note(void *data, const Tas= kState *ts) } } =20 - psinfo.pr_pid =3D getpid(); - psinfo.pr_ppid =3D getppid(); - psinfo.pr_pgrp =3D getpgrp(); - psinfo.pr_sid =3D getsid(0); - psinfo.pr_uid =3D getuid(); - psinfo.pr_gid =3D getgid(); - base_filename =3D g_path_get_basename(ts->bprm->filename); /* * Using strncpy here is fine: at max-length, --=20 2.34.1