Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp133391lqh; Fri, 3 May 2024 16:16:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUr2UdbSOmd38ezG4HDkjP5vzK+uAxZRZIKPUzIvDP/8NEKlKiiUnqi5tYJlGW6kO4JBlQHeWxO+ZanMYVLWLa39jITaUUDyvzIczt1Hg== X-Google-Smtp-Source: AGHT+IExQuJPyAQ9Q6yAHKgZKjHfZrPXAWkY0rZDJS3ykiUNHOxxiEktfAGXPcgWtCJB7wyQV7P7 X-Received: by 2002:a25:6606:0:b0:dcc:fe97:f899 with SMTP id a6-20020a256606000000b00dccfe97f899mr4614010ybc.24.1714778211229; Fri, 03 May 2024 16:16:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714778211; cv=pass; d=google.com; s=arc-20160816; b=q7zpkucBOazxVwCjaoKWt7sJIDJUahKNMNErTXJndz5XE3iN+sIT7fcKJ8mnahsCD8 +NRN4imFwiYPOUwnHkVXjY5XXOXusM6LC0nP/PERMtCTHhhDgUayc/PjFrgMy4soj40u eC7+1mJE6nv72cVga7iXgEvOvlKQF4yCfwhOu7e4HzPQSBDU2GNwuohzMNmZy3t34I7E ufwlB/NBAqsBscJWjwQXtQUoHAoNJ4/uviN83Epe6ktXDzNvUexpUngo7eG02iEvrVBx wnUlnPwPw0F5NI3jtObDr263aMHjjNyuCQY6wts/kW5sPd+EDbMg+G5bi/SLZ6sRlF6M Fq2Q== 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=cGG/rn4AzL6EAyTxraRF01dNEmbt6QApJhVwyWVeemo=; fh=0jdQjXJCA+2QJ/iUTPf6F5BDNnpEBLtzxUUJ4SxnwJM=; b=mhnLlDGkwn7S1WKfit162OLth4NKz7wYikykl9LS59OcMZ0rx39uIqSGwFEiw6JStW tzFh9hdXG+57cvwcdWtslOxUm2nqSQX2YKqc5d3p/OpecfoaQ83By13c0YgvmIg94rs5 CPbFc1YulXHijeykuBZPv74BW8p6l9C+jLxnKhLKhd/+8XnnRG+gy/vQOQ6b7zS96V2d wPtq6SFQuQ8hTm2WH544CPakeEPIXg8+hGRGKNPzmgpQH9uSypDY57SKttFOp/VfmpJs Kf/KMFj3o+XHPhBK8GUyWo0f3cX7YHk9s1Ye7GXD8E6ZpKbpzxajYFlaE9/M+9QHfUdG 5PPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=cr6KDcwO; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-168396-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168396-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w8-20020ac87e88000000b0043ae9948dcbsi4359859qtj.480.2024.05.03.16.16.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 16:16:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168396-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=cr6KDcwO; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-168396-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168396-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F082B1C21EC3 for ; Fri, 3 May 2024 23:16:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E96B84DE3; Fri, 3 May 2024 23:16:37 +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="cr6KDcwO" Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 08BA183A10 for ; Fri, 3 May 2024 23:16:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714778196; cv=none; b=G1msmjLj6BvTZKm8uf80lbHN/nWCInh39chJgXf44YsQvxNpVre6oglji0CoAiygyMLwMQQz7gOdLPUiotE84cn1zZexgLBxpn2KIXRDpaoyjwWHLmEo4bhGtzkv/m6FiOFwi42pP2vyCv3Jo4zhRdVceKFUhBILqDmdHwnoFV4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714778196; c=relaxed/simple; bh=10Im6Ev0hm6GCexrKsrsuAqt7UP5HFJ90hGsgvNShJo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=mpzbZ/trUjir9le3I7Rayu7OZ0KZ2nSTnE3jxMO+80SOA1eePuI9gIOB9ZocMGBDNkpd7XgjzQJr6Wxi6ZoYOt/CxmQVJDmAbCJ1HqFuEHdjLotGdxx6x52YxKeskW/en0+iad5rXSQt1cQtdKdJoUdKpSFd42eS/QYepqC2/kA= 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=cr6KDcwO; arc=none smtp.client-ip=209.85.218.43 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-ej1-f43.google.com with SMTP id a640c23a62f3a-a598e483ad1so26425666b.1 for ; Fri, 03 May 2024 16:16:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1714778193; x=1715382993; 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=cGG/rn4AzL6EAyTxraRF01dNEmbt6QApJhVwyWVeemo=; b=cr6KDcwOBUIXzfzW+aNT6dgf8KM9w5+3PMr5OKvI6Ga+or8Tl/OQwW8KeaA6oNLpL/ zpBaK+8FRxNloQNR4hpFVbJoQKsWtJg7hBuZZprnICOrHGrkjAWgzfCoPwj6V/tXaTie lVcB6kJEJs/RUNfT64DDvOdNFYBLvH2Izdegs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714778193; x=1715382993; 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=cGG/rn4AzL6EAyTxraRF01dNEmbt6QApJhVwyWVeemo=; b=Vu+HMbuyiyqP56s8Fotc6LaoCj8Q08OQKeROoFMQTggauSOPTEeQQA50N7JfB4I3Gf efBCB2DIizyo/1gnk0FBOt4mPxhkCAq+odJMwmVlaTaX73w9Na2mkhi1DUaQGa9xi1nW /yeAkzmDOnhBUkyRCPvni0IljDUgri++Va+ACKsV73T3RvRdwNowJs1VUaHNjbugVUKV DvtOejOAzX48KsruV2XKgiP+VE4YshxTg9yviHvhzZm+KQbmph/rlpaNcw4eK6apLL8g PSFx+do49xHy2YjAXUjX9BFj72X3p8rCQIr2HrkP099a0fZX5VoHfRdFGxvS4ddU3CuQ /SYw== X-Forwarded-Encrypted: i=1; AJvYcCUWvAnfRaMuoYtTAmKtA6P+7xznMNo77zbFF+0CbMv0B+QdrXcEjg63NZm894A0qQWlqBlCjY3npsLNwbF6VFgVh2rGbaYqfJHxt/VE X-Gm-Message-State: AOJu0YzUFE6/tK7Oqz0pqujwcjf1FQIezcjFtwnEDdtyIAW9AoOdfxzS C80lLYcj35nzCJOKDpERed1NGtMnXxLEITNAq7eA+lmsw5MEy8lDXOPDPfKdqv5r1CVBwSxSW5Q 2e7uUnw== X-Received: by 2002:a50:d581:0:b0:572:71b2:e200 with SMTP id v1-20020a50d581000000b0057271b2e200mr2506458edi.22.1714778193398; Fri, 03 May 2024 16:16:33 -0700 (PDT) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com. [209.85.218.50]) by smtp.gmail.com with ESMTPSA id s8-20020aa7d788000000b00562d908daf4sm2206839edq.84.2024.05.03.16.16.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 May 2024 16:16:32 -0700 (PDT) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a598e483ad1so26421566b.1 for ; Fri, 03 May 2024 16:16:32 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWeGyU77+ieRHplaxjUlnq6w77b9+4BA4yZhmvdDm69Bs7q2t8boVtFvpDOdbwZ+/1gAzLzUajrYVwRqEZf4o0VoTjl8Hd5IPqBHOHi X-Received: by 2002:a17:906:52c1:b0:a59:2e45:f528 with SMTP id w1-20020a17090652c100b00a592e45f528mr2851931ejn.38.1714778191864; Fri, 03 May 2024 16:16:31 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <202405031110.6F47982593@keescook> <20240503211129.679762-2-torvalds@linux-foundation.org> <20240503212428.GY2118490@ZenIV> <20240503214531.GB2118490@ZenIV> <20240503220145.GD2118490@ZenIV> <20240503220744.GE2118490@ZenIV> In-Reply-To: <20240503220744.GE2118490@ZenIV> From: Linus Torvalds Date: Fri, 3 May 2024 16:16:15 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] epoll: try to be a _bit_ better about file lifetimes To: Al Viro Cc: keescook@chromium.org, axboe@kernel.dk, brauner@kernel.org, christian.koenig@amd.com, dri-devel@lists.freedesktop.org, io-uring@vger.kernel.org, jack@suse.cz, laura@labbott.name, linaro-mm-sig@lists.linaro.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, minhquangbui99@gmail.com, sumit.semwal@linaro.org, syzbot+045b454ab35fd82a35fb@syzkaller.appspotmail.com, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" On Fri, 3 May 2024 at 15:07, Al Viro wrote: > > Suppose your program calls select() on a pipe and dmabuf, sees data to be read > from pipe, reads it, closes both pipe and dmabuf and exits. > > Would you expect that dmabuf file would stick around for hell knows how long > after that? I would certainly be very surprised by running into that... Why? That's the _point_ of refcounts. They make the thing they refcount stay around until it's no longer referenced. Now, I agree that dmabuf's are a bit odd in how they use a 'struct file' *as* their refcount, but hey, it's a specialty use. Unusual perhaps, but not exactly wrong. I suspect that if you saw a dmabuf just have its own 'refcount_t' and stay around until it was done, you wouldn't bat an eye at it, and it's really just the "it uses a struct file for counting" that you are reacting to. Linus