From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25FE6C4332F for ; Wed, 19 Oct 2022 12:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232529AbiJSMPu (ORCPT ); Wed, 19 Oct 2022 08:15:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232333AbiJSMOe (ORCPT ); Wed, 19 Oct 2022 08:14:34 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6395C15381B for ; Wed, 19 Oct 2022 04:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666180184; 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=HfKaXAM67nrWxBo+o2Le2Vo+rZyeTr5pYYlDrowdGww=; b=CccAIOVsrKqEtSI6i8PdRM+GTP1xYGyPYX6Hz/PMAfHJPgRwQNq+9hxgRkU+THcJKAOWV2 7SdOtJhWw7hDi7e39bBJNR0A98YYWktRdjUBn2Imx/kpOF1NnX2eZQgTk6+UutltAcAMon ScYukKvXHxcJywOMn1XpR24fDuknR9Y= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-547-oHTTxxJFNwG3FNd1n07DEA-1; Wed, 19 Oct 2022 07:49:42 -0400 X-MC-Unique: oHTTxxJFNwG3FNd1n07DEA-1 Received: by mail-wm1-f71.google.com with SMTP id i5-20020a1c3b05000000b003c47c8569easo12847688wma.1 for ; Wed, 19 Oct 2022 04:49:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HfKaXAM67nrWxBo+o2Le2Vo+rZyeTr5pYYlDrowdGww=; b=yUvkZTIWFxqaUFICNkKI/UVc7PFzURN2bT/lzDyEICqfCeCSsaN5qhykPT3maRYw2r 3CQ8CgQZGgUA++xp5MQMzNaq4jNkxmbTChvh6tQn0rVRady1blK6CJOAtO6EAv7E2Zop pXbB27zSxy/vjILtwNw8HCMV9GTbP+1XvptNv9FXKFjFjmPMFjGDRdXosc6YzGR0SXO+ mojxAy4S2zRoDN++Tz4IRKegdqW1qXjAQ85ExitYgxnGIYEbmf3eJoP0MGi4mB97tnrw cct/V+/73Vsjt1edd3y4nu6mwcvnOdRSaquWnuPZ5fFqctehRdSCrMU8KiYRW8/rnbUY 37dQ== X-Gm-Message-State: ACrzQf0t52OeSQYrEaSnLkhwmoNK/L/0jpFuBxLpsNMMp7/2Ozejez/E WY6lOTSF5dYGkbyG8bC348HzFAhp7UbrIsBlSShdM2Dndao78LhUUCXHL2O391o9+NtG5lWR3Go 551d7BQ4woBfUgGGjnXjKgYn3 X-Received: by 2002:a5d:598d:0:b0:231:2304:3a5a with SMTP id n13-20020a5d598d000000b0023123043a5amr4931471wri.434.1666180181690; Wed, 19 Oct 2022 04:49:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4naKoI+49panSp4JLVPLoygdy3bA51aQUk0/netD4C5WEddCLKNJIoIp5COV9GgG6ccsYJeA== X-Received: by 2002:a5d:598d:0:b0:231:2304:3a5a with SMTP id n13-20020a5d598d000000b0023123043a5amr4931455wri.434.1666180181415; Wed, 19 Oct 2022 04:49:41 -0700 (PDT) Received: from redhat.com ([2.54.191.184]) by smtp.gmail.com with ESMTPSA id z10-20020a05600c0a0a00b003a2f2bb72d5sm30867129wmp.45.2022.10.19.04.49.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 04:49:40 -0700 (PDT) Date: Wed, 19 Oct 2022 07:49:35 -0400 From: "Michael S. Tsirkin" To: Yury Norov Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Alexander Gordeev , Borislav Petkov , Eric Dumazet , Guo Ren , Jakub Kicinski , Kuniyuki Iwashima , Linus Torvalds , Menglong Dong , Paolo Abeni , Petr Machata , Sebastian Andrzej Siewior , andriy.shevchenko@linux.intel.com, caraitto@google.com, jonolson@google.com, willemb@google.com, "David S .Miller" , Andrew Jones , amritha.nambiar@intel.com, linux@rasmusvillemoes.dk Subject: Re: [PATCH] Revert "net: fix cpu_max_bits_warn() usage in netif_attrmask_next{,_and}" Message-ID: <20221019074843-mutt-send-email-mst@kernel.org> References: <20221017030947.1295426-1-yury.norov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221017030947.1295426-1-yury.norov@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 16, 2022 at 08:09:47PM -0700, Yury Norov wrote: > This reverts commit 854701ba4c39afae2362ba19a580c461cb183e4f. > > The reverted commit makes netif_attr_test_online() network subsystems > generating warnings, and it breaks syzkaller testing. > > https://syzkaller.appspot.com/bug?extid=9abe5ecc348676215427 > > Signed-off-by: Yury Norov Fixes: 854701ba4c39 ("net: fix cpu_max_bits_warn() usage in netif_attrmask_next{,_and}") Acked-by: Michael S. Tsirkin > --- > include/linux/netdevice.h | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h > index a36edb0ec199..eddf8ee270e7 100644 > --- a/include/linux/netdevice.h > +++ b/include/linux/netdevice.h > @@ -3663,8 +3663,9 @@ static inline bool netif_attr_test_online(unsigned long j, > static inline unsigned int netif_attrmask_next(int n, const unsigned long *srcp, > unsigned int nr_bits) > { > - /* n is a prior cpu */ > - cpu_max_bits_warn(n + 1, nr_bits); > + /* -1 is a legal arg here. */ > + if (n != -1) > + cpu_max_bits_warn(n, nr_bits); > > if (srcp) > return find_next_bit(srcp, nr_bits, n + 1); > @@ -3685,8 +3686,9 @@ static inline int netif_attrmask_next_and(int n, const unsigned long *src1p, > const unsigned long *src2p, > unsigned int nr_bits) > { > - /* n is a prior cpu */ > - cpu_max_bits_warn(n + 1, nr_bits); > + /* -1 is a legal arg here. */ > + if (n != -1) > + cpu_max_bits_warn(n, nr_bits); > > if (src1p && src2p) > return find_next_and_bit(src1p, src2p, nr_bits, n + 1); > -- > 2.34.1