From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7319A3AFCFF for ; Wed, 15 Jul 2026 18:46:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784141170; cv=none; b=dPlOcA85O0lGSkFvBw+jLdv01otTy6sPSRMJeWx7aQJGc8U45P7R17VmyW/pQW5qY3qyHloUqvQAHQ/rIemNhUY+/Z6qXtoEPzspKucd1LnEXuYNWMmHlf9NWNxX0qmnq5PHP9rdrt8S7W9/FcJJxAB8KY/ypy4QNG9YABzGx6Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784141170; c=relaxed/simple; bh=p8DS9Lkfl+bVR+9wrEG/5fYveO8iAKu9dFhFTTtcoac=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=MvOSKmtEbjUlYYIBoZ/c6bqfvnjc8JghKtzPQ1pGxZ+kCNP4GFprj2Ke6TvjUvY6tLcQL2VP021OSIm5nKvgwlR1Ux0Y4BZs5ANNLdYf0Gr9464q+jXXGMrTAsJP/yn0KAxx7vmVjV2OBe9xCQnRa6yAk9yJFvcp2mw5JkB5INA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=nT4A4ZZo; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nT4A4ZZo" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-4799b3f7c83so4305239f8f.2 for ; Wed, 15 Jul 2026 11:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784141163; x=1784745963; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:content-transfer-encoding:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=NZ1koe0FoGKZWlSKLYl/usYRXo5FiitnJD7Hzawo0JA=; b=nT4A4ZZoFBVhnqD+4YsVsUh/vZzwf1iJBHfaqjSWyTneWel/ly9JicJ7vyqH1IX8eO r7aZNR03fCQ7D0kWoeQ1n+bZwglXI/IjbwRa3xcq0qd9/6Ld71Q/BzSH5fd21Vjt7weH D486QQN4TGemEZWOZ0yAF9dxuI1f0Acg5u36RFgL8pudNurEmr56WO3n1VLlwy9hqG/K apsgDSxYuM+tohF9bpqeAVHut5V5iAPEyVyAc5SeUzPM0RzXsV/j70hNg8WZa+MS6jJf G3z95b1dw1Vt3cBTNVhcbRMmFJX3Hr0D4TbUx4zUYRXtPP4sEHmjDlRPkq5Os0MMe0yO KDnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784141163; x=1784745963; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:content-transfer-encoding:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=NZ1koe0FoGKZWlSKLYl/usYRXo5FiitnJD7Hzawo0JA=; b=VwMmWLPvHqe9BFc1awAcGUHMvbzpvLc7OToKFWv84JSvHSTIM2MAmwx23G/+vu9ySR 6g9vOsuP9EbExwKKDQu3RjaDM8pX7yMjMNxtNImRru8ywdMEyEjJqUSvJubBgz5y5URu rp/nT8Syf7MjYpGdsU4yHf6QNL6XS3Io0PYA1KWOVF0AdhU1qpGE2LBmlI0551llo9JV XG7aIKe8m+1/vOxYl/iUQcdB9Rqyz9c9iLAK2yIltquTztl6j+Jrs+yC/hjU9Qhyc1nY K0bU2lKf22JPM/yVNkcDHa0geoRxbYHsCOqAunvHUpg6I7Egwtp66xB96ef2kFEGDWJG UvRQ== X-Forwarded-Encrypted: i=1; AHgh+Rr6p5SRfnRyG/nw3qBXa9bcgPKPsgX2FAw1xeFML2wmAsBZzKHXf/BIpd2cJBFYbgg8nkK/wzOb74V8+HI=@vger.kernel.org X-Gm-Message-State: AOJu0Yw1GyWVq1Dpab+nuvRsZMbTaOyql4yuCpxoqKzbzELdbXf6mBhI 4EVvsSgnG3RXUKQDjZBWUM3vZ3I5GJkic5zFrKDR1FP3kkvQqV2tU46Y5QfxtEMZi1c= X-Gm-Gg: AfdE7cktXC4qyPoYZPMtaELuZIKnqd36qH/Wg9RKbgLrfQuEqLFPD/+cR7d7hLO1kd8 OQ0gWag9ibq0uKxLLpufRDZj4lZj2Gs8Wy4MtkMYzBiI286Z04Ay8Bee8q2CH0xF7027ed0Cvo5 oQYaEZUEqxsfPLhLrDJaM5D9lssESprONIca6qZ4PChYJ5JhSnDoGaKyhAadnTOGmjy9aboXQst H18+tH30VXzrSewomE8HMZCqKISNtZ7pDSt0Sgx5o2W9vJz3goLzDO3AopMI5Uvcn+xExVbJ7Pe MdLfLiklwC50LefXrEZ9buoFK2Hl12y9ZWJapg6wO4+ECiu9C2iWQ15OrEwFCdFBmkEd26Beslk F4se5ByOneoa10dghT8KGMZHNBmw4E7dq4tw9dNe0dgDbbtd9116WPttOWq+9EJK1/pflrGQzgT ZG+cne9YpOOX8yRBhc2OHontngcCyyBWeagamj5TjGDVskVALFq+iSS1DIHWK2R+M6l5xfK5LhH w== X-Received: by 2002:a5d:5f09:0:b0:47f:4e46:e9e8 with SMTP id ffacd0b85a97d-47f4fcc846emr4872875f8f.6.1784141162784; Wed, 15 Jul 2026 11:46:02 -0700 (PDT) Received: from localhost ([2.122.8.179]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f464c25b2sm18639255f8f.30.2026.07.15.11.46.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jul 2026 11:46:02 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 15 Jul 2026 19:46:01 +0100 Message-Id: Cc: "Krzysztof Kozlowski" , "Alim Akhtar" , "Sam Protsenko" , , , , , "Sashiko" Subject: Re: [PATCH 2/3] soc: samsung: exynos-pmu: fix use-after-free of interrupt generator node From: "Alexey Klimov" To: "Peter Griffin" X-Mailer: aerc 0.21.0 References: <20260605-exynos-pmu-cpuhp-idle-fixes-v1-0-0cd05c81a82d@linaro.org> <20260605-exynos-pmu-cpuhp-idle-fixes-v1-2-0cd05c81a82d@linaro.org> In-Reply-To: On Wed Jun 10, 2026 at 11:58 AM BST, Peter Griffin wrote: > Hi Alexey, Hi Peter, > Thanks for your patch. > > On Fri, 5 Jun 2026 at 21:19, Alexey Klimov wro= te: >> >> The setup_cpuhp_and_cpuidle() parses the device tree node for the >> interrupt generation block via of_parse_phandle() and decrements its >> reference count using of_node_put() immediately after fetching the resou= rce >> address. However, later the intr_gen_node pointer is passed into >> of_syscon_register_regmap(). >> >> Fix this by moving the of_node_put() invocation to after the >> of_syscon_register_regmap() call, and adding it to correct error paths. > > I think using > __free(device_node) =3D of_parse_phandle > > would be a cleaner/simpler fix. Yep, thanks. Around time of sending this Krzysztof also adviced to use _free() in another commit on maillist. https://lore.kernel.org/linux-samsung-soc/c866dbcd-c211-48df-84e3-f66785ba8= 538@kernel.org/ I'll update it. Best regards, Alexey