[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] x86: Check return values from early_memremap calls
- To: Borislav Petkov <bp@xxxxxxxxx>, Ross Philipson <ross.philipson@xxxxxxxxxx>
- From: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
- Date: Mon, 10 Oct 2022 10:46:20 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.76) smtp.rcpttodomain=alien8.de smtp.mailfrom=siemens.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=M3F4/Mg5QZArYB53vsIqqIhiUrWNKzG4L7HrJ8U7xVU=; b=Se1Z4CFSDnTVs0Gf6ea80kNm+07xHCBfFpi2ibHyWuaWqkCrBQ3vtDVHdj0cRhTffFt+aCtn579Tt/zVJOadpfMfE7f/YsejmhbjDgFO+F7Ys7WN3B1bXZrp0fWQ/518ArNbkr0KBXeaVePAlnlZimWP+HhuPU0Gfrxj7EQUgbMcn4OQwyDKQWe5QIlVOAQYQSPC4ayausoYlXg6LRLB0IbgARlhzrXPctQnWbuZQjXKYCdMtMt32S+gpDR8MsxEFFbJjxjPAgWXMLVK0yVF9m6JXbMDJTDoAa124IVh2qTzf49UIwg8Tr22WcPiCln2lhFNeEKeHYaWvowyyijQqQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OGgTFgLML7ftpomyo1pbBC+6XMwCY0/MeqnrvRvk2SPljdUhH0CXMEvgpHjeTLDfnYNsRJUUTz9DlqSCEEBX40Lc+vnOcglUsC6ySgOp/o702BmPde7p3L901ChJHN48l4Hd0Ai6SkgzJAEF78iOoWoIZptprjwjO13DXjRLDRwpfS/GtAQMRG7SjMD1JrunVc/aLVzcdMq2S8f3/zc8S3GKGic7lFDVjImyN8eUCSv4eBh6cK6ehzI4CCM4sjCdgIgt3uUcBBk3wZc/qyCGrJ9iq0Z4KWyUiMbwgdO5w4G5r3rS7MH/ZRaKAi7hkZmIaEOEPPzFCNN/m2rUv/4/6w==
- Cc: <linux-kernel@xxxxxxxxxxxxxxx>, <x86@xxxxxxxxxx>, <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <tglx@xxxxxxxxxxxxx>, <mingo@xxxxxxxxxx>, <hpa@xxxxxxxxx>, <luto@xxxxxxxxxxxxxx>, <dave.hansen@xxxxxxxxxxxxxxx>, <kanth.ghatraju@xxxxxxxxxx>, <trenchboot-devel@xxxxxxxxxxxxxxxx>, <jailhouse-dev@xxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Mon, 10 Oct 2022 08:46:50 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 08.10.22 17:12, Borislav Petkov wrote:
> Adding Xen and Jailhouse people and MLs to Cc.
>
> Folks, thread starts here:
>
> https://lore.kernel.org/r/1650035401-22855-1-git-send-email-ross.philipson@xxxxxxxxxx
>
> On Fri, Apr 15, 2022 at 11:10:00AM -0400, Ross Philipson wrote:
>> There are a number of places where early_memremap is called
>> but the return pointer is not checked for NULL. The call
>> can result in a NULL being returned so the checks must
>> be added.
>>
>> Signed-off-by: Ross Philipson <ross.philipson@xxxxxxxxxx>
>> ---
>> arch/x86/kernel/devicetree.c | 10 ++++++++++
>> arch/x86/kernel/e820.c | 5 +++++
>> arch/x86/kernel/jailhouse.c | 6 ++++++
>> arch/x86/kernel/mpparse.c | 23 +++++++++++++++++++++++
>> arch/x86/kernel/setup.c | 5 +++++
>> arch/x86/xen/enlighten_hvm.c | 2 ++
>> arch/x86/xen/mmu_pv.c | 8 ++++++++
>> arch/x86/xen/setup.c | 2 ++
>> 8 files changed, 61 insertions(+)
>
> Ok, a couple of notes:
>
> 1. the pr_*("<prefix>:" ... )
>
> thing is done using pr_fmt() - grep the tree for examples.
>
> 2. I think you should not panic() the machine but issue a the
> warning/error and let the machine die a painful death anyway. But Xen
> folks will know better what would be the optimal thing to do.
>
> Thx.
>
For the Jailhouse bits:
Reviewed-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
(IOW, panic'ing is fine for us here)
Thanks,
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
|