lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E2ECFBE.60602@redhat.com>
Date:	Tue, 26 Jul 2011 10:31:26 -0400
From:	Josef Bacik <josef@...hat.com>
To:	Dan Carpenter <error27@...il.com>
CC:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	Alexander Viro <viro@...iv.linux.org.uk>
Subject: Re: [patch] fs: add missing unlock in default_llseek()

On 07/26/2011 10:25 AM, Dan Carpenter wrote:
> 
> A recent change in linux-next, 982d816581 "fs: add SEEK_HOLE and
> SEEK_DATA flags" added some direct returns on error, but it should
> have been a goto out.
> 
> Signed-off-by: Dan Carpenter <error27@...il.com>
> 
> diff --git a/fs/read_write.c b/fs/read_write.c
> index 5907b49..179f1c3 100644
> --- a/fs/read_write.c
> +++ b/fs/read_write.c
> @@ -166,8 +166,10 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
>  			 * long as offset isn't at the end of the file then the
>  			 * offset is data.
>  			 */
> -			if (offset >= inode->i_size)
> -				return -ENXIO;
> +			if (offset >= inode->i_size) {
> +				retval = -ENXIO;
> +				goto out;
> +			}
>  			break;
>  		case SEEK_HOLE:
>  			/*
> @@ -175,8 +177,10 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
>  			 * as long as offset isn't i_size or larger, return
>  			 * i_size.
>  			 */
> -			if (offset >= inode->i_size)
> -				return -ENXIO;
> +			if (offset >= inode->i_size) {
> +				retval = -ENXIO;
> +				goto out;
> +			}
>  			offset = inode->i_size;
>  			break;
>  	}

Eeek copy+paste bites me again.  Thanks

Acked-by: Josef Bacik <josef@...hat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ