From: ebiederm@xmission.com (Eric W. Biederman)
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Parag Warudkar <parag.warudkar@gmail.com>,
linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@suse.de>,
Al Viro <viro@ZenIV.linux.org.uk>
Subject: Re: [PATCH] Free the memory allocated by memdup_user() in fs/sysfs/bin.c
Date: Sun, 12 Jul 2009 07:57:51 -0700 [thread overview]
Message-ID: <m1ljmune34.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20090708101734.27241.88930.stgit@pc1117.cambridge.arm.com> (Catalin Marinas's message of "Wed\, 08 Jul 2009 11\:17\:34 +0100")
Catalin Marinas <catalin.marinas@arm.com> writes:
> Commit 1c8542c7bb replaced kmalloc() with memdup_user() in the write()
> function but also dropped the kfree(temp). The memdup_user() function
> allocates memory which is never freed.
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Parag Warudkar <parag.warudkar@gmail.com>
> ---
> fs/sysfs/bin.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
> index 9345806..2524714 100644
> --- a/fs/sysfs/bin.c
> +++ b/fs/sysfs/bin.c
> @@ -171,6 +171,7 @@ static ssize_t write(struct file *file, const char __user *userbuf,
> if (count > 0)
> *off = offs + count;
>
> + kfree(temp);
> return count;
> }
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
prev parent reply other threads:[~2009-07-12 14:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-08 10:17 [PATCH] Free the memory allocated by memdup_user() in fs/sysfs/bin.c Catalin Marinas
2009-07-12 14:57 ` Eric W. Biederman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1ljmune34.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=parag.warudkar@gmail.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@ZenIV.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox