Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4641303ybl; Wed, 22 Jan 2020 01:52:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzsAtrOGnfBKW4/5zaVgTg5t44eW7Pp3j3gj0m03AjoQ8kIanm2KgZPYdacCtwFx6eOXcq/ X-Received: by 2002:a05:6808:683:: with SMTP id k3mr6035019oig.50.1579686724720; Wed, 22 Jan 2020 01:52:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579686724; cv=none; d=google.com; s=arc-20160816; b=UdfpD/2+KzG2GPrEDjDZTCrTBMyLJWoYMWwC7597HZioMIx/oBsfLcYlGW2cIBCZAS ubjsypMFqxIPQ6kcNrDqUEsrm4jfgpfw5fuqqHiIQtf3i2nfjXZLOkSOv7G1cfUa42eP 8CtZj/H0SRjGzVK6t19j4iYYY6czzLKDIrnkFB0KG89+9+zMGJPa8x7vaee7HOb3yUvv oVNhYiIxZucNBa1fk3xilfX0mGid91THyQKy4xPo5Ridf1ztdFT2aXthZcgIggrfWsyh 08o4ijsbVKNm91C/O54PqpJt60rQuUW3hc8WgQCNPqUjx+8cjiZMNF6fw2S9maI2dOlC Yu0g== 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=jolVjnGi1/A2RP+OAVARiqZX0dkNrIc3SMTbglhXys4=; b=lNweWiDXaO0xA+CPmAsFYWQZMCdxkQGcZ8czTxSsVSWOza1l4CyhAik0LXi7akDBI9 c2s9agh/0s33zG09ke1BSFw20yj2Jka7rf1pU4hxv1OIdcobBATTG2NT7NdnjAfIzKnI fwsRnpMVy/1a5du/PyhztPMwehl7UxAU1Lu+c85CrmKZKBZgCDg+zVELP/7xiQKOMEp2 112Jun8EycWRpBcYCInrSU57VvSSdsY6DkdQfDBFmGI3khq+o7BchUMtuMB7rdg9qfiW pPjIyHMVPX99nerjytqbTk3UPb4qHKQMGOwJ0NPqh7i5FDEnFiaSSP1y5GpR9R8GUS+b oT1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fLPmnUyW; 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 n2si22126961otk.177.2020.01.22.01.51.53; Wed, 22 Jan 2020 01:52:04 -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=fLPmnUyW; 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 S1730843AbgAVJvE (ORCPT + 99 others); Wed, 22 Jan 2020 04:51:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:53660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732568AbgAVJha (ORCPT ); Wed, 22 Jan 2020 04:37:30 -0500 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 EF5F92467E; Wed, 22 Jan 2020 09:37:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579685850; bh=MRAv4DjXurDeigszhhQyqJaSn3RD9dJlhVII68vR4vE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fLPmnUyWj7o9Z98HLXfpsdtgKPZ2ufi7LY366c3SZg3tRhnOuiFp9LauoG/aw/reZ m9EUS8NNQX7ickDkHcSn7p6HoTia/9TYIQUcX+Bc2LVAQDOesIK2TGPvepucrHwKx2 zzJk07PXjffoDiZPLVVlaDr70e2sLOCwenvxYQU0= 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 4.9 89/97] cfg80211: check for set_wiphy_params Date: Wed, 22 Jan 2020 10:29:33 +0100 Message-Id: <20200122092810.521430774@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092755.678349497@linuxfoundation.org> References: <20200122092755.678349497@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 @@ -525,6 +525,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);