From: NeilBrown <neilb@suse.de>
To: Adam Kwolek <adam.kwolek@intel.com>
Cc: linux-raid@vger.kernel.org, dan.j.williams@intel.com,
ed.ciechanowski@intel.com, wojciech.neubauer@intel.com
Subject: Re: [PATCH] imsm: FIX: map coping causes mdmon crash
Date: Tue, 1 Feb 2011 10:38:41 +1100 [thread overview]
Message-ID: <20110201103841.13b9aa70@notabene.brown> (raw)
In-Reply-To: <20110131160547.5126.57753.stgit@gklab-128-013.igk.intel.com>
On Mon, 31 Jan 2011 17:05:48 +0100 Adam Kwolek <adam.kwolek@intel.com> wrote:
> Too big map was copied (outside allocated memory) and this causes
> mdmon crash for 2 raid0 arrays in container.
> Map of correct (smaller) size should be copied,
> to not overwrite any internal data.
>
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Applied, thanks.
NeilBrown
> ---
>
> super-intel.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/super-intel.c b/super-intel.c
> index 0c988d6..3de4132 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -5074,6 +5074,7 @@ static void imsm_progress_container_reshape(struct intel_super *super)
> struct imsm_super *mpb = super->anchor;
> int prev_disks = -1;
> int i;
> + int copy_map_size;
>
> for (i = 0; i < mpb->num_raid_devs; i++) {
> struct imsm_dev *dev = get_imsm_dev(super, i);
> @@ -5094,6 +5095,7 @@ static void imsm_progress_container_reshape(struct intel_super *super)
> * i.e it needs a migr_state
> */
>
> + copy_map_size = sizeof_imsm_map(map);
> prev_num_members = map->num_members;
> map->num_members = prev_disks;
> dev->vol.migr_state = 1;
> @@ -5104,7 +5106,7 @@ static void imsm_progress_container_reshape(struct intel_super *super)
> set_imsm_ord_tbl_ent(map, i, i);
> map2 = get_imsm_map(dev, 1);
> /* Copy the current map */
> - memcpy(map2, map, sizeof_imsm_map(map));
> + memcpy(map2, map, copy_map_size);
> map2->num_members = prev_num_members;
>
> /* calculate new size
prev parent reply other threads:[~2011-01-31 23:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-31 16:05 [PATCH] imsm: FIX: map coping causes mdmon crash Adam Kwolek
2011-01-31 23:38 ` NeilBrown [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=20110201103841.13b9aa70@notabene.brown \
--to=neilb@suse.de \
--cc=adam.kwolek@intel.com \
--cc=dan.j.williams@intel.com \
--cc=ed.ciechanowski@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=wojciech.neubauer@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).