Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1184000pxf; Fri, 19 Mar 2021 00:35:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfMjr600OC4xwjXyOKh5UuGQm76oTrznIMUDRkUuwiftqGI1e7Z/pkZ534nRCCc3QjtOLT X-Received: by 2002:a17:906:d157:: with SMTP id br23mr2903365ejb.192.1616139346002; Fri, 19 Mar 2021 00:35:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616139345; cv=none; d=google.com; s=arc-20160816; b=hkmWJSqubrnZ1TdE+iIzzA+PQlT4M6WxJXAs6HQWLaxCmoRcmU3faybd2+QRlgo9Ms 0Y6pK27ejgU6Qtr6lnr51G2U6u1uufYFd7UF6HUlTIkuY1OxHqy5iWk6HK2lqcPnsbHi v/Rc3dFR3NDdNrQhK8AjyRpSNWfQ3NeherDaQvsSaJkNE9dG8nkCkMmORGxEhs3PuzT1 3jWSPr0zjTU4uLAQHC6YBLm0UbGYIdf93ZmVWKto3g5TlcGTAssLLCKe5JM8xA4VXLuN AVK85xRkIHkqP5MXb1gJ5Ym+SdJFJgtM9UMRJ3ba+/i7r8GOgfYmtqglFJ872GNcyeKt Gbpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=urQzhmgOX5AXOQJelfFx/ncldq6kmhxylYkJ5Acgg0A=; b=qgLUO+2uPncUfKLHcXvMwNY2VgzzgmnABQ0/90ebSqWxHvvKo/8WLHn079U5UDFAdR JPcZd3P0vSwOOnLBlofiL2zwNSswmPGDme6LxxnLDA8aeN48rUw3HhdQtCnJVgxR9Eaz WdmBgx96SC3QtgPjXODWX6IMp98BenyF346MEwRoMJ31BwpJwxIK0MW7Gk95Yo+tQ4rH b704qdm7WJTMwW5MzN7MB8P7BE+rK4Ky4A4TOSOMLxJLWu2RCEE6t9JmLScvreBXbIND oEaxTWdirbnioGvK1keKiDJLjWRY6q3C3ZBiHmu344MkyW4pVFlFu4yT174LzcKx0eqh TA0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QOPJ+ioS; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si3677131edv.29.2021.03.19.00.35.17; Fri, 19 Mar 2021 00:35:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QOPJ+ioS; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234223AbhCSHep (ORCPT + 99 others); Fri, 19 Mar 2021 03:34:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234016AbhCSHeS (ORCPT ); Fri, 19 Mar 2021 03:34:18 -0400 Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B088C06174A for ; Fri, 19 Mar 2021 00:34:18 -0700 (PDT) Received: by mail-qk1-x749.google.com with SMTP id v136so33418832qkb.9 for ; Fri, 19 Mar 2021 00:34:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=urQzhmgOX5AXOQJelfFx/ncldq6kmhxylYkJ5Acgg0A=; b=QOPJ+ioSziS+Wf9i0JARXPRnSFZX6sRlJV06RqmoiYGZJc0MdP5qz6mHzq1Driyviz 4LtSeSyjUegPikBilpxWUqHG5cbI06J1boqmC93ApsaVy3OA1M2mI8dSlUuYs5/lZB1V uHXzh3mFxrz0Y5k6/TSvPX9jCU2ThvAPrPYo+t9TpX80dVBtoJjFrQlRfUgaU6WgDUFa XZr1LZeDCLhMPbkXUHbtcCgckzZmP74OlPBmy2/nBfUkJF3y+1LcbA5RQJxsLk4i1sem Jp9e3imzPycUqOlqWJrWv61tOAnTeeef87QwHPlmLRYxxygG+rvIeC8EXt/IoOjNt75q LwDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=urQzhmgOX5AXOQJelfFx/ncldq6kmhxylYkJ5Acgg0A=; b=hHBO7x4lGJM87DTOPfrP/UJa5GkCVuUeFwRDIAcdmw/Iovdmoak3rJLZs6laU5LUnx OdG7LyWI+C25LPwVs/BoQYSEtGnG7zyfCkuXXua0P3W6iZeHzPa2Hu20s7aHviK3+vSC /mlbiHt33yM2BZN/rI2GWelmuCSm70zgzqMVy4vuHAIxjSfVfBlmRcZTHy6IX5XRWWey xsLwJEAORMkTj3Ug3OCy1TvdK6QnjRcQ+RHl4vuU7WgPl5PEpbPSNTClMET5gCaX/OWu Oc2E8N/T92hpzIzRgUsfYwCHx/ehEZ8JLl13Eusccbia+jHat8XMI/97g5wATk2zWuKU 7tGQ== X-Gm-Message-State: AOAM533d6/NPjkVHWCrO3iygFeJGfcZoFQD8Z20wGZkSRLp3Hkc/uhXu bvKg3kZm9/9GyBLslrQI2vkLajlpMS4= X-Received: from drosen.c.googlers.com ([fda3:e722:ac3:10:24:72f4:c0a8:4e6f]) (user=drosen job=sendgmr) by 2002:a0c:8623:: with SMTP id p32mr8077081qva.23.1616139257477; Fri, 19 Mar 2021 00:34:17 -0700 (PDT) Date: Fri, 19 Mar 2021 07:34:12 +0000 Message-Id: <20210319073414.1381041-1-drosen@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog Subject: [PATCH v2 0/2] Reconcile Encryption and Casefolding in Ext4 From: Daniel Rosenberg To: "Theodore Y . Ts'o" , Eric Biggers , Andreas Dilger , linux-ext4@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Gabriel Krisman Bertazi , kernel-team@android.com, Daniel Rosenberg Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org These patches add support for ext4 encryption and casefolding at the same time. Since the hash for encrypted casefolded directory names cannot be computed without the key, we need to store the hash on disk. We only do so for encrypted and casefolded directories to avoid on disk format changes. e2fsprogs has already been updated with support for casefolding and encryption. v2 changes: When checking for 'fake' entries (which do not include the extra hash bytes) -Check for . and .. using names instead of position -Check for csum entries via file_type instead of position -Assume last entry in directory will be csum for __ext4_check_entry if csum enabled This means we don't need to pass along lblk all over the place -Don't use siphash value for find_group_orlov, just use regular hash Daniel Rosenberg (2): ext4: Handle casefolding with encryption ext4: Optimize match for casefolded encrypted dirs Documentation/filesystems/ext4/directory.rst | 27 +++ fs/ext4/dir.c | 37 +++- fs/ext4/ext4.h | 73 +++++-- fs/ext4/hash.c | 25 ++- fs/ext4/inline.c | 25 ++- fs/ext4/namei.c | 213 ++++++++++++++----- fs/ext4/super.c | 6 - 7 files changed, 303 insertions(+), 103 deletions(-) base-commit: f296bfd5cd04cbb49b8fc9585adc280ab2b58624 -- 2.31.0.rc2.261.g7f71774620-goog