lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 23 Apr 2021 09:29:57 +0200
From:   Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org
Cc:     Aditya Pakki <pakki001@....edu>,
        "David S . Miller" <davem@...emloft.net>
Subject: Re: [PATCH 064/190] Revert "nfc: s3fwrn5: replace the assertion with
 a WARN_ON"

On 21/04/2021 14:58, Greg Kroah-Hartman wrote:
> This reverts commit 615f22f58029aa747b12768985e7f91cd053daa2.
> 
> 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: Aditya Pakki <pakki001@....edu>
> Cc: David S. Miller <davem@...emloft.net>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> ---
>  drivers/nfc/s3fwrn5/firmware.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/nfc/s3fwrn5/firmware.c b/drivers/nfc/s3fwrn5/firmware.c
> index eb5d7a5beac7..f77f183c9bd0 100644
> --- a/drivers/nfc/s3fwrn5/firmware.c
> +++ b/drivers/nfc/s3fwrn5/firmware.c
> @@ -492,10 +492,7 @@ int s3fwrn5_fw_recv_frame(struct nci_dev *ndev, struct sk_buff *skb)
>  	struct s3fwrn5_info *info = nci_get_drvdata(ndev);
>  	struct s3fwrn5_fw_info *fw_info = &info->fw_info;
>  
> -	if (WARN_ON(fw_info->rsp)) {
> -		kfree_skb(skb);
> -		return -EINVAL;
> -	}
> +	BUG_ON(fw_info->rsp);

It took me some time to understand this but the original commit looks
correct. The recv_frame functions s3fwrn5_recv_frame() or
nci_recv_frame() should free the skb buffer on errors.  Here, the
s3fwrn5_fw_recv_frame() should be called only after sending a FW msg and
is expected to have fw_info->rsp=NULL. Otherwise it could mean that
frame came twice or it came when we did not ask for it.

Original code looks good, please drop the revert.

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ