From nobody Wed Nov 27 11:43:37 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=1699360147; cv=none; d=zohomail.com; s=zohoarc; b=BIwp0chyS/G1xsRgJJGD482h1IqKPu4+e7W2aYq1YbYe+cNI6wECFP5KzQlxEhhVXa6e0Ckol3o+/fu8Yt9+4dzoP3Db0B10imsi5raFSuzY2UPNzH82lPhWSgTP4xpX1ui2pRlm/6TUogdnOJMAatw0P4xqntUYZlBmUAnTSU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699360147; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=bPpjDkEUgqCeZLuJ7FjDj9Qp3yXD435hoj9y2GuMgcc=; b=RnhHbR+VJNC6Ka1m+hx+9uP++PoPGlaYi7InYU/6jEGoPv2h2gzJ3QT9t8dL0zdS6fpXlyuXrhyDEjAvChhrIc1ri4b8DiyxuiCG85WPfR5dGsWd2OPQlqGBDpiW07hoVBlm3SYVBChvjxUrQYWt9T29lXZY3VsHurLBkPK5mTY= 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 1699360147775792.9396742628561; Tue, 7 Nov 2023 04:29:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0LB4-0001en-FN; Tue, 07 Nov 2023 07:27:31 -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 1r0LAH-0007aq-Nq for qemu-devel@nongnu.org; Tue, 07 Nov 2023 07:26:44 -0500 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0LA2-0005N7-A5 for qemu-devel@nongnu.org; Tue, 07 Nov 2023 07:26:39 -0500 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-53dfc28a2afso9445149a12.1 for ; Tue, 07 Nov 2023 04:26:25 -0800 (PST) Received: from m1x-phil.lan ([176.187.216.69]) by smtp.gmail.com with ESMTPSA id gz21-20020a170906f2d500b009ddcf5b07b8sm1002418ejb.148.2023.11.07.04.26.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Nov 2023 04:26:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699359984; x=1699964784; 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=bPpjDkEUgqCeZLuJ7FjDj9Qp3yXD435hoj9y2GuMgcc=; b=V8aVhrGfgx39OX1v0S1sItKfH5CUDLVzn0sRdn0Le/D38biCGkycCpMb1mGGL5NEg/ 5hJy/iSYiZVA4VLXqUtwGxUn7QiWluaxymKt1UkSrKt5AC3ht1d+iz6wSBgNlW0OQn2v T61Sp+sDtY/GQqLY3PwS95Qhieh68QQPbNCocZbKr+amSADpd+dyFCaZFR5WdzDaoWNe t6EDSKLpLpEhZse9+vORYZUS4ee3/j9oRLszc9q9p9qxmB/a8aVi7Hqw3vQWOMDawGU9 IRXOHOuQiyv+iUxcmZxGe9VQtsxt2yJcH5rtVic11Wz5mFwge0euJwkExdS15oUG6l5W cu3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699359984; x=1699964784; 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=bPpjDkEUgqCeZLuJ7FjDj9Qp3yXD435hoj9y2GuMgcc=; b=q0XE8n5tLAhpt8e0Q8AWs1adNff8ZOMb+uHHWgIHrwikuW/VWahIF6rojcfj5/+GzG IlCmQOGGPsYh3NCZzCHHnxm5sr0jXIudaeTqB/nKTBO8lNHoRXj0TuAP1AFfMbclVMWD WX0f2VoeKPG7wR24iZprMeWGhuEUwyKZtTx1OiWb3nAhaJ29w2MnNSpUqaJszFPqTILk LcH/lxG1CSOIF8wRiYw0uFyFMn2ddu5B5jhmoc9zIOd0ptcxAoXzN9HN2LZKoux+KFNG NATIJ8S7jSR+lUmnM/G9ehcUIFe+q9Om3E0WRMwqqarByvwdNVIuFRwEu2Wjxv+gT6o4 qs0Q== X-Gm-Message-State: AOJu0YxLMLXqeudQz2coDRKPUGrCaiYccqXwfyydKOZ3KYcc68XmVaSR USaoZugxjbb4uIp8BcxyolnqU7iOjubVCTC+D6U= X-Google-Smtp-Source: AGHT+IHxpB6kgb0WTfTgGc+1bi7cqwZO6ngXV2cZun9HcsMF3ctSTQNPDcuJp0UjFYxIpufELGYkUg== X-Received: by 2002:a17:907:31c3:b0:9c7:db3:8b31 with SMTP id xf3-20020a17090731c300b009c70db38b31mr19724449ejb.59.1699359983864; Tue, 07 Nov 2023 04:26:23 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, Zongmin Zhou , Zongmin Zhou , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 75/75] dump: Add close fd on error return to avoid resource leak Date: Tue, 7 Nov 2023 13:24:41 +0100 Message-ID: <20231107122442.58674-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231107122442.58674-1-philmd@linaro.org> References: <20231107122442.58674-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::530; envelope-from=philmd@linaro.org; helo=mail-ed1-x530.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=unavailable 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: 1699360149579100001 From: Zongmin Zhou Reported-by: Coverity CID 1523842 (RESOURCE_LEAK) Fixes: e6549197f7 ("dump: Add command interface for kdump-raw formats") Signed-off-by: Zongmin Zhou Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20231107024417.585475-1-min_halo@163.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- dump/dump.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dump/dump.c b/dump/dump.c index 1c304cadfd..ad5294e853 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -2160,6 +2160,7 @@ void qmp_dump_guest_memory(bool paging, const char *p= rotocol, return; } if (kdump_raw && lseek(fd, 0, SEEK_CUR) =3D=3D (off_t) -1) { + close(fd); error_setg(errp, "kdump-raw formats require a seekable file"); return; } --=20 2.41.0