Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2501066lqo; Mon, 13 May 2024 23:55:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVP9bSausN9cJ9P/Vi65n7ZmyBb5it/d1/BVsFjTVUb5AytRjaIlZPct4z2KTQogMj76+PM75r0DYaQvjYmgV2Z3oMNXShXOWArH5FP4A== X-Google-Smtp-Source: AGHT+IEekrHff1gNY6I8foHj8E3FMqCQDW9a3yxZb1Exlyuwm2Dyw+Ja51Mj2Z11egYBQpUQ8EtE X-Received: by 2002:a17:906:80f:b0:a51:8d60:215a with SMTP id a640c23a62f3a-a5a2d572b0emr792267566b.27.1715669713597; Mon, 13 May 2024 23:55:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715669713; cv=pass; d=google.com; s=arc-20160816; b=RJ/VO0f0Gt2I7eTozQ8b6TfKg80a5MiYDXJFUBdG9sz1cZ78P+QWZd2CwMX7SJybAc 5DdRWTYdEytdWcnzu6jYhMuhvC6hKRt9mWMgFP60XwGk1JS+WqioyJAUBNJ8kGputq8Q mAHVbvwymGd0LasbNjY/dx0TBxxW1VA7WIkLyC9xTEPDFbvRInD8EB0NifgMewId7aeY 8F1RLGB2HAc7SDeisiIFQ3DSqHTb7mG0Qu/Vw57d4luSoOgAEQlCSSn+OcKUUAXy/Drt vbDOndlCSBoMSSXA3PAhubREBls7xC6tQtpScJNQG4u5H821iByfAbQbS2WBqqNyywEf hMrg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date; bh=nPLNYfiwDNTH1bP3FqXuKKEJCV9BN2ETi89UlOL/fAw=; fh=KrYY9uFYJC/E82c7Xs+ST4G4Z07MAjSeoBRnRfNGxYw=; b=xY0jPlvF4OP6DVWItBAHdPjfTb3azgjX8PObKrJP7FK43MBME3iZdS4H1mfMcg17Yo v7gB3W9Zf3tSIXZ40BwW53dcS25KSjYPkcXkUYgWBx3wrC6C8MZgRSE9b7+3EeU2vszw OJnw2WMgF04YhVBA3OXmagpazDp+QOc/z2xw2FkcB1o5qobVXqbOkfm3DUVKfCc906bb bQEEe1E8OZ200xm88obuOJk5DT1KCcfGU101jlPCWYwMV7vJQYl8/nSK6P1uLT1lCYOj MtDUD/fhjlE+UBBjJ34Aa4N60SwtuujopfWpa934K6QU+5PEvMNWg5f9+AVECuPgHUae 7sew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-178356-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178356-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a1797c90dsi595785866b.228.2024.05.13.23.55.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 23:55:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178356-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-178356-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178356-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5761D1F21B5A for ; Tue, 14 May 2024 06:55:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 08AE6101F7; Tue, 14 May 2024 06:55:05 +0000 (UTC) Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [176.9.242.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE737AD31; Tue, 14 May 2024 06:54:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=176.9.242.62 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715669704; cv=none; b=J+IB6TRIaxzfjMEJkUZw0FvIvs69lY6fVtQMzsIFz/t7k+8XG+KvKwo81x2UbUKvzjhEkcwdfN2Ey4M5hVZ0ww3sNNuYY1tVRcN+779KzSd1kxHYlxih/vzLJx87qLnfUZOrcv/Obgi8W0Nrl+CY8/QTRme7NZxIwCzckbxTl4I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715669704; c=relaxed/simple; bh=dnr1nGL3WqI6iGgA/+7AS53QJ5C6Oo8Pvkj89qA/GZA=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=U8Rfos/kmUwgN4J5E09iyKJ3daCNCzbhRiWBYeQ3x2/DN0BDdSeBg4Nuqa9RrLNoWQxUx4QiwTz7g8md5dln0IsTrzd7svRfoY2VM4DO1kAdM5SCIwDUIKMqiNQGjCCnF5x+lbgfzuvBqjbRVQWkKVvWMhM/LL02l4idx8sBnSs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de; spf=none smtp.mailfrom=h08.hostsharing.net; arc=none smtp.client-ip=176.9.242.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=h08.hostsharing.net Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 74E4410195696; Tue, 14 May 2024 08:54:52 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 3D8A96FAE9C; Tue, 14 May 2024 08:54:52 +0200 (CEST) Date: Tue, 14 May 2024 08:54:52 +0200 From: Lukas Wunner To: Linus Torvalds Cc: Herbert Xu , "David S. Miller" , Linux Kernel Mailing List , Linux Crypto Mailing List , Julia Lawall , Nicolas Palix , cocci@inria.fr Subject: Re: [GIT PULL] Crypto Update for 6.10 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, May 13, 2024 at 03:12:53PM -0700, Linus Torvalds wrote: > On Sun, 12 May 2024 at 20:50, Herbert Xu wrote: > > > > Lukas Wunner (1): > > X.509: Introduce scope-based x509_certificate allocation [...] > Having random kernel code add random "assume()" lines is absolutely > not what we should do. Particularly not in some random code sequence > where it absolutely does not matter ONE WHIT. > > Now, I've pulled this, but I killed that "assume()" hackery in my merge. Thanks, appreciated. This way of handling it spares me from having to resubmit the patch without assume(). (The patch is prep work for upcoming PCI device authentication.) > > However, this patch still has two outstanding build defects which > > have not been addressed: > > > > https://lore.kernel.org/all/202404240904.Qi3nM37B-lkp@intel.com/ > > This one just seems to be a sanity check for "you shouldn't check > kmalloc() for ERR_PTR", so it's a validation test that then doesn't > like the new test in that 'assume()'. I've been in touch with Julia (+cc) to silence this coccinelle false-positive. But now that the assume() is gone, the coccinelle warning won't appear anyway: https://lore.kernel.org/all/alpine.DEB.2.22.394.2405062136410.3284@hadrien/ > And the second one: > > > https://lore.kernel.org/all/202404252210.KJE6Uw1h-lkp@intel.com/ > > looks *very* much like the cases we've seen with clang in particular > where clang goes "this code isn't reachable, so I'll just drop > everything on the floor", and then it just becomes a fallthrough to > whatever else code happens to come next. Most of the time that's just > more (unrelated) code in the same function, but sometimes it causes > that "falls through to next function" instead, entirely randomly > depending on how the code was laid out. Curiously, this particular 0-day report is for gcc 13.2.0 though, not clang. The assume() macro had no effect with clang when I tested it. So the unnecessary IS_ERR() check persisted despite the macro when compiling with clang. Only gcc honors it. Probably another reason why you would hate the macro. :) clang supports __builtin_assume(). In theory that should have the same effect as __builtin_unreachable() on gcc (albeit with inverse boolean semantics). In practice it had no effect. (Tested with clang 15.0.6.) https://clang.llvm.org/docs/LanguageExtensions.html#builtin-assume So with clang there doesn't seem to be a working way to tell the compiler about assumptions it can make. And with gcc it's apparently "hit and miss" depending on the exact gcc version and code. :( > I suspect that because I removed the whole 'assume()' hackery, neither > of the above issues will now happen, and the code nwo works. Yes. I guess this effort was over the top, so apologies for the noise! Thanks, Lukas