From patchwork Fri Dec 15 17:42:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10115713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5FDA86019C for ; Fri, 15 Dec 2017 17:47:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BFE329EE1 for ; Fri, 15 Dec 2017 17:47:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F9062A092; Fri, 15 Dec 2017 17:47:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D998E29EE1 for ; Fri, 15 Dec 2017 17:47:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756178AbdLORrL (ORCPT ); Fri, 15 Dec 2017 12:47:11 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:39283 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755996AbdLORrG (ORCPT ); Fri, 15 Dec 2017 12:47:06 -0500 Received: by mail-pg0-f68.google.com with SMTP id w7so6253200pgv.6; Fri, 15 Dec 2017 09:47:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lEShlutuRLB17SfOdSu4zdJUybMKo/oX95udld4MdxE=; b=WK+VQ6LGFBhwfyuP95UMYNdkbS2RWITj2n6e9f+e0zcPEBRUD+yfp55ks39ZpaS7Ys SjA0Phi6pRn1PwsWRkBhVccFi6IPOakz8J4LKpajoq4mBukb+ACDs0lmKzJWHGPTRIUI meCHfTrD/ZRMWkn29QX/GtXr+OfEnL5wkliP5mNgpZkLXbgGEi/zWyKkdOr3AjVAmxya +3k21OW7PrZ+f+JsyhRJEkHEM9cgMNRaq2gwuiX+Kmg7tyr0kevqvtp8h7HQ6/k/cH+d IfuneM87NDx64xsHjS3tPaWCxDIceKVFoFVn+ppWMMqukjGcsmgfAnYeKsANcX4kT+8g Aa/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lEShlutuRLB17SfOdSu4zdJUybMKo/oX95udld4MdxE=; b=Hyr0T6ll7TE+fWvcJ7TvYDEOcHzGpLY90tnBueVQmAwK+qpw1fMR9hwCtAapmqnG6W UmEayJ2kOiU6VA7wcsP4q0rcDQwELOTRAfDD2kpWIQNey58oVBachP25sJJ4ZSsI9IU6 l2iJ5GzOSqwAkU8kwX8SXL1L8d5qHS6Aiwy1Eqb/GCJ2RfcgdUwBW/1BiFVLWTUjnawm u4K+bClNGFvyfIxERDB/zqAaTTygdC77lnihHIwWjP/9Y9Y3ZoVCP/jqNmySqATvG9uz cTSVD16Y5qFoJJbKv5Ka1+xtr+cINKJzlN2F/xcFiVAM1t8YRp0BoZTz7G56YcLSk0+p DieA== X-Gm-Message-State: AKGB3mJpqiZUqfY+TLYYzQr8e3dB/+AQkGw017PZgibrrnwodUlRPE8v 7hNRSAIOQz37Y7J4D0njP4Bo0DgG0tA= X-Google-Smtp-Source: ACJfBosox1HBSdSGAfZyEvpTUiCMcXDp3eVjSwkC/AWwuNfMEeC6yNQnP9ureVrO1wOb6UkWAKVduA== X-Received: by 10.98.220.218 with SMTP id c87mr14162834pfl.229.1513360025206; Fri, 15 Dec 2017 09:47:05 -0800 (PST) Received: from zzz.localdomain (c-67-185-97-198.hsd1.wa.comcast.net. [67.185.97.198]) by smtp.gmail.com with ESMTPSA id j62sm12980149pfc.18.2017.12.15.09.47.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Dec 2017 09:47:04 -0800 (PST) From: Eric Biggers To: linux-fscrypt@vger.kernel.org Cc: "Theodore Y . Ts'o" , Jaegeuk Kim , linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, Eric Biggers Subject: [PATCH 24/24] fscrypt: document symlink length restriction Date: Fri, 15 Dec 2017 09:42:25 -0800 Message-Id: <20171215174225.31583-25-ebiggers3@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171215174225.31583-1-ebiggers3@gmail.com> References: <20171215174225.31583-1-ebiggers3@gmail.com> Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers Document that encryption reduces the maximum length of a symlink target slightly. Signed-off-by: Eric Biggers --- Documentation/filesystems/fscrypt.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/filesystems/fscrypt.rst b/Documentation/filesystems/fscrypt.rst index 776ddc655f79..cfbc18f0d9c9 100644 --- a/Documentation/filesystems/fscrypt.rst +++ b/Documentation/filesystems/fscrypt.rst @@ -448,8 +448,14 @@ astute users may notice some differences in behavior: - The st_size of an encrypted symlink will not necessarily give the length of the symlink target as required by POSIX. It will actually - give the length of the ciphertext, which may be slightly longer than - the plaintext due to the NUL-padding. + give the length of the ciphertext, which will be slightly longer + than the plaintext due to NUL-padding and an extra 2-byte overhead. + +- The maximum length of an encrypted symlink is 2 bytes shorter than + the maximum length of an unencrypted symlink. For example, on an + EXT4 filesystem with a 4K block size, unencrypted symlinks can be up + to 4095 bytes long, while encrypted symlinks can only be up to 4093 + bytes long (both lengths excluding the terminating null). Note that mmap *is* supported. This is possible because the pagecache for an encrypted file contains the plaintext, not the ciphertext.