Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp571657lqp; Sun, 9 Jun 2024 09:03:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU9BHL/aD53jdhTf+t53W9lfS60a4IP5DVJgHgpTUTy+tu0yja707CeK9IArrSUITsY6LV1MSoehfMPPdSy/077upZrQpucE3uWxYymjA== X-Google-Smtp-Source: AGHT+IFHcTBB3YYCjNEnCCYiCldQ79wfndItwMkWyiTCRvt792TGnOx0gYEwWEigcOV8Ets1N8yi X-Received: by 2002:a05:6102:4b0:b0:48c:41e8:e43a with SMTP id ada2fe7eead31-48c41e8e5f5mr2043930137.26.1717948980444; Sun, 09 Jun 2024 09:03:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717948980; cv=pass; d=google.com; s=arc-20160816; b=kgjCIuA9QveThPieqXta+9eoHxf2gYKxxjRXGYOiaMIpPSsasOOEdfkJVqXkOI7e/Y VFVDF8t+ZOhFADi+C8aHbfKTM5OvK7PjJ0K1lWnZsSjsXVk75xfgLNnI5PWfLVSt3Dpf r8eUmwo0CB3FGRnwKik+dJAmY+Qfc4eI09GZV72iKkflFsivOo7kLXvNSR8ex9KK/0sI P+qaryepySELWvcgeq7kDT3Ju0q0bz728n722F4Q8CXvdyPr8IHWBm5VkGNVVHe2tppe mV7LzcMY+QUuh6AVooDK1XzYPdDC1hGSEZV2zQk+fTozVzEuz0mirIfm/9UBnpCg9D3q 1/GA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=8se/4P0/1yragouupDZnLHlKNeIFgaBBOQWyoffwNL4=; fh=E3WGmHdHGeQOlLK2gY2OVbqwZHpwZtJxo0MQwuNP0JM=; b=ql1CChtqI/gbPanpZgH4TbBobyQQu8tJYaDh9TrlDANC152Dcctjbh+sYERiu1yEdz exyZbJ871gku3DMONNS/Aab3dajCD+qMoafi5pnCCYiNghXTNRYirPSfYNA7YrMQdn5n uvn3Xp8qvPLg6EDwdsRU5CkxIZAYPxie8fdvmRNScJgMYhe7/7vsayFn9CdaSW0Vaq70 3RNfkgoXzC3Wvh5s/XsgprzpS71bZnaAGyoeqHO8fLAOrMVXhpdjLudSnzfgp+Ba2Qb4 xeLQXxxjbpHAQu9bNsg0qY7qdZTbKtk6fqYINIPUAX7SNr191oSBtAwGJEUixN3kQpGL dXyQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CTZKdYdm; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-207421-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207421-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ada2fe7eead31-48c1a2145f3si1406105137.490.2024.06.09.09.03.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 09:03:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207421-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CTZKdYdm; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-207421-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207421-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 0C3FE1C2240F for ; Sun, 9 Jun 2024 16:03:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9032146B83; Sun, 9 Jun 2024 16:02:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="CTZKdYdm"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="H2U8an1E" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 3B0EE14265 for ; Sun, 9 Jun 2024 16:02:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717948974; cv=none; b=UO7txSfyrqNSMxjM3BWBc2k7dtKsBvC5lcnzk2CT6IPd2Bbk1StZjLOfTu5PtlBelKUsFrGIbM6s7KSzjXm+XKQ65N/WBVT8cpn6AnnjlB0NOmnFQa65OUnx5ndpNe04jPK88PJerjLziOGI5AxPrPjUFyFpzf2SX34FWAIpuyE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717948974; c=relaxed/simple; bh=DodAw0CDZw5lGkogUtyvn5PgD3gDcFWLPYOSKVO/WY8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=RsHLEssCl224QcNBdTM9ZyiW43Sj2q/ZR9IOZfB1rfszpE4wprcTr4OzNpWWBYjlddRHBbOoytoJ61ycpRMzCe5vrjLZSKVcyVCM2vfVHJ3ppZZgNyUZPE3YBTpv4BChGjyECsVNyoO3JLYFlpYfns7rfvEdMFDq63gI+a2vYUc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=CTZKdYdm; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=H2U8an1E; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1717948969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8se/4P0/1yragouupDZnLHlKNeIFgaBBOQWyoffwNL4=; b=CTZKdYdmMLDCxIjW2mxknSapv9GGe+FNMmuvsGInIeuTFWdb7UoNdyRQVapAgGoU26Kd7C dUdqYB33C2xGdjoP5S/1Y4jMDICyND7OhCHxd5SM/cmEs+Z+7NdBBfFFjcH+F1QJCbhe+O ArcfyuurbSNz9wwOUYMigzrdx34NsukV7Ms0e1MK8Nsrpx3+L5j/hU3qxwttqp5lxkRjFm QzizGZS+f15grs06C+36XV5f2pRBO2cbs3vrNAoYksH5z5612pDKidq4k6ffd3bK2vQnuq zstYR3qKWz2HU1ySzYDlZtKimbTyFOlU5DYz2QEe3IFnDDW1/QOFwIkeKRIwfQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1717948969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8se/4P0/1yragouupDZnLHlKNeIFgaBBOQWyoffwNL4=; b=H2U8an1ECedYXsKy/t3EEa9F/MWxsDkNELjppneZE0Gg2z/NWuh0SxF6V9G1ZeJlI3c2Ke c+rcL4lm7ftQljCA== To: Steven Rostedt Cc: Sam Sun , linux-kernel@vger.kernel.org, x86@kernel.org, syzkaller-bugs@googlegroups.com, peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com, ardb@kernel.org, mingo@redhat.com, Borislav Petkov , dave.hansen@linux.intel.com, hpa@zytor.com, xrivendell7@gmail.com, Greg Kroah-Hartman , Tejun Heo Subject: Re: [Linux kernel bug] WARNING in static_key_slow_inc_cpuslocked In-Reply-To: <20240609102530.0a292b07@rorschach.local.home> References: <20240609090431.3af238bc@gandalf.local.home> <87o78axlbm.ffs@tglx> <20240609102530.0a292b07@rorschach.local.home> Date: Sun, 09 Jun 2024 18:02:49 +0200 Message-ID: <87le3exfx2.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Sun, Jun 09 2024 at 10:25, Steven Rostedt wrote: > On Sun, 09 Jun 2024 16:06:05 +0200 > Thomas Gleixner wrote: >> CPU 0 CPU 1 >> >> kernfs_fop_write_iter() kernfs_fop_write_iter() >> set_attr_rdpmc() set_attr_rdpmc() >> arch_jump_label_transform_queue() arch_jump_label_transform_queue() >> mutex_lock(text_mutex) mutex_lock(text_mutex) >> __jump_label_patch() >> text_poke_queue() >> mutex_unlokc(text_mutex) >> __jump_label_patch() >> >> CPU 1 sees the original text and not the expected because CPU 0 did not >> yet invoke arch_jump_label_transform_apply(). >> >> So clearly set_attr_rdpmc() lacks serialization, no? >> > Hmm, but should jump labels fail when that happens? Or should it catch > it, and not cause a BUG? Well the bug is there to detect inconsistency and that clearly works :) But I clearly can't read, because the jump label operations are serialized via jump_label_mutex. Hrm...