Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2823262lqo; Tue, 14 May 2024 10:07:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbuhmrfV6r1iqcLjuYnsxhxo/Ce5UsEUB2+gkgthsoxaEdB67d4vXZ/OO7GTfCiSOAF0y8HSsW/DX2o8tHr6ilcCJjZPVwLZbh3F3hUQ== X-Google-Smtp-Source: AGHT+IEOdFL1kK+1ise3fY+uG9Gi88G64mPas2WEWOhgvYUxWvDCm+pA7Eo0eZxGFQuwvoTGSjAJ X-Received: by 2002:a05:620a:12d5:b0:792:a85c:979d with SMTP id af79cd13be357-792c759fa26mr1574062085a.31.1715706450209; Tue, 14 May 2024 10:07:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715706450; cv=pass; d=google.com; s=arc-20160816; b=hVm7jK88Ml+X1doK6DncegiIjgYqjRwecfw4AuAJyl8oapAI5WXa7CGfUgUQGbKHQy F1AD2+Jy4+F08JAeNwv9+gheSTluvzNFyZCWawpG3JJPabdnJE/RuhBx0SvZ4T1mikq4 khz21csa/XTv/AUZWmWkbD35dhlTvq71fSOnf0ZpRw2ypX7jEZSWiawz+oPS5ezUKj5O SUrOOwokPHOe8KtQ/EBfAU/yVl3drM8mcwoJ2+jWhqtPynftB3DbcfyDrXdcaKXnHUdq 7GfR1GHQ5Vk2r/LCHACMTK7RXsWvv6ptI7QHbCLtx1zRejiNTk11GgPP94mewo0EEddU W/Sw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=3yZqNPwvXDORKPUW8oFHYhpNWnQ0WTMGBEW6etUKrK4=; fh=KZAeevZhJ61lJ4tqS2bYRntm5SiZz2hjUGIHpip6O20=; b=Rp+cGyutaUR727DAhhBMW9/zn9Cb0TvT8kigFtSONEue+0Ip5SNGKydu+tybFGKPbM 9hIBGH6RVJQoWrvoxN4TvmfWR2hmzYZe7YWDONQ5HE5GjxVHo1HWtpBpcu4u5yaPUpPv 52vWbLOHnEV1OZf9GZTqaCwAJAJEsmBu8nMSMuCW+ofYjtxukP2hhZYoaEOpLsEXkQfN JgUGqWDJ3QUsQXlQvK/h/r7Mdcca9/1eT9AvxRLzWCxbsGbHDQDUXLhLT6wN9/bNR3Vu FhxoAna494Q0yyOkHIHbw4MustVxsKo9M+s5pzAND9ULIbYemx+yBVEVSJaj4zxjKCZc yWLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=W0ZSfUzf; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-crypto+bounces-4169-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4169-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792d0f943fbsi768885385a.528.2024.05.14.10.07.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 10:07:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4169-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=W0ZSfUzf; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-crypto+bounces-4169-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4169-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id DAEE51C2181D for ; Tue, 14 May 2024 17:07:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68C9717F394; Tue, 14 May 2024 17:07:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="W0ZSfUzf" X-Original-To: linux-crypto@vger.kernel.org Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6229B17F37F for ; Tue, 14 May 2024 17:07:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715706444; cv=none; b=sncobIx1bP70JDQoZ1ioUdHbGNoAH85S9vGIZ//v0rKONNX4oVt27EKJsIEXsxlTwjictQsv8RjBbumNMAN7LQoQVHgH+O1cxtZ9X/Mez6y/teX3YbkeEvK7+xCJ0li3Sr1MdIzeftkVBrt8K4+2knOCjPq8xchj90O1d2YUEpg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715706444; c=relaxed/simple; bh=EVeLEj7Jswi8cg76AHCqyTRfsBAkt5bp4by2FNUmIwg=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=cy/q13un1DZ8DStzwUVrei3T+FYXA9T3r4Nx5TBu4ob3H647lkCTigR/zE17seQqSduX+e0bciQ+pRQW9pvbhakjT+LqCeOmnlI9BhylKQxy4q1deeBjar1x0Ow6JCrVGHUprt1X4hDDCReuFk97ro4dJnbVJVzhQu5wRx1pY2Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=W0ZSfUzf; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a5a1054cf61so81419866b.1 for ; Tue, 14 May 2024 10:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1715706440; x=1716311240; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=3yZqNPwvXDORKPUW8oFHYhpNWnQ0WTMGBEW6etUKrK4=; b=W0ZSfUzfXXcRjz9699/BmTypgqAimzUMIXkvCdHDk5wH+2TX+kdf1NrJ6Z92Wp9ITx Z5EtC0PcoL97GKe++s4brT4oNXh1pl+I+JkTjvQgd1bf0sacquN6rBoG5TMCu9UiOf1O KL8vuWiiIOguVYk2DImIbKhHSz812eOsifouk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715706440; x=1716311240; h=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=3yZqNPwvXDORKPUW8oFHYhpNWnQ0WTMGBEW6etUKrK4=; b=sM32eOeQiW0vtVSk+s4Ie0nV+L2GWDJhJvDqmhr4/WMIi6EzFA4pEu1H05kv75/WgP bvpuMrMPCLRjgsXI7r3rlp0Pn6s74bDAdlXQJK7nKWrYUQ2YMVXpMP94D93oMkWwahlM TwYMeg4lm5g2iTZEbRpZPuzdZ2O5VDPA+TVDoxRpi/SXylGG0zmnfISBD5J6qelZvtlt Tib4pHsubHqiI82NRC9iKB/j8vOOTVTIljxJDK0lDHPzn6hM6Dbu7i2K+zdiGN7njVrd yza0gF97QsrHCYrYhwD22OXGlaV38fW8s6cfKYolHYhvEQ4zRrB1L1Xcx1dh7zttgFTx G1mg== X-Forwarded-Encrypted: i=1; AJvYcCVh3qzhz5ddMc3vb/IAlAH31QOCabd5TUqSnSABwUL7FNsfSoNtHXLlGQOhtkEYvt4brHCDAaZ26IIsTBfzJbSlMTG8BCLt2IAdSUNe X-Gm-Message-State: AOJu0YwNwmxpxx2f0D5Z0xYrfDHXWKSqoySLj+lyDXattyCdBjnafx1C m011f6i9zwGpTFJCbzqXXhdaXS0s150W1znpmqbaTisJQP/z3Boyqy98mlphJ82vXL1rn8Ci3z2 4N/pIFw== X-Received: by 2002:a17:907:35d4:b0:a5a:7d28:54aa with SMTP id a640c23a62f3a-a5a7d285594mr320162266b.23.1715706440668; Tue, 14 May 2024 10:07:20 -0700 (PDT) Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com. [209.85.218.45]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a1781d342sm749277766b.6.2024.05.14.10.07.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 May 2024 10:07:19 -0700 (PDT) Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a59b81d087aso43731866b.3 for ; Tue, 14 May 2024 10:07:19 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVq1CATgc6aw8j1hkcLeC4t3mLbCRQw+5lmyBz0UTxH1+dY5ZpfHrAzq/P559F7pAsyOqr/fJ6aTvHfqvi4AwaozEujknFJbuSU7z8I X-Received: by 2002:a17:907:35d4:b0:a5a:7d28:54aa with SMTP id a640c23a62f3a-a5a7d285594mr320156966b.23.1715706439246; Tue, 14 May 2024 10:07:19 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Tue, 14 May 2024 10:07:02 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] Crypto Update for 6.10 To: Lukas Wunner Cc: Herbert Xu , "David S. Miller" , Linux Kernel Mailing List , Linux Crypto Mailing List , Julia Lawall , Nicolas Palix , cocci@inria.fr Content-Type: text/plain; charset="UTF-8" On Mon, 13 May 2024 at 23:54, Lukas Wunner wrote: > > On Mon, May 13, 2024 at 03:12:53PM -0700, Linus Torvalds wrote: > > > > > 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. Hmm. I think all the previous reports of "falls through to next function" that I have seen have been with clang, but that is probably be selection bias: the gcc cases of this tend to be found so much more quickly (because gcc is still more common at least on x86) that by the time I see the reports, it's because of some clang issue. And in fact, when I go test this theory by going to search on lore, I do see several gcc reports. So no, it was never just clang-only, it was just that the ones I had looked at were about clang. > The assume() macro had no effect with clang when I tested it. I suspect that the issue is that with *normal* kernel configurations, the code generation is simple and straightforward enough that gcc did the right thing. And then some more complicated setup with more debugging support enabled (particularly things like UBSAN or KASAN) the code gets complicated enough that gcc doesn't do the optimization any more, and then the conditional in assume() doesn't get optimized away at an early stage any more, and remains as a conditional branch to la-la-land. And you actually don't even see this as a warning unless the la-la-land happens to be at the end of a function. IOW, the "branch to nowhere" _could_ just branch to some label inside the function, and the objtool sanity check would never even have triggered. That's why "unreachable()" can be so dangerous. It tells the compiler that code generation in one place no longer matters, and then the compiler can decide to leave things just dangling in odd ways. The code presumably still *works* - because the actual conditional never triggers, so in that sense it's safe and fine. But it's still just horrendous to try to figure out, which is why I was so down on it. Linus