Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3940971imm; Mon, 8 Oct 2018 12:02:48 -0700 (PDT) X-Google-Smtp-Source: ACcGV625pgXcZhxpM7E0agWZ6gzcBLPVy88+cu6wuiHHGCjoDzvPdtirPMbw8DYYCeKWjygJuF5O X-Received: by 2002:a63:7e50:: with SMTP id o16-v6mr22254999pgn.89.1539025368223; Mon, 08 Oct 2018 12:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539025368; cv=none; d=google.com; s=arc-20160816; b=PqkvJ3rmrna9LGMICiSP1REiO67yZ8jG5DjxTiCxmQYZRfXP/8ligSoQ+kyvK+4AVO fqplCc1/+aLL6Lki0hRvyBbljSloWUkI5HIdmS8/q5C8FyZQXX6E1hCzWj42GUKxa8hX F28DszHHyj9m0tJ2io8HxVrEOE+qwOJ7wjkHGbGllcx+5mQTEFMuOwR2J4bFJmOD05Ne tE/YmBpx903ydgfeXksSz25SutHE3imEui+eNOiLoYHVkihXamTy/OO2SdR5BlhFop0N EW0VEWSGvsDdgPdRlV/VlvOJGzLUaSNoZr+bZ+izrVn19tNj7YsLDFKjCMWUAC/PK2Vm DMRQ== 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=wVJbgBUHEhD58KCXIRL49pvb2tGKNevmIcQrMmhXikY=; b=TfXwm2WTWoArOR9AcBQ+Fy0ZI9/1bvUUum6J8AogoUIu7rcxZmgmgZ+3wtUkoi/QYA Fo9FptXxMvM0Fna/Z6D7O4+hLFkWBLI8zVSCfO3z4wxaHt0tBmrN+mezdRqa3kl2ycyM h2DcPuokmnYBiJFqbqeZvKI5idwix8oYaRm3nHrk+CLOyLy5DeGUDF8U6yDaVnJYr+xX sr+rplbA/SF1ecH0CGcquVcNNShA4qBDkgD/d6xEGDJWYASWwDqZIYBR7khqwOyLIrGI 9MJp6kP7/JT0qBFlEXSQLw8wcvLftq5/TBtFwk6p9kCMYBpY2IXAJng+Mkf/dCgJESfV sUmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PucrFrxt; 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 v3-v6si19853892pfd.125.2018.10.08.12.02.33; Mon, 08 Oct 2018 12:02:48 -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=PucrFrxt; 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 S1731631AbeJICBX (ORCPT + 99 others); Mon, 8 Oct 2018 22:01:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:50360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727452AbeJICBW (ORCPT ); Mon, 8 Oct 2018 22:01:22 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (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 0BB2D204FD; Mon, 8 Oct 2018 18:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024495; bh=D7fNSCHU86OMgINeOV0aOtJ0D2Znxoq5yHyu0ADfrcg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PucrFrxtRCS7yDpo86mlTMUYrEnDEBb0lGGXVJG/5H1sME1lz6whjVwttZOf7BhAh 0zUijuZXnh5Ccia0vP911IYDs3fg+Kw4IvOAHnlnDjUVRuc1jzSQYBg46/C6uyUhDf /NOJ6mxrU1emstotNlejt7a3zlRsfHRSewkar9+Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Johannes Berg , Sasha Levin Subject: [PATCH 4.18 058/168] cfg80211: fix a type issue in ieee80211_chandef_to_operating_class() Date: Mon, 8 Oct 2018 20:30:38 +0200 Message-Id: <20181008175622.259986752@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter [ Upstream commit 8442938c3a2177ba16043b3a935f2c78266ad399 ] The "chandef->center_freq1" variable is a u32 but "freq" is a u16 so we are truncating away the high bits. I noticed this bug because in commit 9cf0a0b4b64a ("cfg80211: Add support for 60GHz band channels 5 and 6") we made "freq <= 56160 + 2160 * 6" a valid requency when before it was only "freq <= 56160 + 2160 * 4" that was valid. It introduces a static checker warning: net/wireless/util.c:1571 ieee80211_chandef_to_operating_class() warn: always true condition '(freq <= 56160 + 2160 * 6) => (0-u16max <= 69120)' But really we probably shouldn't have been truncating the high bits away to begin with. Signed-off-by: Dan Carpenter Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/wireless/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -1374,7 +1374,7 @@ bool ieee80211_chandef_to_operating_clas u8 *op_class) { u8 vht_opclass; - u16 freq = chandef->center_freq1; + u32 freq = chandef->center_freq1; if (freq >= 2412 && freq <= 2472) { if (chandef->width > NL80211_CHAN_WIDTH_40)