lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cb40c209-9c4c-f645-8454-bcd74cb72405@amd.com>
Date:   Thu, 3 Nov 2022 17:15:30 +0530
From:   Ravi Bangoria <ravi.bangoria@....com>
To:     Naresh Kamboju <naresh.kamboju@...aro.org>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Borislav Petkov <bp@...en8.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        linux-perf-users@...r.kernel.org,
        open list <linux-kernel@...r.kernel.org>,
        regressions@...ts.linux.dev, lkft-triage@...ts.linaro.org,
        Ravi Bangoria <ravi.bangoria@....com>,
        Stephane Eranian <eranian@...gle.com>,
        Sandipan Das <sandipan.das@....com>
Subject: Re: Perf: BUG: kernel NULL pointer dereference, address:
 0000000000000198

On 26-Oct-22 3:35 PM, Ravi Bangoria wrote:
> On 25-Oct-22 6:36 PM, Ravi Bangoria wrote:
>> On 25-Oct-22 9:59 AM, Ravi Bangoria wrote:
>>> On 20-Oct-22 12:24 PM, Naresh Kamboju wrote:
>>>> Following kernel BUG noticed while running perf testing on qemu-x86-64.
>>>
>>> Thanks Naresh. I'm aware of the crash[1] but haven't got a chance to
>>> root cause it. Let me try to spend some time on it.
>>
>> I tried to mimic https://lkft.validation.linaro.org/scheduler/job/5708609.
>> However, I don't see a way to download lava-guest.qcow2. So I just used
>> rootfs and kernel:
>>
>>   /usr/bin/qemu-system-x86_64 -cpu host -enable-kvm -nographic -net nic,model=virtio,macaddr=DE:AD:BE:EF:66:20 -net user -m 1024 -monitor none -kernel bzImage --append "root=/dev/sda  rootwait console=ttyS0,115200" -hda lkft-console-image-intel-corei7-64-20221019172733.rootfs.ext4 -m 4096 -smp 4 -nographic
>>
>> And I ran perf test inside the guest, which ran fine.
> 
> Running perf test in a loop reproduced the issue after some iterations.

Sorry was distracted a bit. So, this seems to be happening because of
race between amd_pmu_enable_all() and perf event NMI. Something like:

  amd_pmu_enable_all()
  {
      if (!test_bit(idx, cpuc->active_mask))

  --->/* perf NMI entry */
      ...
      x86_pmu_stop() {
          __clear_bit(hwc->idx, cpuc->active_mask);
          cpuc->events[hwc->idx] = NULL;
      }
      ...
  <---/* perf NMI exit */

      amd_pmu_enable_event(cpuc->events[idx]);
  }

Thanks,
Ravi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ