Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933245AbdGKQnk (ORCPT ); Tue, 11 Jul 2017 12:43:40 -0400 Received: from mail-eopbgr10106.outbound.protection.outlook.com ([40.107.1.106]:2976 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932831AbdGKQnf (ORCPT ); Tue, 11 Jul 2017 12:43:35 -0400 Authentication-Results: googlegroups.com; dkim=none (message not signed) header.d=none;googlegroups.com; dmarc=none action=none header.from=virtuozzo.com; Subject: Re: KASAN vs. boot-time switching between 4- and 5-level paging From: Andrey Ryabinin To: Andy Lutomirski , "Kirill A. Shutemov" Cc: Dmitry Vyukov , Alexander Potapenko , "Kirill A. Shutemov" , Linus Torvalds , Andrew Morton , "x86@kernel.org" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andi Kleen , Dave Hansen , linux-arch , "linux-mm@kvack.org" , LKML , kasan-dev References: <75acbed7-6a08-692f-61b5-2b44f66ec0d8@virtuozzo.com> <20170710123346.7y3jnftqgpingim3@node.shutemov.name> <20170710141713.7aox3edx6o7lrrie@node.shutemov.name> <03A6D7ED-300C-4431-9EB5-67C7A3EA4A2E@amacapital.net> <20170710184704.realchrhzpblqqlk@node.shutemov.name> <20170710212403.7ycczkhhki3vrgac@node.shutemov.name> <20170711103548.mkv5w7dd5gpdenne@node.shutemov.name> Message-ID: Date: Tue, 11 Jul 2017 19:45:48 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: VI1PR0501CA0009.eurprd05.prod.outlook.com (2603:10a6:800:92::19) To AM4PR0801MB2722.eurprd08.prod.outlook.com (2603:10a6:200:14::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c6a80bba-658c-45ad-f71e-08d4c87bf676 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:AM4PR0801MB2722; X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB2722;3:037Ua+qGp1mbJZ/8JDmfGxlGmTe0gFtnftjqv9HaSdctCvqF0ohNqK4a35f3WPo+DWD4XPMtI9pnD/A9sqd+s8kn74Q8mqfKeLoSHTR6OdBM5Y3ufCOKomW2MZpFEPSyH/FiLul7gn6Qp0Cy5PhZrBWDny70J9hVYGWnBUUS2LNSunZE/Ns/OQgokA0tebrPN7MHcd0X+PZ+Q80nf6xLhGYAYcwuaxsVFRLViNHUS6bzeafgv/5uKZQoatou6DlCDR27q4Tm+HhayzcxTwqr/jHI9NfQ6ewkftdOZ5dE5fV73YqBDuVGHKGtvpyKtqb9WFyxLpmtWQt2mO+rC10B1JbqLNej1i8vEzQpuzwvpij2zJZ7OeGTzcwk4N+BltOhIDBc0o2bxytQT4gt9xImnR2GzcmwwotYz2q53FwZjjIJJfQOqMaycdn13xpL30hnaORwgpf3JsjmdiQNrc1/RcblZP8587pHMwUXKGco0D/vdje5zlIgzUPhudQcuIUC72Q9OhUtgNKuC/RahdGk4qTiFfGSbSZHSuvflqbp2N1JZ2AjsVVsCg1fjkJB3BczipuFdCoQg2CY9mIk8Ufh2YWGZ9aj3dHv0fvd36sULSIwqooksFgL/S45WSioNQkzaRZgMWl1YeRVs0qIs5uOivAUovI/glWZKrA1nhCdlt6JracL50jEPy1b+V+t2koGt65RmTdu8m9IwSiMDVsIQ0aSUGmMObGqS9+lAp6/G5Y= X-MS-TrafficTypeDiagnostic: AM4PR0801MB2722: X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB2722;25:Tm8+w59SnCgRkXN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/s= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6041248)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:AM4PR0801MB2722;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:AM4PR0801MB2722; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTRQUjA4MDFNQjI3MjI7NDo0am9jWGJjaVNPQWVyM0M5YjgvY1l6UHN4?= =?utf-8?B?MHgvY2NyK0dmOTl2cytKME9iaGU4cGlzc1J3aXN4MzNXQVhKVSthUUhzNEFu?= =?utf-8?B?RjBNYkFrU1hIRVpNSWxFZUp4bWZLZk5Ud2VVa2RWQWpoSGRLYXFCeHRoMUha?= =?utf-8?B?V2NQOGszeldjUThBYzhLbFJneU12SlNEamd4ek9YcEJ1YlhKVlRUWG9SWith?= =?utf-8?B?Q1NkSDZrcExheXV5a2JWaitWWHBxSU9SZTErZitHd0txSWtKZ2lKSkQ2NnZL?= =?utf-8?B?NExCcHNPNGp2blJNUldoSkk5WkhLU1YxaWc1TTBMNWJsWTAwakx1dlU0dDBB?= =?utf-8?B?ZExsSm53VThXWldBaEtIY3VITjJBeHFYeEt6RHNCZGRpNXVFM3UrTmhCS1pN?= =?utf-8?B?Zm5mVU03WFFkeTI1NTZHQnNNMnhHMkV4alNBbDJneDgrR2VVcnllUFVKNkJi?= =?utf-8?B?N0tXeWRIM29aejE2dldjb0xJZW43aEtjNFZYemd0bDBTQ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ZUVrNDQ4ekVtdmdPU0hQVlRKSng3?= =?utf-8?B?NUtYbmJVeGhyMDZDYVdpOXNDdDllcHArb3dqb2J5V09GWStvS2ZtR2YwOVZM?= =?utf-8?B?TEJuQjVIYVpHckcrM2RQRWJRekZVWjFlVnBEMWoxVXFqQzB4ZmtFWkJ6aUlJ?= =?utf-8?B?cGRtRzF4dFhTR0N4emhSeDY1UHh4cTZORjY3TWR1UjhKMVVVN1drdTNhdGpY?= =?utf-8?B?WEpSZTUvbEd4ZzBUMjhJaHBwL0J4c1pYREtzMzI5UUhlTkxXait4akV3dz09?= X-Forefront-PRVS: 0365C0E14B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(7370300001)(4630300001)(6049001)(6009001)(39840400002)(39410400002)(39450400003)(39400400002)(24454002)(377454003)(76176999)(93886004)(86362001)(42186005)(31686004)(54356999)(66066001)(54906002)(53936002)(47776003)(189998001)(6246003)(8676002)(33646002)(50986999)(36756003)(478600001)(575784001)(31696002)(4001350100001)(7416002)(3846002)(305945005)(77096006)(23676002)(81166006)(6116002)(5660300001)(2906002)(50466002)(7736002)(65826007)(4326008)(6666003)(53546010)(38730400002)(2950100002)(83506001)(6486002)(229853002)(7350300001)(25786009)(2870700001);DIR:OUT;SFP:1102;SCL:1;SRVR:AM4PR0801MB2722;H:[172.16.25.12];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTRQUjA4MDFNQjI3MjI7MjM6dTc4cTZQNkIvTVpNUm9YRExuTEIxMjlJ?= =?utf-8?B?TEp6V0ZobEkrNkU4c3R5T1hNOHc1ZEg2aEh5RjErUFYxbnFPUS91V3Bjd2Q5?= =?utf-8?B?WllTUXA4bWFhVVZ2d2ZEMlBBVkxZZHppQW5NbGxJdC8wSmxXc041SXI4d1Nu?= =?utf-8?B?aEhiZTF1RlF3WEpwQWEwWTNxUTh0WHFWLytobHdnZWtlaFJjYlFCeU8rbE5C?= =?utf-8?B?MHd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012SnZ3SkxEQWtna1AvTWVSUXpxaGp6Sm9F?= =?utf-8?B?VVpTOENTS1lWb1RGdVJReUJuYW83UVV5eW5oeVQySnE5eGtISnMrRkRTSlFB?= =?utf-8?B?K3RzeHZ1RzVpNzlnL2V6d200VGhDbGsvVS93ZW11aXYyV0RiSng5TmsxT1Iy?= =?utf-8?B?Vkl2UEM1c3UvdnBZblRJdy9XdTdYbmEvTmtIQUJEV0xkUnV2NUlBK1NCZklv?= =?utf-8?Q?7w/ELH3t/sqws/UkAHDRN1a/ky8AbMHzc=3D?= X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB2722;5:PRZzZu1g97H2EvD2OTUJXViH/JoOWlKRV6zXc8KOQbAJjzx5zq+0vSSqR9ZWwgc7hOn6u7crl0XPSXUQZOJmA0p8WABEhTVoMl+kYtRjPrbChSazSMcO/tDqIC98iRDOi2hgC/fDC4Bq/B1SDJObA1/M8jqdbVpOnQ8WnWfN2IQCepqpl/EeQt6S6v13HcskaOFt0lcTAVSqcBkVcJgTss82T//op2Ig6h7pZggQ73c7Ku78qiBTKwlYZxNcQntlmTS1gY29ejT7K4tug9w3V/apfvlSFPnLkKK8q73pbXa772f2ynZAZVlwyZct5h+mBN3lFdEBzrVYqyyV3as2wE665m4MbNRWZmJmjVkhlBSQaHrL+OJ5+SniFCCu9K98XuN5RoTU8xBcJNhtm4TboK/Gd6k2nxwEiH7SfxdeJsw975o3eZDzJ9dpge2C2C9SL2LXsZqBkYsCtBOqGgAavGbejc2WPsvq2Ldw+P8rTWWg40aj5k8845XTPo9BS/s0;24:zlXasNpJAvxC7grhmeGd2ezzUBRpVTWz4hgl/r/8cA8S/cqoF9mNVDSu2rtlzbDcu7Z9v4gLuIIMOYajHPDs6S0Zk3B3AzfznLMZM/o0Fpo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB2722;7:vBmPcMkPxJaK42gvnpX5asWr89n7vFShycNoAveNZws0tAAd7yKRKRmogSjCqS5Ctz6JWGztWwjLv4Fm8Iv1XZKjh4TBqyZX/fDdBnc7CvXkgGkSIIoBT+AE1oO9wrEAdsM+HnX0vyWHcZpr/jQBAcKsWucpVWr+Bv47Xlcb1/4fkCjP9/rBNipczz5B5v2tEKJi3QQffC84PfWZcgqdsZpOH+UmU8Oe/nvgrVdMU1qVmVtVJjM7KvrsMiR5RoMKTL1/mkn6dk3Nlfy9ZP3U3hjTTdfkfmPFUaMp+X7ahJvXIx2OHmKBL5SP38DVWSvfx3ar833L85g9PIxdOvkMsyVRKUc1vCJE73KEtuNCQpUJXHtLtDZJSAKRSJt4HR1BhMpWEuNou+9xiBJnRCF3AYQVHfXiPU8bZg+oTL2omslTgP6g/kRNbTmzoyEsUSfOQYKQWJnzuHJRbDbq1GEwzzRiXIFSpS4e93GTFdgwN49u+320ST5Iz+4xF76wdDEwk+nWRK4tNubQ2IOEGwJmIgLUNDB4kQ7O35MQIu7p8pT2XJb3eufsyPACzCYyo9zUdRgRH7Aqozrf6T35UFQwM325AMKWaPw/NwHJWIRBc7DWn9r9NheyEYXaI5RNMZno7xZUxm2Gy1Vhaeh8XjuohqaB2aGwDw00JmS0uEbUO6eLlyemR8j/ePjFEnc5OjXOI0/wZeBf6xUKADyxRXMEBC+JY6c2DMYJ3jf2EorMJVodefQaMmtWWALY2oOz8tE0BR6mpFQqa+NuohgS/ta7vJQ9p79MT2bgs3jApw0Siz4= X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB2722;20:KsLVhXMeZl+66nPjpRzc1bwC68+c3ABuHypqovek3kC6TKAmZH0yykMVbo/iMqioNqU34DoYu0moN40J/QmcwLmFARo/8aysk/OVgAFrMlrEL9lf3W5AgnkTBz0aHVCCyOkIcX0kzOst/aA8RsXiejXKbcWGRpsJ98N3EeAUKQc= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2017 16:43:29.1356 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0801MB2722 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2117 Lines: 55 On 07/11/2017 06:15 PM, Andrey Ryabinin wrote: > > I reproduced this, and this is kasan bug: > > │0xffffffff84864897 mov $0xffffffff83f1d0b8,%rdi > │0xffffffff8486489e movabs $0xdffffc0000000000,%rax > │0xffffffff848648a8 push %rbp > │0xffffffff848648a9 mov %rdi,%rdx > │0xffffffff848648ac shr $0x3,%rdx > │0xffffffff848648b0 mov %rsp,%rbp > >│0xffffffff848648b3 mov (%rdx,%rax,1),%al > > we crash on the last move which is a read from shadow Ughh, I forgot about phys_base. Plus, I added KASAN_SANITIZE_paravirt.o :=n because with PARAVIRTY=y set_pgd() calls native_set_pgd() from paravirt.c translation unit. --- arch/x86/kernel/Makefile | 1 + arch/x86/mm/kasan_init_64.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 4b994232cb57..5a1f18b87fb2 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -24,6 +24,7 @@ KASAN_SANITIZE_head$(BITS).o := n KASAN_SANITIZE_dumpstack.o := n KASAN_SANITIZE_dumpstack_$(BITS).o := n KASAN_SANITIZE_stacktrace.o := n +KASAN_SANITIZE_paravirt.o := n OBJECT_FILES_NON_STANDARD_head_$(BITS).o := y OBJECT_FILES_NON_STANDARD_relocate_kernel_$(BITS).o := y diff --git a/arch/x86/mm/kasan_init_64.c b/arch/x86/mm/kasan_init_64.c index d79a7ea83d05..d5743fd37df9 100644 --- a/arch/x86/mm/kasan_init_64.c +++ b/arch/x86/mm/kasan_init_64.c @@ -72,7 +72,8 @@ static void __init kasan_early_p4d_populate(pgd_t *pgd, * TODO: we need helpers for this shit */ if (CONFIG_PGTABLE_LEVELS == 5) - p4d = ((p4d_t*)((__pa_nodebug(pgd->pgd) & PTE_PFN_MASK) + __START_KERNEL_map)) + p4d = ((p4d_t*)((__pa_nodebug(pgd->pgd) & PTE_PFN_MASK) + + __START_KERNEL_map - phys_base)) + p4d_index(addr); else p4d = (p4d_t*)pgd; -- 2.13.0