Message ID | 20221025122150.583617-1-Jason@zx2c4.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp974959wru; Tue, 25 Oct 2022 05:28:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM70ze7rdR8jz812Kgq9NRSdW3HPokEeYkv77bNux4Y3zU1IqaL8WYEU87aeYGvTuEwfWJbu X-Received: by 2002:a17:902:8ec8:b0:186:9c32:79c8 with SMTP id x8-20020a1709028ec800b001869c3279c8mr13407357plo.105.1666700883604; Tue, 25 Oct 2022 05:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666700883; cv=none; d=google.com; s=arc-20160816; b=KArIsmNt3xidQ37gbUdU/NV/beQfdDKmvs2/yGI6/ngB+eYG3H2fKSwXmSaD6R6C/R +bjbv9uo6pUl8xU8d012H2SyWkqjKXks5zz2hMZXIFGEA1Vg/6QjFn021x9Wp7fwblQh QZD6jonhZKNPEnRtWG9E6skrVp1bqE8++miWoKtLynBNmPeEnPuZkiELWNyZIMU74rYG NPI2iQ3X22HaalkqNAd/ZEwMlxP3TgZEeLglbPql5wFlK0Siz6p88I4+8hEmV3iEgdbb 6TCEsVL3FPwiE2EbvN0Tb9WmWOJFSq15sfL4BOuVYn91siSKXm7jqpX8D+54QQipJaJ2 72JA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KZKJWuEIeuKvDUZQNV7Smz75T6WROuu6Yr001YKXCbo=; b=wrDpX7welfeSC/8UpH7oVIgx7mxopXCCPGJEhOUMcnWOqzETHq++I/EPOs2GuYKWW0 n/1JYTtLTL/sdYhBl/9WXElQYM5sjig7cb+hFY0TduNfNO00LfZNdWNfTS8ClCWVUo8M yQt8r5oUbb86DOX+8so2higPRyLy+Q7nZ7wrTnqssZHNHYzyYUWpuvzoEiqdcN0dMZqu ywUsEJap+r2zfj5xXLTEM6F+tlY8zM0BEW0WQl1BqZJfc+cz6c5bcEG+OZvxwpG1oWHA RMY/ZmV1JmvjgHHe9PwR1OsHKA6CB6OR68S5hyV0xBVOtHsIO3sI7E6qT9/7pYfekr8p MOVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=WO1e5oJR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e18-20020a170902ef5200b0017889771a05si2830411plx.566.2022.10.25.05.27.47; Tue, 25 Oct 2022 05:28:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=WO1e5oJR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231526AbiJYMWF (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Tue, 25 Oct 2022 08:22:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbiJYMWD (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 25 Oct 2022 08:22:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBE6D17A959; Tue, 25 Oct 2022 05:22:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 633C3618F6; Tue, 25 Oct 2022 12:22:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14463C433D6; Tue, 25 Oct 2022 12:22:00 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="WO1e5oJR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1666700519; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KZKJWuEIeuKvDUZQNV7Smz75T6WROuu6Yr001YKXCbo=; b=WO1e5oJROkFlQEDo4omTNY1UKBt7//EgstbWIjEpSV7b7Mvf3s5U/yAGhB84jeo0QDl699 jQgzD0XB6RKgkOff4bTSHpB+dz//GusPzz50WqYg+JBH78qH6ePZiDfAdXliafi5uk/RKn q3or7vKA/mdYQBKkK1HeeWGk2Nas1NM= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id ba7e1585 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 25 Oct 2022 12:21:58 +0000 (UTC) From: "Jason A. Donenfeld" <Jason@zx2c4.com> To: linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, dan.carpenter@oracle.com, gregkh@linuxfoundation.org, kvalo@kernel.org, linux-wireless@vger.kernel.org Cc: "Jason A. Donenfeld" <Jason@zx2c4.com> Subject: [PATCH v2] staging: rtl8192e: remove bogus ssid character sign test Date: Tue, 25 Oct 2022 14:21:50 +0200 Message-Id: <20221025122150.583617-1-Jason@zx2c4.com> In-Reply-To: <Y1e+SmS3O2ZaPVoe@kroah.com> References: <Y1e+SmS3O2ZaPVoe@kroah.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747662546018741769?= X-GMAIL-MSGID: =?utf-8?q?1747662546018741769?= |
Series |
[v2] staging: rtl8192e: remove bogus ssid character sign test
|
|
Commit Message
Jason A. Donenfeld
Oct. 25, 2022, 12:21 p.m. UTC
This error triggers on some architectures with unsigned `char` types:
drivers/staging/rtl8192e/rtllib_softmac_wx.c:459 rtllib_wx_set_essid() warn: impossible condition '(extra[i] < 0) => (0-255 < 0)'
But actually, the entire test is bogus, as ssids don't have any sign
validity rules like that. So just remove this check look all together.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
Changes v1->v2:
- Remove ssid sign test entirely rather than casting to `s8 *`.
drivers/staging/rtl8192e/rtllib_softmac_wx.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
Comments
On Tue, Oct 25, 2022 at 02:21:50PM +0200, Jason A. Donenfeld wrote: > This error triggers on some architectures with unsigned `char` types: > > drivers/staging/rtl8192e/rtllib_softmac_wx.c:459 rtllib_wx_set_essid() warn: impossible condition '(extra[i] < 0) => (0-255 < 0)' > > But actually, the entire test is bogus, as ssids don't have any sign > validity rules like that. So just remove this check look all together. > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: linux-staging@lists.linux.dev > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> > --- > Changes v1->v2: > - Remove ssid sign test entirely rather than casting to `s8 *`. Thanks! Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> regards, dan carpenter
On 10/25/22 14:21, Jason A. Donenfeld wrote: > This error triggers on some architectures with unsigned `char` types: > > drivers/staging/rtl8192e/rtllib_softmac_wx.c:459 rtllib_wx_set_essid() warn: impossible condition '(extra[i] < 0) => (0-255 < 0)' > > But actually, the entire test is bogus, as ssids don't have any sign > validity rules like that. So just remove this check look all together. > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: linux-staging@lists.linux.dev > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> > --- > Changes v1->v2: > - Remove ssid sign test entirely rather than casting to `s8 *`. > > drivers/staging/rtl8192e/rtllib_softmac_wx.c | 9 +-------- > 1 file changed, 1 insertion(+), 8 deletions(-) > > diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c > index f9589c5b62ba..1e5ad3b476ef 100644 > --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c > +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c > @@ -439,7 +439,7 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, > union iwreq_data *wrqu, char *extra) > { > > - int ret = 0, len, i; > + int ret = 0, len; > short proto_started; > unsigned long flags; > > @@ -455,13 +455,6 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, > goto out; > } > > - for (i = 0; i < len; i++) { > - if (extra[i] < 0) { > - ret = -1; > - goto out; > - } > - } > - > if (proto_started) > rtllib_stop_protocol(ieee, true); This patch cannot be applied on: [PATCH] staging: rtl8192e: use explicitly signed char On 10/24/22 18:30, Jason A. Donenfeld As line 456 was changed. Bye Philipp >
On Tue, Oct 25, 2022 at 07:35:08PM +0200, Philipp Hortmann wrote: > On 10/25/22 14:21, Jason A. Donenfeld wrote: > > This error triggers on some architectures with unsigned `char` types: > > > > drivers/staging/rtl8192e/rtllib_softmac_wx.c:459 rtllib_wx_set_essid() warn: impossible condition '(extra[i] < 0) => (0-255 < 0)' > > > > But actually, the entire test is bogus, as ssids don't have any sign > > validity rules like that. So just remove this check look all together. > > > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > Cc: linux-staging@lists.linux.dev > > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> > > --- > > Changes v1->v2: > > - Remove ssid sign test entirely rather than casting to `s8 *`. > > > > drivers/staging/rtl8192e/rtllib_softmac_wx.c | 9 +-------- > > 1 file changed, 1 insertion(+), 8 deletions(-) > > > > diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c > > index f9589c5b62ba..1e5ad3b476ef 100644 > > --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c > > +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c > > @@ -439,7 +439,7 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, > > union iwreq_data *wrqu, char *extra) > > { > > - int ret = 0, len, i; > > + int ret = 0, len; > > short proto_started; > > unsigned long flags; > > @@ -455,13 +455,6 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, > > goto out; > > } > > - for (i = 0; i < len; i++) { > > - if (extra[i] < 0) { > > - ret = -1; > > - goto out; > > - } > > - } > > - > > if (proto_started) > > rtllib_stop_protocol(ieee, true); > > This patch cannot be applied on: > [PATCH] staging: rtl8192e: use explicitly signed char > On 10/24/22 18:30, Jason A. Donenfeld > As line 456 was changed. This now in my staging-linus branch, so perhaps you applied it to the wrong one. thanks, greg k-h
On Tue, Oct 25, 2022 at 7:35 PM Philipp Hortmann <philipp.g.hortmann@gmail.com> wrote: > > On 10/25/22 14:21, Jason A. Donenfeld wrote: > > This error triggers on some architectures with unsigned `char` types: > > > > drivers/staging/rtl8192e/rtllib_softmac_wx.c:459 rtllib_wx_set_essid() warn: impossible condition '(extra[i] < 0) => (0-255 < 0)' > > > > But actually, the entire test is bogus, as ssids don't have any sign > > validity rules like that. So just remove this check look all together. > > > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > Cc: linux-staging@lists.linux.dev > > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> > > --- > > Changes v1->v2: > > - Remove ssid sign test entirely rather than casting to `s8 *`. > > > > drivers/staging/rtl8192e/rtllib_softmac_wx.c | 9 +-------- > > 1 file changed, 1 insertion(+), 8 deletions(-) > > > > diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c > > index f9589c5b62ba..1e5ad3b476ef 100644 > > --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c > > +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c > > @@ -439,7 +439,7 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, > > union iwreq_data *wrqu, char *extra) > > { > > > > - int ret = 0, len, i; > > + int ret = 0, len; > > short proto_started; > > unsigned long flags; > > > > @@ -455,13 +455,6 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, > > goto out; > > } > > > > - for (i = 0; i < len; i++) { > > - if (extra[i] < 0) { > > - ret = -1; > > - goto out; > > - } > > - } > > - > > if (proto_started) > > rtllib_stop_protocol(ieee, true); > > This patch cannot be applied on: > [PATCH] staging: rtl8192e: use explicitly signed char They're mutually exclusive, which is why this one here was marked as a v2 and sent in reply to that one. Greg picked up the v2 and all is well. Jason
diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index f9589c5b62ba..1e5ad3b476ef 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -439,7 +439,7 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, union iwreq_data *wrqu, char *extra) { - int ret = 0, len, i; + int ret = 0, len; short proto_started; unsigned long flags; @@ -455,13 +455,6 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, goto out; } - for (i = 0; i < len; i++) { - if (extra[i] < 0) { - ret = -1; - goto out; - } - } - if (proto_started) rtllib_stop_protocol(ieee, true);