Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1223008

Re: [PATCH v2] arm/xen: Enable user access to the kernel before issuing a privcmd call

Path csiph.com!goblin1!goblin.stu.neva.ru!news2.arglkargh.de!feeder.erje.net!1.eu.feeder.erje.net!nntpspool01.opticnetworks.net!aioe.org!bofh.it!news.nic.it!robomod
From Julien Grall <julien.grall@citrix.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] arm/xen: Enable user access to the kernel before issuing a privcmd call
Date Fri, 11 Sep 2015 20:00:02 +0200
Message-ID <q7AMa-sV-5@gated-at.bofh.it> (permalink)
References <q7zGq-7k9-23@gated-at.bofh.it> <q7zZM-7Wu-23@gated-at.bofh.it>
X-Original-To Russell King - ARM Linux <linux@arm.linux.org.uk>
X-Ironport-Av E=Sophos;i="5.17,512,1437436800"; d="scan'208";a="303052224"
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0
MIME-Version 1.0
Content-Type text/plain; charset="windows-1252"
Content-Transfer-Encoding 7bit
X-Dlp MIA2
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 48
Organization linux.* mail to news gateway
X-Original-Cc <xen-devel@lists.xenproject.org>, <linux-arm-kernel@lists.infradead.org>, <ian.campbell@citrix.com>, <stefano.stabellini@eu.citrix.com>, <linux-kernel@vger.kernel.org>, Riku Voipio <riku.voipio@linaro.org>
X-Original-Date Fri, 11 Sep 2015 18:09:21 +0100
X-Original-Message-ID <55F30AC1.5020202@citrix.com>
X-Original-References <1441988759-4572-1-git-send-email-julien.grall@citrix.com> <20150911170027.GX21084@n2100.arm.linux.org.uk>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1223008

Show key headers only | View raw


On 11/09/15 18:00, Russell King - ARM Linux wrote:
> On Fri, Sep 11, 2015 at 05:25:59PM +0100, Julien Grall wrote:
>> +	/*
>> +	 * Privcmd calls are issued by the userspace. We need to allow the
>> +	 * kernel to access the userspace memory before issuing the hypercall.
>> +	 */
>> +	uaccess_enable r4
>> +
>> +	/* r4 is loaded now as we use it as scratch register before */
>>  	ldr r4, [sp, #4]
> 
> As I mentioned in one of my previous mails, "ip" should be safe to use
> here - it's a caller-corrupted register, just like r0-r3 and lr.  So,
> you could do:
> 
> 	ldr r4, [sp, #4]
> +	uaccess_enable ip

The register ip (aka r12) is used to store the hypercall number.
The easiest one, without much changes, was r4.

> which fractionally tightens the window.
> 
> However, there's nothing actually wrong with your version - there's no
> way we could've got this far with sp pointing at userspace.
> 
> I'm happy with either version, so:
> 
> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>

Thank you!

> 
> How do you want to handle the patch?  I already have some other uaccess
> fixes queued up to send to Linus before the merge window closes.

I was thinking to ask Stefano to carry it in Xen tree. But I don't mind
if it goes with your tree.

Regards,

-- 
Julien Grall
--
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/

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH v2] arm/xen: Enable user access to the kernel before issuing a privcmd call Julien Grall <julien.grall@citrix.com> - 2015-09-11 18:50 +0200
  Re: [PATCH v2] arm/xen: Enable user access to the kernel before  issuing a privcmd call Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-09-11 19:10 +0200
    Re: [PATCH v2] arm/xen: Enable user access to the kernel before issuing  a privcmd call Julien Grall <julien.grall@citrix.com> - 2015-09-11 19:40 +0200
      Re: [PATCH v2] arm/xen: Enable user access to the kernel before issuing  a privcmd call Julien Grall <julien.grall@citrix.com> - 2015-09-11 19:40 +0200
        Re: [PATCH v2] arm/xen: Enable user access to the kernel before  issuing a privcmd call Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-09-11 20:00 +0200
          Re: [PATCH v2] arm/xen: Enable user access to the kernel before  issuing a privcmd call Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2015-09-11 20:00 +0200
            Re: [PATCH v2] arm/xen: Enable user access to the kernel before  issuing a privcmd call Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-09-11 20:10 +0200
              Re: [PATCH v2] arm/xen: Enable user access to the kernel before  issuing a privcmd call Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2015-09-14 11:40 +0200
                Re: [PATCH v2] arm/xen: Enable user access to the kernel before  issuing a privcmd call Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-09-14 12:10 +0200
                Re: [PATCH v2] arm/xen: Enable user access to the kernel before  issuing a privcmd call Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2015-09-14 13:20 +0200
    Re: [PATCH v2] arm/xen: Enable user access to the kernel before issuing  a privcmd call Julien Grall <julien.grall@citrix.com> - 2015-09-11 20:00 +0200

csiph-web