From patchwork Fri Dec 15 17:42:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 849326 X-Patchwork-Delegate: richard@nod.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="H37rBSCW"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="v5dWEM4A"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qbIGggAZ"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yyylF39lQz9s03 for ; Sat, 16 Dec 2017 04:55:37 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=tFvXmt94QI84RyZZXeenKbT+dA1OFF0EW6uZnBs/9VY=; b=H37rBSCW5ZwvTx/cVlM/okdK/G WKSYiggKtu5gMmBSVOfbiHSXwmmAQlXRIYInyLivrcgvYLJu3Uz+qUTwnxmc57Bf09xj75qYDlMHD jr3hH8VXop4W2wNzXJToQD97dcmp+ifbY18krITOkfPNlVC1v09BTSTpL9g7LFob5EW+h30H0k1lC Bcwf0LMNIwLKMVQPuaUSGIvDAzc9OnMhqlolNU3huH6L7/ZFTIHdUhB/12C5HrprXNWdkq21G53Nf FJQrMwEw4cywttk7Um+Ezj8X4E+2I25IhbMMpqgs1NME7hvITxBEgtJE5zgfVJzYA9L/qAaX/2mcY kpRCB+JQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ePuCk-0000h6-Rh; Fri, 15 Dec 2017 17:55:26 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ePu5J-0000Av-GY for linux-mtd@bombadil.infradead.org; Fri, 15 Dec 2017 17:47:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QwmgdyEhQdLEe23GR7crp+rYN1qd48mZQnGA88cbj+o=; b=v5dWEM4AXCh1j0DcbTPYdTXM4 WwQ0BD/zwZoqpAA0vyVnCr0/EGI46mm4gNStANsIJCqulb4T+rVPRd9YdCFLgLZ9TIQpMF0StFUQC RgLPUxPd/oxlx1rKcTYt+UIlMG11R/mxXuXOnKLRCF7W9aE8labPOF8jdaapXbY45sZDk48Xf13yC KlVJ4sCmpg2oOUzJCHAV4qVIrueI9Bg4WP3OY+1OMzn07rgzhdLwL4KFjvbzhHYvmTWyw4oCWndDu S97SlqSDhhdCOeeaEsQK3zdAzW8qm2eh5F0Sqp1jrJgqoeh5ucLhyGX0tGXng1F7tSsJ1hVLMZZey Q5ZGmSIQA==; Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ePu4v-0007mX-D9 for linux-mtd@lists.infradead.org; Fri, 15 Dec 2017 17:47:22 +0000 Received: by mail-pg0-x243.google.com with SMTP id y6so6255437pgp.4 for ; Fri, 15 Dec 2017 09:47:01 -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=QwmgdyEhQdLEe23GR7crp+rYN1qd48mZQnGA88cbj+o=; b=qbIGggAZb60uhwIuEWMlftMq6mtwb7vE996Q7v6B3m3AjiXu+fy7VJV9D65VnjWkZU mnph6j//I7RGeT3Z2Fhu9a3I7jjj3sLdFeewlcP+9DH+WvUlC43jFYXaCM4jBRrOws0X 84ISCf1z25B1Wpfynt/zCIiKQbwWrT8bGcfJBtiXPQJ/+cRyhQ1llVpSHczDfIhroy1n 1h8nwU3Bu9qJgtdiyOU7Kmpc+O+8atCMkJSJSALBnTF60fGvM+5wdRoKhOMrRWbnSbnY ZYJfN45DQ/GWwcUiah8EByM+zXefj0QypimMJ+CA62iWB53C/4AV6kWOifdO0vTJ5ZJ0 WbtQ== 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=QwmgdyEhQdLEe23GR7crp+rYN1qd48mZQnGA88cbj+o=; b=fAI9DpWliqEXKBbzAuDn/k6HNz2vSmeuixkZf0xzBF0xr0rGxDYjlzMfX+NnI7U0eL CyP4G/kNMbqQUvLB5ewR0UmqHEmUGYUzd2e3JdfDBTGNaHGGCDMuSZ6H6dbKMbEx4GAI 3wfl4X/Lv9yJoZ9cXSV7YJ3sm23h2RlkRPCge4nJr46r+amB4OxS19lAcBvw3MZb1nJ0 dQcqyO6JNZICWV+hJf7l3X5hUu7KcktSaxCETk4QtgisqU+v/ACCUxNNNOXvZ2b4LTX+ /wjXhSf7/u158lRO/pyiexDkJy3TPvC42HZyfrUlHt1+DTmqImFTkblHWAL+0mbq13g2 SU7w== X-Gm-Message-State: AKGB3mJlc5j9i8eem64Lz5ExA8uqT81BlE4OBdaRnQDCNIU6k670SBy2 sPAd1H1t7k+aLKQgBaLKJXk= X-Google-Smtp-Source: ACJfBovueMyYjumt0MMy++2JCecGrrmiW5YcbZZY2ZAE1oWEewvPV8/X6EdmviKuWnjwC8jUt2N1hg== X-Received: by 10.84.232.6 with SMTP id h6mr13939964plk.263.1513360017965; Fri, 15 Dec 2017 09:46:57 -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.46.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Dec 2017 09:46:57 -0800 (PST) From: Eric Biggers To: linux-fscrypt@vger.kernel.org Subject: [PATCH 18/24] ubifs: switch to fscrypt_get_symlink() Date: Fri, 15 Dec 2017 09:42:19 -0800 Message-Id: <20171215174225.31583-19-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> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c05:0:0:0:243 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ebiggers3[at]gmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (ebiggers3[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Theodore Y . Ts'o" , Eric Biggers , linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, Jaegeuk Kim , linux-ext4@vger.kernel.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Eric Biggers Signed-off-by: Eric Biggers --- fs/ubifs/file.c | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index dfe85069586e..3cfc578c42ea 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -1662,49 +1662,17 @@ static const char *ubifs_get_link(struct dentry *dentry, struct inode *inode, struct delayed_call *done) { - int err; - struct fscrypt_symlink_data *sd; struct ubifs_inode *ui = ubifs_inode(inode); - struct fscrypt_str cstr; - struct fscrypt_str pstr; - if (!ubifs_crypt_is_encrypted(inode)) + if (!IS_ENCRYPTED(inode)) return ui->data; if (!dentry) return ERR_PTR(-ECHILD); - err = fscrypt_get_encryption_info(inode); - if (err) - return ERR_PTR(err); - - sd = (struct fscrypt_symlink_data *)ui->data; - cstr.name = sd->encrypted_path; - cstr.len = le16_to_cpu(sd->len); - - if (cstr.len == 0) - return ERR_PTR(-ENOENT); - - if ((cstr.len + sizeof(struct fscrypt_symlink_data) - 1) > ui->data_len) - return ERR_PTR(-EIO); - - err = fscrypt_fname_alloc_buffer(inode, cstr.len, &pstr); - if (err) - return ERR_PTR(err); - - err = fscrypt_fname_disk_to_usr(inode, 0, 0, &cstr, &pstr); - if (err) { - fscrypt_fname_free_buffer(&pstr); - return ERR_PTR(err); - } - - pstr.name[pstr.len] = '\0'; - - set_delayed_call(done, kfree_link, pstr.name); - return pstr.name; + return fscrypt_get_symlink(inode, ui->data, ui->data_len, done); } - const struct address_space_operations ubifs_file_address_operations = { .readpage = ubifs_readpage, .writepage = ubifs_writepage,