Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp545647rdb; Mon, 29 Jan 2024 09:58:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IFLg1tFv9d9/vBmNuLsM3C1h8mEKpyjGx8RFmh3D3qUYwRzepVh30T7UlKbUnMDtUTtMzQH X-Received: by 2002:a05:6402:40d4:b0:55d:3171:cadc with SMTP id z20-20020a05640240d400b0055d3171cadcmr5126758edb.0.1706551138281; Mon, 29 Jan 2024 09:58:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706551138; cv=pass; d=google.com; s=arc-20160816; b=CtM7/hwix64Ed26Y+sSjMrxy3SyoKwpNtsc7cGGj+1KtBf4aUM3UcDAdA2yZF6f1dA pnMtXv9X9EnlnyG9YfCGKGcCtDdGhz8MhiNBqEkFNg0+23Jww8OwhiUSYaHnsyplOAtM 8dMvPBbZwuFsPaPGEJxQAm1ElqZLFjG+lSkkxLt/BLX0uo+oxWaj/2m+4mdOzboJzvzO E0/YqHBC8/Gik1okm4HzjJwM5coO+q1GYwLZ0Pra8eiNC9xil8y5LopU8Yza32tTPlHR zw0cdJf/PIADsupTabh18/q9yHrm1e70EWvlr+0TGV+FXGHELY4czTUStfL/LjgCXQ09 TyoA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=AkYokCIwpJBz8xiFXNezYEF1FGA6YIGCtwREDWysAIE=; fh=Md50wLehZoDD5Sx7nueCG/UN4tfSAivmPz4nrPW3cUY=; b=vnOngwJ1Cm+cYP5Fie9THH+aiC2jg+EXCKd+Wb9QHJ/+m173N8O5sBpXFF63VNuIJf GOFKSYfYDF0jKzrem/mLMatCrhswaH/XcFMZNkdJJahZ/sMBP6MPWu7AUQ1fVP5Pbs2+ fGgbsCisys923I4J6CxaAX4UESUPyQufXWApX+j7O3f/HM0l06LGaWWlaQRgy7oGAGk/ ivUR7eS2Jg2FsB6ZrLLcfHMxQroozjXNYo0Xqe6IAVjifdjmNLBafsd+4S2CHn4Q9XcP pGKUdo1v6uB1T4VWkJkQK3jcDR/RFo15CEFru3d6t8RQMtn3NiaOq+dJeWxjT7gXmdvX VvdA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=heAvSSTb; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-43250-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43250-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i3-20020a0564020f0300b0055ebc164cd1si2655175eda.119.2024.01.29.09.58.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 09:58:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43250-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=heAvSSTb; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-43250-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43250-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4647F1F27D4C for ; Mon, 29 Jan 2024 17:57:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB8B53F9E4; Mon, 29 Jan 2024 17:56:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="heAvSSTb" Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.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 34DA7157E64 for ; Mon, 29 Jan 2024 17:56:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706550973; cv=none; b=HsIuzmrBbm0ZESsbF+/TG1tvIvu4+bc6HTEZfU24Rwv8+SVrYf4H02AlpmpjTnodoqv1rcl6xd2qE/rl4P++BklKxKF/wv6EiBIpP4U2f0yCOdD+7M60mWVl7D0KrrV0OqD/V9eWbasUZES2W9W2UJwlBLZN0ZrvUaat/ubXfH0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706550973; c=relaxed/simple; bh=eJ4tB/dpOgHGrxgqDYW104LSCUa8aT6Nh1QEcB2/LFo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=EEnEjrCJkCFDI9UchLuhycGOge4YQw5KTT97B7CSH9ZiVO0QwfWN4rKl40bqhAyCQdKkg6qiiHL5Es/orTGA5Mf/TPiCuObcEUpwB93/htKXiQj0jKi59qOnMFoRP1ZkNu3dNPA0ODEjbzjrBHiLdd7XUmOi9NnxTsJCtsNX/Cc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=heAvSSTb; arc=none smtp.client-ip=209.85.208.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2cf42ca9bb2so36705511fa.1 for ; Mon, 29 Jan 2024 09:56:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1706550970; x=1707155770; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=AkYokCIwpJBz8xiFXNezYEF1FGA6YIGCtwREDWysAIE=; b=heAvSSTb75W6Y3CJNKb21/ZtCHt/Bm7spFnt9UT+MeoMP0WaU8+xVdeLjW1Gsip9o/ j08cG/kTqWr1Mm/650KDN/juOcNmXP5Sv3YuoMvLhEeqMdv2NQAGtIAou7xuFv1bbZKZ uGxL75ttWmr7nvcAAtLH5Rm1dJy4yF3dVYBOU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706550970; x=1707155770; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AkYokCIwpJBz8xiFXNezYEF1FGA6YIGCtwREDWysAIE=; b=V7t/vNAuoK3t1MmdQbLsSb43ICY0MBOfek6TtDSNBpPbL4lB2j9nQHdCbLVAHPAcQf WTVIuw9gyUvf6rpg1WlK7+pdthiSgQJXD7W7QsQsYU3XUyAP9xrAZvmZDpoCuXNdqPah OolHaWAmyZYsZ2QNTPje1N13S9GtcVfaEQYtqhFlnSE4LRouuUcmT11TdpNHIjJnwpId itVHIvE0R2nTsedwHpi9XeGnN5XI2See3Tl2FUmB5YJeIKR1O3RRbB0TbuWR3deqV1wE pwDEwYE33Jlj0judSEumR58GN4me3huytRPcC/t3/fNU07fx8dKv3gv1mYUKgH/nS7W9 vc4A== X-Gm-Message-State: AOJu0Ywxcjz0AI08bSsKkWGxJvC0Lw/LA4NqEX+fwrsecGjKnzhFVEtK wM0InRONV5ptfekJy73Z+2TOB5AOMlBsetKyHCuHpzUZzMYCA80fQYggeUwAEyvsBUHJ3qcqu+V ydHc= X-Received: by 2002:a2e:9c4e:0:b0:2cf:33a3:42fd with SMTP id t14-20020a2e9c4e000000b002cf33a342fdmr4145474ljj.2.1706550969999; Mon, 29 Jan 2024 09:56:09 -0800 (PST) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com. [209.85.208.42]) by smtp.gmail.com with ESMTPSA id e25-20020a056402149900b0055efbf3b5basm1371776edv.56.2024.01.29.09.56.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Jan 2024 09:56:09 -0800 (PST) Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-55a035669d5so3799950a12.2 for ; Mon, 29 Jan 2024 09:56:09 -0800 (PST) X-Received: by 2002:a05:6402:2709:b0:55a:392:143e with SMTP id y9-20020a056402270900b0055a0392143emr4968057edd.27.1706550969019; Mon, 29 Jan 2024 09:56:09 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <202401291043.e62e89dc-oliver.sang@intel.com> <20240129120125.605e97af@gandalf.local.home> In-Reply-To: From: Linus Torvalds Date: Mon, 29 Jan 2024 09:55:52 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address To: Steven Rostedt Cc: kernel test robot , oe-lkp@lists.linux.dev, lkp@intel.com, linux-kernel@vger.kernel.org, Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Christian Brauner , Al Viro , Ajay Kaher , linux-trace-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Mon, 29 Jan 2024 at 09:40, Linus Torvalds wrote: > > eventfs_create_events_dir() seems to have the same bug with ti->flags, > btw, but got the ti->private initialization right. > > Funnily enough, create_file() got this right. I don't even understand > why create_dir() did what it did. > > IOW, I think the right fix is really just this: Actually, I think you have another uninitialized field here too: 'dentry->d_fsdata'. And it looks like both create_file and create_dir got that wrong, but eventfs_create_events_dir() got it right. So you *also* need to do that dentry->d_fsdata = ei; before you do the d_instantiate(). Now, from a quick look, all the d_fsdata accesses *do* seem to be protected by the eventfs_mutex, except (a) eventfs_create_events_dir() doesn't seem to take the mutex, but gets the ordering right, so is ok (b) create_dir_dentry() drops the mutex in the middle, so the mutex doesn't actually serialize anything Not dropping the mutex in create_dir_dentry() *will* fix this bug, but honestly, I'd suggest that in addition to not dropping the mutex, you just fix the ordering too. IOW, just do that dentry->d_fsdata = ei; before you do d_instantiate(), and now accessing d_fsdata is just always safe and doesn't even need the mutex. The whole "initialize everything before exposing it to others" is simply just a good idea. Linus