Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1073159ybn; Wed, 2 Oct 2019 10:24:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTy9146EmHwvPfudb4B614UJSbineglhKlU0RDmW5tJ5v8QFoYRMuCqaGx24+DM2fCnqdE X-Received: by 2002:a17:906:c82d:: with SMTP id dd13mr3964828ejb.169.1570037093874; Wed, 02 Oct 2019 10:24:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570037093; cv=none; d=google.com; s=arc-20160816; b=rLwAqiakmGDJb5qyReNODur5kUwGO5qXige3iVaD47xblWz0Y/9dbQHYP8K4mrvnTR TeRmslTfmHiXv684L9uyoWhbEBhJ7JNBSWPHEQ48H8R2HhITYOWok0GUpv3MHgFTu4m0 3wwV7pBub9eENILRIlngsSyJ9N+oI5QwNqsMSJjVK8YQRQ140mdozBbI3Cdgp0Nv+MSq 9vQl+eD3cixr8OtAUNCL3aDV9fYN7QLaVLaSb16K2GjKZQrAVJu8rM/Q9bfeU1Ye6L97 GKe9ub3EK+gLbdl14VgjlV89QKi2hmqIE6Q6ZQbnQ8mkYWZHsgQkpuaSmWW+XVRcyzKV p7Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:user-agent:cc:to :references:in-reply-to:from:subject:content-transfer-encoding :mime-version:dmarc-filter:dkim-signature:dkim-signature; bh=pR4iN+nbk3XlGKX5+m6c/ULE4MpK61Cry7dK2V1JtTs=; b=M+shYhTIonhjf8sP/PsCbujymyGpk6P6CdrCMussoPv/x5OGK+16so1RlDPU9wv7EL qVbfoiX0wWEvUZCnW1/lElAT69ZRDwd8ZPgxMTPbwWpTAmSpsabM/0PF3jam+qFpeBho RB9KEjHqOYL+/XBXj+Kk2GtnvN1ZGkrmwX6PzsyMV4hL7o9KHmtN7ijuNDB4qWlGRbzV M49zboC6r9j33HWq1stVc8Q2yGAnrvvO+v81IlpedPOjMDsE+Beyn9xl9xrd4LsZ7rWJ ybLxnDq2OlADMF57p36LHo/cpb09f9nizPbV28zUzLVkEJnUYyjToflpB8nfPuoVyiEn Gipw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=QyfFhXRO; dkim=pass header.i=@codeaurora.org header.s=default header.b=GXGifv1B; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pw28si11116357ejb.43.2019.10.02.10.24.28; Wed, 02 Oct 2019 10:24:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=QyfFhXRO; dkim=pass header.i=@codeaurora.org header.s=default header.b=GXGifv1B; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727418AbfJBRXb (ORCPT + 99 others); Wed, 2 Oct 2019 13:23:31 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:33938 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726669AbfJBRXb (ORCPT ); Wed, 2 Oct 2019 13:23:31 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4D7A36115A; Wed, 2 Oct 2019 17:23:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1570037010; bh=GIXrIjcKew/FoSFsIMkDMdHE5gnAVoURct4BSIsXqxc=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=QyfFhXROIYAyipZMl6DRHkPWNaRvNu8hED+sSGCLM4u+N/POb3L0rD0ZmPSCj7LBt C0tJqOMORy9oMRiXFcAzjmMq64oteeSNMezh3KYKYkO51aTu75OnzYNm3vIvmvmsIq P1vSenro7bgxNI1zkuHGpuBuAf91W1VI+5dZ6LwA= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MISSING_DATE,MISSING_MID,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1975E6085F; Wed, 2 Oct 2019 17:23:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1570037009; bh=GIXrIjcKew/FoSFsIMkDMdHE5gnAVoURct4BSIsXqxc=; h=Subject:From:In-Reply-To:References:To:Cc:From; b=GXGifv1B22O5usx+rXwUjtUTrYLLrR+Pw1UD7AcXsz3MMOWnZzNr1cTLcJKtRzm9I ULmBz8oTsdWLjtAsN+zQ+FpaN1X0BO/m2SYeh1Law3u8YrDsUOs9m1JzpMdw/YEf9A PvnxPsasPE3Njk/1mYK0YYjzPHQRUyQa4ZO9/g+k= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1975E6085F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] wil6210: check len before memcpy() calls From: Kalle Valo In-Reply-To: <20191001120823.29853-1-efremov@linux.com> References: <20191001120823.29853-1-efremov@linux.com> To: Denis Efremov Cc: linux-wireless@vger.kernel.org, Denis Efremov , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, wil6210@qti.qualcomm.com, Maya Erez , "David S. Miller" , stable@vger.kernel.org User-Agent: pwcli/0.0.0-git (https://github.com/kvalo/pwcli/) Python/2.7.12 Message-Id: <20191002172330.4D7A36115A@smtp.codeaurora.org> Date: Wed, 2 Oct 2019 17:23:29 +0000 (UTC) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Denis Efremov wrote: > memcpy() in wmi_set_ie() and wmi_update_ft_ies() is called with > src == NULL and len == 0. This is an undefined behavior. Fix it > by checking "ie_len > 0" before the memcpy() calls. > > As suggested by GCC documentation: > "The pointers passed to memmove (and similar functions in ) > must be non-null even when nbytes==0, so GCC can use that information > to remove the check after the memmove call." [1] > > [1] https://gcc.gnu.org/gcc-4.9/porting_to.html > > Cc: Maya Erez > Cc: Kalle Valo > Cc: "David S. Miller" > Cc: stable@vger.kernel.org > Signed-off-by: Denis Efremov > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 2c840676be8f wil6210: check len before memcpy() calls -- https://patchwork.kernel.org/patch/11168621/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches