Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5834201ybi; Wed, 31 Jul 2019 04:07:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfnZfS1wuK0zF/9RB9OmujnMiGQQ9M1RWFG20SLaEe2gqqEkOZLsJ8m691wHviMSGa5M5z X-Received: by 2002:aa7:9f1c:: with SMTP id g28mr46242672pfr.81.1564571269930; Wed, 31 Jul 2019 04:07:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564571269; cv=none; d=google.com; s=arc-20160816; b=vyrU6OPmfDFwicZw/g6oWyitoYJxY6HnNuy1hKHwVOvG+HGuuAQl32oDXa/A9kCUmF uJNgMYi0h6MhbnAjrcuIeL+3WPoRVR6xpHegO2VEAXzb7K0z/O75kiELaBnK2mi8hXuy De3QgOwWr316q4mpPGIFdME5gWo/YuiTNBgQSkfVslTfXI6hOPXZhnNlxEM0oBdHTjH7 sN4/5ITifDLAiZCSpibhvfxIlkHltMD0mzYhAHqC84kmXToCkwVJZDDjgnd/GJ6so2PB sLeuVl55PnCoGrHraeThcV5F8wSJUBLjaAtoizN+DL7nbdQrS5xtn3MWhh/sGuasgUq+ Emzg== 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:date:cc:to:from:subject :message-id; bh=68zB6im60oDh8wdkAADfDMf6l1vpBYNxbsWQjeJN200=; b=PreQ5lJ2h9vuqkLd/YhuEcz4iX4MERFOXPG5Q2XS/DhrYba/wh2/jWFlTx4ufWs/Qa EpV874zaE2sWJXf9UoGyOkuObtsBYJr/9eimN5EFHDgVedGWwbYHw+rmNt9oAuogVghH azSPERwSM4RUrCozGjFtCYiazi4lvUSi9v7bCCxa/qiXrSi/Rz53BJC6mcDEF4JS8HLx fv3Kon8+xggMPdNPtUnVdzeCNm4uumny3PAg0wHGRGgJoY5psdSYvk6e2FUPXrN5uu3S ehhTVD4FAR1cJcFEdj6lDArjV6sTvWvt1ck19upanPdVfDf8POXkduyaQw45yDlGAjhA PY2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 x16si34879831pgi.312.2019.07.31.04.07.23; Wed, 31 Jul 2019 04:07:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728355AbfGaJvR (ORCPT + 99 others); Wed, 31 Jul 2019 05:51:17 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:55858 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725793AbfGaJvR (ORCPT ); Wed, 31 Jul 2019 05:51:17 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hslGN-00057W-Sa; Wed, 31 Jul 2019 11:51:15 +0200 Message-ID: Subject: Re: [PATCH v3 2/3] nl80211: Limit certain commands to interface owner From: Johannes Berg To: Denis Kenzior Cc: linux-wireless@vger.kernel.org Date: Wed, 31 Jul 2019 11:51:13 +0200 In-Reply-To: <20190701153317.27170-2-denkenz@gmail.com> (sfid-20190701_173327_508693_6824CD6B) References: <20190701153317.27170-1-denkenz@gmail.com> <20190701153317.27170-2-denkenz@gmail.com> (sfid-20190701_173327_508693_6824CD6B) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, 2019-07-01 at 10:33 -0500, Denis Kenzior wrote: > If the wdev object has been created (via NEW_INTERFACE) with > SOCKET_OWNER attribute set, then limit certain commands only to the > process that created that wdev. > > This can be used to make sure no other process on the system interferes > by sending unwanted scans, action frames or any other funny business. > > This patch introduces a new internal flag, and checks that flag in the > pre_doit hook. So, looking at this ... I can't say I'm convinced. You're tagging 35 out of about 106 commands, and even if a handful of those are new and were added after your patch, this doesn't really make sense. NL80211_CMD_LEAVE_IBSS is tagged, but not NL80211_CMD_LEAVE_MESH? NL80211_CMD_NEW_STATION is tagged, but not NL80211_CMD_NEW_MPATH? NL80211_CMD_SET_KEY is tagged, but not NL80211_CMD_SET_PMK or NL80211_CMD_SET_PMKSA? NL80211_CMD_UPDATE_CONNECT_PARAMS is tagged, but not NL80211_CMD_UPDATE_OWE_INFO (though this could be patch crossing?) NL80211_CMD_CONTROL_PORT_FRAME isn't tagged? NL80211_CMD_SET_QOS_MAP isn't tagged? It almost feels like you just did a "git grep NL80211_CMD_" on your code, and then dropped the flag on everything you were using. And honestly, I think you need a better justification than just "unwanted scans, action frames or any other funny business". Also, how's this not just a workaround for some very specific setup issue you were seeing, where people trying out iwd didn't remove wpa_s properly (*)? I'm really not convinced that this buys us anything except in very limited development scenarios - and those are typically the exact scenarios where you _want_ to be able to do things like that (and honestly, I'd be pretty pissed off if I couldn't do an "iw wlan0 scan" just because some tool decided it wanted to have control over things). (*) also, that would just happen to work for you now with iwd winning because you claim ownership and wpa_s doesn't, you'd still get the same complaints "iwd doesn't work" if/when wpa_s *does* start to claim ownership and you get locked out with a patch like this, so I don't feel you'd actually win much even in this case. I'm trying to come up with places where we do something similar, defend one application running as root against another ... but can't really? Think about VPN - we don't stop anying from removing or adding IP addresses that the VPN application didn't intend to use, yet that can obviously break your connection. You could even run dhcp on it, even if for (most) VPN protocols that's rather useless. Overall, I'm not really convinced. The design is rather unclear (randomly sprinkling magic dust on ~35% of commands), and it's also not really clear to me what this is intended to actually achieve. johannes