From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DBF939A070 for ; Mon, 10 Aug 2026 06:49:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786344547; cv=none; b=AkmTNOuVuxcY6zTd/2h9rpuZ4ETtIyE//xxeG6FbSMma9b45krWxW8aChiWPOzk+t8B3SPomHgYA8zThFBs1IIdsqs/CYUjDcYrXlAJTaou9M1nUTDqUlnD770aYD/EV+HBzHMw1bhbPPq1o5XOcmFzYOn87XJKpv80XxayvW4E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786344547; c=relaxed/simple; bh=4D5D/f0Xq+4TYrA2Sp41ORXVwyt98I6byagsSpHqcQk=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=FYmh/Z/Bpi1kjNa1qn/Ez/jBuDoMOt+FBBZlRnv4AZ0DsEdW3trZK4uiUeeudodc+bJhFwNsQihr9ZF4NJuta+MP9JorwCkSMXUFAp8ZDbX7pSgVttwnhGwfUC4M527zMtdSphxHvaPRxiiIJNTrWaeemueDv6v+Rf/2egqJ0Z0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=WLf5S2SU; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="WLf5S2SU" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2cc7e86e7aeso16184945ad.2 for ; Sun, 09 Aug 2026 23:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1786344545; x=1786949345; darn=vger.kernel.org; h=content-disposition:content-type:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=50HL9wmONCa+hoZ86lrxs541+o7BFxCLnlWyLnQTfY4=; b=WLf5S2SUYXRWXyEPXRXmGMIw2PeQNCOY85uyEoT9KhTu3kF6sjpsw6ob/ldAGvxA1R OaCKLybrVoidIcAFUJcG/VhZWJfzQuxXB608VxWktVQmAOAYzJa8Y2Upg9zPSZH3N6ZM MWCaD+4WyfkD+ER6YuE1nfrrfROZ43g727qpg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786344545; x=1786949345; h=content-disposition:content-type:mime-version:message-id:subject:cc :to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=50HL9wmONCa+hoZ86lrxs541+o7BFxCLnlWyLnQTfY4=; b=ef/l1ZgzcUo/C5OFtux15J9tLjG1qD72RxN2zlQHCrmpKCAeZAIjAjvjIkKypVK664 nvicVaKVaMCU2bE/pVod7vpWQo9JEMk5fzXT2amDk46olEv4Wi0ZzFnPhwhy5tNsSaWU Rhf4zYhL2HP2uinIRaJwpyIz2Y+xi53AXl+stYtCpCVQ0afHJ8Zd3H1xd2DA2a/oMzuE BrLPDw239Xqm+7tKpzyr7E47jitOKkmRQVR+JfUeISJwWOpqLndsTSy8MicrmeiKFMwL 0vOjDp4f3EQHd5mc3ObD16XX1Uxw5YhswhuP/nBzHiJzkR5QJz5zq+ffcTqOfRWNcTxt uPIA== X-Forwarded-Encrypted: i=1; AHgh+RpsPQCRvWVx2CrIH3LbWONtk15hoHSILpngT8AyxAQJeOeP5m5fOCiCpCXuctgxci1B6LfiGs+6r/lskNA=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3BQfC8jfnmfp4FQGpkCaNbN4hItTRG3MDsG9+Ytk0jLJT7AWE 6d3uXxpwIYZ/noS+0d1EkoUY8jd+PNnF1IGniqUbgqEzCfY+rNnPL/+UwRfkjhO8QQ== X-Gm-Gg: AR+sD12yi8fyYlksa/8GDz9mWGHpPNO/pzgANtD8uQMTFwLTAv24xFNUYaOP5rUb4ip Q5MGpGPeNvoP7q6t9d+3+gSJHiSlTBppf1/Hzwr9S66gQ0Hg1OcJcHGsUq3iUu/3y9QuKtfOjev PjwxlVGCVQOWy4jDQkM4ZHCrUZuZ2z6QM2JNNaWtBanqtxPmEe2PQ19L8hpamZKuj/hKPMg6Dzo w82io2hCUaV5Y4CoHzOwcyhnh4ad964zxF3frPHts3doObw5JLEWKDOH6d1Tq0QF/cH9Zq1AOMb UPHufXvahccW58S7k70LytHDwDpEijrVIwvcwmRfQKNbIFvEHhDJBFCUdIQpMO2VXDZ6563joID L+iYJCIMnjyQYuQXMhwpyPmVcjN+tX2/1rCshEMtTlw/OpxQ7zfj9cm9y15+2ZMU6yVvSgY0U5d 8fua3DRbjYnxGW1CzMuuAxGayO9UkiT70MzQ2zPPnV1F1jTBovlqGnFgR3M2HwDTB7GkzawOe6O hofRsG3O9koaALc0xiYv+lJesfKj11Vo3raH/E= X-Received: by 2002:a17:90a:ec85:b0:380:f85c:94b4 with SMTP id 98e67ed59e1d1-3909d8075eamr30121723a91.7.1786344545412; Sun, 09 Aug 2026 23:49:05 -0700 (PDT) Received: from google.com ([2a00:79e0:2031:6:ddfb:e755:8f7f:81af]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-390b37eac8csm5415699a91.4.2026.08.09.23.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Aug 2026 23:49:04 -0700 (PDT) Date: Mon, 10 Aug 2026 15:49:01 +0900 From: Sergey Senozhatsky To: Thomas Gleixner , Peter Zijlstra , "H. Peter Anvin" Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: x86: missing FRED #PF event data? Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Greetings, I'm currently looking at rather very strange crashes. At first they looked like a bug in core networking, but then things started to look quite interesting: <1>[ 1998.756455][ T6928] BUG: kernel NULL pointer dereference, address: 0000000000000000 <1>[ 1998.756462][ T6928] #PF: supervisor read access in kernel mode <1>[ 1998.756465][ T6928] #PF: error_code(0x0000) - not-present page <6>[ 1998.756468][ T6928] PGD 0 P4D 0 <4>[ 1998.756471][ T6928] Oops: Oops: 0000 [#1] SMP NOPTI <4>[ 1998.756475][ T6928] CPU: 2 UID: 1010221 PID: 6928 Comm: v_net:0 Tainted: G U W O 6.18.32 #1 PREEMPT <4>[ 1998.756479][ T6928] Tainted: [U]=USER, [W]=WARN, [O]=OOT_MODULE <4>[ 1998.756483][ T6928] RIP: 0010:csum_partial+0x8d/0x110 <4>[ 1998.756489][ T6928] Code: 10 48 13 57 18 48 13 57 20 48 83 d2 00 83 c1 d8 74 2d 48 83 c7 28 f6 c1 20 75 40 f6 c1 10 75 57 f6 c1 08 75 66 f6 c1 07 74 15 <48> 8b 07 f6 d9 c0 e1 03 48 d3 e0 48 d3 e8 48 01 c2 48 83 d2 00 48 <4>[ 1998.756491][ T6928] RSP: 0018:ffffb1eb88ecb608 EFLAGS: 00010202 <4>[ 1998.756493][ T6928] RAX: 540017b7b4eb9f91 RBX: 000000000000046c RCX: 000000000000000c <4>[ 1998.756495][ T6928] RDX: b24ec1c172c93eee RSI: 000000000000046c RDI: ffff97cd9c6bbffc <4>[ 1998.756497][ T6928] RBP: 0000000000000494 R08: 0000000000000000 R09: 0000000000000028 <4>[ 1998.756499][ T6928] R10: ffff97cda1a62a00 R11: 0000000000002140 R12: 0000000000000000 <4>[ 1998.756500][ T6928] R13: 0000000000000000 R14: ffff97ce2b800000 R15: 0000000000000000 <4>[ 1998.756502][ T6928] FS: 000075ea3ea45e78(0000) GS:ffff97d51b551000(0000) knlGS:0000000000000000 <4>[ 1998.756504][ T6928] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 <4>[ 1998.756505][ T6928] CR2: ffff97cd9c6bc000 CR3: 0000000164429002 CR4: 0000000100f72eb0 <4>[ 1998.756507][ T6928] PKRU: 55555554 <4>[ 1998.756508][ T6928] Call Trace: <4>[ 1998.756510][ T6928] <4>[ 1998.756512][ T6928] skb_checksum+0x1bc/0x2f0 <4>[ 1998.756519][ T6928] skb_segment+0x729/0xde0 [..] All the crashes are reported as NULL ptr derefs, however, I believe this is not exactly the case. In all crashes CR2 is 0x1000 aligned (we always crash accessing first byte of a page). It seems that csum_partial() calls load_unaligned_zeropad() and we hit what load_unaligned_zeropad() comment describes as very unlikely) case: "word being a page-crosser and the next page not being mapped"). So instead of reading 4 remaining bytes of the page and zeroes for trailing 4 bytes, we panic(). It appears that FRED #PF is set to 0 while CR2 points to a correct page address. I added a simple printk to exc_page_fault: address = cpu_feature_enabled(X86_FEATURE_FRED) ? fred_event_data(regs) : read_cr2(); /* Fall back to CR2 if FRED event data was empty */ if (unlikely(!address)) { address = read_cr2(); pr_err(":: fixed up address to %lx [[fred: %lx cr2: %lx]]\n", address, fred_event_data(regs), read_cr2()); } and got the following while running my tests (and well, we don't crash anymore): [ 254.040223] :: fixed up address to ffff9c4d64af4000 [[fred: 0 cr2: ffff9c4d64af4000]] ... [ 1821.904563] :: fixed up address to ffff9c4e9dd0a000 [[fred: 0 cr2: ffff9c4e9dd0a000]] Does any of this make sense to you?