Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3606442ybb; Mon, 6 Apr 2020 11:53:14 -0700 (PDT) X-Google-Smtp-Source: APiQypJvJ+xKyS6wnRHEAtRbRboWocrv3uyWkRJNtaWWlrTmSHTNKYOAyA+SrgI5ihD/quCEJ7iV X-Received: by 2002:aca:1c13:: with SMTP id c19mr525348oic.178.1586199193993; Mon, 06 Apr 2020 11:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586199193; cv=none; d=google.com; s=arc-20160816; b=N5HsSVlMqefwqZ/KPMfBUriXrOh++4hx6ov2FknLanrSehHOr+w9EIzQY2XufK9e/S 5pQ0TYNdBSdSQNgG+7a414Q/f8K9KohQuDZPtk8QBp4GDvmtdkdNXv7cgXGpfkrTnecB SwwL1nGte/50ll9OZx1xY/0fQDsp4YLGefRVMYlKrwRQeKHa1GVD6EWqMp3XoRCkpk76 UE7fjCq6M2kZbqHKWFU8p3g/IivEtBFYeTtznfOcWaU14+bayQZWmRcA1wN2R8swGWey mEWq5yHj5sqL/ugPmjrGuiBKNM1CYTfmUAGR2Q6nRrz1eMXXsnBMskoWjU5UP2Ogf/VU q1jw== 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=J831BvXSZ4dluXeKhv7pHnbr2T5WLO3S2aAL6TUllUY=; b=M0mS0OE7cvw1K7Cq64K83IE3mkxBUVpfl5BrXrLHTEqz6cnslOFONRjygARDTJAnHc 07Qxxtitifk4zr5a3LPeKEY5DSAR8a0iZmmB86IW5kyTtsAo0rMzheYco/j/GeH8rRIe 81agZ3S788/fu6tPQBAXr/46PpxID3EJQUqFI6R7foFTDwt14xMbjhUECRjHr/KZ/URb WQGYLE6GybNjavIOzA1vGyTgtaSLLO5GdyACzIesPVwx1bUcBCIqBe2963JUUhBl1TPW xGJPi5hPD35Vx4Rock7aM9UWcv+VFE/737SGUxlLUqzDUbozNPDS/lGN1KLzXp5LDNTZ a37w== 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 v3si190019oog.10.2020.04.06.11.53.02; Mon, 06 Apr 2020 11:53:13 -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 S1726310AbgDFSwt (ORCPT + 99 others); Mon, 6 Apr 2020 14:52:49 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:36766 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbgDFSwt (ORCPT ); Mon, 6 Apr 2020 14:52:49 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jLWrW-00AbyI-19; Mon, 06 Apr 2020 20:52:46 +0200 Message-ID: <962a24ee0e07aeb0937490368413f33bbfd502d9.camel@sipsolutions.net> Subject: Re: [PATCH] rtw88: add more check for wowlan pattern From: Johannes Berg To: Brian Norris , Tony Chuang Cc: Kalle Valo , linux-wireless , timlee@realtek.com Date: Mon, 06 Apr 2020 20:52:44 +0200 In-Reply-To: (sfid-20200406_203233_188368_CC497BE9) References: <20200406074705.25022-1-yhchuang@realtek.com> (sfid-20200406_203233_188368_CC497BE9) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) 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 > > + /* Each pattern is divided into different kinds by DA address > > + * a. DA is broadcast address > > + * b. DA is multicast address > > + * c. DA is unicast address same as dev's mac address > > + * d. DA is unmasked. Also called wildcard type. > > + * e. Others is invalid type. > > + */ > > So I take it that (e) is "looks like unicast, but the user didn't > provide the whole DA, or the DA isn't ours"? It feels to me like > that's still something actionable, in some cases. Cases: > (1) partial mask, matching > (2) partial mask, non-matching > (3) full mask, non-matching > I'm not totally sure about (2) and (3), but that feels to me like > something we don't really expect to accept anyway -- should this be > rejected in the higher-level API? > For (1), it seems like it would probably be reasonable to still > interpret this as unicast? I know that might not strictly follow what > the user asked, but it feels pretty close -- and I also don't believe > that it's wise to mostly-silently (yes, you added kernel logging; but > this still doesn't get fed back to the user-space caller) drop the > wake-pattern request. > > Alternatively, if you're going to strictly reject stuff like this, > then maybe you need to add a cfg80211 driver validity callback, so you > can reject patterns up front. I think Johannes suggested this was a > possibility before. Yeah, I don't see why not. Really the API wasn't built in mind with something this "smart" in mind, it was kinda for a dumb "oh hey here's a frame, we converted it to ethernet format, and then we match on it". I'm not really sure why you'd even _want_ to do anything beyond that, but if that's the firmware you're stuck with, well, what can we do? johannes