From: James Bottomley <James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
To: Seiji Aguchi <seiji.aguchi-7rDLJAbr9SE@public.gmane.org>
Cc: "linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org"
<matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
"dle-develop-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org"
<dle-develop-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
Tomoki Sekiyama <tomoki.sekiyama-7rDLJAbr9SE@public.gmane.org>
Subject: Re: [PATCH v2]Move kzalloc() just before memset() to avoid initializing new sysfs entries
Date: Fri, 10 May 2013 13:24:52 -0700 [thread overview]
Message-ID: <1368217492.2024.31.camel@dabdike> (raw)
In-Reply-To: <A5ED84D3BB3A384992CBB9C77DEDA4D41AFF1A87-ohthHghroY0jroPwUH3sq+6wyyQG6/Uh@public.gmane.org>
I really think the description is wrong. the problem isn't anything to
do with memset, it's because we're not getting a new allocation each
time we call efivar_create_sysfs_entries(). How about this?
---
Subject: [PATCH] efivar: fix oops in efivar_update_sysfs_entries() caused by memory reuse
The loop in efivar_update_sysfs_entries() reuses the same allocation for
entries each time it calls efivar_create_sysfs_entry(entry). This is
wrong because efivar_create_sysfs_entry() expects to keep the memory it
was passed, so the caller may not free it (and may not pass the same
memory in multiple times). This leads to the oops below. Fix by
getting a new allocation each time we go around the loop.
[insert oops report here]
---
James
next prev parent reply other threads:[~2013-05-10 20:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-10 20:09 [PATCH v2]Move kzalloc() just before memset() to avoid initializing new sysfs entries Seiji Aguchi
[not found] ` <A5ED84D3BB3A384992CBB9C77DEDA4D41AFF1A87-ohthHghroY0jroPwUH3sq+6wyyQG6/Uh@public.gmane.org>
2013-05-10 20:11 ` Seiji Aguchi
2013-05-10 20:24 ` James Bottomley [this message]
2013-05-10 20:34 ` Seiji Aguchi
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=1368217492.2024.31.camel@dabdike \
--to=james.bottomley-d9phhud1jfjcxq6kfmz53/egyhegw8jk@public.gmane.org \
--cc=dle-develop-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=seiji.aguchi-7rDLJAbr9SE@public.gmane.org \
--cc=tomoki.sekiyama-7rDLJAbr9SE@public.gmane.org \
/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