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: <CAKywueQko2NYXegHaRnXguxfZXnXyqqifCG866YYmO96U7OTwg@mail.gmail.com>
Date:   Wed, 17 May 2017 13:05:30 -0700
From:   Pavel Shilovsky <piastryyy@...il.com>
To:     Colin King <colin.king@...onical.com>
Cc:     Pavel Shilovsky <pshilov@...rosoft.com>,
        Steve French <sfrench@...ba.org>,
        linux-cifs <linux-cifs@...r.kernel.org>,
        samba-technical <samba-technical@...ts.samba.org>,
        kernel-janitors@...r.kernel.org,
        Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] CIFS: check if pages is null rather than bv for a failed allocation

2017-05-17 11:24 GMT-07:00 Colin King <colin.king@...onical.com>:
> From: Colin Ian King <colin.king@...onical.com>
>
> pages is being allocated however a null check on bv is being used
> to see if the allocation failed. Fix this by checking if pages is
> null.
>
> Detected by CoverityScan, CID#1432974 ("Logically dead code")
>
> Fixes: ccf7f4088af2dd ("CIFS: Add asynchronous context to support kernel AIO")
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> ---
>  fs/cifs/misc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
> index b08531977daa..3b147dc6af63 100644
> --- a/fs/cifs/misc.c
> +++ b/fs/cifs/misc.c
> @@ -810,7 +810,7 @@ setup_aio_ctx_iter(struct cifs_aio_ctx *ctx, struct iov_iter *iter, int rw)
>
>         if (!pages) {
>                 pages = vmalloc(max_pages * sizeof(struct page *));
> -               if (!bv) {
> +               if (!pages) {
>                         kvfree(bv);
>                         return -ENOMEM;
>                 }
> --
> 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