From: Tyler Hicks <tyhicks@canonical.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: ecryptfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ecryptfs: lookup: Don't check if mount_crypt_stat is NULL
Date: Wed, 28 Mar 2018 20:45:22 -0500 [thread overview]
Message-ID: <b6ebb694-2b6e-e5bb-ff94-2aea46f7a3f6@canonical.com> (raw)
In-Reply-To: <1516329625-19236-1-git-send-email-linux@roeck-us.net>
[-- Attachment #1.1: Type: text/plain, Size: 1375 bytes --]
On 01/18/2018 08:40 PM, Guenter Roeck wrote:
> mount_crypt_stat is assigned to
> &ecryptfs_superblock_to_private(ecryptfs_dentry->d_sb)->mount_crypt_stat,
> and mount_crypt_stat is not the first object in struct ecryptfs_sb_info.
> mount_crypt_stat is therefore never NULL. At the same time, no crash
> in ecryptfs_lookup() has been reported, and the lookup functions in
> other file systems don't check if d_sb is NULL either.
> Given that, remove the NULL check.
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Thanks! I think this change is fine. I'll get it queued up.
Tyler
> ---
> fs/ecryptfs/inode.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
> index 847904aa63a9..97d17eaeba07 100644
> --- a/fs/ecryptfs/inode.c
> +++ b/fs/ecryptfs/inode.c
> @@ -395,8 +395,7 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode,
>
> mount_crypt_stat = &ecryptfs_superblock_to_private(
> ecryptfs_dentry->d_sb)->mount_crypt_stat;
> - if (mount_crypt_stat
> - && (mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES)) {
> + if (mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES) {
> rc = ecryptfs_encrypt_and_encode_filename(
> &encrypted_and_encoded_name, &len,
> mount_crypt_stat, name, len);
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2018-03-29 1:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-19 2:40 Guenter Roeck
2018-03-29 1:45 ` Tyler Hicks [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b6ebb694-2b6e-e5bb-ff94-2aea46f7a3f6@canonical.com \
--to=tyhicks@canonical.com \
--cc=ecryptfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®