Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp342077pxu; Thu, 3 Dec 2020 01:25:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGYUFeVuVoNKJ6zoderAG7nDahiDD0kgK/7/SlB9lsUufY/Ryx3FYpIEVgUAPL90hAxQzk X-Received: by 2002:a05:6402:1c8a:: with SMTP id cy10mr1963461edb.151.1606987549168; Thu, 03 Dec 2020 01:25:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606987549; cv=none; d=google.com; s=arc-20160816; b=liQW02MfDks6HVUAbzrf5Q8c8EcpCFxQydr1I7vp7JBVS4RhFZpW4mPbieYlpfBF0C 4Xslm5pCdrxUf5L/+MOW8EuNuPKuC6mVHGtSaT5wTZkict73dV0ZBUuOr/xIWLAzRqok 8e30/gH02rfZYyXHyp2eKk8U5NZ1fRZwtC72nLHInN2U862Lni5z2yiUTMt2l5jU8LiZ Ogm1FJ+7d5kth+8rj3GzOrVMCqrYu/Ce/Wrq2shM101Q+8aONb7OM4euDK9H06bA4oI7 FQfF2hHjt4c+YiEz0NqWINZfKpg3/AeS3+eQFhC+/XcYGMX0tYzOQmp0NDYhJ2/lJC44 WNiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gUGdlGNoL1O7VEWU2AVMCRfeTyTWIlfCjjdVrD+3qL4=; b=Q035jeEybZhC/oOecTRN7YnMxOyxrJrQCf6hZRRw42ARe8ClcmdSOSmNnZElV6saPM 8F9w3X2sZVYwefLfhpf0PXbDAdV3SL1sh8JPAYAPr4YWjGeTmNDeRQ/OEiIhPOQvVJya V0OpWo2fKv/+3cS+cjHplwtCE8FZu5jppNJasO6nolXuMtQlHUPyh1nJcQYGtqlMGZGG c43I1JVp1KI6GAQk2X0vaOiNqhx1a7kNIAQSxolVxfjdKu8th0EV8UBhnb2O7bqSmwlG RIsz/+FuHLsLxBCQbFtjF5mME+S/+Df3DmYKl5u2Spc9q1dKdNKH+8wllxpZ7eqAogAk jYuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YNaTjEMP; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch11si568673edb.384.2020.12.03.01.25.26; Thu, 03 Dec 2020 01:25:49 -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=@google.com header.s=20161025 header.b=YNaTjEMP; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730075AbgLCJV1 (ORCPT + 99 others); Thu, 3 Dec 2020 04:21:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726003AbgLCJVZ (ORCPT ); Thu, 3 Dec 2020 04:21:25 -0500 Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 043E3C061A4D for ; Thu, 3 Dec 2020 01:20:39 -0800 (PST) Received: by mail-qk1-x731.google.com with SMTP id y18so1419711qki.11 for ; Thu, 03 Dec 2020 01:20:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gUGdlGNoL1O7VEWU2AVMCRfeTyTWIlfCjjdVrD+3qL4=; b=YNaTjEMPw2uqFxgiLDxwQKGIYKuGORcEAZ1Fg5A/QLnnulKDKTT7IavUVd1gXfPq9K f9vwuHFrKApqi6VDgVwJW8ODLyQBA+cjsdMF41LBebtSz701Dp/ioGGXIhWJ+2a4efmE /Nd/FIyt1KHhloJy2tIYci7CSz2ZGcnSG0KCYK6fxwYsOguxHQ+c+vlkdfSCnYrGyBJP +2LqqGv4Eu3+KXZkeoU52KWHszczFs7myUqQEIAzAVMxyNWX28YTsuwoM8edtSVQJ55m VUhUiNMtoXGZFU8zxsF+NNOitSl5dCKB8bzVhZ0WYIajLci0yoDRPv25srVH2FR4TSLi yaxQ== 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=gUGdlGNoL1O7VEWU2AVMCRfeTyTWIlfCjjdVrD+3qL4=; b=pNCyId1dir0XVO70IobryomvAo1rXJV8FPQpNZ/wmU6KdDq22yiLoe+8UuQx5FmPp+ ShZCeSP/gzeNhi1FytuMLEAnQdW7IbA9/Zj8cyZbMR0VCNXKHRtWvAIXocfkcJDsnyf0 T1r2ATDjcp7wnYyUI2r2ffXgbPwy3T1H3OF7CwU+VzvoVJlSNJBwSITCFTgp/oon2K9Q eHiL/4pLVYvfSMASceRSf2HwbHLfUZ0n9jdymQExHMK3wqJSdkr6mHQayPS4f6bYMpah JA4PLxVH6iCquZW8mpHxM0UvMl+3gSH8xUg3KfUzBCZwpd7/NN5ZPPC9s9QSOFxOpDhI fHpg== X-Gm-Message-State: AOAM532Gu+Odd16Svnc2EEjCBGW2UwO0zaRguosufmh3kMyoAS2EDb19 4D4VdEohrFchpVTkFmiVeXW7N9KNWUvJLjwqdmmE7LahYMI= X-Received: by 2002:a05:620a:12e4:: with SMTP id f4mr1945051qkl.265.1606987237985; Thu, 03 Dec 2020 01:20:37 -0800 (PST) MIME-Version: 1.0 References: <87f443cf-26c0-6302-edee-556045bca18a@ozlabs.ru> In-Reply-To: From: Dmitry Vyukov Date: Thu, 3 Dec 2020 10:20:26 +0100 Message-ID: Subject: Re: WARN_ON_ONCE To: Alexey Kardashevskiy Cc: syzkaller , Michael Ellerman , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 3, 2020 at 10:19 AM Dmitry Vyukov wrote: > > On Thu, Dec 3, 2020 at 10:10 AM Alexey Kardashevskiy wrote: > > > > Hi! > > > > Syzkaller triggered WARN_ON_ONCE at > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/tracepoint.c?h=v5.10-rc6#n266 > > > > > > === > > static int tracepoint_add_func(struct tracepoint *tp, > > struct tracepoint_func *func, int prio) > > { > > struct tracepoint_func *old, *tp_funcs; > > int ret; > > > > if (tp->regfunc && !static_key_enabled(&tp->key)) { > > ret = tp->regfunc(); > > if (ret < 0) > > return ret; > > } > > > > tp_funcs = rcu_dereference_protected(tp->funcs, > > lockdep_is_held(&tracepoints_mutex)); > > old = func_add(&tp_funcs, func, prio); > > if (IS_ERR(old)) { > > WARN_ON_ONCE(PTR_ERR(old) != -ENOMEM); > > return PTR_ERR(old); > > } > > > > === > > > > What is the common approach here? Syzkaller reacts on this as if it was > > a bug but WARN_ON_ONCE here seems intentional. Do we still push for > > removing such warnings? > > +LKML +LKML for real > Hi Alexey, > > Yes, see the guidelines here: > https://elixir.bootlin.com/linux/v5.10-rc6/source/include/asm-generic/bug.h#L67 > > Without a criteria for kernel but/not a kernel bug no kernel testing > is possible. > > But this may be a real bug as well. The code seems to assume that > ENOMEM is the only possible error here, which is not the case in > reality. > > > > Another example is: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/tracepoint.h?h=v5.10-rc6#n313 > > > > My VMs crash on dereferencing it_func_ptr which is easily fixable by: > > > > @@ -307,9 +307,11 @@ static inline struct tracepoint > > *tracepoint_ptr_deref(tracepoint_ptr_t *p) > > \ > > it_func_ptr = \ > > > > rcu_dereference_raw((&__tracepoint_##_name)->funcs); \ > > + if (it_func_ptr) \ > > do { \ > > it_func = (it_func_ptr)->func; \ > > __data = (it_func_ptr)->data; \ > > > > > > But - this only happens when OOM killer starts killing syzkaller > > processes (I do not give it much memory so it is quite artificial > > environment). Do we push these? > > > > Are there guidelines of some sort? Thanks, > > > > > > -- > > Alexey > > > > -- > > You received this message because you are subscribed to the Google Groups "syzkaller" group. > > To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller+unsubscribe@googlegroups.com. > > To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller/87f443cf-26c0-6302-edee-556045bca18a%40ozlabs.ru.