[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Arm: avoid .init.data to be marked as executable


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 14 Jun 2021 12:02:43 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sHdTEpmXpCdOEPV+CfkRImOUaqcbwd4uriVh5rok7iQ=; b=a2pHaJTggM0TUx+4p6cOb0Kne87wofW1cRDHED+VgwXwnShhUwTk1deKI88s7vm6NgDfKi06IL36BY4G3J1Hsn4fcS35cMfF2w5vCcABoj9wVdd5ch9iNMVoOK/Di6dhwQVEeCqSMf32armCwAk/bd42OC5hyPeJJxlGjWjFNWb8Vc3v99fEDbXqi6geKc6JAZ8kU3q1e9fG5YV2sNEixPcg+MzMI2Rfi+QKAHEGxaVnoz4tojgJ/Us8TqW0EC4W+gDC7kc0Wrr42KjCbdg9gq+St19E1c02CnzbzD6JGLZ3WKR3BFgWL35caUIjx601JsLKa1Hbs0JIVL37/X4xhg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ncI++CmL0y/6asVKUsQjZk0mAMNwdoLSdn6Z5rAx3y2UBBynfmfw1nCO0GeOg1jQCTW1950z5SRrpzzYeavnfjUmZ9bssMrIdgAfJqIY/N1qeYNdwYBn/eYCRMfZ04tfN3gijXFWlQOAKlvMXgrkxuYnigIedMm0zxqSqGN44UdF9FsGAQjpgvdfqxEOoH1GN5UTtcZ7tUC7EOBn8lRn5AH4v8fRE1nW5gaEYqcYwGLljSrUJEJw9cltpAX9ui176u9l84tVIBJIXolPkX4YrFS2nfInkgZ3zq3Jcq5X6s+vXPK+TlokBlFgCBBfrcL7m7SIWMbnNjwnmU+p3evYZw==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 14 Jun 2021 10:03:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.06.2021 11:41, Julien Grall wrote:
> On 11/06/2021 11:39, Jan Beulich wrote:
>> This confuses disassemblers, at the very least. Move
>> .altinstr_replacement to .init.text,
> 
> The alternative code was borrowed from Linux. The code has now changed 
> to cater very large kernel. They used to keep the .altinstr_replacement 
> and altinstructions close to each other (albeit they were both in 
> .init.text).
> 
> I am not entirely why, but I am a bit worry to separate them. What sort 
> of test did you do?

Well, just build tests, on the assumption that relocation overflows
would be reported by the linker if the sections ended up too far
apart.

>> dropping the redundant ALIGN().
>>
>> Also, to have .altinstr_replacement have consistent attributes in the
>> object files, add "x" to the one instance where it was missing. >
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>> ---
>> I'm uncertain whether having .altinstr_replacement inside or outside the
>> [_sinittext,_einittext) region is better; I simply followed what we have
>> on the x86 side right now.
> 
> This means the altinstructions will be marked executable in the 
> page-table. They technically should not be executable, so I would move 
> them outside _einittext and make sure the section is aligned to a PAGE_SIZE.

Hmm, are you saying you bother getting attributes right for .init.*
in the page tables? I ask because we don't on x86, and because it
would seem wasteful to me to pad to PAGE_SIZE just for this. But
you're the maintainer, i.e. I'm merely double checking ...

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.