Re: [PATCH 090/190] Revert "net/smc: fix a NULL pointer dereference"

From: Greg Kroah-Hartman
Date: Tue Apr 27 2021 - 14:02:44 EST


On Wed, Apr 21, 2021 at 02:59:25PM +0200, Greg Kroah-Hartman wrote:
> This reverts commit e183d4e414b64711baf7a04e214b61969ca08dfa.
>
> 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@xxxxxxx>
> Cc: Ursula Braun <ubraun@xxxxxxxxxxxxx>
> Cc: David S. Miller <davem@xxxxxxxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> ---
> net/smc/smc_ism.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c
> index 9c6e95882553..6558cf7643a7 100644
> --- a/net/smc/smc_ism.c
> +++ b/net/smc/smc_ism.c
> @@ -417,11 +417,6 @@ struct smcd_dev *smcd_alloc_dev(struct device *parent, const char *name,
> init_waitqueue_head(&smcd->lgrs_deleted);
> smcd->event_wq = alloc_ordered_workqueue("ism_evt_wq-%s)",
> WQ_MEM_RECLAIM, name);
> - if (!smcd->event_wq) {
> - kfree(smcd->conn);
> - kfree(smcd);
> - return NULL;
> - }
> return smcd;
> }
> EXPORT_SYMBOL_GPL(smcd_alloc_dev);
> --
> 2.31.1
>

The original is incorrect and causes a memory leak. I will keep this
revert and fix it up properly with a follow-on patch.

thanks,

greg k-h