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 A972CECAAD5 for ; Mon, 29 Aug 2022 16:03:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbiH2QDu (ORCPT ); Mon, 29 Aug 2022 12:03:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230008AbiH2QDs (ORCPT ); Mon, 29 Aug 2022 12:03:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE4C37F10F; Mon, 29 Aug 2022 09:03:46 -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 ams.source.kernel.org (Postfix) with ESMTPS id 66C49B81103; Mon, 29 Aug 2022 16:03:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17BB3C433D6; Mon, 29 Aug 2022 16:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661789024; bh=0AOW/zs6zHy61FY4GddWkzH7pYiahcVeqYaXS5onjsY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ZsTSWJO+IcoP4tUURggvMAy0hJcILNceeFhiIsbyeNoEEF8AUOHP5YZBo4Tq9gigy f/kl17jX+MArnENqg1xaaGY9aqoFayW1IRIhJmMG/g7jNqPCETQzUApsVvKe0/Sbv5 tbWh8ptYKD1/NlOO0+ILXbSDePqH8Fjsa1ue/6aXi0MiT/yNkSxLZ1hbFe1ek0K5tT Fs21iw5WFiXsGEuWnaZUEFgn4ayuQdm4UFqJ1mMIqlaV4r2bjHFCC9eYDJLaDYNbbw TqxBJGfvWCwsLfUj/GOUbC3FSauNXVdHrnBxBniaMaGJLUr8ltd1ojXZYdjoVA5yqu eQnXNxmiOU+jQ== From: Kalle Valo To: =?utf-8?B?SsOpcsO0bWU=?= Pouiller Cc: Dan Carpenter , linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] wfx: prevent underflow in wfx_send_pds() References: <2729343.a3EqFhE7eK@pc-42> Date: Mon, 29 Aug 2022 19:03:38 +0300 In-Reply-To: <2729343.a3EqFhE7eK@pc-42> (=?utf-8?B?IkrDqXLDtG1l?= Pouiller"'s message of "Mon, 22 Aug 2022 14:20:53 +0200") Message-ID: <87a67ndokl.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org J=C3=A9r=C3=B4me Pouiller writes: > On Friday 19 August 2022 07:23:43 CEST Dan Carpenter wrote: >> This does a "chunk_len - 4" subtraction later when it calls: >>=20 >> ret =3D wfx_hif_configuration(wdev, buf + 4, chunk_len - 4); >>=20 >> so check for "chunk_len" is less than 4. > > This patch also ensures that buf[4] won't overflow during: > > if (buf[4] !=3D '{' || buf[chunk_len - 1] !=3D '}') > dev_warn(wdev->dev, "PDS:%d: unexpected content\n", chunk_num); > >> Fixes: dcbecb497908 ("staging: wfx: allow new PDS format") >> Signed-off-by: Dan Carpenter > > Reviewed-by: J=C3=A9r=C3=B4me Pouiller BTW J=C3=A9r=C3=B4me, as you are the driver maintainer you can use Acked-by. --=20 https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatc= hes