Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3337234pxb; Fri, 5 Nov 2021 13:57:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNpz1saefH03dD8SRbxXZ37Pz3lhf4As/G5jLSSfmTs9Y06p0eK7lb9GVsjU1nZH6vKlWE X-Received: by 2002:a5d:804a:: with SMTP id b10mr1161500ior.197.1636145832123; Fri, 05 Nov 2021 13:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636145832; cv=none; d=google.com; s=arc-20160816; b=rVvJVQ2v9xlJtktfQ/E8Hyekk6Xs2PIO6CjgJ0xYHJzcs8yw17DrMrrn09kbcujSiH o0rdSlbSnVXD+Nif5iaA5lU0HAbLxjaRF5OOGYBqmF3YKTSY4vZvhrmNBW6bhXeHh10t k0s7MSLJ+i9IBQj8d+Yogm10oM12RCTwwbgTI3KmoIsJ0HYBA8ntOGMqdK6F5oUIHRK5 Q7lHqsqvPHBt8fuWCDornVdwUi4rujTy6SCeGBRPLN+fbJRq4YB31XHUvS4SdokJIGWZ v+WOLUEoTj0C4Pv5j1n1WTpNadO4nngX21iPJDCpg6jPx2kFRSDV8CPLU9+gRnkiahrb EIIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=a+70iYdg6zUu8Lqi6l7KLgNhOA3/zlkFH1TwBReetG8=; b=PicRmbvEnO3p1BlpEzsGX19UFMc0nvRweaiKObxAvFm1FNN7RYD95mai8jY8TclYiB /vPeuXB948aUZerJskte9Qnb0rgvec0MXHQTLuinavAPAYSSVpmU5hE24VbobV01nXKd l5Psx+r7LFFVTikPq6T10TLZzFiDeWJP4XzMOBCibKLZkaG5m0TXSCE+6/oYMZ4DdPjK +B2cXhVsofY4thOR4dqYyPR08ZfoW1gLBCCQgTULuEgdbcH4qYcI0hN0pByuR+/g3d3z ftAyM13Wn5QfBCWRCXeyBBs6EkxgWaSou+mn3C7JdJr9yk9FJV3SmKCTCJvRUfZ+vivt 5pKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WFzb2tac; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t34si17451998jal.104.2021.11.05.13.56.58; Fri, 05 Nov 2021 13:57:12 -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=@linutronix.de header.s=2020 header.b=WFzb2tac; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234423AbhKER13 (ORCPT + 99 others); Fri, 5 Nov 2021 13:27:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234059AbhKER1M (ORCPT ); Fri, 5 Nov 2021 13:27:12 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DAAEC06120D; Fri, 5 Nov 2021 10:24:32 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1636133071; 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: in-reply-to:in-reply-to:references:references; bh=a+70iYdg6zUu8Lqi6l7KLgNhOA3/zlkFH1TwBReetG8=; b=WFzb2tacbq96jVu7RhlPEY4ULAeT4NuRbAOanTgGuRy/qpi2bUkxmNNLRTWO0SncoPbetJ GzG1hhnas/4PzZ4pG0L+QAy0fclAP8oT52Ueai63Lbb7Bc4oIvAKvwY0n3D6RTgtHZjrq4 vYYzbW2TlmyZzM0kFZt41Umm5TiXT4+TXhzqW8ZKU7DvqlvUctH9g+AFDzxMjxaN0jh4an 43Qp0WDRm5pzufSwvweUov/AvbFltQR3bMotKfEmao3NwkGHMsAMvcI4zMsoU4E9WAO9+D Ty067a+yyQd/E+8EsUsAzDY/HSIg6psHVWh6q+ZuCyQGsd5x6yH7jEzQozvCjA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1636133071; 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: in-reply-to:in-reply-to:references:references; bh=a+70iYdg6zUu8Lqi6l7KLgNhOA3/zlkFH1TwBReetG8=; b=r+mu8TZwIG5G63i+/GeMuj/wlWX2MPGiPtXez1sg5Nbz+KWGwShfBlubhoAfBgjTgH4eeI I/+66eCg6UgqYYAw== To: Dmitrii Banshchikov , Alexei Starovoitov Cc: 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 In-Reply-To: <20211105170328.fjnzr6bnbca7mdfq@amnesia> References: <00000000000013aebd05cff8e064@google.com> <87lf224uki.ffs@tglx> <20211105170328.fjnzr6bnbca7mdfq@amnesia> Date: Fri, 05 Nov 2021 18:24:30 +0100 Message-ID: <875yt64isx.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 05 2021 at 21:03, Dmitrii Banshchikov wrote: > On Fri, Nov 05, 2021 at 08:53:06AM -0700, Alexei Starovoitov wrote: >> > Timestamps from within a tracepoint can only be taken with: >> > >> > 1) jiffies >> > 2) sched_clock() >> > 3) ktime_get_*_fast_ns() >> > >> > Those are NMI safe and can be invoked from anywhere. >> > >> > All other time getters which have to use the timekeeping seqcount >> > protection are prone to live locks and _cannot_ be used from >> > tracepoints ever. >> >> Obviously. >> That helper was added for networking use cases and accidentally >> enabled for tracing. > > Sorry for that. > I'm preparing a patch that will forbid using bpf_ktime_get_coarse_ns() > helper in BPF_LINK_TYPE_RAW_TRACEPOINT. It cannot be used in TRACING and PERF_EVENT either. But those contexts have to exclude other functions as well: bpf_ktime_get_ns bpf_ktime_get_boot_ns along with bpf_spin_lock/unlock bpf_timer_* Thanks, tglx