Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3025107lqp; Mon, 25 Mar 2024 17:31:08 -0700 (PDT) X-Forwarded-Encrypted: i=4; AJvYcCWKtSfkJzonLCCzv9HHVNw7A/2Eyq3ByYk5+69ZYNi/LOBQGG+UZPFIrIzM2o5mTB2ThFZWywMwB1yB7MSn/MosMMCUoghNGFoDfvUyag== X-Google-Smtp-Source: AGHT+IEKbBb8YU2UKendilloMtwNeQcSsPKoC40J2CTslPF8VAF1UZ8DKULCFziR4Q2NHVaTg+YP X-Received: by 2002:a05:6a20:788f:b0:1a1:87a9:5caa with SMTP id d15-20020a056a20788f00b001a187a95caamr6134957pzg.29.1711413068191; Mon, 25 Mar 2024 17:31:08 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1711413068; cv=pass; d=google.com; s=arc-20160816; b=DngtRUjKAzljXKzNRuv6wPbidahXSEsWzpe3xM+wYDMnLIlN9YXVNxBQx9hWocg4bb ItSTeK/FhPzNh6j0W5jV0RgT/IORsQlWqgTXOscA/kiWALS8CBEpmUTnW6l3vDqWMABu iye9tr7CBjsobFVUjSNgSAw0Kq1SGKTmXWDQQEYtBMs+eeqfk2jAhd6m1PkHQ+sxV7P6 +/fG25ijXI5z9AGksdDoSw0p1lFbidQjMBaXAtADRhwx+uKngIEgBxqsTr8fcqOaEmaP eX+49dyrv5jk6+DTGk0A1fzuOcAwYM6py2/wyV7dXWBzDMJ37zCkauOm6YwFm0DJjvzi H0jA== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:references:in-reply-to:subject:cc:to:from:dkim-signature :message-id; bh=/MvYkEvJaEDaTgzwXlfM3JjLexNKp+ZD+YKnxgQvNvo=; fh=TItrNgO7NBqN3QfSGtCJnNInGhzVgANaWuU3ky6LPd4=; b=YNpnOj9EeO839BtPeiRGciVfDI3qPOR6JkAF8XiKOi813QCp9xFkqbBgcvQNOuoRNo 9BKjchaV29vW0VoP01g9Sph0HIaExiSzwnWam9ZlZ70O2md/+KTPHCfE7vJfAh/Mz2Uz DV2IbHJoSXO0K2Xdb5+c1WqnFDvJAJkF+IuItqmz9/xUgjoHJ4GfTWWjHYbunXE5SZhy GD7sLC3DuZCd1qcCvSgj18b5bF4fDDaVyBTDam9AycY3J0uj9C0SqFCu0D8rA69xvgRZ Dgznzzh5a9btTW2OXZZpKm55R7gt8PbqNEwNcawNEzGus2n4r+91feDbI6iQqJozDRVA M2eA==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@manguebit.com header.s=dkim header.b=RgjwET4G; arc=pass (i=2 spf=pass spfdomain=manguebit.com dkim=pass dkdomain=manguebit.com dmarc=pass fromdomain=manguebit.com); spf=pass (google.com: domain of linux-kernel+bounces-117996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117996-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=manguebit.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id o24-20020a17090aac1800b002a0351d76d3si8467064pjq.140.2024.03.25.17.31.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 17:31:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@manguebit.com header.s=dkim header.b=RgjwET4G; arc=pass (i=2 spf=pass spfdomain=manguebit.com dkim=pass dkdomain=manguebit.com dmarc=pass fromdomain=manguebit.com); spf=pass (google.com: domain of linux-kernel+bounces-117996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117996-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=manguebit.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 1078DB2A67C for ; Mon, 25 Mar 2024 20:58:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A7B95D73B; Mon, 25 Mar 2024 20:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=manguebit.com header.i=@manguebit.com header.b="RgjwET4G" Received: from mx.manguebit.com (mx.manguebit.com [167.235.159.17]) (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 1550359B70; Mon, 25 Mar 2024 20:58:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=167.235.159.17 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711400293; cv=pass; b=oeboe9FxNM+iH4szWegnoHe7W+zE+jywIzQwHRTG+1GldeDEKbjN83Tv5q3Q9zeMVXWXXTuVZXOQv7RZUtGyqOkeJZDhDvNka2TgZg7YW8q4YvVlP+cH+AunVGfGqm8cpj8jwVki+S2m8McTcJmYD3lR5XdLB83HEO+3ErjBgCk= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711400293; c=relaxed/simple; bh=76tSERWslhopEOc4u8fRhhRiUnP40jVe+hwo51dCKeo=; h=Message-ID:From:To:Cc:Subject:In-Reply-To:References:Date: MIME-Version:Content-Type; b=q0Xz3o5rUKCGcPyZ1su+qZwz3F0j+FGB52VWhxHr1dRpzno8cMWnXtDL+ZljWgC9CLqut2XzCJE+hSCWFHs4c3XVqBF9CwXTmYxpBYnBIscnBBTKpqrLGhx4Q9Ft/dA/ZQY3/zsoWjO5nKVFh7zDtLn8QJqzDC48sBBusyRMUWE= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manguebit.com; spf=pass smtp.mailfrom=manguebit.com; dkim=pass (2048-bit key) header.d=manguebit.com header.i=@manguebit.com header.b=RgjwET4G; arc=pass smtp.client-ip=167.235.159.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manguebit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=manguebit.com Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1711399640; 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=/MvYkEvJaEDaTgzwXlfM3JjLexNKp+ZD+YKnxgQvNvo=; b=RgjwET4GT2LPkB3kXDJcBckngZwYEgONKnEF6H/uBX2L/FYUh2ER2kLLnvfXCAgcWZWkWP QLKd4xRY+JWMn3+u88vfL1PXEyTZMcal9eMFiqDCjo7VOvxo/AXclOOZQwpK+9HlN36QE1 9eF2q5+5y9v+g2nOuWpfdKo8ndO0+DVtvFVV8P08QS1v0CHvDriLaIVowB1wJSn+tCJZmz DF+b/2h+y+9PXA0SaRj3DJpCKPjp3jEHm6QjdaBfBxEnGyVlX5h/S0Mnef8xi09aoheARe bAQf9wm14PDUCkUO7OudaG9uQ71lLlRIORyCeMe7RNI+f+jtzRkOYKi2r4DfTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1711399640; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/MvYkEvJaEDaTgzwXlfM3JjLexNKp+ZD+YKnxgQvNvo=; b=WS1iOrWs1eb+MxY1dQd/82e124OrdEijARV75JqHo+hWaA2Ne7Sz9YEm3Knw9ow3zkLbUJ +mDGgam3XUX/bJFFhj6yXX02oCoM35iOGavtxAXZbOkCFxvzWZRiQ+h45TqW2qV1IzCGbQ WOpMphq+e9AN40niw2tH6hCv43SEgxQT9VwV7u2QGBBhKGpgUxBP6LwqZAmif9u9ZldhmE pu4iAR2dwpd2+5ZrLdlbaMFE2dobmkYjNVLx2DGn6liXRkpmADw2RNaOlc9eD2QHP4Dq9H a7jHf0WrfeVTJDm2kroWoyTiKtbgUe+89gy5pz7DRG57j2ahl0Exn7ucxpyH8A== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.mailfrom=pc@manguebit.com ARC-Seal: i=1; s=dkim; d=manguebit.com; t=1711399640; a=rsa-sha256; cv=none; b=cpJ7+g7T28hOqVFhxBw2OZo5TAOgf0/kRogSfzCHCssax9p7NKZa4nuHQZhSxRrHxdE3qh NYg7lWIz58OMdVyPZVA0SpVC/bmyPyVV5icox1wUgiqz8+8+BZR8tSCE5BZVdQT9qnlp1Q 6KNy3SbHkElj9HGWipQf67e4qpyLlbmlaWI/7HPrG5fGiVPUmmoxR80sCoZVF8WULK7i7B kj+YowgVal9BZvbLR6jqDTDTBymhtK1HV7UivfIPPU1+yblEoV/2UOOjCRkQ9QQr9Jgqc1 OBxXKOC6B7uKL39obFYICrKij5TvV85ZI67FMv8JUJ+ISxcEthWAdzUQq8IB/g== From: Paulo Alcantara To: Al Viro , Steve French Cc: Christian Brauner , Roberto Sassu , LKML , linux-fsdevel , CIFS , Christian Brauner , Mimi Zohar , Paul Moore , "linux-integrity@vger.kernel.org" , "linux-security-module@vger.kernel.org" Subject: Re: kernel crash in mknod In-Reply-To: <20240325195413.GW538574@ZenIV> References: <20240324054636.GT538574@ZenIV> <3441a4a1140944f5b418b70f557bca72@huawei.com> <20240325-beugen-kraftvoll-1390fd52d59c@brauner> <20240325195413.GW538574@ZenIV> Date: Mon, 25 Mar 2024 17:47:16 -0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Al Viro writes: > On Mon, Mar 25, 2024 at 11:26:59AM -0500, Steve French wrote: > >> A loosely related question. Do I need to change cifs.ko to return the >> pointer to inode on mknod now? dentry->inode is NULL in the case of mknod >> from cifs.ko (and presumably some other fs as Al noted), unlike mkdir and >> create where it is filled in. Is there a perf advantage in filling in the >> dentry->inode in the mknod path in the fs or better to leave it as is? Is >> there a good example to borrow from on this? > > AFAICS, that case in in CIFS is the only instance of ->mknod() that does this > "skip lookups, just unhash and return 0" at the moment. > > What's more, it really had been broken all along for one important case - > AF_UNIX bind(2) with address (== socket pathname) being on the filesystem > in question. Yes, except that we currently return -EPERM for such cases. I don't even know if this SFU thing supports sockets. > Note that cifs_sfu_make_node() is the only case in CIFS where that happens - > other codepaths (both in cifs_make_node() and in smb2_make_node()) will > instantiate. How painful would it be for cifs_sfu_make_node()? > AFAICS, you do open/sync_write/close there; would it be hard to do > an eqiuvalent of fstat and set the inode up? This should be pretty straightforward as it would only require an extra query info call and then {smb311_posix,cifs}_get_inode_info() -> d_instantiate(). We could even make it a single compound request of open/write/getinfo/close for SMB2+ case.