Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4811438pxj; Tue, 22 Jun 2021 08:31:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi/AWrQv1r415IvuFa4BcKXoq5snvrQrch2PcnlAn4g7D7QWwPL3W1CCVcg4dGVcPa9DeK X-Received: by 2002:a05:6602:14cd:: with SMTP id b13mr3370799iow.193.1624375862897; Tue, 22 Jun 2021 08:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624375862; cv=none; d=google.com; s=arc-20160816; b=pCQIeCOw5UGjrCVrTxgEDbYhcvgw4qg8mrCt5XbNntESFW8ILrFtmQaa8HMMTJeLv2 PJG2FLTHh9yjoK5mgoXX42T2AFNTgdmki9abxidwZhGpCyFL0rxXPrL3wCs8bzS7yTeb kHVA43yXRHpxdS1n7nYnytT0cbj9Z2bF63DH9zTAjBdq68JTHCx+F2u0rd5UQFHrAHW5 gouYPs3wBDF6pJHADyi27tg5l891/b4BHr7DAcLKN9zDYkMQlQu48JV/+mL7Tx5KpniR 5iq0/1ldaFnn3FVtfONLMpATKTIj4Uno4kJ1083iC8lH9sV6oT0BmIfdff6AB+dm5g7i o4kw== 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 :dmarc-filter:sender:dkim-signature; bh=z7NDcu8cPjZwCK7QqOyl43gPgmkxXEZyQgRW5JNHxRI=; b=Cw1nFh4NHmc7IrA4t/q8cePQBsTd50a1f1zlMyA0xJfguIgyok1sbYO5mqvB6iy6IB fJ8ZwaQEDts/wxNyFtFzisqVK+KrqfQZnitbnFsIotOrTFGcX5MnLVfsX2qsNdcBJk7T C/TLeh57QSOIzMfMIG14rIuUSCOe18d52uVXYz1KfKSTBQqxiFWExcfChdD5jFQph+uP Nyar5/r263j/YOd0O18QsukYLsweFdqjGj4nO/74soiGjqU2Gh0JX7ZbTeBb1LbtRUNN Y3otCqjQAjeKoJUSA2iLqQ3F3NRjgD35xVeWvA62OJmCmfgDgCIkyDDSuyrtiRw14+IO XbWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=ZWdsAGZO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p8si20543068ilh.98.2021.06.22.08.30.48; Tue, 22 Jun 2021 08:31:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@mg.codeaurora.org header.s=smtp header.b=ZWdsAGZO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232381AbhFVPcO (ORCPT + 99 others); Tue, 22 Jun 2021 11:32:14 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:23759 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232303AbhFVPbp (ORCPT ); Tue, 22 Jun 2021 11:31:45 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1624375769; h=Date: Message-Id: Cc: To: References: In-Reply-To: From: Subject: Content-Transfer-Encoding: MIME-Version: Content-Type: Sender; bh=z7NDcu8cPjZwCK7QqOyl43gPgmkxXEZyQgRW5JNHxRI=; b=ZWdsAGZO76F200Zw4SC+VJR6dOOaE6u2Bp65BoTL0I4yETV/0yqTdct2Ei+g5UnaCVLgp4Bu KCqXU0TCqJvAZ9jWkWlTLuEDXh6t8gPgZM3ccphekO2dCHjBaeneKBbqQyCxSQb9gQUK98cR /FAsKhQvjkJLwVYyoY0uFUoG/ng= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-east-1.postgun.com with SMTP id 60d201a31200320241f5756c (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 22 Jun 2021 15:28:35 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id AAC31C43148; Tue, 22 Jun 2021 15:28:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,BAYES_00, MISSING_DATE,MISSING_MID,SPF_FAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from tykki.adurom.net (tynnyri.adurom.net [51.15.11.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id E4206C43144; Tue, 22 Jun 2021 15:28:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E4206C43144 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=kvalo@codeaurora.org Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] wcn36xx: Avoid memset() beyond end of struct field From: Kalle Valo In-Reply-To: <20210617171058.3410494-1-keescook@chromium.org> References: <20210617171058.3410494-1-keescook@chromium.org> To: Kees Cook Cc: Kees Cook , "David S. Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-hardening@vger.kernel.org User-Agent: pwcli/0.1.0-git (https://github.com/kvalo/pwcli/) Python/3.7.3 Message-Id: <20210622152834.AAC31C43148@smtp.codeaurora.org> Date: Tue, 22 Jun 2021 15:28:34 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kees Cook wrote: > In preparation for FORTIFY_SOURCE performing compile-time and run-time > field bounds checking for memset(), avoid intentionally writing across > neighboring array fields. > > Instead of writing past the end of the header to reach the rest of > the body, replace the redundant function with existing macro to wipe > struct contents and set field values. Additionally adjusts macro to add > missing parens. > > Signed-off-by: Kees Cook > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. d3a1a18ab034 wcn36xx: Avoid memset() beyond end of struct field -- https://patchwork.kernel.org/project/linux-wireless/patch/20210617171058.3410494-1-keescook@chromium.org/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches