From patchwork Tue Jun 23 09:35:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Dipolt X-Patchwork-Id: 1315034 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=robart.cc Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=hMry/t44; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=LUT97bxP; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=robart.cc header.i=@robart.cc header.a=rsa-sha256 header.s=B016B336-104E-11EA-8E2D-E36DD02BB770 header.b=eMC+ahoV; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49rh5f0wSNz9sRf for ; Tue, 23 Jun 2020 19:37:40 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Subject:Message-ID:To:From:Date:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=BxElW+Uhq2Kc+np9c4Ild5ada6N/BoxDvb5pmlcd50M=; b=hMry/t44ddn5djUE2QsmgutolG Nq8ltYWMxH8i6KCBJepWKCsvfqiEn6xSIUYvNPyhL2pYMXtUtKQj+x6alfL6rBqYPEAlWNpPN7x0K AeGnakD+Kt111D27w9vb3u0xYsaCXJFWKP3is9Dgj8eqUYWyAC682S9J3u0HGgmRU8nqLhpiBZkRv b1OeS51wWbDlZHy7W7YnbDT/PEAgGilKspkflEH5MD4lcK9jXcrgqUl+D8g0InConBZyGx5toN4n7 AfoFpodf7OxdZVJZfecN8RbNX/NyEcz8eHphHvN3bb6c+y6sPzTtF7iCdUm0YC1pYcXETOHeAWjxs dFXACWKw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnfLZ-0006LR-NZ; Tue, 23 Jun 2020 09:36:05 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnfLX-0006KY-Ry for linux-mtd@merlin.infradead.org; Tue, 23 Jun 2020 09:36:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Subject:Message-ID:To:From:Date:Sender:Reply-To:Cc:Content-ID: Content-Description:In-Reply-To:References; bh=+1Rl2K2ucQOIM1cDVmVUrZFbQzJ5npqD6CWiP0OpUEY=; b=LUT97bxPYHB/idZmWVw0AdUuVb P5onjeQOxx0jIvsuy/OYlcLRQNnbyrtyuy3k4ensugd7Xnci5rqBcQbeaGYESwMGFIr8JnE7koUfy VOJyhjQXSsfzLKBhuB7qKW+T6G9r9/1nGktt6vaYLM5vIN1fdRtRp67w+TrI/02Ez5PRo5FbyhcGD jgYKjrLQtMSmVwI9aBHiNe2jmJcfVw9tZgR7vD1kpDUhF3SsLxVPoWhkk7l6fyb5xjMw0ohDZs4F+ DvFMlqRo2lV7UrVzTSu63aAHomVp+qBoo6ySNqasM8QlFOl4uYgrROBL60u3gBDBSg7g0YyJLmsvU JBNw03lg==; Received: from srv-mta-01.robart.cc ([80.123.245.229]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnfLU-00030Q-Ik for linux-mtd@lists.infradead.org; Tue, 23 Jun 2020 09:36:03 +0000 Received: from localhost (localhost [127.0.0.1]) by srv-mta-01.robart.cc (Postfix) with ESMTP id 7636C1C103B for ; Tue, 23 Jun 2020 11:35:50 +0200 (CEST) Received: from srv-mta-01.robart.cc ([127.0.0.1]) by localhost (srv-mta-01.robart.cc [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id NuCTR68h_89N for ; Tue, 23 Jun 2020 11:35:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by srv-mta-01.robart.cc (Postfix) with ESMTP id 4E9111C10E2 for ; Tue, 23 Jun 2020 11:35:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 srv-mta-01.robart.cc 4E9111C10E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=robart.cc; s=B016B336-104E-11EA-8E2D-E36DD02BB770; t=1592904950; bh=+1Rl2K2ucQOIM1cDVmVUrZFbQzJ5npqD6CWiP0OpUEY=; h=Date:From:To:Message-ID:MIME-Version; b=eMC+ahoVw7r2xFXTQuc9jKjl60rLDdm6XYsB+1zGSVaC4PXjepPxGsQ/SHZwZMxCm qFE33YXQUC64K7nNt3B+t/vW5hPInw8DFD/rCjL9yKK2VXClshPkgf15zQPpgGVK+/ cTGowUdxHZDvC8aXzHrDhJhIzj08hPCqaNhcqQVjB0k7k+eUWna97wcPBjWRuhDQYm S8msZ0n1S7M8kJ8eyXZIqAGtbqoWfajiWTEHTHPj+vIz3FYBTA6sX2poelc+KGX67I aSV+ZJrl6vSkafkvqYg2Ued1yAXBe7/TeUnyY+gDO8+9p/D021nsFfmqk2hN5HHvP3 6PQ22LngBwqtw== X-Virus-Scanned: amavisd-new at srv-mta-01.robart.cc Received: from srv-mta-01.robart.cc ([127.0.0.1]) by localhost (srv-mta-01.robart.cc [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id jhA9j-ohuIXa for ; Tue, 23 Jun 2020 11:35:50 +0200 (CEST) Received: from srv-mda-01.robart.cc (srv-mda-01.intern.robart.cc [10.0.10.21]) by srv-mta-01.robart.cc (Postfix) with ESMTP id 387FE1C103B for ; Tue, 23 Jun 2020 11:35:50 +0200 (CEST) Date: Tue, 23 Jun 2020 11:35:50 +0200 (CEST) From: Manuel Dipolt To: linux-mtd Message-ID: <333067545.1988194.1592904950183.JavaMail.zimbra@robart.cc> Subject: mtd-utils: mkfs.ubifs with fscrypt does not crypt hardlink files MIME-Version: 1.0 X-Originating-IP: [10.0.20.40] X-Mailer: Zimbra 8.8.15_GA_3901 (ZimbraWebClient - FF68 (Linux)/8.8.15_GA_3895) Thread-Index: A/yyQnhWI0fr0OkiqklUOUOMHCI1bQ== Thread-Topic: mtd-utils: mkfs.ubifs with fscrypt does not crypt hardlink files X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200623_103600_807257_BD236635 X-CRM114-Status: UNSURE ( 4.06 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org hi, Hardlink files gets not crypted per default via mkfs.ubifs with fscrypt (missing fctx parameter for the add_multi_linked_files function) Is http://git.infradead.org/mtd-utils.git currently down? yours, Manuel Patch to crypt also hardlinks: diff --git a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c index 0b5e2e0..c32ebc3 100644 --- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c +++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c @@ -2202,7 +2200,7 @@ out_free: /** * add_multi_linked_files - write all the files for which we counted links. */ -static int add_multi_linked_files(void) +static int add_multi_linked_files(struct fscrypt_context *fctx) { int i, err; @@ -2213,7 +2211,7 @@ static int add_multi_linked_files(void) for (im = hash_table[i]; im; im = im->next) { dbg_msg(2, "%s", im->path_name); err = add_non_dir(im->path_name, &im->use_inum, - im->use_nlink, &type, &im->st, NULL); + im->use_nlink, &type, &im->st, fctx); if (err) return err; } @@ -2264,7 +2262,7 @@ static int write_data(void) err = add_directory(root, UBIFS_ROOT_INO, &root_st, !!root, root_fctx); if (err) return err; - err = add_multi_linked_files(); + err = add_multi_linked_files(root_fctx); if (err) return err; return flush_nodes();