Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3123291pxm; Mon, 28 Feb 2022 12:31:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJysxN63zDH6t7zJ294i27KQFpf6LRD4KPqm/LC/dbQ0QYJbTSqSyCo7xW/vjOCsSM4aBNbV X-Received: by 2002:a63:7d1c:0:b0:373:d43f:3ab7 with SMTP id y28-20020a637d1c000000b00373d43f3ab7mr18525587pgc.425.1646080286313; Mon, 28 Feb 2022 12:31:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646080286; cv=none; d=google.com; s=arc-20160816; b=tZYyjRyvlZNf5k6Ed+tFTph8qfwlKmIdAE1rOHAGnYo0VjgDWATTrjUq1AhZ885IV1 ft7H7h+Io9nPnu6I1ihT7vp1pbqr2J/AJkFBkft+e6Ki7/5OeL+Zg1SJuh7bl3t2LH0V IV+vA4aDHa0PNk42CDgEr3PN5payejGcbsr8x0mGhWNMedLewnXDl373GJrpIciBc8te SIsSLKtktxLeYuW0u1hxyFvVYHhOhy3AlmlQcg1PyMvO8fp6WklkuzDVSmNhh3KZS462 J3NqWwOfxQU5WG8MBVDOnOdbk412kSpKMzIslAVm3RyJrxifS44RXmBUE28NnvLFymKq fa9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:to:from:date:dkim-signature; bh=NovqsBoy/0URWfLvmBVoRSYXztYMjxk7Xvy7AZyKgQ8=; b=LASa0owRDIkZenwp1ADJfGiC925G4nlXJVoY8UcuSpDlXgKZhXeDdiCah2AwmsJ0UI OVcT/gf9sRAiaTynVryp/jfnLp0LVyXvMS8/KoK34jax7luM12vx1vqGvXKm3tXXK88V vGg+Ht5uh+RlhobxWhUpE4tCKxIswZ1XKWZr+nQ12NrgoRpu9EifmkPx1VH+B3j64j2s KawVdPwP1Wfs7ho4mQtMqCt2t6GZTaBdMAriCrhajftduRuh7I33uMePDxlb9UBIOxeB LInUtJqi9ktgBV/SdUIKP37bkVCjdcCOpllPQXm5rO6Vurr7ZtPagEFuuPsbHo+uIzfN UqbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202006 header.b=HVWZqSfY; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i25-20020aa78d99000000b004f0fc0ad94fsi9816900pfr.87.2022.02.28.12.31.11; Mon, 28 Feb 2022 12:31:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202006 header.b=HVWZqSfY; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbiB1Uab (ORCPT + 99 others); Mon, 28 Feb 2022 15:30:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbiB1UaP (ORCPT ); Mon, 28 Feb 2022 15:30:15 -0500 X-Greylist: delayed 1799 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 28 Feb 2022 12:29:26 PST Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3809A5C354 for ; Mon, 28 Feb 2022 12:29:25 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 0259BBD2 for ; Mon, 28 Feb 2022 20:32:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202006; t=1646076757; bh=WqcZGxLVkI/ykaqRWbHL0DFLRiXeUiOhOVqn2BQ+VYU=; h=Date:From:To:Subject:From; b=HVWZqSfYQAIOLPuISUQGW0q5GxQezs4wjJR8SCRDFnYnNrM5t8iztAtW13jMnlmSI LSgUTyajOQxm028DY3Lehiplw9whu8OoT3sRGxBjzSSxctvxaqMNMkR3EXKxz7Nx0L roAnfuVwkivt4MlxY2d4uKZBCg8XEzdr2ej3I6krJk+NL2J6PE5XEIX8gSSSK7SNcS rmTLOt2HKS/5CMxpaZMso+OPbBOSv9Xp71lAUdcoaxaWjTjTFhQGeVQ+XRqPy7Lp2J tcOtzyo2FY4rnEDbBKxbeZE3ls+lusrwessrY7AgWFOvZdQmCjagP+2R35NaV/4lqX GDn6dgfMAk+Sw== Date: Mon, 28 Feb 2022 20:32:35 +0100 From: =?utf-8?B?0L3QsNCx?= To: linux-nfs@vger.kernel.org Subject: exportfs recursively processes backslash escapes in exports file Message-ID: <20220228193235.2g2uvf7fphj4jdy5@tarta.nabijaczleweli.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sgfxbmsll2gwt67h" Content-Disposition: inline User-Agent: NeoMutt/20211029 X-Spam-Status: No, score=3.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, FROM_SUSPICIOUS_NTLD_FP,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP, RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org --sgfxbmsll2gwt67h Content-Type: multipart/mixed; boundary="65m2ezorwnvfs6y6" Content-Disposition: inline --65m2ezorwnvfs6y6 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! It is, I fear, like in the subject: $ tail -4 /etc/exports.d/zfs.exports /a\040\134053\040b 1(sec=3Dsys,rw,no_subtree_check,mountpoint,crossmnt) /a\040\134134053\040b 2(sec=3Dsys,rw,no_subtree_check,mountpoint,crossmnt) /a\040\134134134053\040b 3(sec=3Dsys,rw,no_subtree_check,mountpoint,cross= mnt) /a\040\134134134134053\040b 4(sec=3Dsys,rw,no_subtree_check,mountpoint,cr= ossmnt) # exportfs -ra exportfs: Failed to stat /a + b: No such file or directory exportfs: Failed to stat /a + b: No such file or directory exportfs: Failed to stat /a + b: No such file or directory exportfs: Failed to stat /a + b: No such file or directory I just wanted to export '/a \053 b', of course. The rest are just PoC. The manual states: > You can also specify spaces or other unusual character in the export > name using a backslash followed by the character code as three octal > digits. The this happens on 1:1.3.4-6 off Debian, nfs-utils-2.6.1, and current HEAD (7f8463fe702174bd613df9d308cc899af25ae02e). strace off HEAD attached. Best, =D0=BD=D0=B0=D0=B1 Please keep me in CC, as I'm not subscribed. --65m2ezorwnvfs6y6 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=strace Content-Transfer-Encoding: quoted-printable execve("./utils/exportfs/exportfs", ["./utils/exportfs/exportfs", "-ra"], 0= x7fffa27ca428 /* 15 vars */) =3D 0 brk(NULL) =3D 0x55dcf1911000 access("/etc/ld.so.preload", R_OK) =3D -1 ENOENT (No such file or dire= ctory) openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) =3D 3 fstat(3, {st_mode=3DS_IFREG|0644, st_size=3D101487, ...}) =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0\4\0\0\0\4\0\0\0\250\2\0\0\0\0\0\0\250\2\0\0\0\0= \0\0\250\2\0\0\0\0\0\0D\0\0\0\0\0\0\0D\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0P\345td= \4\0\0\0\34\202\1\0\0\0\0\0\34\202\1\0\0\0\0\0\34\202\1\0\0\0\0\0T\t\0\0\0\= 0\0\0T\t\0\0\0\0\0\0\4\0\0\0\0\0\0\0Q\345td\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0R\= 345td\4\0\0\0\10\274\1\0\0\0\0\0\10\314\1\0\0\0\0\0\10\314\1\0\0\0\0\0\370\= 3\0\0\0\0\0\0\370\3\0\0\0\0\0\0\1\0\0\0\0\0\0\0\4\0\0\0\24\0\0\0\3\0\0\0GNU= \0P\30#{\277\1+@\224\2\177\320\271o\302*$In\244\4\0\0\0\20\0\0\0\1\0\0\0GNU= \0\0\0\0\0\3\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\262\2\0\0i\1\0\0\17\0\0\0\0\0\0\= 0\0\0\0\0\370\0\0\0\26\1\0\0\261\0\0\0\2\0\0\0\0\0\0\0g\1\0\0\0\0\0\0W\1\0\= 0\0\0\0\0\0\0\0\0\0\0\0\0E\1\0\0\304\0\0\0\0\0\0\0\0\0\0\0", 832) =3D 832 fstat(3, {st_mode=3DS_IFREG|0755, st_size=3D149520, ...}) =3D 0 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = =3D 0x7f36a2a54000 mmap(NULL, 136304, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =3D 0x7f36a2= a32000 mmap(0x7f36a2a39000, 65536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_= DENYWRITE, 3, 0x7000) =3D 0x7f36a2a39000 mmap(0x7f36a2a49000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE,= 3, 0x17000) =3D 0x7f36a2a49000 mmap(0x7f36a2a4e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_= DENYWRITE, 3, 0x1b000) =3D 0x7f36a2a4e000 mmap(0x7f36a2a50000, 13424, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP= _ANONYMOUS, -1, 0) =3D 0x7f36a2a50000 close(3) =3D 0 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libresolv.so.2", O_RDONLY|O_CLOEXEC= ) =3D 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260C\0\0\0\0\0\0@\0= \0\0\0\0\0\0\310c\1\0\0\0\0\0\0\0\0\0@\08\0\t\0@\0\36\0\35\0\1\0\0\0\4\0\0\= 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0P<\0\0\0\0\0\0P<\0\0\0\0\0= \0\0\20\0\0\0\0\0\0\1\0\0\0\5\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\= 0\0\0\365\321\0\0\0\0\0\0\365\321\0\0\0\0\0\0\0\20\0\0\0\0\0\0\1\0\0\0\4\0\= 0\0\0 \1\0\0\0\0\0\0 \1\0\0\0\0\0\0 \1\0\0\0\0\0<.\0\0\0\0\0\0<.\0\0\0\0\0\= 0\0\20\0\0\0\0\0\0\1\0\0\0\6\0\0\0\20V\1\0\0\0\0\0\20f\1\0\0\0\0\0\20f\1\0\= 0\0\0\0p\f\0\0\0\0\0\0p4\0\0\0\0\0\0\0\20\0\0\0\0\0\0\2\0\0\0\6\0\0\0\250]\= 1\0\0\0\0\0\250m\1\0\0\0\0\0\250m\1\0\0\0\0\0\20\2\0\0\0\0\0\0\20\2\0\0\0\0= \0\0\10\0\0\0\0\0\0\0\4\0\0\0\4\0\0\08\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, 0) =3D 0x7f36a2= a18000 mprotect(0x7f36a2a1c000, 73728, PROT_NONE) =3D 0 mmap(0x7f36a2a1c000, 57344, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_= DENYWRITE, 3, 0x4000) =3D 0x7f36a2a1c000 mmap(0x7f36a2a2a000, 12288, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE,= 3, 0x12000) =3D 0x7f36a2a2a000 mmap(0x7f36a2a2e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_= DENYWRITE, 3, 0x15000) =3D 0x7f36a2a2e000 mmap(0x7f36a2a30000, 6784, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_= ANONYMOUS, -1, 0) =3D 0x7f36a2a30000 close(3) =3D 0 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) =3D= 3 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@n\2\0\0\0\0\0@\0\0\= 0\0\0\0\0p\2\34\0\0\0\0\0\0\0\0\0@\08\0\f\0@\0A\0@\0\6\0\0\0\4\0\0\0@\0\0\0= \0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0\240\2\0\0\0\0\0\0\240\2\0\0\0\0\0\0\= 10\0\0\0\0\0\0\0\3\0\0\0\4\0\0\0 ?\31\0\0\0\0\0 ?\31\0\0\0\0\0 ?\31\0\0\0\0= \0\34\0\0\0\0\0\0\0\34\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0\1\0\0\0\4\0\0\0\0\0\0= \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200I\2\0\0\0\0\0\200I\2\0\0\0\0\= 0\0\20\0\0\0\0\0\0\1\0\0\0\5\0\0\0\0P\2\0\0\0\0\0\0P\2\0\0\0\0\0\0P\2\0\0\0= \0\0\f\245\24\0\0\0\0\0\f\245\24\0\0\0\0\0\0\20\0\0\0\0\0\0\1\0\0\0\4\0\0\0= \0\0\27\0\0\0\0\0\0\0\27\0\0\0\0\0\0\0\27\0\0\0\0\0\313\237\4\0\0\0\0\0\313= \237\4\0\0\0\0\0\0\20\0\0\0\0\0\0\1\0\0\0\6\0\0\0\340\245\33\0\0\0\0\0\340\= 265\33\0\0\0\0\0\340\265\33\0\0\0\0\0000P\0\0\0\0\0\0(\217\0\0\0\0\0\0\0\20= \0\0\0\0\0\0\2\0\0\0\6\0\0\0\200\313\33\0\0\0\0\0\200\333\33\0\0\0\0\0\200\= 333\33\0\0\0\0\0\340\1\0\0\0\0\0\0\340\1\0\0\0\0\0\0\10\0\0\0\0\0\0\0\4\0\0= \0\4\0\0\0\340\2\0\0\0\0\0\0\340\2\0\0\0\0\0\0\340\2\0\0\0\0\0\0D\0\0\0\0\0= \0\0D\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0\7\0\0\0\4\0\0\0\340\245\33\0\0\0\0\0\34= 0\265\33\0\0\0\0\0\340\265\33\0\0\0\0\0\20\0\0\0\0\0\0\0\220\0\0\0\0\0\0\0\= 10\0\0\0\0\0\0\0P\345td\4\0\0\0