Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2634588ybt; Mon, 22 Jun 2020 03:21:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXA1ALulBoszJmuvijgIcI/L5dzqD7HDxlviOF2LET4VSjVYL2oFcTip79AmlNIEi0Fcur X-Received: by 2002:a17:906:dbda:: with SMTP id yc26mr14690711ejb.82.1592821308075; Mon, 22 Jun 2020 03:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592821308; cv=none; d=google.com; s=arc-20160816; b=HvBUIRGLqqAsF7F4mXk0xfvbrviuD0b6LaKHftoTQZ33xHX2M3w3ZNaD1e5me/p3oR iUfFPDjYavAOcDBueHK1Wb2Zq5GATbJizmnjAqPWhsV6jLMeb2x4ipC7ZztPw6qAOJED NR5bSMsWNqkijbCZhHGKFKsrsfxkVsYVt9jBuhQgMfOQosv73d8MWQel2tgDXlBauuPU 3Uz42VCo9Jz/LTr/s9DbQJeEE/ztpp34hs0l+4y89WxhZwlpUJOD9HhPBRKWshDxsqfx 1c5O3U46n4LsKHDy8fyGG2bNEfegrTjPTajnH+0rcj7ANuM5tqG3CdxYsV1mJJSY0u8r zl9Q== 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=R3B47LhSzlhf0CyG1tgvim2OLOrvyZ3razYI3nJme5U=; b=NT0NU0WsfilVEcvjec8oAqUNPFUWlvEuwVE9S1qh+9pfyg7Co8xm5tI7urZ0GI3YpP 95bQYSsRkJv9XPXL9LRp/9o9XiDBNWk5jMZvekkSG5630JoHWT96CH3EgkasLWrqOM7L F3l773xqJ+7WFjw2Z2JnoAsgIElRHKFQ7jGv7t4qeDnvDILzM6cCJlqPKIs5cyC3vfL4 WKRFJEFHaD+cG1UdumnrSZRWHtK5Xbr9Ymu2FVjKvH0manlqrKExzG8nJJMhaUnPCHR7 yEs3hG44cWuJFP7Jle8bjQlKcDQpzyoMpwbTXCC2h6p1A5Q2DeF58pl8eFck9A3RvSSy vqhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="F7/MYp6K"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t21si8496693edy.548.2020.06.22.03.21.25; Mon, 22 Jun 2020 03:21:48 -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; dkim=pass header.i=@linaro.org header.s=google header.b="F7/MYp6K"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727882AbgFVKQq (ORCPT + 99 others); Mon, 22 Jun 2020 06:16:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727017AbgFVKQq (ORCPT ); Mon, 22 Jun 2020 06:16:46 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 551D5C061794 for ; Mon, 22 Jun 2020 03:16:45 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id y11so18637213ljm.9 for ; Mon, 22 Jun 2020 03:16:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R3B47LhSzlhf0CyG1tgvim2OLOrvyZ3razYI3nJme5U=; b=F7/MYp6K3ALqvV1Pk4dcuMsGKwszBlgZe6Wswk+bxqBKID6d74blxWVWa8ithjNlbB f+ZfUhB55CLLROLEhJ/H71hH4eGx/w74csavIqcgv2EUFST86ArC2UEIQN/srrf83gGj 5UbUUqyvat9aUPnhxdtMeGggVsExXeL7vO3xXKMMMybrsHMSNMAr8IwdwtSbEZJM6JaM 25hZeuIRs4MnuCB81nu7KQGTa+ZxC2MHgMzQOgAj/vZT5c+jKs39G2PVD6hKP6fNq31j 981OSedENF5UJm6cPOHI+q/RjPTzDzvIvgFpySUuC1ijacExCY4BKFyAOTEpmQqF49Xb rP3A== 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=R3B47LhSzlhf0CyG1tgvim2OLOrvyZ3razYI3nJme5U=; b=Q2cZVZNzASN0rp0Ac0Uf1FWDo+jgTJB/r4rRJkQelc8GPsz/E9ChifnZdKKoFiciMV 7rQp1JAG+wIFdEZfcmguYGw73KkfdR2dgwSSUL6mTD9YOjtX4w3JCdN55H1+I9lcYPIH /iEacDUanw/Zm1TXYogJSr+qBUVzvTs0AsjwK/hKpi53YHGQLtpgW/g08M+pbl4wr9VO nQasO1rkxj0MMT7wRSAM8BvrkIdSUtvK8OHzGOJfqtgN6BF43tbWScnkQr3Y1dUH21b+ ZrjNbQdectUDLkfUblAR3AZ3hsEhrPCPLW74x1VYpMKFRzvHqMIvLgocx1NqGaSG8+SY qSjQ== X-Gm-Message-State: AOAM533EiRQiFjwPy81DTuR0pE5CohkWpbbbk24ByK9WmdB2WX5RJ8Ty qMf8nbhfL3SLqEQy9UzWZUT2Sfjw3w4MfGMQ/JF8Hg== X-Received: by 2002:a2e:984b:: with SMTP id e11mr7726051ljj.358.1592821003711; Mon, 22 Jun 2020 03:16:43 -0700 (PDT) MIME-Version: 1.0 References: <87y2onbdtb.fsf@nanos.tec.linutronix.de> <8E41B15F-D567-4C52-94E9-367015480345@amacapital.net> <20200616132705.GW2531@hirez.programming.kicks-ass.net> <20200617131742.GD8389@yuki.lan> <87r1ucb0rt.fsf@nanos.tec.linutronix.de> In-Reply-To: <87r1ucb0rt.fsf@nanos.tec.linutronix.de> From: Naresh Kamboju Date: Mon, 22 Jun 2020 15:46:32 +0530 Message-ID: Subject: Re: [LKP] Re: [LTP] [x86/entry] 2bbc68f837: ltp.ptrace08.fail To: Thomas Gleixner , Cyril Hrubis , LTP List , lkft-triage@lists.linaro.org Cc: Peter Zijlstra , Andy Lutomirski , Alexandre Chartre , LKML , lkp@lists.01.org, Andy Lutomirski , Masami Hiramatsu 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 On Fri, 19 Jun 2020 at 01:32, Thomas Gleixner wrote: > > Cyril Hrubis writes: > > 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? > > According to https://www.openwall.com/lists/oss-security/2018/05/01/3 > the trigger is to set the breakpoint to do_debug() and then execute > INT1, aka. ICEBP which ends up in do_debug() .... > > In principle each kernel address is ok, but do_debug() is interesting > due to the recursion issue because user space can reach it by executing > INT1. > > So you might check for exc_debug() if do_debug() is not available and > make the whole thing fail gracefully with a usefu error message. My two cents, LTP test case ptrace08 fails on x86_64 and i386. ptrace08.c:62: BROK: Cannot find address of kernel symbol \"do_debug\" This error is coming from test case setup KERNEL_SYM = do_debug if (strcmp(symname, KERNEL_SYM)) tst_brk(TBROK, "Cannot find address of kernel symbol \"%s\"", KERNEL_SYM); Test case got pass when DEBUG_INFO config enabled CONFIG_DEBUG_INFO=y ptrace08.c:68: INFO: Kernel symbol \"do_debug\" found at 0xd8898410 Full test log, https://lkft.validation.linaro.org/scheduler/job/1483117#L1325 ref: https://bugs.linaro.org/show_bug.cgi?id=5651#c1