Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2669256ybp; Thu, 10 Oct 2019 10:45:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKXQ3ROq7saN5cqAqh3SFDL6jxZbzrUhOo4fY+gu9dT7K08bsUss5AuJpOWZ/dUzV4cu41 X-Received: by 2002:aa7:c38d:: with SMTP id k13mr9444844edq.34.1570729508605; Thu, 10 Oct 2019 10:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570729508; cv=none; d=google.com; s=arc-20160816; b=Svfw55gBU8rN5b9MVZcqVrCURJiWvB3IFDJSajGBfI41E7TgmhNxg9/U/6GpyRyZqx 6u0zxqxdz39EEfoJzoqVkuW5r06u70OYRg3EcnnBgLvo4ZLSauwCqL6D2QWwcC5NaTgB lqVvPKWsT0dYpPICvf/RonhiFS2JcRVYSaD7HBPd/xohlFXgL/f58Hi2RJD40tVfJVfu 9O/9Wf95DVeX90tpNuPnzXrLPfmYaKh71LtYr1WtaaLhJ3WN9bALddXhyIn2w/leVVwq sZJoziLpE2vIaAjAM4laE3D1oVfyDFEHBrgoCSfIpb9xH2/VF0RzUn4PBEcLAmuECMe/ ffeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DKe45SUxB6hYFAJK4Hzzx9HwPC758qhlQpHJI3tZEIo=; b=Gn+iPs+xXrzBG/Tn5tfoVsVy4ik4eopfRo86xVmWQXhS/uCoP1PghT4pj+7viQ8RUS UKvTKGCUs/DXCHe29rVxzrbj/9T1ABcq1rGgv7jq4vPZJYmdiiALodrBT8oRJ296RrcJ G8gdrjCJLm4sPIDteyXXgTl2nWxUAcrXJWOLzLXxt7bMdYoio0mFnydLuJfm+8hPWXMy YMLz+gCflfcixvkX0vyVyqflEml5hcFsh6QLvq4sKmf4v94nC61MBzr9V/ldkavIZMxz CK7/UxKMd+zGcBkAx8slRUHmBikjzDpkMGHMa/pvoFF3Jkv4yhJgcJSC6c2zpLGJLD17 b9WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VWVqLMSh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i27si3526796ejg.249.2019.10.10.10.44.43; Thu, 10 Oct 2019 10:45:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VWVqLMSh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726524AbfJJRo1 (ORCPT + 99 others); Thu, 10 Oct 2019 13:44:27 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:46020 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726091AbfJJRo0 (ORCPT ); Thu, 10 Oct 2019 13:44:26 -0400 Received: by mail-ot1-f65.google.com with SMTP id 41so5609952oti.12 for ; Thu, 10 Oct 2019 10:44:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DKe45SUxB6hYFAJK4Hzzx9HwPC758qhlQpHJI3tZEIo=; b=VWVqLMShkk5AFXL8NAEgE0bqeZexDXkca5zP9VsCIHpGJGP655Ahj59j6PofdbF8yy zkXGLQUiQVY2NUUON+mXcdZoaZ16AEqOJUqMfJGAQSARITAkutR4PupxVfwgjhvHFnbd oWv1EFdvgCKVUXqmDGsUwNcxvGMa/a/TZNyHk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DKe45SUxB6hYFAJK4Hzzx9HwPC758qhlQpHJI3tZEIo=; b=deLbrWRSTU8kD6I1O/VcgBuFWgplLv8ecxlJ4xQ5GXGwPoGvVqcphiPFt212ckSVCH GnNJ/EWYDC+G9NIOnf9NSQfxkEXcqahNZ4lDDVUBeG0DLTgKls9mb+xS3wqeDmBc8UKP 1lrg580u4GPxYDATvkDS0TqMETsZZ0kQW3PmovTiR60ZI/MBsus2c9xQfo6v9fOS6FfF kvHLuV7FefbHurmNN9pkQwGY0jLD7QXTCNRsCJnqUunf2QRwa7k83wTO8VokxQBxiPPU 1rUNPr51+t2drn6cIwjgvBPxFwitnYXQvstEofu7wa1r8OaEJj75cTHhd2ekMlnLnc98 oPwQ== X-Gm-Message-State: APjAAAVe/bQUzGYY3XF/G/9VD1J0ehYd5jWPjp4nFtyKg9QaubRfQkEy i8vIaU5h4J19NgWoO7gCHSOQtc5+Jpk= X-Received: by 2002:a05:6830:11d1:: with SMTP id v17mr2296568otq.41.1570729465949; Thu, 10 Oct 2019 10:44:25 -0700 (PDT) Received: from mail-io1-f49.google.com (mail-io1-f49.google.com. [209.85.166.49]) by smtp.gmail.com with ESMTPSA id w13sm1786284oih.54.2019.10.10.10.44.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Oct 2019 10:44:25 -0700 (PDT) Received: by mail-io1-f49.google.com with SMTP id c6so15517019ioo.13 for ; Thu, 10 Oct 2019 10:44:25 -0700 (PDT) X-Received: by 2002:a5d:8991:: with SMTP id m17mr12301165iol.52.1570729464667; Thu, 10 Oct 2019 10:44:24 -0700 (PDT) MIME-Version: 1.0 References: <20190906060115.9460-1-mark-pk.tsai@mediatek.com> In-Reply-To: <20190906060115.9460-1-mark-pk.tsai@mediatek.com> From: Doug Anderson Date: Thu, 10 Oct 2019 10:44:13 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] perf/hw_breakpoint: Fix arch_hw_breakpoint use-before-initialization To: Mark-PK Tsai Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , jolsa@redhat.com, namhyung@kernel.org, Matthias Brugger , Alix Wu , YJ Chiang , LKML , "moderated list:ARM/Mediatek SoC support" , Linux ARM , "stable@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Sep 5, 2019 at 11:01 PM Mark-PK Tsai wrote: > > If we disable the compiler's auto-initialization feature > (-fplugin-arg-structleak_plugin-byref or -ftrivial-auto-var-init=pattern) > is disabled, arch_hw_breakpoint may be used before initialization after > the change 9a4903dde2c86. > (perf/hw_breakpoint: Split attribute parse and commit) > > On our arm platform, the struct step_ctrl in arch_hw_breakpoint, which > used to be zero-initialized by kzalloc, may be used in > arch_install_hw_breakpoint without initialization. > > Signed-off-by: Mark-PK Tsai > Cc: YJ Chiang > Cc: Alix Wu > --- > kernel/events/hw_breakpoint.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Stable should pick this up, please. It landed in mainline as commit 310aa0a25b33 ("perf/hw_breakpoint: Fix arch_hw_breakpoint use-before-initialization"). * I have confirmed that it cleanly applies to and fixes a kernel based on v4.19.75, so picking it back to kernels 4.19+ is the easiest. * I have confirmed that my test shows that hardware breakpoints fail on my arm32 test machine on v4.18.20 and on v4.17.0. They last worked on 4.16. Picking this patch alone is not sufficient to make 4.17 and 4.18 work again. Bisecting shows that the first breakage was the merge resolution that happened in commit 2d074918fb15 ("Merge branch 'perf/urgent' into perf/core"). Specifically both parents of that merge passed my test but the result of the merge didn't pass my test. If anyone cares about 4.17 and 4.18 at this point, I will leave it as an exercise to them to try to get them working again. -Doug