Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2170520pxb; Fri, 5 Feb 2021 10:35:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/n/QG/bshz579CAwElZL/2dB72r5IlN60YaAQ49xP2iUUjNi5GBlEYZMgZswmlGSCNJA7 X-Received: by 2002:aa7:d98a:: with SMTP id u10mr4842818eds.275.1612550110387; Fri, 05 Feb 2021 10:35:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612550110; cv=none; d=google.com; s=arc-20160816; b=UtDFZR+++AQywWGuJ5Si1KRu9TIJzmpM4ej/lGyI356ZbVnCcJ3OLyFPOplOyJGocd M557zbvqMgkfaqP94MECCqngBAaiaKwd4C/XcdDtHX4HnvlC0A0IyxAWq9OvYH4keZFJ FhnQEiCpx/jL4Blga8Ih6Ye36fR/yL0/Kg4IRcJTCdbuBXyTk/EzstkvMj4aQTLWuTp0 sjlp9cEwGmVekJR3QG0i+XJ4JCfuTOTAfWNwKEN3wcFLaSeaXZIAJrGB6TgzMhoeDvo+ +ewBal3ieYTuq4m30VijRF66PbNr8xUvnNLPeRIKDKqhshqyb0FJJtkqPS1Sg7ivJ+Nq NdJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vlQvi4zwrhYdmhWv9Vq2VVPj783HBaHFi1PsMzmm4d4=; b=klTsax7H8OMi+Sx1ldeHaGv7cBGFOSubZ2VPLQZZADbdRWHGBB0rUAzy3ylfuoHLMm 8hc+lAjWc3qB4YwBnx+9XjrHunpuZElUVvsftsp54BUqYF85ZGlwwZH0QLbv03zfpd4W QRviOJgTc3jwRbL5zSDZcKp34Y6AS+H6jsNzb08wubitGfGWJ5UiRLwVryYTFHUvuKGt QNXzz4M8ARDbE8Atb9Niqnkmy2HMs5mBm+48XaQkhirYoV7W/2PIC0LrLsBKiG5eDNMp 9occfFPGPdZMiqOfwUc4ehps+FDJdlvXGbQAcXBZvXKlYMoEnBPJQXuNByNGqgD6EWwJ /14w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=u5KwWnRg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si6507547edj.194.2021.02.05.10.34.45; Fri, 05 Feb 2021 10:35:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=u5KwWnRg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232679AbhBEQs4 (ORCPT + 99 others); Fri, 5 Feb 2021 11:48:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233602AbhBEQq2 (ORCPT ); Fri, 5 Feb 2021 11:46:28 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29585C0617AB for ; Fri, 5 Feb 2021 10:28:09 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id u25so11259195lfc.2 for ; Fri, 05 Feb 2021 10:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vlQvi4zwrhYdmhWv9Vq2VVPj783HBaHFi1PsMzmm4d4=; b=u5KwWnRgD5pCq8gQDMJt0XLX6g9/Z5ZNYeBsQGYQxHdY71V+QRFsaeEOmZm6M+ctjV bQD1HKcK8T2Jrh53z9N+NFHan5+3H3Q6/0X4nUMiXYxT09lykwbEWXR88hTWJHYCZIhq BXZ7E6G+aqGgYdwAarNmkrhuOVfvFrr2LI3XEFW3W0yoeSQD/UI4GL9HIriyQ1weopok aBg/5Bpq9/Gfd1La9sQhfdHOrC5IOja8dkhHG3Vnj3KodZzGKd9qlWAAWxrx00C5gDTb GV+nT32hXVTzhYrxrB+kk7t2GJnWTEf/lCcEBxLbN+sY7IS7PCcnP/uGk5Bw82LtIo87 Obcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vlQvi4zwrhYdmhWv9Vq2VVPj783HBaHFi1PsMzmm4d4=; b=g42x8deN7mXTVM+Jwpp+ciqzGl1qfCYrgaChEAgWpGKGThyOVsA9KVCfaEDByI8i1j nO/GMsiAV6MBz7wKG0YD4nuG8a8wjqi1hDXali383IynGoWK3ExntfpA+CiFqZW1caH5 pjmehv8FXJyewOG1EB3qDI8s1aabg14KoJ9xH4v6jWDkW0bT+u+D+cEDSjedHUtJYx5C pHIYIz/CxBYuXJfYAFv3Bmu9SBLwGybIC+MQHiKz+dUPFY6B26MvS9Dl0PTx6mAALtIB v4v9Iri2xiGS+HFj0fUqzoJqSFegxZ9hiumvwfEWfxkxjYWacZxBRq5Yl9PxTGEvVxAm Nluw== X-Gm-Message-State: AOAM531gqwLUQ6f0zjOiJ6zUkFBI/UVdJ7CvlgCjIfNK25lTM/MaWbc3 ZiHzrs0IVyKHLZphIPJ3+CD0aNoJgTKgf+MwVLbH1w== X-Received: by 2002:ac2:5e84:: with SMTP id b4mr3353569lfq.73.1612549687415; Fri, 05 Feb 2021 10:28:07 -0800 (PST) MIME-Version: 1.0 References: <20210107223424.4135538-1-arnd@kernel.org> <20210118202409.GG30090@zn.tnic> <20210203185148.GA1711888@localhost> <20210205103457.GC17488@zn.tnic> In-Reply-To: <20210205103457.GC17488@zn.tnic> From: Nick Desaulniers Date: Fri, 5 Feb 2021 10:27:54 -0800 Message-ID: Subject: Re: [PATCH] x86: efi: avoid BUILD_BUG_ON() for non-constant p4d_index To: Borislav Petkov Cc: Nathan Chancellor , Ard Biesheuvel , Arvind Sankar , Arnd Bergmann , Thomas Gleixner , Ingo Molnar , X86 ML , Nathan Chancellor , Arnd Bergmann , Darren Hart , Andy Shevchenko , "H. Peter Anvin" , linux-efi , platform-driver-x86@vger.kernel.org, Linux Kernel Mailing List , clang-built-linux , "Kirill A. Shutemov" , Kees Cook Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 5, 2021 at 2:35 AM Borislav Petkov wrote: > > On Wed, Feb 03, 2021 at 11:51:48AM -0700, Nathan Chancellor wrote: > > x86_64 all{mod,yes}config with clang are going to ship broken in 5.11. > > Dunno, it is still broken here even with those build assertions removed. And it > ain't even an all{mod,yes}config - just my machine's config with > > CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y > CONFIG_UBSAN=y > # CONFIG_UBSAN_TRAP is not set > CONFIG_CC_HAS_UBSAN_BOUNDS=y > CONFIG_CC_HAS_UBSAN_ARRAY_BOUNDS=y > CONFIG_UBSAN_BOUNDS=y > CONFIG_UBSAN_ARRAY_BOUNDS=y > CONFIG_UBSAN_SHIFT=y > CONFIG_UBSAN_DIV_ZERO=y > CONFIG_UBSAN_SIGNED_OVERFLOW=y > CONFIG_UBSAN_UNSIGNED_OVERFLOW=y > CONFIG_UBSAN_OBJECT_SIZE=y > CONFIG_UBSAN_BOOL=y > CONFIG_UBSAN_ENUM=y > CONFIG_UBSAN_ALIGNMENT=y > CONFIG_UBSAN_SANITIZE_ALL=y > # CONFIG_TEST_UBSAN is not set > > and clang-10: > > lib/strncpy_from_user.o: warning: objtool: strncpy_from_user()+0x253: call to __ubsan_handle_add_overflow() with UACCESS enabled > lib/strnlen_user.o: warning: objtool: strnlen_user()+0x244: call to __ubsan_handle_add_overflow() with UACCESS enabled > ld: init/main.o: in function `kmalloc': > /home/boris/kernel/linux/./include/linux/slab.h:557: undefined reference to `__ubsan_handle_alignment_assumption' > ld: init/initramfs.o: in function `kmalloc': > /home/boris/kernel/linux/./include/linux/slab.h:552: undefined reference to `__ubsan_handle_alignment_assumption' > ld: init/initramfs.o: in function `kmalloc_large': > /home/boris/kernel/linux/./include/linux/slab.h:481: undefined reference to `__ubsan_handle_alignment_assumption' > ld: init/initramfs.o: in function `kmalloc': > /home/boris/kernel/linux/./include/linux/slab.h:552: undefined reference to `__ubsan_handle_alignment_assumption' > ld: /home/boris/kernel/linux/./include/linux/slab.h:552: undefined reference to `__ubsan_handle_alignment_assumption' > ld: init/initramfs.o:/home/boris/kernel/linux/./include/linux/slab.h:552: more undefined references to `__ubsan_handle_alignment_assumption' follow > ld: mm/mremap.o: in function `get_extent': > /home/boris/kernel/linux/mm/mremap.c:355: undefined reference to `__compiletime_assert_327' ^ this one is https://lore.kernel.org/lkml/20201230154104.522605-1-arnd@kernel.org/. Trying to get the last of these tracked down. I think there were some changes to UBSAN configs that weren't tested with clang before merged. > ld: mm/rmap.o: in function `anon_vma_chain_alloc': > /home/boris/kernel/linux/mm/rmap.c:136: undefined reference to `__ubsan_handle_alignment_assumption' > ld: mm/rmap.o: in function `anon_vma_alloc': > /home/boris/kernel/linux/mm/rmap.c:89: undefined reference to `__ubsan_handle_alignment_assumption' > ld: mm/rmap.o: in function `anon_vma_chain_alloc': > /home/boris/kernel/linux/mm/rmap.c:136: undefined reference to `__ubsan_handle_alignment_assumption' > ld: /home/boris/kernel/linux/mm/rmap.c:136: undefined reference to `__ubsan_handle_alignment_assumption' > ld: /home/boris/kernel/linux/mm/rmap.c:136: undefined reference to `__ubsan_handle_alignment_assumption' > ld: mm/vmalloc.o:/home/boris/kernel/linux/mm/vmalloc.c:1213: more undefined references to `__ubsan_handle_alignment_assumption' follow > make: *** [Makefile:1164: vmlinux] Error 1 > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette -- Thanks, ~Nick Desaulniers