Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp831215rdg; Fri, 13 Oct 2023 02:24:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1KthqqfmbnlhqGSB3EABVGTS1kUKEsRPiXrmJC+cwErDbk22d6QqGNYsP3sc1wU9U2S3+ X-Received: by 2002:a05:6a20:4411:b0:149:97e4:8ae4 with SMTP id ce17-20020a056a20441100b0014997e48ae4mr37782546pzb.0.1697189081871; Fri, 13 Oct 2023 02:24:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697189081; cv=none; d=google.com; s=arc-20160816; b=tD343WkrBA/3TpIJlBO49044kqj5YeLRqirlDmI06vITkSRNOeggCbNX5MlOLhEyKw V7o6ZckyBJpUZUcoGmuDz0vIpDsw2Zjxhl5kRtklA/NB3JpXspi68w3M4xz2QUdWpRIV Rrw0yCSwndrnFI4P7ze9QVQYEuLp4oYcmEjXDhn253utyM3lb5uSa8HBMlzsGsXUYaYP yn1zw/eTPjybA4akB2GfmaYbANtoqhoo6TlbN8wkPTwFPsiwdFmBjqfCTIta8YH4ttfc /c714IJ4UAHyq0aYi9Y6EV7DscxSbVYMqMTHVgWTfO3EikDtWgAGo9c8sj/dlE1f3uQ4 g5fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:references :in-reply-to:subject:cc:to:from:date:mime-version:dkim-signature; bh=MSjCScCsKFgtwMRKhbDe2359MLCSh8mn86JPCUAjPmA=; fh=giMb+AZboeFnhi1zBICHRjUXXg8KfJ/j4JR6EU+RgTs=; b=m3ysZYZUR4xmVmib8jrdP2tcp2yCGD0QhwmdmmHAL1XetIwU2RzJpI21fWCH2Qj22o /bjAIHxERzrlTfCZKiJKzklgHm7qJbl766Ve2+wzCgKp9JyQRab8AysVK/GMAxNdRGI/ Q8ve86pw4zDrkOgX3wQrMnwhobkNHs8Xg0UKk0/1D1XEPaOiiJ8sNmlA4Uzebn6Uv6tE WbpDb/M1qoCJlASHV8CJm/6s2EP1FF19SaY2T5WiC3YehreD5kI/3FSK2UuZdJcHFOkF GLa1mnrzzmiuTzQTm0hbwUBes3im+hoOqL2IZ+iPvLN+m5F4cDP8dbJ3/bMWLQjxjW19 7iig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J35dmo33; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id p18-20020a637412000000b005702257f332si430148pgc.21.2023.10.13.02.24.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 02:24:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J35dmo33; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0A65A82F4E31; Fri, 13 Oct 2023 02:24:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230391AbjJMJYk (ORCPT + 52 others); Fri, 13 Oct 2023 05:24:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230345AbjJMJYj (ORCPT ); Fri, 13 Oct 2023 05:24:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8293595; Fri, 13 Oct 2023 02:24:36 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1927AC433C8; Fri, 13 Oct 2023 09:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697189076; bh=7IfoDnU1fNHDKyeP8m+8aGUt38qVXh15uI2Ni01PUrA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=J35dmo33SSEMIUEFMJ6d55ek49G6ch/FaskK0E7xAheo+6D2v0lxwalYJBHggAXOG X8sCeOpKcwJm0QMakhnMHdBX6dLKJmSKnkJOMH1dxLYKRA5MgiZgCeM8ADlL+n2H75 d+KF0wNS9ezgUd8zNUNONVRgvspLHoNmXUGUBsW3Po0PkuaX6k05s9B7r0/alDFT8b jwdC4Du7PMzsSWPs5zrSIbkdGG84ni5exmnHCSAgS2hSubA/72E3dxFnmY/RXCkkR7 xzJXKWSCdGIaK6+lnl6FYSEX/oZXGmAUnV+2i9+REfkcxzQDGsk9nfo7MfMYXiugGF 6msa+4Xkd4Rxw== MIME-Version: 1.0 Date: Fri, 13 Oct 2023 11:24:31 +0200 From: Michael Walle To: =?UTF-8?Q?Alexis_Lothor=C3=A9?= Cc: Claudiu Beznea , Kalle Valo , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Ajay Singh , stable@vger.kernel.org, heiko.thiery@gmail.com Subject: Re: [PATCH] wifi: wilc1000: use vmm_table as array in wilc struct In-Reply-To: <20231013-wilc1000_tx_oops-v1-1-3761beb9524d@bootlin.com> References: <20231013-wilc1000_tx_oops-v1-1-3761beb9524d@bootlin.com> Message-ID: X-Sender: mwalle@kernel.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 13 Oct 2023 02:24:41 -0700 (PDT) Hi, Am 2023-10-13 10:26, schrieb Alexis Lothoré: > From: Ajay Singh > > Enabling KASAN and running some iperf tests raises some memory issues > with > vmm_table: > > BUG: KASAN: slab-out-of-bounds in wilc_wlan_handle_txq+0x6ac/0xdb4 > Write of size 4 at addr c3a61540 by task wlan0-tx/95 > > KASAN detects that we are writing data beyond range allocated to > vmm_table. > There is indeed a mismatch between the size passed to allocator in > wilc_wlan_init, and the range of possible indexes used later: > allocation > size is missing a multiplication by sizeof(u32) Nice catch. > While at it, instead of simply multiplying the allocation size, do not > keep > dedicated dynamic allocation for vmm_table: define it as an array with > the > relevant size in wilc struct, which is already dynamically allocated > > Fixes: 40b717bfcefa ("wifi: wilc1000: fix DMA on stack objects") > Cc: stable@vger.kernel.org > Signed-off-by: Ajay Singh > Signed-off-by: Alexis Lothoré Looks good to me. But you'll change the alignment of the table, not sure if that matters for some DMA controllers. -michael