From: Richard Mortimer <richm@oldelvet.org.uk>
To: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org, debian-sparc@lists.debian.org,
linux-lvm@sistina.com, richm@oldelvet.org.uk,
marcelo.tosatti@cyclades.com
Subject: [linux-lvm] Re: [PATCH] Re: lvm problems on sparc64 - Trying to vfree() nonexistent vm area
Date: Tue, 31 Aug 2004 23:00:10 +0100 [thread overview]
Message-ID: <1093989609.2124.139.camel@duncow> (raw)
In-Reply-To: <20040830174015.10edb69b.davem@davemloft.net>
Thanks. Fixes the problem nicely.
Whilst I remember I forgot to include the patch below last night. When I
was looking at the ioctl32.c code I noticed a few inconsistencies in the
structures used in the copy to/from user calls. I don't think that the
original versions were incorrect but it seems best to make things
consistent.
How do they look
Richard
--- arch/sparc64/kernel/ioctl32.c.orig 2004-08-29 00:12:09.000000000
+0100
+++ arch/sparc64/kernel/ioctl32.c 2004-08-31 22:06:23.000000000 +0100
@@ -2949,7 +2949,7 @@
case LV_REMOVE:
case LV_RENAME:
case LV_STATUS_BYNAME:
- err = copy_from_user(&u.pv_status, arg,
sizeof(u.pv_status.pv_name));
+ err = copy_from_user(&u.lv_req, arg,
sizeof(u.lv_req.lv_name));
if (err)
return -EFAULT;
if (cmd != LV_REMOVE) {
@@ -2992,7 +2992,7 @@
case PV_CHANGE:
case PV_STATUS:
- err = copy_from_user(&u.pv_status, arg, sizeof(u.lv_req.lv_name));
+ err = copy_from_user(&u.pv_status, arg, sizeof(u.pv_status.pv_name));
if (err)
return -EFAULT;
err = __get_user(ptr, &((pv_status_req32_t *)arg)->pv);
@@ -3064,7 +3064,7 @@
if (u.lv_bydev.lv) {
if (!err)
err = copy_lv_t(ptr, u.lv_bydev.lv);
- put_lv_t(u.lv_byindex.lv);
+ put_lv_t(u.lv_bydev.lv);
}
break;
On Tue, 2004-08-31 at 01:40, David S. Miller wrote:
> On Tue, 31 Aug 2004 01:15:40 +0100
> Richard Mortimer <richm@oldelvet.org.uk> wrote:
>
> > I'm seeing problems with lvm on sparc64. I have a reproducible test case
> > using snapshots where I can reliably reproduce an error similar to
> >
> > Trying to vfree() nonexistent vm area (0000000140072000)
>
> For once it's not sparc64's fault, it's a bug in the generic
> LVM ioctl handling :-)
>
> It saves both pointers, clobbers the userspace copy, then only
> restores one of the two pointers correctly. Easy to fix, see
> below.
>
> Marcelo, please apply, thanks.
--
richm@oldelvet.org.uk
WARNING: multiple messages have this Message-ID (diff)
From: Richard Mortimer <richm@oldelvet.org.uk>
To: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org, debian-sparc@lists.debian.org,
linux-lvm@sistina.com, richm@oldelvet.org.uk,
marcelo.tosatti@cyclades.com
Subject: Re: [PATCH] Re: lvm problems on sparc64 - Trying to vfree()
Date: Tue, 31 Aug 2004 22:00:10 +0000 [thread overview]
Message-ID: <1093989609.2124.139.camel@duncow> (raw)
In-Reply-To: <20040830174015.10edb69b.davem@davemloft.net>
Thanks. Fixes the problem nicely.
Whilst I remember I forgot to include the patch below last night. When I
was looking at the ioctl32.c code I noticed a few inconsistencies in the
structures used in the copy to/from user calls. I don't think that the
original versions were incorrect but it seems best to make things
consistent.
How do they look
Richard
--- arch/sparc64/kernel/ioctl32.c.orig 2004-08-29 00:12:09.000000000
+0100
+++ arch/sparc64/kernel/ioctl32.c 2004-08-31 22:06:23.000000000 +0100
@@ -2949,7 +2949,7 @@
case LV_REMOVE:
case LV_RENAME:
case LV_STATUS_BYNAME:
- err = copy_from_user(&u.pv_status, arg,
sizeof(u.pv_status.pv_name));
+ err = copy_from_user(&u.lv_req, arg,
sizeof(u.lv_req.lv_name));
if (err)
return -EFAULT;
if (cmd != LV_REMOVE) {
@@ -2992,7 +2992,7 @@
case PV_CHANGE:
case PV_STATUS:
- err = copy_from_user(&u.pv_status, arg, sizeof(u.lv_req.lv_name));
+ err = copy_from_user(&u.pv_status, arg, sizeof(u.pv_status.pv_name));
if (err)
return -EFAULT;
err = __get_user(ptr, &((pv_status_req32_t *)arg)->pv);
@@ -3064,7 +3064,7 @@
if (u.lv_bydev.lv) {
if (!err)
err = copy_lv_t(ptr, u.lv_bydev.lv);
- put_lv_t(u.lv_byindex.lv);
+ put_lv_t(u.lv_bydev.lv);
}
break;
On Tue, 2004-08-31 at 01:40, David S. Miller wrote:
> On Tue, 31 Aug 2004 01:15:40 +0100
> Richard Mortimer <richm@oldelvet.org.uk> wrote:
>
> > I'm seeing problems with lvm on sparc64. I have a reproducible test case
> > using snapshots where I can reliably reproduce an error similar to
> >
> > Trying to vfree() nonexistent vm area (0000000140072000)
>
> For once it's not sparc64's fault, it's a bug in the generic
> LVM ioctl handling :-)
>
> It saves both pointers, clobbers the userspace copy, then only
> restores one of the two pointers correctly. Easy to fix, see
> below.
>
> Marcelo, please apply, thanks.
--
richm@oldelvet.org.uk
next prev parent reply other threads:[~2004-08-31 22:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-31 0:15 [linux-lvm] lvm problems on sparc64 - Trying to vfree() nonexistent vm area Richard Mortimer
2004-08-31 0:15 ` Richard Mortimer
2004-08-31 0:40 ` [linux-lvm] [PATCH] " David S. Miller
2004-08-31 0:40 ` [PATCH] Re: lvm problems on sparc64 - Trying to vfree() nonexistent David S. Miller
2004-08-31 22:00 ` Richard Mortimer [this message]
2004-08-31 22:00 ` [PATCH] Re: lvm problems on sparc64 - Trying to vfree() Richard Mortimer
2004-09-02 1:37 ` [linux-lvm] Re: [PATCH] Re: lvm problems on sparc64 - Trying to vfree() nonexistent vm area David S. Miller
2004-09-02 10:58 ` Richard Mortimer
2004-09-02 10:58 ` [PATCH] Re: lvm problems on sparc64 - Trying to vfree() Richard Mortimer
2004-09-02 20:28 ` [linux-lvm] Re: [PATCH] Re: lvm problems on sparc64 - Trying to vfree() nonexistent vm area David S. Miller
2004-09-02 20:28 ` [PATCH] Re: lvm problems on sparc64 - Trying to vfree() David S. Miller
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=1093989609.2124.139.camel@duncow \
--to=richm@oldelvet.org.uk \
--cc=davem@davemloft.net \
--cc=debian-sparc@lists.debian.org \
--cc=linux-lvm@redhat.com \
--cc=linux-lvm@sistina.com \
--cc=marcelo.tosatti@cyclades.com \
--cc=sparclinux@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.