From patchwork Thu Aug 1 13:45:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roxana Nicolescu X-Patchwork-Id: 1967674 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WZVbz3TdHz1ydq for ; Thu, 1 Aug 2024 23:46:06 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sZW7v-0001Z5-TI; Thu, 01 Aug 2024 13:45:55 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sZW7t-0001Ye-Bc for kernel-team@lists.ubuntu.com; Thu, 01 Aug 2024 13:45:53 +0000 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 72FC03F048 for ; Thu, 1 Aug 2024 13:45:52 +0000 (UTC) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5a2ceb035f9so2879407a12.0 for ; Thu, 01 Aug 2024 06:45:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722519952; x=1723124752; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4KwAcE8aVNVD84L/5Yjeociui8P6hFNoV+zej2BacE8=; b=oGgGZxQvcX5R/lH65/FyoW8XI7lE1wxpLuvBrtGGdXwi78qY8u6BCchJXOJSsRY4g4 PRWyF4jZZ6HO9WQC/dLTmsNHllsS0F9qrpsKQhSQjSREXo6e7hUGLc27DyG4Suc6LMqg Ytc7/RD5ZGAVxlpREW2fl+nHuOB7pSUSMLsG3LT5PGl00z/ZYR2yLX9C1rq0zXgELhlz oOYTIAS1hg9P8nO5zarWPpw4YWMFktSXY+d73Gbotr6I0Q/Ruj5o2eVfvMUd8yu+dEQ+ NSCY9onvZrxHI/+zEhz2kmSDVt2UWocLvHJHviR+z7WX32uS/3HPNaPBYJmcBH7+QR/1 x5Zg== X-Gm-Message-State: AOJu0YwrvK1YW1eNDpTPdS+Z/W+c8KUKWSm+phwqXjxDAuxjeAPFxF5Q iIb6rC02YJcjErtZHFNWAasFVIx7FbGGWR1eiBi8hduD0OredCqc3sAHw8SD4qCmBfcWyS5UUsO XsROhFr6S+5HLOu90RsB3V+BK5v9TwBRUYO0XaNipa4APANORpkJtCGohkPRju3x3/x7JThnPsn ESCEMpMFdmfd1BKjA= X-Received: by 2002:a05:6402:5108:b0:57d:40e3:2a71 with SMTP id 4fb4d7f45d1cf-5b77c28e541mr1253391a12.6.1722519951847; Thu, 01 Aug 2024 06:45:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE56EZaTGFOTZoe4RIu/nmQJV5uQ0+GUy2qYxV/xhDY8ie5FCMd/ktGFBRJOKdITB9dzt2Ssw== X-Received: by 2002:a05:6402:5108:b0:57d:40e3:2a71 with SMTP id 4fb4d7f45d1cf-5b77c28e541mr1253371a12.6.1722519951339; Thu, 01 Aug 2024 06:45:51 -0700 (PDT) Received: from work.lan (82-170-30-252.fixed.kpn.net. [82.170.30.252]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ac64eb3a95sm10109527a12.61.2024.08.01.06.45.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 06:45:51 -0700 (PDT) From: Roxana Nicolescu To: kernel-team@lists.ubuntu.com Subject: [SRU][J:linux/J:hwe-6.8][PATCH 1/1] UBUNTU SAUCE: Revert "randomize_kstack: Improve entropy diffusion" Date: Thu, 1 Aug 2024 15:45:49 +0200 Message-Id: <20240801134549.91291-2-roxana.nicolescu@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801134549.91291-1-roxana.nicolescu@canonical.com> References: <20240801134549.91291-1-roxana.nicolescu@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2073267 This reverts "randomize_kstack: Improve entropy diffusion" that changed the kernel stack for entropy to 1KiB, limitting the thread kernel stack to 15KiB. This impacts virtualbox 6.1.50 on jammy, that is no longer maintained upstream. The issue does not persist on version 7.0.20 due to a code refactoring that probably resulted in less stack usage. Fixing it on the jammy virtualbox package side is not straightfoward because the fix is not easy to backport to 6.x and upgrading the jammy package to 7.x breaks current users machines. This is a temporary solution needed due to the impact, more investigation is required. Signed-off-by: Roxana Nicolescu --- include/linux/randomize_kstack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/randomize_kstack.h b/include/linux/randomize_kstack.h index 5d52d15faee0c..d373f1bcbf7ca 100644 --- a/include/linux/randomize_kstack.h +++ b/include/linux/randomize_kstack.h @@ -58,7 +58,7 @@ DECLARE_PER_CPU(u32, kstack_offset); if (static_branch_maybe(CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT, \ &randomize_kstack_offset)) { \ u32 offset = raw_cpu_read(kstack_offset); \ - offset = ror32(offset, 5) ^ (rand); \ + offset ^= (rand); \ raw_cpu_write(kstack_offset, offset); \ } \ } while (0)