Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3286505ybb; Tue, 31 Mar 2020 02:07:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtSdNYnSZxyqST9Hkz4pFHd8vyPxx0PpxvatT3srakYYFdHf/lqWz7/fB6agvogKMy9dZu7 X-Received: by 2002:a9d:3f62:: with SMTP id m89mr697912otc.20.1585645656568; Tue, 31 Mar 2020 02:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645656; cv=none; d=google.com; s=arc-20160816; b=BNc4O43SM+8j9v9umCQc42XxNQvFmIuGxo6FuYtn0IwFHr0nRH5fbRI8KaLxpLtrZb L8LwsEtbD6HbEaxx4FR+tuKoAX1o28TpCA3hqeqWfeU4I/gLBUEh2qT+X9zpftpJC1GI 6uyerInAK4GTWpt+PBu/NwhLxuLqFn1PkE0cF4Mc5ysj4MZQmT1IChsYoR7Q2zTI2t/i WCs8zaKz0th+9jnTEC6S/Unl4VLRdXKljnrRHQFI1mnlAhV4dWFLb14wrWCHiQnIoQE5 KqJYh6Q3D+wtcQdNWemoYzIB6qovrn/lDKJe+u+yFTKCsuWm5rCEg4JtueJuFYlKRjmj UpjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Spxj3q0QUH5wkpqLHWWe+ugkd/6ToBxAKlEwAy3dRcY=; b=BFHzVKLkKkO7EC1KMgu27NVlGy+wjuXHcVkArZSs6vYettze9t1u4Ab6vZp2VsPDvf Pk3dzp/dvYaX0VnFHuTJn77P+3GNuNCOuzqJ9ju1l30fRy2LyyISXJoqo1worscoQVyX NlzHuQUZyDJ5fP7SyRS0WdBIoBDdN0bsm+zGPKQACK+ADBhoCwQlm2ejZjltDsx2XOfo 2xBhmEUproH0sHu4yiQoEJ/0V5eetk3MAqQyMj9S2j2iPUlVxDfnq6Py9VGj1PSeJYc8 +hNO0fJMmI2KlSOYjAdgqC/6lktA4RvyPnd8Q+mmvgEq9FCc9YPcJk48LOOIUDPmT7MQ Os/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=or2KBLcn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 h81si6883836oif.20.2020.03.31.02.07.24; Tue, 31 Mar 2020 02:07:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=or2KBLcn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731055AbgCaJHK (ORCPT + 99 others); Tue, 31 Mar 2020 05:07:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:48662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731181AbgCaJHB (ORCPT ); Tue, 31 Mar 2020 05:07:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D341D20675; Tue, 31 Mar 2020 09:07:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645621; bh=qQwBDFzSp4aOGOwQwSFV8JxU0PnUe5HGBU7fJ4SIY5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=or2KBLcn1wUikRUey5gq36nLtUDWlwwTnSEE5uHvcK+LX5c83pyikTRsQRE+G38Ru EYRYSlamnAxKfr8lbsaYRlGcE2FZaS9Ds2CPT33q1oQLX9KbQ/miERJSJ0ZPrOBNdm n2iRQViA9V773NlfoADuUP6R4aNX9OrFZ8CpLIaA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg Subject: [PATCH 5.5 108/170] nl80211: fix NL80211_ATTR_CHANNEL_WIDTH attribute type Date: Tue, 31 Mar 2020 10:58:42 +0200 Message-Id: <20200331085435.660024649@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg commit 0016d3201753b59f3ae84b868fe66c86ad256f19 upstream. The new opmode notification used this attribute with a u8, when it's documented as a u32 and indeed used in userspace as such, it just happens to work on little-endian systems since userspace isn't doing any strict size validation, and the u8 goes into the lower byte. Fix this. Cc: stable@vger.kernel.org Fixes: 466b9936bf93 ("cfg80211: Add support to notify station's opmode change to userspace") Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20200325090531.be124f0a11c7.Iedbf4e197a85471ebd729b186d5365c0343bf7a8@changeid Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/wireless/nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -16416,7 +16416,7 @@ void cfg80211_sta_opmode_change_notify(s goto nla_put_failure; if ((sta_opmode->changed & STA_OPMODE_MAX_BW_CHANGED) && - nla_put_u8(msg, NL80211_ATTR_CHANNEL_WIDTH, sta_opmode->bw)) + nla_put_u32(msg, NL80211_ATTR_CHANNEL_WIDTH, sta_opmode->bw)) goto nla_put_failure; if ((sta_opmode->changed & STA_OPMODE_N_SS_CHANGED) &&