Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1446674rwb; Wed, 26 Jul 2023 12:38:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlEeIlfzFl744b1GZC/PlI+YWUHMaZyWeGJfGwFRRNmPkkXB74MqbVJnrWjRnpJ7OcOwm8G2 X-Received: by 2002:a17:90b:4f81:b0:267:fb26:32bd with SMTP id qe1-20020a17090b4f8100b00267fb2632bdmr2878143pjb.7.1690400283973; Wed, 26 Jul 2023 12:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690400283; cv=none; d=google.com; s=arc-20160816; b=xnZH0tFcTMEnKpLnZXJHzMXwJk0C3y5hvR6ozAkUHrJIdfPYtfAAJ8dZ48UZyxPrAU OmRwfo5wMFozFFxeiXb2de8eEaV46/yd8Sjk2IhfWJTzTbUCViawORpmOQGOYsryL5xj V7XktmW1fWrfbw8ei0LytLjkO9oLUWVM5ir8rhfOKmdfyv2300k069p3LIZp+9sgRKpf epOXHGinAmDQUmCJzLb1lkk7x4sfhcKnPFLEonxkfiYm1adPU+cQccjPAMudycyT3FPR huZ/3qCXkCVOIl7H0flAkHkjWM6lULEqG8v/8bMQ2wvbPplaxER1UgEz7mgtt+Hn9CPO 2pEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=hiilh5SPUkxLXuPg+O64Z/2jvTR2UErAkyuGNIhDY9w=; fh=k+WmTPnTL6J4Wy46KdBqY3PzRbnHY1nTd1BmYz3mTEM=; b=Q+Z48HBectwEDnVXRIVhpz9pWgt45jrwIrTE7qMcIgfPVxhurisHYLBl+dXLgiHjQj Z//9o+mHxFWU0OIbR0yAIZRD2Z4mUteXmEiJcCxuqypZ9vhzF7PXrZs6F/a8DJkHvc0s u3w8cPBv5gEN1oeS2q8YS5cOX0XjfmiCASOuF5l59anB+T52Rq0Yiuo7hCu16B3MLyqt oet70k2LQ5NcJGoSkTMUKBZs5+ldvCksrcTub1JYFmcrzwDfBWi4mM/7Pwrm1ppJPBYb X3AFlaYh2IyslnwQy3n25OURrOvqxVzIwhXdeW6KSEQn2SeMbAOwl16tSmpaTc1gkORR 8TOw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r7-20020a17090a454700b00263e299dff6si1467750pjm.74.2023.07.26.12.37.50; Wed, 26 Jul 2023 12:38:03 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231165AbjGZSpj (ORCPT + 99 others); Wed, 26 Jul 2023 14:45:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230516AbjGZSpg (ORCPT ); Wed, 26 Jul 2023 14:45:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 439A21FF2 for ; Wed, 26 Jul 2023 11:45:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CE1DB61C63 for ; Wed, 26 Jul 2023 18:45:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C323C433C8; Wed, 26 Jul 2023 18:45:34 +0000 (UTC) From: Catalin Marinas To: Will Deacon , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64/sme: Set new vector length before reallocating Date: Wed, 26 Jul 2023 19:45:31 +0100 Message-Id: <169039710582.703186.12071568238096709534.b4-ty@arm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230726-arm64-fix-sme-fix-v1-1-7752ec58af27@kernel.org> References: <20230726-arm64-fix-sme-fix-v1-1-7752ec58af27@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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, 26 Jul 2023 13:12:26 +0100, Mark Brown wrote: > As part of fixing the allocation of the buffer for SVE state when changing > SME vector length we introduced an immediate reallocation of the SVE state, > this is also done when changing the SVE vector length for consistency. > Unfortunately this reallocation is done prior to writing the new vector > length to the task struct, meaning the allocation is done with the old > vector length and can lead to memory corruption due to an undersized buffer > being used. > > [...] Applied to arm64 (for-next/fixes), thanks! [1/1] arm64/sme: Set new vector length before reallocating https://git.kernel.org/arm64/c/05d881b85b48 -- Catalin