Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29225616rwd; Wed, 5 Jul 2023 08:52:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlHVEHecVVjCf4tsZmtlso+RZw0OXxpYHsN2/sy7cXMp6/RYSSPt1uZWhc5PyzWLryhAY6aE X-Received: by 2002:a62:7b07:0:b0:668:82fe:16f1 with SMTP id w7-20020a627b07000000b0066882fe16f1mr17805451pfc.1.1688572342877; Wed, 05 Jul 2023 08:52:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688572342; cv=none; d=google.com; s=arc-20160816; b=BxsWP7WI/Uqr9Ttwc89Nr0m5nmpc1z1183M0hYFYIlHhYQaypqdq4+BHIejqxjHI77 W4lDWcXDy5vvISKBFlnVrNwOPI/712caoCIVflUGwgWXlcol41Ry3sofYpegeOBuJHQI yY9SCDG7Le3kJwSezE7fNOO2jQzH4MfY7PrpMDrTAc11t1Ic1AiCY3jjqq9U1bkz41zE tqsfx7ty8JRaWc3XoNBNAAgK+OuI+gMkItWCxuJzJqKmiIxflUYzRWXIqMAWseXxFKOi A4QCUsvgp/1twpWRu4Cbok3rfcopLpXXL7rrldr58prDz6VE/LWbZIJ2sGEyweiDohS5 tBJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=kFLkuuEr2OZJi8rYluDn15EpBTEmNyobXaduOGi0kXQ=; fh=U2HI+UvrtJxp7aflPOuxonCUKwJ7eeqFkXDPOxD7fPg=; b=Yp3oaupA8T5BpvJXaMwfSIPNqIkhllwzx1vTRDvZD76Z+yURBRpMf0AlBkVD/TJj0b BpGZbQHAROp1xNUEg+z1GkJ4fQvar79q5cjV75U9hRSj/3MNozmHdLiFBDWJepTxV11T 9KmnzkVwh1I/JAAJDEfgvoLbVLyJCzz0Xdi8AXmLVRN9/xSPuDKyzms9riA9NvYjaezf k7OrUGhxThDRZG6LhxYUO7vAXvzzq2XU0iy0a+4HX0TZpBu1uwU1v7PDbQa65W9nGc3W en4xGlWdtpS5/ye5ZJ+Jb0TY7GDLTxgYDRnTwuXyx+dTh/jWYpQx1UvG5WH6rZXWoldL eF6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=LJfXLxXf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fb22-20020a056a002d9600b0067af445c0f0si19679032pfb.291.2023.07.05.08.52.09; Wed, 05 Jul 2023 08:52:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=LJfXLxXf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233155AbjGEPRR (ORCPT + 99 others); Wed, 5 Jul 2023 11:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232571AbjGEPRQ (ORCPT ); Wed, 5 Jul 2023 11:17:16 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8984211B for ; Wed, 5 Jul 2023 08:17:14 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fbd200d354so331295e9.1 for ; Wed, 05 Jul 2023 08:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1688570233; x=1691162233; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=kFLkuuEr2OZJi8rYluDn15EpBTEmNyobXaduOGi0kXQ=; b=LJfXLxXfwx4Z0qyE+pqszPsaFmvHtDisTPTLK35KDWxfNKelSoU/3SaCTvSnm1wgei HbSHtjPNaZG+yRE8p6PqhMZljuh6vB/A10Sjr7p8btuEyyigAYWhFkaS2lYnpR5FATWY NBbkTFbaQke5UyVXjG7syrLOyEq+IFQqf0uiaNwTykpDLTHJVKpt2LpuqFw9CQYesOhw AFG0FRcIGZfNznsUo/PNPT38NUsvRERgFsyADQnIvyFfklVGm+CYtJoOkDOzThxOum24 pAphuXv+QaRboqsq6TaPGMmg2kVOxqApf59N7AQHYJ0IAwRMrkmv666Nv7v0E6EYO361 aPkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688570233; x=1691162233; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kFLkuuEr2OZJi8rYluDn15EpBTEmNyobXaduOGi0kXQ=; b=E61MRvlUcuIIQ4ileboY3OhmwqUKbBhpKxlqqwl7tGUjPN0hpVDNoynB9v8lAuwAvu u02j0X5srpGHj+iXhLMZ4qg/a1yFJpr8OpyL1hYyrQED0EVOQrfLXYkYjCMFKecCyVfb 9+pEAFvx6OHin9ziQtXZbXVbPx1ZxTwOB30DaqvhE7JxV2kyZ+Eivd994X/gRQU/MyhO 6KrrT1/YXQrsHL6to4JgQoRqlomlKASsnEvDk8FaxRAj/37op+Wk8nOMbUfv0HESTTBf JjKlCVHC/3MS09A4KsMjw02t38tHHYZ6KMWJnN+uF1AXtjhJcDYoksYulEErca+SWyZB EkxA== X-Gm-Message-State: ABy/qLYnFTzchyxowCol0GiEvRUrB13hQH+l9veZuK1UsBFyR/QUpKUM l/BzGN51jLmP37bXoqd4+xePCYkHWIggbMKC9GlDs/gnqP7DbLpPkoAeAw== X-Received: by 2002:a05:600c:5119:b0:3f4:2736:b5eb with SMTP id o25-20020a05600c511900b003f42736b5ebmr83931wms.1.1688570232970; Wed, 05 Jul 2023 08:17:12 -0700 (PDT) MIME-Version: 1.0 References: <9a8e34ad-8a8b-3830-4878-3c2c82e69dd9@alu.unizg.hr> <202307022018.B26F5795@keescook> <625e951e-9922-d15d-5520-e8cd5eba1995@roeck-us.net> <4fa56264-f188-46f9-cc77-117b469b3328@roeck-us.net> <2b1a4f49-ba18-0246-af09-4e4133814411@alu.unizg.hr> <202307022230.6121D6896@keescook> <202307031149.823F9A3@keescook> <202307031606.3FD9D0D@keescook> <3CDD1188-7B2A-4D53-9B8F-C07BC39844E9@kernel.org> <19d0e63c-db47-8f02-2f79-0923f675898c@alu.unizg.hr> In-Reply-To: From: Jann Horn Date: Wed, 5 Jul 2023 17:16:36 +0200 Message-ID: Subject: CONFIG_UBSAN_TRAP #UD error message on x86 [was: Re: [CRASH][BISECTED] 6.4.1 crash in boot] To: Kees Cook Cc: Linux Kernel Mailing List , Linux LLVM , "the arch/x86 maintainers" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 5, 2023 at 4:10=E2=80=AFAM Kees Cook wrote: > On July 4, 2023 4:15:20 PM PDT, Mirsad Todorovac wrote: > >On 7/4/23 23:36, Kees Cook wrote: > >> On July 4, 2023 10:20:11 AM PDT, Mirsad Todorovac wrote: > >>> all Wayland and X11.org GUI applications fail to start, with errors l= ike this one: > >>> > >>> Jul 4 19:09:07 defiant kernel: [ 40.529719] invalid opcode: 0000 [= #1] PREEMPT SMP NOPTI > >> > >> Hmm, is CONFIG_UBSAN_TRAP set? > > > >marvin@defiant:~/linux/kernel/linux_torvalds$ grep CONFIG_UBSAN_TRAP .co= nfig > >CONFIG_UBSAN_TRAP=3Dy > > Ah-ha! Turn that off please. With it off you will get much more useful re= ports from USBAN. It might be useful if the x86 code under handle_invalid_op() at least printed a warning about this when the kernel crashes with #UD on a system with CONFIG_UBSAN_TRAP=3Dy? It seems pretty unintuitive and unhelpful that the kernel just crashes itself with a #UD and no further information in this configuration. Even just a "WARNING: CONFIG_UBSAN_TRAP active, #UD might be caused by that" on every #UD that does not come from a known BUG() location or such might be better than nothing... And maybe the Kconfig help text could be clearer on this, too. Currently it does say that this turns warnings into "full exceptions that abort the running kernel code" but it does not say that the exception reporting will become pretty unhelpful, so it's probably not really what you'd want for debugging.