Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3866533pxb; Tue, 19 Apr 2022 11:22:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5iXwa+aOcEdGReujUnRBQn/WwvPX4DW7pkLW5SJ2UnrF/72iKyOrLjfNzqQBWJwtsi3aX X-Received: by 2002:a17:906:99c5:b0:6df:8215:4ccd with SMTP id s5-20020a17090699c500b006df82154ccdmr14725900ejn.684.1650392560758; Tue, 19 Apr 2022 11:22:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650392560; cv=none; d=google.com; s=arc-20160816; b=TZ5evUfDX0EhmLbrwf36/nGHMTT/5kkCIiQK41Si6vptahW/gR4s5+Vz0Ns4z38B4M hPF3zoVup15qfsjB1SklWkGN5IYZSjdRy4ggJiVfMV7/H/lEujhymUei7hujHro+72wu zn9Qn4yFhJII/t+OF/SJ+cV1NwU3BtT1NoNfZcJNTB36niCZOCEIfDXI3J2toYxJpA4B 2jPObynqpBGURVpdEtcaHy3aKxFew2Oj7kpKmKl8L2CwuqlcF+bK/0+nqg+jZL2anzCY aXXgP9GtpeT0ZVpGPPdpsYq+eePQlp0sWAwhqC+/17UoNDXXFUk4OpkVntHAY3068aqm 8NYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7SM/vg8Zn1DeyfKG5+pRv2bb9WpyIhTG9+QZd6UWt3M=; b=TD6g615W5nUf2GRJ9YqiImL7eF1k9SlpMKe6nJfSmxXvRETJ2eYvNkCYZh3joSUaoE pZiWvaejD1ybIh057LUTD5XrTN88x9KxO28TyWIwuARoSm6i5mjtrXLi62vBmjMQU2LR KKzV8aSQ1XWMzOhX6Skes7kvj4I5uLF35ZwLWLHn4qSHNo3ICethoqKMOTbIwYB7WLBQ l4buhvDDtEDvHInS0GFW3touXQ9ReeyEZLjmXw5zi2kLh+Z4t8EQJHLMT6X52btEDoq9 nIPFPCNkrlJgis5h9I+HCll1mwYGl6zQbplvJoYknHA/Cuxdbjp4m9YzXGxIvn9snwxh r7tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n9STqwmK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v23-20020aa7d9d7000000b0041d8b74dd12si8332897eds.600.2022.04.19.11.22.16; Tue, 19 Apr 2022 11:22:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=n9STqwmK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238977AbiDRM1g (ORCPT + 99 others); Mon, 18 Apr 2022 08:27:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238780AbiDRM0O (ORCPT ); Mon, 18 Apr 2022 08:26:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A967EE03D; Mon, 18 Apr 2022 05:20:10 -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 529BDB80ED6; Mon, 18 Apr 2022 12:20:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A73D0C385A1; Mon, 18 Apr 2022 12:20:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650284408; bh=O0gvCtnZhBJtodvmay0VSXZVJisqZkVG+Lo2qywGmHQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n9STqwmKj4+OFb548ZLrr46NlOrgKlWcKzGO9nzXFuFfwyaIL/qm5+FE4vUh1NbfY PtrjsVbJfs6O7Krj3de6SkMtmLZwQ+C++vFMd1JuCseIqMiclJeqU9UVhl0UVQ4b1K txJER9PTfVnlo9IlD4B/uZ3JCBmvimR2fDaEMCiI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Greear , Johannes Berg , Sasha Levin Subject: [PATCH 5.17 088/219] mac80211: fix ht_capa printout in debugfs Date: Mon, 18 Apr 2022 14:10:57 +0200 Message-Id: <20220418121208.976039363@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121203.462784814@linuxfoundation.org> References: <20220418121203.462784814@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 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-kernel@vger.kernel.org From: Ben Greear [ Upstream commit fb4bccd863ccccd36ad000601856609e259a1859 ] Don't use sizeof(pointer) when calculating scnprintf offset. Fixes: 01f84f0ed3b4 ("mac80211: reduce stack usage in debugfs") Signed-off-by: Ben Greear Link: https://lore.kernel.org/r/20220406175659.20611-1-greearb@candelatech.com [correct the Fixes tag] Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/debugfs_sta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index 9479f2787ea7..88d9cc945a21 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c @@ -441,7 +441,7 @@ static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf, #define PRINT_HT_CAP(_cond, _str) \ do { \ if (_cond) \ - p += scnprintf(p, sizeof(buf)+buf-p, "\t" _str "\n"); \ + p += scnprintf(p, bufsz + buf - p, "\t" _str "\n"); \ } while (0) char *buf, *p; int i; -- 2.35.1