Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp524778lqp; Sun, 9 Jun 2024 07:06:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVdlvVfW8XAH/ouOusEML71L9MLuL82zW6a76oQz0P8/Zn8O56xSyT+PTqrtCLuwfiO+P4Pk2TYXEaFtqrrmGoPcN4i1xUBgxV9Egr5xg== X-Google-Smtp-Source: AGHT+IHBaupXTqaWcrMfCXID2mhXGUivnJrVq16uhcn8w3rb2W7GGp5In8ywXEBjQ4ES7lHKc/Pq X-Received: by 2002:a17:902:e84d:b0:1f7:2ba:4c1f with SMTP id d9443c01a7336-1f702ba4ed5mr20971005ad.22.1717941981127; Sun, 09 Jun 2024 07:06:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717941981; cv=pass; d=google.com; s=arc-20160816; b=h8JRGPR5nNV6oqz2XozAvZ2PzGQfuvkQCVgorE+IrV65WeWPXDUZzNG0dWrGQLisYK hd9QkUatbmGO8j5N1hmJswgbLhaugrTJVpBroqZCb4z1GUNxzEaDtA1bzdhyoA2y+HRo RVnR5zrOot/D0lrAhkgS/uV7m8eN3FkAkhsTxmyd2gjod0y/6w9BbJ8/BoC7j+cuZ0FZ nNm4s0n3twPM2cfsjsdPvF995nVXfqw+7l80fv3pUM6TpzAKwMyTL25BFNXOatu9sM69 7W+U8DTX1Z9wp5C7pRL/8tMiph1mC1t2LQT7IA8ZGmhSqsBYcsoqI1sHI+nVeCuCoaOo l7aw== 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:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=MdK2zU1xqNbST/UF9ZI3uh8ZHJQkTJnk5XC1SoB0iQo=; fh=buMa4vly2EVZxrY/xXA/0aaJY/r+Yv95LFDNhjWCCnI=; b=LCrViThXqEbSIwIIEfgceaB+hDtLZ+zhYj+YrqHf5PbgAKheFu1CLg92DqRe0griu1 sAVcndopJkGsvP6T6UQcXkNZ/srnZdieZDLK9dw0CbjjK9D3RUfvD6qqRFcZTE11477a shSkCtfyAVrUICuX13YSQfIlSWcfrgUunkxfVLI1xI6S+8336XYobU+115tafKcxigNr W5Vfmfd3SH4G6TEDFlKedUqgl6oplrRrBAlaAmLJAxXklWHw8Dr6K29Jpg0g9o5Bs1zA D8Qt8Xus6ORT44sH0uv56h2+kNvZkPsh4AkBwpvvDGA8Eu/QM5u0PvfZZ4LZ1X35hl8O Qz9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wJ8bfMbH; 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-207377-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207377-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd81fbe7si42727595ad.555.2024.06.09.07.06.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 07:06:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207377-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wJ8bfMbH; 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-207377-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207377-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9D02F2816EC for ; Sun, 9 Jun 2024 14:06:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5DB5743AA8; Sun, 9 Jun 2024 14:06:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wJ8bfMbH"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YdJgnW/4" 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 D131C5258 for ; Sun, 9 Jun 2024 14:06:13 +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=1717941975; cv=none; b=DEggallDxpjVION/YHtd3JaIs4EY4YQFRF4sbL8VZCaI+nitEFTYS5z+m03uNT6J9I8SslRiVGnTtS9S6japr1ELuzQSpe6DXf1e8bBw62iPja8bOKwlAXf2sZqjNYSgzd2p4qVQEfWrPx1hHg8GGEMglDWT9TZcY8dzXzynTHI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717941975; c=relaxed/simple; bh=6QVgF/8COzoVrtWePYt2nKdMT6SVy0blal0ckZNuez8=; h=From:To:Cc:Subject:In-Reply-To:Date:Message-ID:MIME-Version: Content-Type; b=rKW7+netH6Gl7BJ45dcPIQYFmHVJqcGDW135vgACI/619qhGdAPZY5mjZCWqLtoqpowRwBfuY3Gk6JzVE0PkycVtGshwXmpuIOP/sdYKfz8Ga9nd2dUVYZiuH20865ZalPxLtoqkpIVggknn1GY6t7QtCdn6+FjS5YqujTgTwj0= 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=wJ8bfMbH; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=YdJgnW/4; 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=1717941966; 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; bh=MdK2zU1xqNbST/UF9ZI3uh8ZHJQkTJnk5XC1SoB0iQo=; b=wJ8bfMbHDbGEDHsvrp99UfMga4Xgzh0XrQ01OnGNVfJkSp7X5K38+/pTszobVdJU1hHJ6z T7+yDwg3zHoBVzzBMz52qXHiy/Ua8wUgpFDW/aBB7gFWaf/lhdRY2RhA0HkTon7aTrwhFB leHoOown417Hkgp4zXwyd2aIsuy8X+MT6R/0jJKyf7U5tczHTCE86OzT4Bdg/0GSsvNJCT 2DAhFFkbPiKCmYGJqJCjphLPfWswn0vnlrE0aVO3CVFf8ANxC7X6zgp7PxuGM7HE0qzAg0 U6XjyBbSYeAnhI+FBZewagL/wmXtooVdGBgvHd35opQfyvn1JmajxvQsnP8srA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1717941966; 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; bh=MdK2zU1xqNbST/UF9ZI3uh8ZHJQkTJnk5XC1SoB0iQo=; b=YdJgnW/4qSsyqca8bqzAqhmLHZGAo15QGtIqPKvwqbehoBQ6wu30GVCX96ATHHDSluD7q9 AuaHyh7RsfPaW3DQ== To: Steven Rostedt , Sam Sun Cc: 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: <20240609090431.3af238bc@gandalf.local.home> Date: Sun, 09 Jun 2024 16:06:05 +0200 Message-ID: <87o78axlbm.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 09:04, Steven Rostedt wrote: > On Sun, 9 Jun 2024 14:33:01 +0800 > Sam Sun wrote: >> [ 82.310798][ T8020] ------------[ cut here ]------------ >> [ 82.311236][ T8020] kernel BUG at arch/x86/kernel/jump_label.c:73! > > This is not a bug with jump labels. It's a bug with whatever is using jump > labels. Looks like something tried to modify a jump label that no longer > exists. The jump label exists. >> [ 82.331873][ T8020] set_attr_rdpmc+0x193/0x270 >> [ 82.332179][ T8020] ? get_attr_rdpmc+0x30/0x30 >> [ 82.332511][ T8020] ? sysfs_kf_write+0x18d/0x2b0 >> [ 82.332832][ T8020] ? sysfs_kf_read+0x370/0x370 >> [ 82.333159][ T8020] kernfs_fop_write_iter+0x3ab/0x500 > > So, something in kernfs modified a jump label location that was freed? No. What happens is: 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? Thanks, tglx