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

Re: [PATCH v3 4/5] x86/xen: Avoid relocatable quantities in Xen ELF notes


  • To: Ard Biesheuvel <ardb+git@xxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Wed, 9 Oct 2024 13:16:36 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IYZTUMfT1THjUHLWlC/KI1rYIse6Y3fIVSg54AXOhjA=; b=ZVPpDAQewITXU2z9LyHLJR8L8RG8B5MmY7DdtpYJw7mUSDfdRzPnWJGv96GkfAUCg5irq1KtR3GyVged76xjfzcQ7fAQUamwX5nGXjvgm8dVdizDi9Qgudkc9TOSNgKhYCfklFzPqwn5qsiOTa5RYt3BV+aO7HWegOTCHIqQo2OGYdr0jQSnodEaZMRh8AGZeDpk8ACEX4cDPSlPuwj0uLTObn2s+3OOm+LO6oDVnc/td87Wv1jsP03SY/Wghy378mUa/idN5mIyNoTBEJDy14/6q5Zk0WZTJa/jGkYMn/24c7n/yPIj7zo0w05APWgkmsLtsrukTtoe0ezXPBleUA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DFPnFFF89Mhh24q7QbOIafIQhBbK/oh/N4+fsJjiTGOPlmOsmYe3eSW/0nVQbD040nsJ7XGI4fVXkUGHzPZOCeVgOxbBYm5CBKkjPhDR9Aw2YHaQzeAQfBPNCYuO19CzCOq8+l2mdSbdw+rM4osQstihC3Sfns2ouACC90gEoVt/yMTdCAUCtxxwTTMeyYHM7G29Hn0zTAICrPqOl1ADJTfYO1C8wdl91h5CiZG/xXOlX5EKY9ZBue0qRbLgytF3rxbkbfQ7KZ/qU7EIX/WaRXOyWlnnsZPbmBX5xB5T3QCikeSKAW6UMkK4IwgQDuR9gL2nykpdyIhMwRals64vjQ==
  • Cc: Ard Biesheuvel <ardb@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, "Boris Ostrovsky" <boris.ostrovsky@xxxxxxxxxx>, <x86@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 09 Oct 2024 17:16:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2024-10-09 12:04, Ard Biesheuvel wrote:
From: Ard Biesheuvel <ardb@xxxxxxxxxx>

Xen puts virtual and physical addresses into ELF notes that are treated
by the linker as relocatable by default. Doing so is not only pointless,
given that the ELF notes are only intended for consumption by Xen before
the kernel boots. It is also a KASLR leak, given that the kernel's ELF
notes are exposed via the world readable /sys/kernel/notes.

So emit these constants in a way that prevents the linker from marking
them as relocatable. This involves place-relative relocations (which
subtract their own virtual address from the symbol value) and linker
provided absolute symbols that add the address of the place to the
desired value.

Tested-by: Jason Andryuk <jason.andryuk@xxxxxxx>
Signed-off-by: Ard Biesheuvel <ardb@xxxxxxxxxx>

Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>

Thanks,
Jason



 


Rackspace

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