Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp483723ybt; Wed, 17 Jun 2020 06:19:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuA+3of5T4qMZaz08kWKlOOyAOGWTZsWtlSEefyGRrMZmCyVXr1t2FbEbL5QkUxq62GxRe X-Received: by 2002:a17:906:7c56:: with SMTP id g22mr7340133ejp.507.1592399985474; Wed, 17 Jun 2020 06:19:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592399985; cv=none; d=google.com; s=arc-20160816; b=RlfFVeHGzKowgxiSHfx2RDgckZJ52Axjs9wyy4BRQoDKG/0i/PNwVcfZB2rzWpUJxD g3zUiHbDkDyBCvdL9+Am2PcX1YEPww89g5Ju+lj4ODhu4jZoYH1NU/J6GZeDmqk2Gqov UfPMEEVJXHF1Out1C8vj73mC+2ziuIXzIvvffjBSz7uDk7bQ2ZWKDtHvySaYVL7qpGoS nRHuHwrl/w2B22qbGOWi6V7PxUauFX2lt0d4b5qMEsiow9NsedG2+hDMZzlHxQIynaVc LO3JFOPRvTER2CzhD0qYVY1JH3+4kwKNXpsR8IZP+TvB3a1kk+RCqi5/ecS1GdLYd6nR CURQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=A9qYwMVnly7wkmecSLKgTn4giNkV/SSMIpe4imPpRl8=; b=cYikmQNDzFbGKSQN7DCVjaZFjwL6jfsbrc5MQUGpKIXwC1oEO90VpWHhVYi3tXH66r 75/PYteTb5S/rHbhbgznHz1lhmiXonG/f0VRWcaAChErB/w0j9jF2EQ8R1YwnVME9poa L2Izdlph/ppJrmetd6PaXg4b4vxXu1AoFALD544UZZEApbiSWOThBVbfmOOlQ7Wmngwj Ectkg2ksW9Suyo3toHxcmhlbkxTfO89HUzPwLTE6BSFwWFzZY+6Bupa2RwNUtS5HvKv+ EcGYW91MCKLeUHmueqeOK/9DmzGMWnNO1kamGA3R+eEDkDbooMbVJQf56oER0QzFrDx/ HY9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si12780225ejz.15.2020.06.17.06.19.21; Wed, 17 Jun 2020 06:19:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726845AbgFQNR2 (ORCPT + 99 others); Wed, 17 Jun 2020 09:17:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:54196 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726763AbgFQNR2 (ORCPT ); Wed, 17 Jun 2020 09:17:28 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D269EAD11; Wed, 17 Jun 2020 13:17:30 +0000 (UTC) Date: Wed, 17 Jun 2020 15:17:42 +0200 From: Cyril Hrubis To: Peter Zijlstra Cc: Andy Lutomirski , Alexandre Chartre , kernel test robot , LKML , lkp@lists.01.org, Andy Lutomirski , Thomas Gleixner , ltp@lists.linux.it Subject: Re: [LTP] [x86/entry] 2bbc68f837: ltp.ptrace08.fail Message-ID: <20200617131742.GD8389@yuki.lan> References: <87y2onbdtb.fsf@nanos.tec.linutronix.de> <8E41B15F-D567-4C52-94E9-367015480345@amacapital.net> <20200616132705.GW2531@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200616132705.GW2531@hirez.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > > >> FYI, we noticed the following commit (built with gcc-9): > > >> > > >> commit: 2bbc68f8373c0631ebf137f376fbea00e8086be7 ("x86/entry: Convert Debug exception to IDTENTRY_DB") > > >> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master > > > > > > Is the head of linux.git exposing the same problem or is this an > > > intermittent failure, which only affects bisectability? > > > > It sure looks deterministic: > > > > ptrace08.c:62: BROK: Cannot find address of kernel symbol "do_debug" > > ROFL It's nice to have a good laugh, however I would really appreciate if any of you would help me to fix the test. The test in question is a regression test for: commit f67b15037a7a50c57f72e69a6d59941ad90a0f0f Author: Linus Torvalds Date: Mon Mar 26 15:39:07 2018 -1000 perf/hwbp: Simplify the perf-hwbp code, fix documentation Annoyingly, modify_user_hw_breakpoint() unnecessarily complicates the modification of a breakpoint - simplify it and remove the pointless local variables. And as far as I can tell it uses ptrace() with PTRACE_POKEUSER in order to trigger it. But I'm kind of lost on how exactly we trigger the kernel crash. What is does is to write: (void*)1 to u_debugreg[0] (void*)1 to u_debugreg[7] do_debug addr to u_debugreg[0] Looking at the kernel code the write to register 7 enables the breakpoints and what we attempt here is to change an invalid address to a valid one after we enabled the breakpoint but that's as far I can go. So does anyone has an idea how to trigger the bug without the do_debug function address? Would any valid kernel function address suffice? -- Cyril Hrubis chrubis@suse.cz