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]
Message-ID: <CY4PR21MB0135BF129DED3C5BC7799C47B6CD0@CY4PR21MB0135.namprd21.prod.outlook.com>
Date:   Mon, 12 Jun 2017 23:12:17 +0000
From:   Pavel Shilovskiy <pshilov@...rosoft.com>
To:     Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        "sfrench@...ba.org" <sfrench@...ba.org>
CC:     "linux-cifs@...r.kernel.org" <linux-cifs@...r.kernel.org>,
        "samba-technical@...ts.samba.org" <samba-technical@...ts.samba.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: RE: [PATCH] CIFS: Fix some return values in case of error in
 'crypt_message'

2017-06-11 0:12 GMT-07:00 Christophe JAILLET <christophe.jaillet@...adoo.fr>:
> 'rc' is known to be 0 at this point. So if 'init_sg' or 'kzalloc' fails, we
> should return -ENOMEM instead.
>
> Also remove a useless 'rc' in a debug message as it is meaningless here.
>
> Fixes: 026e93dc0a3ee ("CIFS: Encrypt SMB3 requests before sending")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
>  fs/cifs/smb2ops.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
> index c58691834eb2..cdcb3d95add8 100644
> --- a/fs/cifs/smb2ops.c
> +++ b/fs/cifs/smb2ops.c
> @@ -1809,7 +1809,8 @@ crypt_message(struct TCP_Server_Info *server, struct smb_rqst *rqst, int enc)
>
>         sg = init_sg(rqst, sign);
>         if (!sg) {
> -               cifs_dbg(VFS, "%s: Failed to init sg %d", __func__, rc);
> +               cifs_dbg(VFS, "%s: Failed to init sg", __func__);
> +               rc = -ENOMEM;
>                 goto free_req;
>         }
>
> @@ -1817,6 +1818,7 @@ crypt_message(struct TCP_Server_Info *server, struct smb_rqst *rqst, int enc)
>         iv = kzalloc(iv_len, GFP_KERNEL);
>         if (!iv) {
>                 cifs_dbg(VFS, "%s: Failed to alloc IV", __func__);
> +               rc = -ENOMEM;
>                 goto free_sg;
>         }
>         iv[0] = 3;
> --
> 2.11.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Thanks for catching this.

Reviewed-by: Pavel Shilovsky <pshilov@...rosoft.com>

--
Best regards,
Pavel Shilovsky

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ