[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTikw_2ztHC4Q0e=QoJ7RjuAXGpX5u0nTjtbdECXa@mail.gmail.com>
Date: Sat, 25 Dec 2010 22:16:31 +0100
From: richard -rw- weinberger <richard.weinberger@...il.com>
To: Jesper Juhl <jj@...osbits.net>
Cc: ceph-devel@...r.kernel.org, linux-kernel@...r.kernel.org,
Sage Weil <sage@...dream.net>
Subject: Re: [PATCH] Ceph: Fix use-after-free in destroy_fs_client()
On Sat, Dec 25, 2010 at 7:01 PM, Jesper Juhl <jj@...osbits.net> wrote:
> Hi,
>
> In fs/ceph/super.c::destroy_fs_client() the pointer 'fsc' is freed by
> kfree() and subsequently used in a call to dout() - use after free bug.
> Easily fixed by simply moving the kfree() call after the dout() call.
As I sad before, %p reads only the address.
> Signed-off-by: Jesper Juhl <jj@...osbits.net>
> ---
> super.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/fs/ceph/super.c b/fs/ceph/super.c
> index 08b460a..7373594 100644
> --- a/fs/ceph/super.c
> +++ b/fs/ceph/super.c
> @@ -498,8 +498,8 @@ void destroy_fs_client(struct ceph_fs_client *fsc)
>
> ceph_destroy_client(fsc->client);
>
> - kfree(fsc);
> dout("destroy_fs_client %p done\n", fsc);
> + kfree(fsc);
> }
>
> /*
>
>
> --
> Jesper Juhl <jj@...osbits.net> http://www.chaosbits.net/
> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
> Plain text mails only, please.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists