Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2193487iof; Tue, 7 Jun 2022 22:47:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGA39SdCAiP8Ud2TS7k5oqGPJapYWM1uRHsO5GcRHmM3kqnTfQ/9pO5yMz2vUNapgHt01k X-Received: by 2002:a05:6a00:194d:b0:51b:eb84:49b1 with SMTP id s13-20020a056a00194d00b0051beb8449b1mr23341902pfk.77.1654667240282; Tue, 07 Jun 2022 22:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667240; cv=none; d=google.com; s=arc-20160816; b=QZ8RtNDQXsxNdbeRdhms6bHHsxOcGsDufe2FSOFG7yTSr6pV7vtBSZ1C3SpUvCFfYt IBx1ceaf0rQszPb1vMWDLY5Q4MMG6nhx9UhgsBP+LJ5NHzKnE3oLlJudnKAoSFfIYqY5 j71eqVbOMzNw1RZNdDvcdWYxmBzwmrzyAdUO4McZUdTbILeu/luoRQoc9HQ3sS13zh6S m+APMnuIh0dtx9vu4PTD5Kxdne8WPNQrylAqB22BcnCvxD6K8jc4sBEfxKMDMzGxKTrr jD61N8MmhTejnZ1AVi1wvfHtG7XCh3PJXiHjf/HPNabLtjXLiaBd2EAjnV5z/How+9b3 G85Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AWnMwme8JHkE78r6d0oN+uOBpnp6in3lJMIAsHs7A4s=; b=S74e6Hdx+rGDboVTN0p5Huqile+I7Ej48QzirJM1qMs+patMQLFzArriUARFXGHFUX BBchFmY/zfoKxQ1fkQfyQFFgSt5L1GbkNn9iHMSA/UA4oi7FeturGkLWgdOdsLasdSSo kah32ek/HXv9UkvqGicOMfdnQDMklNoXk2lr1otyY6qfcWrtKZELUVbTu5nFhNG95/45 E6dRPgcJYQQwIZd5K8MPTyyonZLNbkvqwFzQgP8xhi97BbYYgLrQLyIyWbxwslKCvNiI PhULwTmfNPzf/UBXFAxnBlSZ5VglxJMO2y1EZ0aA1J+RLtQpY279zQx9rHWmzZrv89Bd QLLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lEjvzEqz; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j11-20020a654d4b000000b003fdd5d8c869si9208152pgt.685.2022.06.07.22.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:47:20 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lEjvzEqz; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D7B0649C83D; Tue, 7 Jun 2022 22:12:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234428AbiFHAXV (ORCPT + 99 others); Tue, 7 Jun 2022 20:23:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383757AbiFGWZO (ORCPT ); Tue, 7 Jun 2022 18:25:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2899426EEBF; Tue, 7 Jun 2022 12:22:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AE713609D0; Tue, 7 Jun 2022 19:22:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B82C7C385A2; Tue, 7 Jun 2022 19:22:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629772; bh=9E8DLy1jXcYjYN0wqF0KZRXbQUMR5XhMKZCP7s2JCPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lEjvzEqzSsrZTeAiG93YqHKJHj3wi96zXe2r6D1PytjGLCl8tyY+4y/zVDuC173zi g8163PfgXtd84hCQKXwGRqqkV+nyGFQ7ImPbCxAdtGDAKQ8CCaDjUvatlNLsNWONaw eEHBfdtlMCOEmn7whRwKHelSKGcPLlzfVEM5OZno= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Borntraeger , Claudio Imbrenda , Heiko Carstens , Nico Boehr Subject: [PATCH 5.18 761/879] s390/perf: obtain sie_block from the right address Date: Tue, 7 Jun 2022 19:04:39 +0200 Message-Id: <20220607165024.953078037@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Nico Boehr commit c9bfb460c3e4da2462e16b0f0b200990b36b1dd2 upstream. Since commit 1179f170b6f0 ("s390: fix fpu restore in entry.S"), the sie_block pointer is located at empty1[1], but in sie_block() it was taken from empty1[0]. This leads to a random pointer being dereferenced, possibly causing system crash. This problem can be observed when running a simple guest with an endless loop and recording the cpu-clock event: sudo perf kvm --guestvmlinux= --guest top -e cpu-clock With this fix, the correct guest address is shown. Fixes: 1179f170b6f0 ("s390: fix fpu restore in entry.S") Cc: stable@vger.kernel.org Acked-by: Christian Borntraeger Acked-by: Claudio Imbrenda Reviewed-by: Heiko Carstens Signed-off-by: Nico Boehr Signed-off-by: Heiko Carstens Signed-off-by: Greg Kroah-Hartman --- arch/s390/kernel/perf_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/s390/kernel/perf_event.c +++ b/arch/s390/kernel/perf_event.c @@ -30,7 +30,7 @@ static struct kvm_s390_sie_block *sie_bl if (!stack) return NULL; - return (struct kvm_s390_sie_block *) stack->empty1[0]; + return (struct kvm_s390_sie_block *)stack->empty1[1]; } static bool is_in_guest(struct pt_regs *regs)