Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4825202ybl; Wed, 22 Jan 2020 05:27:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxyJQMnIbC1RJnse+Rw08H7muU5YZz0RQiUP73TqXaAlqE848lqBdSrS37XohYWzpPPhPdt X-Received: by 2002:a9d:7410:: with SMTP id n16mr7631121otk.23.1579699646925; Wed, 22 Jan 2020 05:27:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699646; cv=none; d=google.com; s=arc-20160816; b=t1psX+OVciHEkBL9643RElN9mBAVJM8YUjY8lmpPwLh8z3AiCu/MmjZiA+6BINe0vd qKhpLEiiypUHDZzcaM2e1C4UEGUT/3HmvsL4q+GL0Oxr4rY/FxDrYQgScJBakERDnZkX //p2skMpAh2Lx2ex3yqcpmFXqx5Ovs39/rkQGJbTTVghsBt0EuSGIAUFzG/fCRHbmnLK Z2pMbbcNrFIwiWlbMeCikL0xA7mkzQ9xEB9EiDH4W0YGofU2hd9oJWdoFbOZJqR+He6v NJhyMnZjEsokSiX9RXfMh1XtC1BAot7PU0RSM8/uoWEliFOjEH9J2r3qR+ZSq+Sgr9Tf Ec+g== 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=6yeCKE0in/mb9TkgFQnen9FR+JyVT8Zr7k+Yh5NpS98=; b=wqfZZuhqTbHLcfXOrBOKZN9BQ8NY9bdzBHEKRWfYoQdZn3kdiFT+XpN3bMyfUjOilD tJPptx2Vui1d2R6y1acL65Mtg+M/NrtnJkBSZqN2G9/Io9ww3cQvBYSVg6e5sTF39AxH ieZHSzXMgGlKSQWe5nwIMz/oYPuAhZu9KiJCah1ekZ4ZytfrmV2xwFN5jmK79ehFxw5U 56CsLDgi2SnJkDXjojpHKJYgebCjtzinJ5bQ+EuhIF+t7UgEdIQ5J2jRKMcS75fD5NAC KuQ3x5ysldgOtYLlbgeclzVGRJQMdzeJC7+YrT59BlmnG0OCC2/LuXhBsKRyXOe7VxwH 6siA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DkbX01dr; 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 e22si23175130oiy.124.2020.01.22.05.27.07; Wed, 22 Jan 2020 05:27:26 -0800 (PST) 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=DkbX01dr; 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 S1731508AbgAVN0J (ORCPT + 99 others); Wed, 22 Jan 2020 08:26:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:46632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729327AbgAVN0I (ORCPT ); Wed, 22 Jan 2020 08:26:08 -0500 Received: from localhost (unknown [84.241.205.26]) (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 CB1822467B; Wed, 22 Jan 2020 13:26:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699567; bh=YZYxwVcxrm8qa1ZwVhg+IGCl5KG1S5MxBogZBbNJm8E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DkbX01drtCdiFB4UFar8G+zq2YmGuofHeG3ZixqUbjn0wdbBt6BTJE/w7oE0JUxj7 AjzKnUF0xvEbdXska6OP7iD7hCtXO/NQ7LSbqctetOiB5/qqdww6jrSB/W9Tt8wEpV gGCVWLQltdl09hBZysTJ9hyuQHRk5wsr5/zM0rew= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+e8a797964a4180eb57d5@syzkaller.appspotmail.com, syzbot+34b582cf32c1db008f8e@syzkaller.appspotmail.com, Johannes Berg Subject: [PATCH 5.4 181/222] cfg80211: check for set_wiphy_params Date: Wed, 22 Jan 2020 10:29:27 +0100 Message-Id: <20200122092846.650947415@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@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 24953de0a5e31dcca7e82c8a3c79abc2dfe8fb6e upstream. Check if set_wiphy_params is assigned and return an error if not, some drivers (e.g. virt_wifi where syzbot reported it) don't have it. Reported-by: syzbot+e8a797964a4180eb57d5@syzkaller.appspotmail.com Reported-by: syzbot+34b582cf32c1db008f8e@syzkaller.appspotmail.com Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20200113125358.ac07f276efff.Ibd85ee1b12e47b9efb00a2adc5cd3fac50da791a@changeid Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/wireless/rdev-ops.h | 4 ++++ 1 file changed, 4 insertions(+) --- a/net/wireless/rdev-ops.h +++ b/net/wireless/rdev-ops.h @@ -538,6 +538,10 @@ static inline int rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed) { int ret; + + if (!rdev->ops->set_wiphy_params) + return -EOPNOTSUPP; + trace_rdev_set_wiphy_params(&rdev->wiphy, changed); ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed); trace_rdev_return_int(&rdev->wiphy, ret);