[095/190] Revert "rtlwifi: fix a potential NULL pointer dereference"
diff mbox series

Message ID 20210421130105.1226686-96-gregkh@linuxfoundation.org
State New, archived
Headers show
Series
  • Revertion of all of the umn.edu commits
Related show

Commit Message

Greg KH April 21, 2021, 12:59 p.m. UTC
This reverts commit 765976285a8c8db3f0eb7f033829a899d0c2786e.

Commits from @umn.edu addresses have been found to be submitted in "bad
faith" to try to test the kernel community's ability to review "known
malicious" changes.  The result of these submissions can be found in a
paper published at the 42nd IEEE Symposium on Security and Privacy
entitled, "Open Source Insecurity: Stealthily Introducing
Vulnerabilities via Hypocrite Commits" written by Qiushi Wu (University
of Minnesota) and Kangjie Lu (University of Minnesota).

Because of this, all submissions from this group must be reverted from
the kernel tree and will need to be re-reviewed again to determine if
they actually are a valid fix.  Until that work is complete, remove this
change to ensure that no problems are being introduced into the
codebase.

Cc: Kangjie Lu <kjlu@umn.edu>
Cc: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/wireless/realtek/rtlwifi/base.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Bryan Brattlof April 27, 2021, 1:21 a.m. UTC | #1
On Wed, Apr 21, 2021 at 02:59:30PM +0200, Greg Kroah-Hartman wrote:
>
>This reverts commit 765976285a8c8db3f0eb7f033829a899d0c2786e.
>
>Commits from @umn.edu addresses have been found to be submitted in "bad
>faith" to try to test the kernel community's ability to review "known
>malicious" changes.  The result of these submissions can be found in a
>paper published at the 42nd IEEE Symposium on Security and Privacy
>entitled, "Open Source Insecurity: Stealthily Introducing
>Vulnerabilities via Hypocrite Commits" written by Qiushi Wu (University
>of Minnesota) and Kangjie Lu (University of Minnesota).
>
>Because of this, all submissions from this group must be reverted from
>the kernel tree and will need to be re-reviewed again to determine if
>they actually are a valid fix.  Until that work is complete, remove this
>change to ensure that no problems are being introduced into the
>codebase.
>
>Cc: Kangjie Lu <kjlu@umn.edu>
>Cc: Kalle Valo <kvalo@codeaurora.org>
>Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>---
> drivers/net/wireless/realtek/rtlwifi/base.c | 5 -----
> 1 file changed, 5 deletions(-)
>
>diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
>index 6e8bd99e8911..1d067536889e 100644
>--- a/drivers/net/wireless/realtek/rtlwifi/base.c
>+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
>@@ -452,11 +452,6 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
> 	/* <2> work queue */
> 	rtlpriv->works.hw = hw;
> 	rtlpriv->works.rtl_wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name);
>-	if (unlikely(!rtlpriv->works.rtl_wq)) {
>-		pr_err("Failed to allocate work queue\n");
>-		return;
>-	}
>-
>

Hey Greg!

If you're still working on this series, this patch looks to be a 
legitimate fix for the potential NULL pointer.

However we should probably inform 'rtw_init_core()' of this failure in 
addition to printing about it.

Do you want to apply this revert and I send a fix after this has made 
its way through?

--
~Bryan

>
> 	INIT_DELAYED_WORK(&rtlpriv->works.watchdog_wq,
> 			  rtl_watchdog_wq_callback);
> 	INIT_DELAYED_WORK(&rtlpriv->works.ips_nic_off_wq,
>--
>2.31.1
>
Greg KH April 27, 2021, 12:59 p.m. UTC | #2
On Tue, Apr 27, 2021 at 01:21:49AM +0000, Bryan Brattlof wrote:
> On Wed, Apr 21, 2021 at 02:59:30PM +0200, Greg Kroah-Hartman wrote:
> >
> >This reverts commit 765976285a8c8db3f0eb7f033829a899d0c2786e.
> >
> >Commits from @umn.edu addresses have been found to be submitted in "bad
> >faith" to try to test the kernel community's ability to review "known
> >malicious" changes.  The result of these submissions can be found in a
> >paper published at the 42nd IEEE Symposium on Security and Privacy
> >entitled, "Open Source Insecurity: Stealthily Introducing
> >Vulnerabilities via Hypocrite Commits" written by Qiushi Wu (University
> >of Minnesota) and Kangjie Lu (University of Minnesota).
> >
> >Because of this, all submissions from this group must be reverted from
> >the kernel tree and will need to be re-reviewed again to determine if
> >they actually are a valid fix.  Until that work is complete, remove this
> >change to ensure that no problems are being introduced into the
> >codebase.
> >
> >Cc: Kangjie Lu <kjlu@umn.edu>
> >Cc: Kalle Valo <kvalo@codeaurora.org>
> >Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >---
> > drivers/net/wireless/realtek/rtlwifi/base.c | 5 -----
> > 1 file changed, 5 deletions(-)
> >
> >diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
> >index 6e8bd99e8911..1d067536889e 100644
> >--- a/drivers/net/wireless/realtek/rtlwifi/base.c
> >+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
> >@@ -452,11 +452,6 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
> > 	/* <2> work queue */
> > 	rtlpriv->works.hw = hw;
> > 	rtlpriv->works.rtl_wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name);
> >-	if (unlikely(!rtlpriv->works.rtl_wq)) {
> >-		pr_err("Failed to allocate work queue\n");
> >-		return;
> >-	}
> >-
> >
> 
> Hey Greg!
> 
> If you're still working on this series, this patch looks to be a 
> legitimate fix for the potential NULL pointer.
> 
> However we should probably inform 'rtw_init_core()' of this failure in 
> addition to printing about it.
> 
> Do you want to apply this revert and I send a fix after this has made 
> its way through?

I'll keep this revert as the "unlikely()" should never be used for
something trivial like this (the compiler and CPU does a better job),
and printing an error message also doesn't help much.

I'll fix this up with a "simpler" version that does this properly by
propagating the error backwards...

thanks,

greg k-h

Patch
diff mbox series

diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
index 6e8bd99e8911..1d067536889e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
@@ -452,11 +452,6 @@  static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
 	/* <2> work queue */
 	rtlpriv->works.hw = hw;
 	rtlpriv->works.rtl_wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name);
-	if (unlikely(!rtlpriv->works.rtl_wq)) {
-		pr_err("Failed to allocate work queue\n");
-		return;
-	}
-
 	INIT_DELAYED_WORK(&rtlpriv->works.watchdog_wq,
 			  rtl_watchdog_wq_callback);
 	INIT_DELAYED_WORK(&rtlpriv->works.ips_nic_off_wq,