Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3942824imm; Mon, 8 Oct 2018 12:04:18 -0700 (PDT) X-Google-Smtp-Source: ACcGV60zSMOxuL4I7FCTgSDPYlj7uhLYtxmXesocgRjG9nFeMevcLdyiCvBLXQbjj/ThUL1+eC26 X-Received: by 2002:a63:4c23:: with SMTP id z35-v6mr9614517pga.312.1539025458896; Mon, 08 Oct 2018 12:04:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539025458; cv=none; d=google.com; s=arc-20160816; b=X1fdo+CbNidbJNSbZydTH6Q5kiriW/5+mn2u0v3B9fs1pYDj6JdEnBC3ozph8+NCla 6B/Lh1IGMNHS/JK44TwoECQhqADrW67WUIC6Z65icZ7ZzkZ+7dYXjamhLS9CX6IR+AZ8 Ea5sjVigWYNeTRWGMGYzavQvRrZ29iks96v6vDcGXAdldY7z32QkOhLnH5FPoBCoQLnA +n0MNv0xx/RGjR+zZbDzkTK/VWL0ySPyQ7Bv8rLZgUpQZ1oWkC4HeBMhk08GgqAAbvgT D2RhOPCDHDcoyBcjtHQO3s52fpMfIbXoGH/Cn7XKXOjrDZbnfFXcG0R+ERqRvGN/fE6o if8w== 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=o1m+TxbcVvWsPdubcnROP/O3Lzxw1NrqeOLb8tJMRmw=; b=gpZthnntHT4Lwuht0nbxeMTwTrgl3QO6XLWG2uG+d5ehOiYUhnQA37mn3UiotYEOPI WfATzbf3hE3ZyY+DAu+ACVf24vO1YzfiPPCwGCVNiWDyc1ShhtbCSHYgZro9OODn71F/ qu/W/nFZo5zZa+MRJ51UjyrgVrakftzPq6QoQOE8dmnYAoNHuWdb/ut6Qg2MohBA/BuV xSGBU5OOyMLKroVMNFlxVdlEj059STxt6c1TebZjohwbJecIuHEvWfih3FtbSn9w+rlM 1WW934kqqachQUkkoHmzlC+APjlTIvc0wkhN91OmkwHZS7v0Zlo+s9kwDW9bdRA5ebX6 Nc5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YknC90bE; 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 24-v6si16535154pgn.428.2018.10.08.12.04.03; Mon, 08 Oct 2018 12:04:18 -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=YknC90bE; 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 S1731072AbeJIB6x (ORCPT + 99 others); Mon, 8 Oct 2018 21:58:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:47058 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728570AbeJIB6w (ORCPT ); Mon, 8 Oct 2018 21:58:52 -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 6B84B2087D; Mon, 8 Oct 2018 18:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024346; bh=WUvoHHhguRsBAOaE0SoyeetpJzc2gPq5FmUS1WQodHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YknC90bEJm61EZWAB+AO906J+hzn0kxMpaRQIVwreMchnu30jbrhABGpb414gkExA QKphJwex/8I01SgTQoiLdu9iMk6ZYe66Gm991rrqZWrzXaqi70sCIoVCYjBbT7j1W+ SYd5RooJcvK26EVizjDcLbW35S/NrXxjygNgvA3U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+2a12f11c306afe871c1f@syzkaller.appspotmail.com, Johannes Berg , Sasha Levin Subject: [PATCH 4.18 003/168] mac80211_hwsim: require at least one channel Date: Mon, 8 Oct 2018 20:29:43 +0200 Message-Id: <20181008175620.171849782@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: Johannes Berg [ Upstream commit 484004339d4514fde425f6e8a9f6a6cc979bb0c3 ] Syzbot continues to try to create mac80211_hwsim radios, and manages to pass parameters that are later checked with WARN_ON in cfg80211 - catch another one in hwsim directly. Reported-by: syzbot+2a12f11c306afe871c1f@syzkaller.appspotmail.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/mac80211_hwsim.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -3194,6 +3194,11 @@ static int hwsim_new_radio_nl(struct sk_ if (info->attrs[HWSIM_ATTR_CHANNELS]) param.channels = nla_get_u32(info->attrs[HWSIM_ATTR_CHANNELS]); + if (param.channels < 1) { + GENL_SET_ERR_MSG(info, "must have at least one channel"); + return -EINVAL; + } + if (param.channels > CFG80211_MAX_NUM_DIFFERENT_CHANNELS) { GENL_SET_ERR_MSG(info, "too many channels specified"); return -EINVAL;