Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7852788pxb; Fri, 19 Feb 2021 00:28:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQQXMqy/sZacNu+rqGkKmc79jIOT/8hj/nOSj6Tf/LeKDJLqkDmBXz17JgJSKvKgQ5kzvu X-Received: by 2002:a05:6402:1777:: with SMTP id da23mr8013679edb.120.1613723296329; Fri, 19 Feb 2021 00:28:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613723296; cv=none; d=google.com; s=arc-20160816; b=U48SJ8N30aCgisoASLgZ3zoRYMKdn7hlYVkg7EcLsC4nveQVHkJ36GrD+EaLz8LbSm jn0m/FuExBS01gXAy/8GSu+NbeOmosDL4YItgxQf6lmgzB+gkCS55mhBFTuswIDaGsoL rJLOj60TnAulvb1yU39NhUQnGLw2WkNSHWxEjTrg6p6YAJDXvvbjcuG+q8xj/W/kzSwh 3+GdTyw2NDT4WFXJohrxYGtRxJotI6QjTFnVEFATd8dNn/eJXabkK+cRV9Woa5f1FQBy XrM2LNyUApLsR2cYiHamb95yiZd4Z3ZLp3WfwG0kGC4gkhXtxU8AplkNpHJnch7vQ1uv j4Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=9Iii29UrgqgUJ20TANrlIC1nFHinh4CVVYVrjUsg+ho=; b=ds+80BVB2ClxGrD1DuICYqJvfJK5efyQkAQwsWw6UzmOgp54KvmOYGh4trf/ZYosB2 QKH7nlzIdGpbzq2GlB3Pp8G5F8MoO1TK3JM9Os3zsn9D3vFBB7+u9Qojeq4Wy8pAPDkw jXMdchb2LnXklE6kI/OgvPn7GWsbj9xhwaxKRplw7Bh4ChKGU0if4esEZpC5Uya/s6tl don65v9t/trRHFAD4pkna5pgEjAdWXTgrdfduOI1Sktm4BKQvT8oGFoZYvGsbGEsxnkd P0d1msQwTayD51WTTnwKoPiE4x5NL6VoN2wju6LJlAty8YL+/sCCiC6y8oU8TKkiX8v/ kEVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e7si5504698ejr.111.2021.02.19.00.27.51; Fri, 19 Feb 2021 00:28:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229812AbhBSI0c (ORCPT + 99 others); Fri, 19 Feb 2021 03:26:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229636AbhBSI0a (ORCPT ); Fri, 19 Feb 2021 03:26:30 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A88EEC061574; Fri, 19 Feb 2021 00:25:49 -0800 (PST) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1lD16b-005ENE-7X; Fri, 19 Feb 2021 09:25:41 +0100 Message-ID: <55e82d3019ea7f5dce3e1df88ee9188d47ae81f5.camel@sipsolutions.net> Subject: Re: [PATCH] [v13] wireless: Initial driver submission for pureLiFi STA devices From: Johannes Berg To: Srinivasan Raju Cc: Mostafa Afgani , Kalle Valo , "David S. Miller" , Jakub Kicinski , open list , "open list:NETWORKING DRIVERS (WIRELESS)" , "open list:NETWORKING DRIVERS" Date: Fri, 19 Feb 2021 09:25:40 +0100 In-Reply-To: References: <20200928102008.32568-1-srini.raju@purelifi.com> <20210212115030.124490-1-srini.raju@purelifi.com> (sfid-20210212_125300_396085_B8C8E2C0), Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, 2021-02-19 at 05:15 +0000, Srinivasan Raju wrote: > Hi, > > Please find a few responses to the comments , We will fix rest of the comments and submit v14 of the patch. > > > Also, you *really* need some validation here, rather than blindly > > trusting that the file is well-formed, otherwise you immediately have a > > security issue here. > > The firmware is signed and the harware validates the signature , so we are not validating in the software. That wasn't my point. My point was that the kernel code trusts the validity of the firmware image, in the sense of e.g. this piece: > + no_of_files = *(u32 *)&fw_packed->data[0]; If the firmware file was corrupted (intentionally/maliciously or not), this could now be say 0xffffffff. > + for (step = 0; step < no_of_files; step++) { > + start_addr = *(u32 *)&fw_packed->data[4 + (step * 4)]; But you trust it completely and don't even check that "4 + (step * 4)" fits into the length of the data! That's what I meant. Don't allow this to crash the kernel. > > > +static const struct plf_reg_alpha2_map reg_alpha2_map[] = { > > > + { PLF_REGDOMAIN_FCC, "US" }, > > > + { PLF_REGDOMAIN_IC, "CA" }, > > > + { PLF_REGDOMAIN_ETSI, "DE" }, /* Generic ETSI, use most restrictive */ > > > + { PLF_REGDOMAIN_JAPAN, "JP" }, > > > + { PLF_REGDOMAIN_SPAIN, "ES" }, > > > + { PLF_REGDOMAIN_FRANCE, "FR" }, > > > +}; > > You actually have regulatory restrictions on this stuff? > > Currently, There are no regulatory restrictions applicable for LiFi , > regulatory_hint setting is only for wifi core So why do you have PLF_REGDOMAIN_* things? What does that even mean then? > > OTOH, I can sort of see why/how you're reusing wifi functionality here, > > very old versions of wifi even had an infrared PHY I think. > > > > Conceptually, it seems odd. Perhaps we should add a new band definition? > > > > And what I also asked above - how much of the rate stuff is completely > > fake? Are you really doing CCK/OFDM in some (strange?) way? > > Yes, your understanding is correct, and we use OFDM. > For now we will use the existing band definition. OFDM over infrared, nice. Still, I'm not convinced we should piggy-back this on 2.4 GHz. NL80211_BAND_1THZ? ;-) Ok, I don't know what wavelength you're using, of course... But at least thinking about this, wouldn't we be better off if we define NL80211_BAND_INFRARED or something? That way, at least we can tell that it's not going to interoperate with real 2.4 GHz, etc. OTOH, this is a bit of a slippery slow - what if somebody else designs an *incompatible* infrared PHY? I guess this is not really standardised at this point. Not really sure about all this, but I guess we need to think about it more. What are your reasons for piggy-backing on 2.4 GHz? Just practical "it's there and we don't care"? johannes