From owner-freebsd-stable@freebsd.org Thu Mar 4 07:37:20 2021 Return-Path: Delivered-To: freebsd-stable@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 3D3C0564A38 for ; Thu, 4 Mar 2021 07:37:20 +0000 (UTC) (envelope-from ardovm@yahoo.it) Received: from sonic312-27.consmr.mail.ir2.yahoo.com (sonic312-27.consmr.mail.ir2.yahoo.com [77.238.178.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DrjPV4Rppz4mcs for ; Thu, 4 Mar 2021 07:37:18 +0000 (UTC) (envelope-from ardovm@yahoo.it) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1614843436; bh=NGfwgPlfcxSGQ1b60UlHQMxC1Ul1jVJyLUOqaeNsmSM=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=IdexHedO9e3aTQhdGP+NMIH9B261DkP41k2BpXrEvxasDRj3otKgXQSzBrtA/QMGS1hAgcszeceNgAz9UU60ZvX2fKUTXPvuAnsec63wCKUidwKY3rWOw06spHCN06Tn5+2KYXNM0d+S9NpFKp63uw9GaWbgxY95BneOZ58fbR3ORWmBBkjYRDlSNY+j+I2h/TdJdB8QkjAFhknqdMZBv+Q1Vm/njVoe8GZuufiBrOYC/c2g47mtMAhwRHFXcLiRjl+LkEGCq0zUKl8vepYSlh7CQng6FMeP+a0mzaD5tgd7OCco0OT+4kVeXnz+D+R3Di+JwfsFMGvPxLKUEhgTQQ== X-YMail-OSG: C9qUdLYVM1kPyZc1BcbCBNsC_67Rdsn.RCg.CU_QrD6HDnrlsqW06dicWX4.U2I M.cx7UCYgkWIhNbpB3_mWcf_CohwCWVfMXnFFkD3VjD0YqGICdCMLL.2kA4gec5R7YzMSkEx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W GlYIaMiRQWn1GJm7nT9SHrNjABhaBvVKva_9Hs8v538.v.EXBMW0tCDU0hpu.zAlaYTwFNM9f0Fr a.NoXUAq9wNxef5YJ7DQcEzMic7IQBdzMHwH2OMqC8sA36I8nNH7nYV8oUVuI3cYLlAQvliqtxrN KVLrluoqCWl7u9vtA.JDu4OU5Rz0.2__k9y5Cpqgk6AHwdrsmWk2CjSIYun3nd5NQPpfE X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ir2.yahoo.com with HTTP; Thu, 4 Mar 2021 07:37:16 +0000 Received: by smtp405.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 15de4f6745a98cccf5286ef77821262c; Thu, 04 Mar 2021 07:37:13 +0000 (UTC) Received: by nuvolo.localdomain (Postfix, from userid 1001) id 2F1FB1264B7; Thu, 4 Mar 2021 08:37:11 +0100 (CET) Date: Thu, 4 Mar 2021 08:37:11 +0100 From: Arrigo Marchiori To: freebsd-stable@freebsd.org Subject: Re: Trying do mount a slice containing a r/o mounted partition makes the filesystem unreadable Message-ID: References: <202102271443.11REhqps070102@nuc.oldach.net> <4ccaadf5-922f-37ee-e3f5-9f02db60516e@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4ccaadf5-922f-37ee-e3f5-9f02db60516e@FreeBSD.org> X-Mailer: WebService/1.1.17712 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.9.1) X-Rspamd-Queue-Id: 4DrjPV4Rppz4mcs X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; FREEMAIL_FROM(0.00)[yahoo.it]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[yahoo.it:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.it,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.it]; ASN(0.00)[asn:34010, ipnet:77.238.176.0/22, country:GB]; RBL_DBL_DONT_QUERY_IPS(0.00)[77.238.178.98:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[yahoo.it:s=s2048]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[77.238.178.98:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[77.238.178.98:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[77.238.178.98:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-stable] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 07:37:20 -0000 Dear All, On Tue, Mar 02, 2021 at 10:55:15AM +0200, Andriy Gapon wrote: > On 02/03/2021 09:50, Arrigo Marchiori via freebsd-stable wrote: > > Dear All, > > > > On Sat, Feb 27, 2021 at 04:34:52PM +0100, Arrigo Marchiori via freebsd-stable wrote: > > > >> Hello Helge, and thank you for replying again. > >> > >> On Sat, Feb 27, 2021 at 03:43:52PM +0100, Helge Oldach wrote: > >> > >>> Arrigo Marchiori via freebsd-stable wrote on Sat, 27 Feb 2021 14:00:24 +0100 (CET): > >>>> On the memstick, the root filesystem is mounted read-only. I > >>>> apologize, I should have told it explicitly. The ``invalid'' attempt > >>>> is to mount it read-write (no mode is indicated on the command line). > >>> > >>> Try to make it r/w mounted (which I suspect you are attempting to > >>> achieve): > >>> > >>> mount -uw / > >> > >> Ok, I will try this. > >> > >> But just for the record: I am not try to achieve anything. I gave the > >> ``invalid'' mount command by mistake (I wanted to mount a partition > >> from another disk and wrote "da0" instead of "da1") and I saw that the > >> system became unstable. I thought that this should not happen and I > >> reported it here. > > > > I have two updates. > > > > 1- the da0s2a slice starts 16 (blocks?) after the beginning of da0s2. > > bsdlabel(8) output (copied by hand): > > # /dev/da0s2: > > 8 partitions: > > # size offset fstype [fsize bsize bps/cpg] > > a: 1491200 16 4.2BSD 0 0 0 > > c: 1491216 0 unused 0 0 # "raw" part, don't edit > > > > 2- if I mount the partition rw, then the mount command _always_ fails > > with error "operation not permitted" and the system _always_ remains > > stable. This is independent from mounting from /dev/ufs/label or > > /dev/da0s2a. > > > > Therefore I can change the description of this problem report as: > > > > ----8<--------8<--------8<--------8<--------8<--------8<--------8<--------- > > > > When a BSD partition is mounted _read_only_ to / (suppose > > /dev/da0s2a), if I try to mount its containing slice (/dev/da0s2) I > > receive a ``strange'' error message, and from that moment the mounted > > filesystem becomes unreadable. > > > > - If the partition is mounted from /dev/ufs/label, then mount(8) > > reports "Operation not permitted" and the system remains stable. > > This is the expected behavior IMHO. > > > > - If the partition is mounted read_write, from any special device, > > then mount(8) reports: > > - "Operation not permitted" if I try to mount the slice rw, > > - the same strange error message if I try to mount the slice ro, > > and the system remains stable. > > > > - The "strange error message" is "invalid argument" on 11.4-STABLE. > > > > ----8<--------8<--------8<--------8<--------8<--------8<--------8<--------- > > > > Now to the question: is this worth a PR? Was it already reported? Or > > is it just something that ``should not happen'' because root should be > > allowed to shoot themselves in the foot? > > > > Thank you in advance and best regards, > > I think that this is worth a PR. Just reported: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254005 > I think that even when mounting read-only the underlying GEOM object should be > marked for exclusive use. > I vaguely recall that UFS has some quirk in this respect to allow for > modifications by fsck. That is supposed to be limited to the root filesystem. > Maybe it should further be limited to certain boot stages to prevent > foot-shooting after a system is fully booted. Thank you and best regards, -- Arrigo http://rigo.altervista.org