From owner-freebsd-hackers@freebsd.org Thu May 14 20:20:59 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC0982DE0E8 for ; Thu, 14 May 2020 20:20:59 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 49NNGM304Jz3NBH for ; Thu, 14 May 2020 20:20:59 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id 6478E2DE0E6; Thu, 14 May 2020 20:20:59 +0000 (UTC) Delivered-To: hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 642382DE0E5; Thu, 14 May 2020 20:20:59 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oo1-f68.google.com (mail-oo1-f68.google.com [209.85.161.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NNGL2h3hz3NBC; Thu, 14 May 2020 20:20:58 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oo1-f68.google.com with SMTP id i9so1015434ool.5; Thu, 14 May 2020 13:20:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XATE2oJ0HCuFXl80aMe5Q5Rja4dYj+iHGk3WbqQ5L5k=; b=OckIhjHn8hBzYYAVjFfYj2zlSWONwsdA1bjqyew2cfzDgvp2EDEp+FUCHr0PhqHGAc en6/1W9sIQJ33sUd4IG3dFD6k1VWFU2xRmM5Ac5QPKxNlHMZv18Oiq9qJqM7zOMjcftw GcW/knHtMuYVfYm7jKYxQUCMaxqqty+tbo3U0jeWuSTl09LdnbAyxtEAq45dVVuAwzQD ftbNu9HeZAMCn4lA3PuyVDRmwgmId26BSVObsnIFepyDHkHqSViB0UoWZI6nppSMiuhS xJxZylIsMvJEo3qdPIZeRHWGBKo8Kh6mu+wE+73x7avzumTPR5iNQ0M959Yz0BYO8rCL IVpA== X-Gm-Message-State: AOAM531kWZYQPs+cBxLuVLjXdEocpAH7qKE0HGCTjR1xCjt5OaBEjWaE AfmULX0+06qipATAn5RsdY//kuRS49mjlBu3uIYV1+p0 X-Google-Smtp-Source: ABdhPJz1oesoJ2TL0mvKnDzjdg2rT79hMVCT4EGOe2ig/T0QTHbmsRLXhCsYR6R04mPt9AarDhQxnYThlENR1O1X4io= X-Received: by 2002:a4a:3107:: with SMTP id k7mr5037283ooa.61.1589487657049; Thu, 14 May 2020 13:20:57 -0700 (PDT) MIME-Version: 1.0 References: <202005142017.04EKH0aA093503@fire.js.berklix.net> In-Reply-To: <202005142017.04EKH0aA093503@fire.js.berklix.net> From: Alan Somers Date: Thu, 14 May 2020 14:20:45 -0600 Message-ID: Subject: Re: [HEADSUP] Disallowing read() of a directory fd To: "Julian H. Stacey" Cc: Kyle Evans , "freebsd-arch@freebsd.org" , "freebsd-hackers@freebsd.org" X-Rspamd-Queue-Id: 49NNGL2h3hz3NBC X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.161.68 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-0.89 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-0.95)[-0.947,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.67)[-0.670,0]; TO_DN_SOME(0.00)[]; URI_COUNT_ODD(1.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[68.161.85.209.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_GOOD(0.00)[68.161.85.209.rep.mailspike.net : 127.0.0.18]; IP_SCORE(-0.28)[ip: (-0.51), ipnet: 209.85.128.0/17(-0.39), asn: 15169(-0.42), country: US(-0.05)]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 20:20:59 -0000 On Thu, May 14, 2020 at 2:17 PM Julian H. Stacey wrote: > Kyle Evans wrote: > > Hi, > > > > This is a heads up, given that I'm completely flipping our historical > > behavior- I intend to commit this review in a couple days' time > > without substantial objection: https://reviews.freebsd.org/D24596 > > > > With this, FreeBSD 13 will not allow read() of a directory fd, which > > could have previously returned some data from the underlying > > filesystem in no particular standardized format. > > > > This is a still-standards-compliant switch from one > > implementation-defined behavior to another that's already been adopted > > in various other popular kernels, to include OpenBSD, MacOS, and > > Linux. > > > > Worth noting is that there's not really one largely-compelling reasons > > to switch this after so many years (unless you find yourself that > > irate when you accidentally `cat` a directory), but there are some > > benefits which are briefly discussed in the commentary around the > > review along with the history of the current behavior. > > > > This change also simplifies filesystem implementations to some extent. > > > > Thanks, > > > > Kyle Evans > > There is ZERO need for a spurious change at 2 days notice after 42+ years ! > > "cat ." as been supported since Unix V6 1978 or earlier, > no problem, even occasionaly useful. > Really? When is that occasionally useful? I've never seen anything useful come out of reading a directory.