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: <94155867-d589-6451-2f3b-a960df559702@google.com>
Date:   Thu, 6 Apr 2017 08:30:40 -0700
From:   Greg Hackmann <ghackmann@...gle.com>
To:     zhangshuxiaomi@...il.com, gregkh@...uxfoundation.org
Cc:     arve@...roid.com, riandrews@...roid.com,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        zhangshuxiao <zhangshuxiao@...omi.com>
Subject: Re: [PATCH] staging: android: ashmem: lseek failed due to no
 FMODE_LSEEK.

On 04/06/2017 07:30 AM, zhangshuxiaomi@...il.com wrote:
> From: zhangshuxiao <zhangshuxiao@...omi.com>
>
> vfs_llseek will check whether the file mode has
> FMODE_LSEEK, no return failure. But ashmem can be
> lseek, so add FMODE_LSEEK to ashmem file.
>
> Signed-off-by: Shuxiao Zhang <zhangshuxiao@...omi.com>
> Tested-by: Greg Hackmann <ghackmann@...gle.com>
> ---
>  drivers/staging/android/ashmem.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
> index 3f11332..e4530ac 100644
> --- a/drivers/staging/android/ashmem.c
> +++ b/drivers/staging/android/ashmem.c
> @@ -392,6 +392,7 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
>  			ret = PTR_ERR(vmfile);
>  			goto out;
>  		}
> +		vmfile->f_mode |= FMODE_LSEEK;
>  		asma->file = vmfile;
>  	}
>  	get_file(asma->file);
>

This commit message is missing some important context.

ashmem_llseek() passes the llseek() call through to the backing shmem 
file.  91360b02ab48 ("ashmem: use vfs_llseek()") changed this from 
directly calling the file's llseek() op into a VFS layer call.  This 
also adds a check for the FMODE_LSEEK bit, so without that bit 
ashmem_llseek() now always fails with -ESPIPE.

I've tested that this patch fixes the regression on both hikey running 
AOSP and User Mode Linux running Debian.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ