Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1680940rwe; Fri, 2 Sep 2022 01:47:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR5nqPkaZ4J+XUA1GosoQQykrDkYo2G+WBzzwp/uM78Gifqj1PcmVLc6y5CK776nEaFW41cv X-Received: by 2002:aa7:cdc5:0:b0:447:91ef:a3cd with SMTP id h5-20020aa7cdc5000000b0044791efa3cdmr30966855edw.168.1662108430437; Fri, 02 Sep 2022 01:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662108430; cv=none; d=google.com; s=arc-20160816; b=NehuV3CTPCZWwU6yOg9WehRwdvQhMetmOTdeoRZa2QV9gioQ3K0snTXpheGUYwWvqP 5ptaOySG0Eh/9xSoPxkEELk/FgiRCK4PKU4GUfXheYIMPLR0TisuGCm0S3BdFaOr91pU iYj7yV0jWKvLLuTqomZfAbi5mA+WxfEmbx/W4VwaApGyY0qCU11rUONUNM7hONGPIwfM YH1mkfRFQQer5jZtZqeMu7dc1wvXJsiliv1ekr/ns/u1dkoLcS2c4BWiB/FlTpcqIy/D fKYP4nhpJwDVkvoncQX6t3EYMloqxDYjHf1obFhLfBwkSvLRVObGe52dU2grTTulKdJl ssaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:user-agent:cc:to:references :in-reply-to:from:subject:content-transfer-encoding:mime-version :dkim-signature; bh=N2Lx0W5JCUhWXiFDPS1APPvkuyw7W0II6myNei9QsrQ=; b=rdSk9erBGhKi0veVU/hSmXHARvfvgGVIJnNnSjLmkUKtsJJFaOa7UwFVHPS7PzkSoI izpHevImDncY6PIwyJ342sdP0akNrbs7wMhokF/wk5uKEEBl90ZcdFjH2Pb5Q980rSHl JuhmcUYb9tU8ZVCIZrKXnhkuSsEf7Bgx2S0VP54a/1tNK524JIz4Mgf/RotW/8zU55U3 XGWPNOEQoh8zCdh2yAmsfs/gLYfJwr28GN9lmBce2VD1K3z1AuPJz5aPR8htC548c76K wXEmOXVjptQZ0QNLBE0OPAj4wGEyo9K6/K7hv8yKZGxcjFWT31/iA/enBJQxYhXg7yza TZow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N2+4+n3c; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z13-20020a05640240cd00b00448aec620e0si1544463edb.17.2022.09.02.01.46.53; Fri, 02 Sep 2022 01:47:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N2+4+n3c; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235916AbiIBIqY (ORCPT + 64 others); Fri, 2 Sep 2022 04:46:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235948AbiIBIpz (ORCPT ); Fri, 2 Sep 2022 04:45:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C939A47E; Fri, 2 Sep 2022 01:44:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2A15E62129; Fri, 2 Sep 2022 08:44:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A800DC433D6; Fri, 2 Sep 2022 08:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662108291; bh=pru3KgiHjYBk/40M6hUqyO6pVQW0ylbsFZNCWGwZ2mA=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=N2+4+n3cQsK2vZ2QCYsgDGpraYd1AmZ4N7tEBP0TC2B/sdTPn9hjO4E/BAhNXxXFm 5+MeGEt43JdvlGFMMvXOIAgP9Ouqqn6K49l3ga47XVTLZb2emJIxVI8boYzhXbp+Q7 QPMPhusWG2kqfz7TQ5RodVu+oyvY9Xh3m5UyycjuFdbnhdA1SBjfh2Oe9pYx4CAxpA fmQREWUIdCm49oMAYdW4oOZoyJJx6e9vpJjZ3zyVVN3IGTjhJedWcuppkQI+cq0Kb+ wV4xCMotL/o8pcefCFo6JU9ywrK0eAk8UQO6KwN9znX45j/9aZfQafhLtRyoYhsd4n r9zu188btrF8w== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: wifi: wfx: prevent underflow in wfx_send_pds() From: Kalle Valo In-Reply-To: References: To: Dan Carpenter Cc: =?iso-8859-1?q?J=E9r=F4me?= Pouiller , linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.7.3 Message-ID: <166210828663.24345.249472656523771487.kvalo@kernel.org> Date: Fri, 2 Sep 2022 08:44:50 +0000 (UTC) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Dan Carpenter wrote: > This does a "chunk_len - 4" subtraction later when it calls: > > ret = wfx_hif_configuration(wdev, buf + 4, chunk_len - 4); > > so check for "chunk_len" is less than 4. > > Fixes: dcbecb497908 ("staging: wfx: allow new PDS format") > Signed-off-by: Dan Carpenter > Reviewed-by: Jérôme Pouiller Patch applied to wireless-next.git, thanks. f97c81f5b7f8 wifi: wfx: prevent underflow in wfx_send_pds() -- https://patchwork.kernel.org/project/linux-wireless/patch/Yv8eX7Xv2ubUOvW7@kili/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches