Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3867843pxj; Tue, 15 Jun 2021 10:19:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfK1+JkVNi7FcfrnDvAkTcTCXyJ86NUqgbE6YoDmpng0texYTYMQN6TO6TX6gu8L7H7VuI X-Received: by 2002:a17:907:2d88:: with SMTP id gt8mr615645ejc.449.1623777544634; Tue, 15 Jun 2021 10:19:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623777544; cv=none; d=google.com; s=arc-20160816; b=XYoh1HN8w9cIieB52v5+nPpqnIdVQFQscNgJwgHGMds2qsdBkTCHqerxKbDXUsX5au S6A05EdbfSApgJvmWOmV2LkcX+i4W33jxBNhoYBhTkjv+7vWwB1ZYaOO5+XWEJ3JBJbG tp184OZTX86tXku+etWZdukAlo6VYrSXvbzQ0clbRF84V8d0M5Oeg7U4rr3XSlWdBeWb cqsYqWD80/+3xiiFmjP7Oqq3juBltX7JdzoJNzbSmIHT6OyoboPRxKRWttzFEspOH2Q4 QBHV3pHptN+XU/0hrb5PyXjXeymDRQj7cAHSle2M0Fx59BsrlRH1MandmZUsM+HZltm/ 9TdQ== 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=RwNx+DWFt6NNdGSxWQzHJjFVZVQ/XJYkZRUEXCZIYHk=; b=Op+1cuq18RUSKvugRJnK3HKzFl/gdGKJEiW5rLOtYbhEWL+1fcwQktnlWBOY9NCh0g 62BnA8r9/AQcaYF475TQ+HRAh9n+JNJyCUc0Lq/NeEHIptD0f73t1e19kI3gUpgdJhNW wADQxupwK2UDOWTpDSj7XzDxPP/HNGAUdCoITHHMiS4Ejctdv80n64yd0xy9f1ihKbe0 yEouFkcQaKqKZouH++cyDKp6CK6ceCQRNEdYi0VS0i+z8gXohEwX4/mWCyLXVUgqLGwH SotQFxG1HIrWHi9x/gHXULSUFKGsTkz2nSpJXhOwy6ROs9F2hSUGhEADfnVoBxk5XZTe s6/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RUZvQpey; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bd17si15029973edb.476.2021.06.15.10.18.36; Tue, 15 Jun 2021 10:19:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@chromium.org header.s=google header.b=RUZvQpey; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229898AbhFORUI (ORCPT + 99 others); Tue, 15 Jun 2021 13:20:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbhFORUH (ORCPT ); Tue, 15 Jun 2021 13:20:07 -0400 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C7F8C061574 for ; Tue, 15 Jun 2021 10:18:02 -0700 (PDT) Received: by mail-oi1-x231.google.com with SMTP id h9so18945539oih.4 for ; Tue, 15 Jun 2021 10:18:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RwNx+DWFt6NNdGSxWQzHJjFVZVQ/XJYkZRUEXCZIYHk=; b=RUZvQpey2LpbHYX4a5zfm5XX9WX7G4+MwqUTOgxNJY7fHoY+kPL4EGAaupGCJZM/M2 vJ7j3+a0kBJUhvhbwm30UR/YYRyZNblFjqZAnSDDCZLIUDYWp4M0cnQ76tuMiizIzc4d JjfykEYKErjeE9KQChscveDKf6mhNXHy4hu0c= 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=RwNx+DWFt6NNdGSxWQzHJjFVZVQ/XJYkZRUEXCZIYHk=; b=BFxtMvnVA7UpIzhbKQaTXBNX8Np0kk3nRKbPNePCvFWdSwrUdmfXNey623jrCc+oAT 78d19kov+oPZU8F90OwoOVl+aadi9GLMRpzPyqymQClv9zBlo4NxAz0hOPBtT1iGZ6Ut SSYIS7gaINbumv+idr7h3sLgsEHieIvPLaXkJECJMShLvCMC1WvmGUeejywirgtgMiaS hpnhNaHbAYOP0PXNk35rThflg5+7XfADOPx8JWoWsyNy3W6v2KD8dWKsPa8OkemEYoXq 99neDbTvUh+s8PFVp1IREy4gFT3K2FjNDFN1Zl7/GD6XR5ByrwgPXHQy1Ws9WmXe2ByE idaA== X-Gm-Message-State: AOAM530xZothrK3s5aTDUQQrAiB476iYC6Zvio2WgZZE33p+I7GhE437 BYn/df1zWPDTxORdiKeymU91Oe+nf2wfUw== X-Received: by 2002:a05:6808:6d1:: with SMTP id m17mr3879498oih.34.1623777481287; Tue, 15 Jun 2021 10:18:01 -0700 (PDT) Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com. [209.85.210.45]) by smtp.gmail.com with ESMTPSA id n7sm3879268oom.37.2021.06.15.10.18.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Jun 2021 10:18:00 -0700 (PDT) Received: by mail-ot1-f45.google.com with SMTP id i12-20020a05683033ecb02903346fa0f74dso15011379otu.10 for ; Tue, 15 Jun 2021 10:18:00 -0700 (PDT) X-Received: by 2002:a9d:5f11:: with SMTP id f17mr240707oti.229.1623777479566; Tue, 15 Jun 2021 10:17:59 -0700 (PDT) MIME-Version: 1.0 References: <20210521024834.8354-1-yguoaz@cse.ust.hk> <20210615133102.7E774C43145@smtp.codeaurora.org> In-Reply-To: <20210615133102.7E774C43145@smtp.codeaurora.org> From: Brian Norris Date: Tue, 15 Jun 2021 10:17:47 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mwifiex: protect against divide by zero in mwifiex_set_ibss_params To: Kalle Valo Cc: Yiyuan GUO , linux-wireless , amit karwar , Ganapathi Bhat , Sharvari Harisangam , Xinming Hu , Yiyuan GUO Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, Jun 15, 2021 at 6:31 AM Kalle Valo wrote: > > Yiyuan GUO wrote: > > > In function mwifiex_set_ibss_params, the variable index may remain > > zero if it is never altered inside the loop, leading to a potential > > divide by zero problem. > > > > Signed-off-by: Yiyuan GUO > > Brian explains in the report why the code is ok: > https://bugzilla.kernel.org/show_bug.cgi?id=212993#c1 Ah, forgot there was a patch for this too. FWIW, it's probably ok to submit such a patch, if just for safety's sake (future refactoring?). I just didn't figure it deserved an open "bug" entry, when it's clearly not one. > Patch set to Rejected. That's fine with me. Thanks, Brian