Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1278415

Re: [PATCH] fix an endianness bug in ext4_encrypted_follow_link()

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH] fix an endianness bug in ext4_encrypted_follow_link()
Date 2015-11-26 20:50 +0100
Message-ID <qzaIh-13l-1@gated-at.bofh.it> (permalink)
References <qz6EI-6XT-55@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


(cc'ing Julia Lawall)

On Thu, 2015-11-26 at 15:27 +0000, Al Viro wrote:
> applying le32_to_cpu() to 16bit value is a bad idea...

Julia, perhaps you or your crew could produce a coccinelle test
for this class of error?

> diff --git a/fs/ext4/symlink.c b/fs/ext4/symlink.c
> index abe2401..e8e7af6 100644
> --- a/fs/ext4/symlink.c
> +++ b/fs/ext4/symlink.c
> @@ -52,7 +52,7 @@ static const char *ext4_encrypted_follow_link(struct dentry *dentry, void **cook
>  	/* Symlink is encrypted */
>  	sd = (struct ext4_encrypted_symlink_data *)caddr;
>  	cstr.name = sd->encrypted_path;
> -	cstr.len  = le32_to_cpu(sd->len);
> +	cstr.len  = le16_to_cpu(sd->len);
>  	if ((cstr.len +
>  	     sizeof(struct ext4_encrypted_symlink_data) - 1) >
>  	    max_size) {

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] fix an endianness bug in ext4_encrypted_follow_link() Al Viro <viro@ZenIV.linux.org.uk> - 2015-11-26 16:30 +0100
  Re: [PATCH] fix an endianness bug in ext4_encrypted_follow_link() Joe Perches <joe@perches.com> - 2015-11-26 20:50 +0100
    Re: [PATCH] fix an endianness bug in ext4_encrypted_follow_link() Al Viro <viro@ZenIV.linux.org.uk> - 2015-11-26 22:10 +0100
      Re: [PATCH] fix an endianness bug in ext4_encrypted_follow_link() Julia Lawall <julia.lawall@lip6.fr> - 2015-11-26 22:30 +0100
        Re: [PATCH] fix an endianness bug in ext4_encrypted_follow_link() Joe Perches <joe@perches.com> - 2015-11-26 23:50 +0100
          Re: [PATCH] fix an endianness bug in ext4_encrypted_follow_link() Fengguang Wu <lkp@intel.com> - 2015-11-27 02:40 +0100
  Re: [PATCH] fix an endianness bug in ext4_encrypted_follow_link() Theodore Ts'o <tytso@mit.edu> - 2015-11-26 21:30 +0100

csiph-web