Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5393216pxb; Sun, 7 Nov 2021 11:17:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJw61kHvCPKsVtOqd/z9n5PhT1iI/+Q48MOVyYya6+4En515U6jtZoKmeu2BK77r1pOlLaBU X-Received: by 2002:a05:6602:2c45:: with SMTP id x5mr9503841iov.94.1636312658950; Sun, 07 Nov 2021 11:17:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636312658; cv=none; d=google.com; s=arc-20160816; b=O08z7dLE1iN+UmaQHd3o5bseBWdX9NGt6INxA6z4PM1wMByBzHFjP+B0ulckNqrVXn JUYhLg6rH9x12D2Eu+5GOsxsWntgKlnju09pfmE6KcaacI141q6JDGfOoNaBFmQttIT3 m6JEGfr9S0lWaP15sypZZMZbcy8hH7ES9+yi/yTV8GhMjXtQMAfmzWA0j76/jswtQSt1 SEJsX2Nc/UbyLKJ97WWPiB6JRWTv6g7Z3iUOdjeipdVINFgafYkjQj6xr0xosC/ps/c2 UrRRa5TEb3ro2gqJmmgcsmP/D1cIWrOrp4TwoYEs/ucNaf2FlwJqEijg3DI2qwpaqn/B vivQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3yVpPO0r/qITHteS4fsEzbLkYGCl0u5VUYb9MU6DMSw=; b=asN6OvFRXCtXT9ADRrmmrCbJ/tAebkFn+xItlQQ9NYfpulLQ730lp97jPwwEFodVeW +GTJE5AZfxBeJKzFcZ3LC4GwAQoPatUOwAQ8M5BTmTzIgVlsYFdcX4LJT21oyCYSO+lZ Ho3HX936wu2VOxZ2u/UtgkNsYFTwg9P0e3X5NjRjrwsInzZVHMOz8pdxmKWvWor2ZKdr PW8B/QFWXBM45JV4zMoOjwCHnfJgtww0e2f7GJxjtzTWb92xu+/PXyGvzRtjvFULGJ+X oK+fH9DZPQ43ucDyIxztO09n72Le8LTZu7As3/dEPw+O5Ru9r9COD7A7SGM0DOjqShMh YULg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ubique-spb-ru.20210112.gappssmtp.com header.s=20210112 header.b=VC9z4vem; 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 u12si15972433ilv.57.2021.11.07.11.17.25; Sun, 07 Nov 2021 11:17:38 -0800 (PST) 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=@ubique-spb-ru.20210112.gappssmtp.com header.s=20210112 header.b=VC9z4vem; 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 S229620AbhKGNyI (ORCPT + 99 others); Sun, 7 Nov 2021 08:54:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229589AbhKGNyH (ORCPT ); Sun, 7 Nov 2021 08:54:07 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF0CDC061714 for ; Sun, 7 Nov 2021 05:51:23 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id w29so10499802wra.12 for ; Sun, 07 Nov 2021 05:51:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ubique-spb-ru.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3yVpPO0r/qITHteS4fsEzbLkYGCl0u5VUYb9MU6DMSw=; b=VC9z4vemDTkn/EFs3v9RnK94bYTsxLtkywc6KyidgSu383GOqctuu/O/p1q8uHbHwS grnowSTDXsaPjvX/VzHvqqeK9Ib3u0PWmH6wTFWJJtvIsySLHKZCP0+w8BU75/8i4YDD S4lrk5i3r7A7OZYQHsqjHTQAmrB/nPXswnvPscRqJcTQ+8kNMDUak7E3vB/zJx5hGDym ehv01ejyhMOExAmZhhiJXNkIqQDCItZ7+GjMDZbcXov3WSIOwIuTq7Tz/qPINyzPiX9m 50XfOCJ0qEPlo3bjUuzwyxC4tm1qaDORO6rDIwSd0WZq59HmFxfwcdBcALOUOMHJj1Kq EGfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3yVpPO0r/qITHteS4fsEzbLkYGCl0u5VUYb9MU6DMSw=; b=tjw4SoRqdVo7365mzNOElH7MiS1iBywylZWS0Y9bStFkVrvHI/E+xC8JDl8QLMokq/ kPl8+QqnfouSx80pdA2Q8QGeWyIrPpCMpXNrqR5BVpaKb9Qpqy/RuzJ6hEXEaT5nv+SV N8LFWg7jVWU/ccqW2D1xxn8+M2/uuTGWu90ZoSFHYRIZ7JxXxYDaw6F3mGuUlrBfPVue By74WCSykgphsoiup1/oz6PdZ83wW+OP4DCOHqI1WBhhkPPpCD8VadqTe5Gj+jPQzba4 II+cpbstoCZuhsxBV/b+/bi79HhEZYN3NhgHvbIMqvNEIe38QOpLwFnvFhLkZq/zyEW6 vGLA== X-Gm-Message-State: AOAM531lvv8QoSNYBIJVnK6MK2b6nLLn3Lgy5WFwCeU3NzIhMOucV5JQ J6q2jAydJQcgJVpRoQbguf94rA== X-Received: by 2002:adf:c183:: with SMTP id x3mr91597468wre.90.1636293082225; Sun, 07 Nov 2021 05:51:22 -0800 (PST) Received: from localhost ([91.75.210.37]) by smtp.gmail.com with ESMTPSA id m3sm4171415wmi.19.2021.11.07.05.51.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 05:51:21 -0800 (PST) Date: Sun, 7 Nov 2021 17:51:15 +0400 From: Dmitrii Banshchikov To: Thomas Gleixner Cc: Alexei Starovoitov , syzbot , John Stultz , LKML , sboyd@kernel.org, syzkaller-bugs , Peter Zijlstra , Mark Rutland , Steven Rostedt , Alexei Starovoitov , Daniel Borkmann , bpf Subject: Re: [syzbot] possible deadlock in ktime_get_coarse_ts64 Message-ID: <20211107135115.tqqx62sxsfeuzslb@amnesia> References: <00000000000013aebd05cff8e064@google.com> <87lf224uki.ffs@tglx> <20211105170328.fjnzr6bnbca7mdfq@amnesia> <875yt64isx.ffs@tglx> <20211106200733.meank7oonwvsdjy4@amnesia> <87zgqg2r4o.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zgqg2r4o.ffs@tglx> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 07, 2021 at 11:32:07AM +0100, Thomas Gleixner wrote: > > 2) bpf_spin_lock/unlock have notrace attribute set. > > How is that supposed to help? > > You cannot take a spinlock from NMI context if that same lock can be > taken by other contexts as well. > > Also notrace on the public function is not guaranteeing that the inlines > (as defined) are not traceable and it does not exclude it from being > kprobed. > > > 3) bpf_timer_* helpers fail early if they are in NMI. > > > > Why they have to be excluded? > > Because timers take locks and you can just end up in the very same > situation that you create invers lock dependencies or deadlocks when you > use that from a tracepoint. > > hrtimer_start() > lock_base(); > trace_hrtimer...() > perf_event() > bpf_run() > bpf_timer_start() > hrtimer_start() > lock_base() <- DEADLOCK > > Tracepoints and perf events are very limited in what they can actually > do. Just because it's BPF these rules are not magically going away. > Thanks for the clarification. -- Dmitrii Banshchikov