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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=Zz8eQTS+ja59eB9-F1aE2QP5DEVCwqBP50j8K@mail.gmail.com>
Date:	Wed, 15 Dec 2010 23:49:39 +0100
From:	Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To:	Mariusz Kozlowski <mk@....zgora.pl>
Cc:	Chris Mason <chris.mason@...cle.com>, linux-btrfs@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] btrfs: fix memory leak on error path in btrfs_get_acl()

On Wed, Dec 15, 2010 at 10:57 PM, Mariusz Kozlowski <mk@....zgora.pl> wrote:
> If posix_acl_from_xattr() fails we leak memory stored in 'value'.
>
> Signed-off-by: Mariusz Kozlowski <mk@....zgora.pl>
> ---
>  fs/btrfs/acl.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
> index 2222d16..11c9561 100644
> --- a/fs/btrfs/acl.c
> +++ b/fs/btrfs/acl.c
> @@ -61,6 +61,7 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
>                if (size > 0) {
>                        acl = posix_acl_from_xattr(value, size);
>                        if (IS_ERR(acl))
> +                               kfree(value);

Be careful with the evil { }

>                                return acl;
>                        set_cached_acl(inode, type, acl);
>                }
> --
> 1.7.0.4
>
> --
> 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/
>
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ