From patchwork Mon Mar 11 06:04:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 779408 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp1373276wrt; Sun, 10 Mar 2024 23:06:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWIobsBlZFzd6xtQ+UqBkhsQvJnC1/WhGt0/QBOwlBYpGU21hqJcKelrqMM2y6I5+j7qsxtE/gZcekFsTVxbdTe X-Google-Smtp-Source: AGHT+IHepCvEUSxWknJHXcPucZAtFTp4spcsPMuH8owGF9KlYSwVBzj2BtbcdJ61bbjPmwho3nNN X-Received: by 2002:a05:6358:b315:b0:17c:1b6e:e4f5 with SMTP id ow21-20020a056358b31500b0017c1b6ee4f5mr7139050rwc.27.1710137185720; Sun, 10 Mar 2024 23:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710137185; cv=none; d=google.com; s=arc-20160816; b=os5UqccElcPg9xc3rVYKnN4UqbOpkwtycbE13+dLFuaeU8PegHD+3h7I6hxIe8gJIt RACmRinZBorwG9cARG6v+tfyoufWCSp47M5cEfLfwPP2dJVzAxS/itd9MrEZ7F1nulP3 9TpFKJZArdPSxVLG+qzTcEmIOXYLlzvCipec7lsTPKMIP0OntuUDh9QwQJanm3lwD4iQ F9tdbEVIJ+T4E99z0hpzd2qHYbK5FHYHUXaoLUgqT9RLczPVmpDLODi2pJ3jHiXBROxD eHrqz9NK5JuL+k2br0rZKkL7bhTEQW+GB/hR016V+FQx2c1Jz2Cgm5mAtHyzGpCJ0C+q wuvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=T7wM/S+LBXC4hmfzLEA4Q2Vo+vH3NsQdY3B+yanN870=; fh=Oh7JfSVLzY3vHf94plRqTygr/TnX2apRhxTRSsJ7LeE=; b=aPx16zNoeVkjAgbt6gF2PY/275e7cQIXSr4Zw1q87zPmOQkwyOdcZChR4iG22GkwKY eTBlswlPF7vR7FtDnVlTG8yqombnV1qLOcnsOfB0uCrX7ScsT3ruJrKhu2FkN2iG38qr fEBSlpaIQsf8lRBGsz7Ck1fcz0mVrCDM3LEe5jSfYOELJ7t7PLqagGBoA15lRDELPN5n 6HZjvh/DQ0g9WpET//ZHjzmdAdlOA3MIF6P1DvpGUQ2d/0gXsvSQT/7tz+0HDCOHG9iy xwr6WZ8ZwypeO1yIYNFNHY4hglzqRrTgJrX9u/I0C4d8JOfqZJC9cVIPfgLtzDM+mBoh sWRg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OsWquVG3; 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 b13-20020a05620a04ed00b00788691eec04si2165282qkh.713.2024.03.10.23.06.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Mar 2024 23:06:25 -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=OsWquVG3; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjYmq-0002SI-LN; Mon, 11 Mar 2024 02:05:24 -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 1rjYmm-0002Ry-Ou for qemu-devel@nongnu.org; Mon, 11 Mar 2024 02:05:22 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rjYmi-0007ry-NV for qemu-devel@nongnu.org; Mon, 11 Mar 2024 02:05:19 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-41312232c7aso18977575e9.0 for ; Sun, 10 Mar 2024 23:05:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710137114; x=1710741914; 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=T7wM/S+LBXC4hmfzLEA4Q2Vo+vH3NsQdY3B+yanN870=; b=OsWquVG3HOmrc/qhbLFIHmwU40dJ3zRKLE9wFYa2vjs04+gaptLuwWhkQAmXKBsWhS W/LQUdj1d3gswyYxFp68HjLpmr80q8sFCgO6hTbKl2edSbmqt2FgVLBv2pAZDabp2r+c pCOHC2CCfeoWVcL3S0kWSE3Pv1gwaVx2yyr45tMst5Ied1aN1VGsiGM0Rf4YuNpYnpEV XGaAz2y7zYlXJTP93yxj5N6I8s0atR/UVqgQBstp195xF2KOgi73QLgg308tTOO1MOWT O+pmn1GgzmHEp35l/yWwnS9J/yijvaHXvzqCC6CrdVXkDnuPQHIAbt9G7cGc4AQ/IjqV aFCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710137114; x=1710741914; 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=T7wM/S+LBXC4hmfzLEA4Q2Vo+vH3NsQdY3B+yanN870=; b=ObgqNleAvmQBeI/QL/H1eSyUWaAkgoRsK+eJtIMivtGwG+a7GmMkcJG0ov+xjfVBrw CDQVae8YfxXmrskcQ19UNRf2KCCSyDySh7y9q6sB2ivWFJNgDsYwGFqXIahNKnU2KuFJ jA6xxitpEqjSamKid64gVWVS9i7/sALqy+Hndw9Fg46B8ctM94gkebCKWDluxLPDj4wA 3KyfoE5AT5OZ+3jYD5IKvG3fjVSWg4RNm3TNM50Ys0rioybP7Ivwj1Bff63vM5lyHGJa jDAO0Vqm6UVUi/rPtbGdyjI/l6F+op+aBxz528JC33kTZxSkgmhLo6ttbKUH72mv8c7a M2FA== X-Gm-Message-State: AOJu0Yxl2iMm2CI4DAv92CrvPzAzh6KGpOovR24d9L40PO8qsrvPvSJ3 SOccudqLZuaLx4be8ICRbzIJBHtyOO9pRkvCbL89dtWwN3S6VNJudzmMIGXicKuoXdcAo6TtFT9 aAuM= X-Received: by 2002:adf:c089:0:b0:33e:7620:7288 with SMTP id d9-20020adfc089000000b0033e76207288mr6531710wrf.20.1710137113703; Sun, 10 Mar 2024 23:05:13 -0700 (PDT) Received: from linaro.. ([102.35.208.160]) by smtp.gmail.com with ESMTPSA id i6-20020adffdc6000000b0033b66c2d61esm5450044wrs.48.2024.03.10.23.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 23:05:13 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Mahmoud Mandour , Alexandre Iooss , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH] plugins/howvec: fix use-after-free Date: Mon, 11 Mar 2024 10:04:56 +0400 Message-Id: <20240311060456.218190-1-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wm1-x32b.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org reported by coverity scan Reviewed-by: Philippe Mathieu-Daudé --- contrib/plugins/howvec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c index 2d10c87e0fb..5be91f6fc5c 100644 --- a/contrib/plugins/howvec.c +++ b/contrib/plugins/howvec.c @@ -168,8 +168,8 @@ static void free_record(gpointer data) { InsnExecCount *rec = (InsnExecCount *) data; g_free(rec->insn); - g_free(rec); qemu_plugin_scoreboard_free(rec->count.score); + g_free(rec); } static void plugin_exit(qemu_plugin_id_t id, void *p)