Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2868910lqo; Mon, 20 May 2024 22:17:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWfRM/cQkPIG1Lm84KeNVi2AFk+brf+l7OoFk3JsuiXzZazboXOxO1cL1zu5+IhqFFVCzMRmfu9kVq5zzZLX6yXp6aEJP7GIWHo4hG9PA== X-Google-Smtp-Source: AGHT+IHhbrVyVPuijDAsNBNE+MxOL3/9QwSlUhRATYzVCdMxvqB8zBCuAQj0wClhPXClrF7ThKpa X-Received: by 2002:a17:906:b081:b0:a5a:5c98:c594 with SMTP id a640c23a62f3a-a5a5c98c636mr1633918866b.65.1716268631249; Mon, 20 May 2024 22:17:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716268631; cv=pass; d=google.com; s=arc-20160816; b=ZQWgLZfYlc51Akm8LNEOFOeVNvb+bQ93FhBs3iyXiKgtKwj0o7Ak7I02RavthNUd2P GKJt9X2a0lOy85W0tw+LP8qssi86Uj03AZLHRDE/rkixH280F6H/XYJv/ZhR8ITV2/uv n8ZpDZ4LQr3cMM/2M+FztlMUQyR37xirXrBUhD23IEVHWNA/+iLXAWjhyDX879fzRaXs ii5M9+HgguImdUEkd5u+ahoo+qfBOBhkOBv1+d56MxzOYd9Bv1dheVfupf0gHop/NglF Al/k4Dt2Mq8IjrU3j6RNvf+wvwuH9NAZPfjeNVZCr/B61clPoRCOwsSW7xOeTRRQC+yx tKXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=hgUwu3svSa/mKw/B4ZxaOIDnZq+qTy2nIfXUeSQJiaw=; fh=v99zvwiCfn+AXKceECtkr7eAf9Lr2YBAMR7WnUI4Ab0=; b=CVzTZ1VlxwsKACoRFltz+NVFdCucJCQLdksKuPbT68UojsjcHeBv/oFivmbfDj+eNL 3tp4Hg6fm4XBy7p/LThFfiUiLv3esjJQOvozxCBjZgC+SxlOKTdc5T5tiWwkfb/ey2lM UJ15F7s0sAF3PGCm42p1zbENkIgfcIicQwAdkWk8ByXFPshhFayrC0uGqalifZ1AiUCP tniOidLkE1IagzNHRPqFNi1q0HWh7Otyc9H7EEuaTe+k37iQnuX2b3lOF9MGymxYO9qm aSZf6prHH0zQCJkYqlvJ5Il4VfVQDFripnCvCwvRgjPb5Vkcywzq6r7eOW6ccRl4Q3lH JxiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=hdr1VATd; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-184501-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184501-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17ba65a8si1438027366b.676.2024.05.20.22.17.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 22:17:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184501-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=hdr1VATd; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-184501-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184501-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E35AE1F228E8 for ; Tue, 21 May 2024 05:17:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D3A9C405FB; Tue, 21 May 2024 05:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="hdr1VATd" Received: from mout.web.de (mout.web.de [217.72.192.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DF04256A; Tue, 21 May 2024 05:16:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.72.192.78 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716268620; cv=none; b=LwlXm5gWZAXmkgRxeGfXGJNkyak0AOI39+P9O6hSNW+yRDEtGL/P06pZSshzA3LHxYijjFvrpypcMOkbDePWm5ZFAvL7ObZUJnnJBPaAoIjuZE7VTZngm3s+MnPBXPO1YJUisHGqC7+5xBFznspnjmhjnBr3jHcH1fdC142zxxE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716268620; c=relaxed/simple; bh=/s6qGPTiO3NdFoPJ8/vp10uRHmTzmRiDeMvPwnZ8c5E=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=I4i9xNcKrJBO4hn8MWsSiq1KkOyyP19ieDLCM9ikauqSo4no0gsNGYfwcgKfJn5FOhuAZ3SmhPZhKBerf+XYpg8i/+TOFEU7TOPJ/0TD6a+MVUJo0VXFqAQK/42MpA+WIOyzIO01nBciMcN7BY5BxINYNj6knV7+7EfV0AfFqiQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=hdr1VATd; arc=none smtp.client-ip=217.72.192.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1716268594; x=1716873394; i=markus.elfring@web.de; bh=hgUwu3svSa/mKw/B4ZxaOIDnZq+qTy2nIfXUeSQJiaw=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=hdr1VATdqSfzqdqxwbRX6qFA7xw6+YPfKYJY39hNnw1C9+FhJfxLSaJw18zxGScm 8ouY2p3XlX3q4ad3eT1kFSfbiRwFfF4HeeL5dseJF+8fB6MTfD1C0xoOsFThqC/Ws B7kBY3L3MxSSKVsYlMwtdqO8+BGNRNcKK7N44agWCWt/pQUgX3v4F5i3a9a5QiFuc aiTQHpXzSrlX/vyjYLlHpox8JhKoGik2LiJduA/3FGkLZVpX6wpXmRE5wESNhaNmG amCWJcwe0Fc91MHCFGngIWsWzwVCB9nw6uu4J3zpk6fU8iNq1b6IpSflxUs1RIM+l VrARuW8i8nfkW7uqhw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.82.95]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1Mr7eu-1svFS813mI-00oDwt; Tue, 21 May 2024 07:16:34 +0200 Message-ID: <51368bcf-d2e3-42cc-a112-a1a485f29c73@web.de> Date: Tue, 21 May 2024 07:15:50 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [v2] platform/x86: ISST: fix use-after-free in tpmi_sst_dev_remove() To: Hans de Goede , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Harshit Mogalapalli , platform-driver-x86@vger.kernel.org, kernel-janitors@vger.kernel.org, Srinivas Pandruvada , Zhang Rui Cc: LKML , Dan Carpenter , Dan Carpenter References: <20240517144946.289615-1-harshit.m.mogalapalli@oracle.com> <6d1bf351-77cc-7fe9-2d62-8bd99789e4f1@linux.intel.com> <5287fc2e-91c5-442b-b66c-6eb1fe334ce4@redhat.com> Content-Language: en-GB From: Markus Elfring In-Reply-To: <5287fc2e-91c5-442b-b66c-6eb1fe334ce4@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:t7NUvlE8czJwXU7Bpl/yyyB58A8Ut98ImsBGm7E04hmHCtuNbgN 4MfJyi7qJtSUk0liZMfMjfw4Nd5s4AicD223LMbmD5W4p5lUd5JmAvCncdA+rfArMB09bId cTNdTWZdc6qKrIszMGzQfMpTWWW7SW95S1iORJdhQHpRvHFBQC70VKfnJMKQZCWyy1OypSB ND0a0yhmys61uVMfFKurw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:7edThkPRkf0=;g2aiRURtDsylLBOGFMPs2cSvVjE ZmTdV8DCJsVx1y9cVHUz3zWOexys94PikniTlsZUQ4eR7TzrmHEkYX1hhXvg4jom8OtgnSRa0 KJpz8ZfFUTrAU3fsCD17O39noWsaRuJDOoYBuYCCHms/mbbNWsVgEgBtzolbaKh3dT8eTLrpf hHhEKIW4D8Th2+L8n23qPFLz2+mmFyINzsHSmqUk16Jqz+8y7Zlgfrn3q1Xsx5hDyfKaNcAiE HDrDLfnrlVTkmnntGfXUOi9XgowS8tgm4nxwGsamu28EhbUeL2unigRYhddRo9a/BoP0suipY vYRvZ1IIccAPPieCNx/DTeodVUthcbm0EQsvk43zQK1mJyFMDijaTFvCKjso+q6bQV/14Ef5b ACjCPiZWeekFYny6rCKcyrlYS34bRZInaHtDafe5zdKKOVDBqlK2DgqrrC5ZPr/k/+kUHmasy BtCSlnI5Zl38JdylnwaUUG8/LSgj2Z4n3VSWXmwJ1GwIyZsmLbItjWP1TIWr7+DaUqlqsXpdD v5LXAfD3kxP0VUMhuStuixaE+G2qXQbLsQt7/xpRN7sHNh3PpyU9WSuhs+JmY7xC7maPkMyet EuNNFbOQa8j0JHrb5ubx28yV0EwmaSL9GkM5VH5YGbFA9gLXpgthru7e0HkYLIQBlx5GB02vk RXKyBuP+35V2Q+aCW6twP45h6E3lZl5EOtCMyM7TQIIlefKDqKR2zkvnxibfpLEA9CB2vMSEq vY+spUyfjK5avAgiS+F5St/YuCyL8UokdKVAhIgtwG4CD7aRltzP2BV4l4g99Dtm4y1MeAjNh TNVxgpQqWdCVhcQGkB+w+cmAnwAoWCqmL3Xuzfa9sb+vM= >>>> =E2=80=A6 >>>>> Fix this by reordering the kfree() post the dereference. =E2=80=A6 > The original wording of the commit message really is fine as is, > I see no need for Harshit to send a new version and I plan to > merge this as is. Are there opportunities remaining to improve the discussed wording? 1. https://en.wiktionary.org/wiki/post#Etymology_1 2. https://en.wiktionary.org/wiki/reorder 3. Function call indication? https://elixir.bootlin.com/linux/v6.9.1/source/mm/slub.c#L4371 4. Rephrasing of =E2=80=9CFix this by =E2=80=A6=E2=80=9D? 5. https://en.wikipedia.org/wiki/Dangling_pointer#Cause_of_dangling_pointe= rs 6. https://wiki.sei.cmu.edu/confluence/display/c/MEM30-C.+Do+not+access+fr= eed+memory#MEM30C.Donotaccessfreedmemory-AutomatedDetection 7. https://en.wikipedia.org/wiki/Code_sanitizer#KernelAddressSanitizer Regards, Markus