From owner-freebsd-fs@freebsd.org Thu Feb 27 20:05:38 2020 Return-Path: Delivered-To: freebsd-fs@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 6069D24CD2D for ; Thu, 27 Feb 2020 20:05:38 +0000 (UTC) (envelope-from jdelisle@gmail.com) Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 48T3Z93tbdz41LB for ; Thu, 27 Feb 2020 20:05:37 +0000 (UTC) (envelope-from jdelisle@gmail.com) Received: by mail-io1-xd31.google.com with SMTP id z190so882431iof.1 for ; Thu, 27 Feb 2020 12:05:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zNXXzwYqVNC4gjJwwfxMyyZka/P+L4gUW8JZii2H0Ks=; b=naRbe16s4PlUqgRphPVtM8YjVQyCUBs0BLOLCLWNsyEGP7uwgjCNR7zd214v/WYjcF H2sAjPzOwI2QWORvGzzPFbmp7ONMlpQNWb34+ZXyyoqZ4m1lXXuj1tAMnu2cnqJlfafI x8anMIZ7zTZBGoO22EjgsDuvf51vUb9mGlq9AupOxeWtdrQwJb7EzWQnrU6gR9ij7xkq S5j2lDSq02yalU8bq1MXG84dIxp4ckhSF1kRvbtXaDu2vYaTzDdUGkFO34vgKP0E5gHz neUhcjFhmz4p+rYOs8MMiFENXPbLZspF1haSCjt/7iamByl/RlbaP242A59n9xiHvePN Txyg== 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=zNXXzwYqVNC4gjJwwfxMyyZka/P+L4gUW8JZii2H0Ks=; b=btlfPcTMtE92WupsUv4zPepfB9uCOODPfknzIIRv7AC08FrJlum41whis1CFIJTt1X AHcL1doJhV+EppRjcJt+/Bsv9WbaRmSmeGQByF3d3K+ssevqhvOa5SRv0naXWtuM1y5b ybMn1O3uuFQji11mI7xVgxAD037iki/x1BE6Pgb6QnE4HOFi7dBTKy/tHuM+qaTJ13KT R1ke3kN9QULLUZRRWdV8E7b6SwfZ9p/x+dJczSjSN01HX01IpO4sygNZdSIwGkLcEfJ/ im2C5UVXl4t0EGhKWQL6Mxzn46LXnPqten7ssHfY7KRj9aK30DFbTNk6E7b7UmlN46sE i4oA== X-Gm-Message-State: APjAAAUP97tDSy59hqvXk9PW8eWrYrMVBXibqLOMy+g2ArwGkyhqhx/r 5ojyWTYSXWO5j+1YmzwRtAmawkyj8KmZlqOd33qDfp44 X-Google-Smtp-Source: APXvYqyUdWTCNnrqoifS1DmHEZbHOMsufCsLqrfCYCLWLbwRB2LJBkrfIzsOLFJrmA/unK/4BE2L6rVWiRuZ/pJgRRU= X-Received: by 2002:a05:6638:501:: with SMTP id i1mr437391jar.25.1582833936085; Thu, 27 Feb 2020 12:05:36 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: jdelisle Date: Thu, 27 Feb 2020 14:05:24 -0600 Message-ID: Subject: Re: Linux could write to read only files on FreeBSD NFS server To: Luoqi Chen Cc: freebsd-fs X-Rspamd-Queue-Id: 48T3Z93tbdz41LB X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=naRbe16s; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of jdelisle@gmail.com designates 2607:f8b0:4864:20::d31 as permitted sender) smtp.mailfrom=jdelisle@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; URI_COUNT_ODD(1.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-6.53), ipnet: 2607:f8b0::/32(-1.88), asn: 15169(-1.67), country: US(-0.05)]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-fs@freebsd.org]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[1.3.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 20:05:38 -0000 Without the requested info running your script is a waste of time. This already strikes me as a case of user-error/ RTFM, but I'm giving you the benefit of the doubt and asking for info that's absolutely necessary to even begin looking at this. On Thu, Feb 27, 2020 at 1:19 PM Luoqi Chen wrote: > I gather you haven't tried the script -- I didn't bother to include more > details because they didn't seem to matter, this is not some corner case > scenario. My guess is this is something fundamental, like, linux expects > the server side to enforce the access control while freebsd assumes that > the client has already done the check. > > On Thu, Feb 27, 2020 at 10:40 AM jdelisle wrote: > >> I feel like this is missing a lot of important information needed to >> answer your question. >> >> What's your NFS mount command? What user are you running that script >> as? What do the permissions look like on the NFS server side? What does >> your NFS export look like? etc.. >> >> On Thu, Feb 27, 2020 at 11:42 AM Luoqi Chen wrote: >> >>> Hi, >>> >>> This was actually a pretty old problem, I noticed it a few years back and >>> have been monitoring it when I upgrade the os on either the linux or the >>> freebsd side -- it's still present between the latest centos and freebsd >>> as >>> of today. I meant to look into this issue myself, but had never found >>> time >>> for it, that's why I'm writing to this list, maybe it's a known problem >>> or >>> someone's willing to spend some time on it. >>> >>> And here you go, the problem, >>> >>> % cat ~/rotest.sh >>> #!/bin/sh >>> cp /dev/null x >>> getfacl x >>> chmod -w x >>> getfacl x >>> echo aaa >> x >>> echo status $? >>> cat x >>> rm -f x >>> % sh ~/rotest.sh >>> # file: x >>> # owner: luoqi >>> # group: wheel >>> user::rw- >>> group::r-- >>> other::r-- >>> >>> # file: x >>> # owner: luoqi >>> # group: wheel >>> user::r-- >>> group::r-- >>> other::r-- >>> >>> status 0 >>> aaa >>> >>> The script was run on a centos inside a directory nfs mounted from a >>> freebsd. The append would fail for a centos/centos or a freebsd/freebsd >>> combo. It's very easy to reproduce, it doesn't depend on any specific >>> centos or freebsd version, nor on nfs version 3 or 4, nor on underlying >>> file system ffs or zfs. >>> >>> -luoqi >>> _______________________________________________ >>> freebsd-fs@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/freebsd-fs >>> To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" >>> >>