From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D375FC4727C for ; Mon, 21 Sep 2020 22:13:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93A64239EE for ; Mon, 21 Sep 2020 22:13:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="hhIFa+Hw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728235AbgIUWNu (ORCPT ); Mon, 21 Sep 2020 18:13:50 -0400 Received: from mail.skyhub.de ([5.9.137.197]:57050 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726457AbgIUWNt (ORCPT ); Mon, 21 Sep 2020 18:13:49 -0400 Received: from zn.tnic (p200300ec2f07e300e2ed6c50343c7f1c.dip0.t-ipconnect.de [IPv6:2003:ec:2f07:e300:e2ed:6c50:343c:7f1c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 71B581EC03CE; Tue, 22 Sep 2020 00:13:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1600726428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=u/ai9rsZw+bNAm914PoiDjMDRau8nkOxqRVQQam3P/4=; b=hhIFa+HwsHiJYClqiBVdi1Zs+j17VmkRx6ejhUnKosSKTVoLLpf0rw0S4uyBCMjAhRbnj9 e5K6QyaYlpxrn8s35hw1AOs/SQinkNiLfRLilJPLjoyC2LkNhxbZIEZqV3N1ykF272FFwL zFn5B1wFdrMMQG3o7PBLxpKP7aUVt7c= Date: Tue, 22 Sep 2020 00:13:36 +0200 From: Borislav Petkov To: Nick Desaulniers Cc: Dmitry Vyukov , syzbot , Arnaldo Carvalho de Melo , Alexander Shishkin , "H. Peter Anvin" , Jiri Olsa , LKML , Mark Rutland , Ingo Molnar , Namhyung Kim , Peter Zijlstra , syzkaller-bugs , Thomas Gleixner , the arch/x86 maintainers , clang-built-linux Subject: Re: general protection fault in perf_misc_flags Message-ID: <20200921221336.GN5901@zn.tnic> References: <00000000000052569205afa67426@google.com> <20200919110831.GD7462@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 21, 2020 at 01:59:43PM -0700, Nick Desaulniers wrote: > Right, the two sequences above look almost the same, except those 4 > bytes of zeros (the disassembler gets confused about the rest, but > it's the same byte sequence otherwise). Are the two disassemblies a > comparison of the code at runtime vs. compile-time? Yes. > If so, how did you disassemble the runtime code? ./scripts/decodecode < /tmp/splat where /tmp/splat contains the line starting with "Code:". Make sure you have only one "Code:"-line, otherwise you'll see the code of the *last* Code: line only. > If runtime and compile time differ, I suspect some kind of runtime > patching. If it is, it ain't patching at the right place. :) But no, that function is pretty simple and looking at its asm, there's no asm goto() or alternatives in there. But that .config might add them. It adds a lot of calls to *ASAN helpers and whatnot. > I wonder if we calculated the address of a static_key wrong > (asm goto). What function am I looking at the disassembly of? > perf_misc_flags() in arch/x86/events/core.c? Yes. > With this config? > https://syzkaller.appspot.com/x/.config?x=cd992d74d6c7e62 (though I > don't see _any_ asm goto in the IR for this file built with this > config). Right, there should be none. > If this is deterministically reproducible, I suppose we > could set a watchpoint on the address being overwritten? Sounds like worth a try. I'll go sleep instead, tho. :) Gnight and good luck. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette