From: Greg Kroah-Hartman Date: Sun, 9 Apr 2017 19:19:17 +0000 (+0200) Subject: 3.18 patch X-Git-Tag: v4.4.61~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=67dd755547da53c7ad02b4180bc5464832da76b0;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18 patch --- diff --git a/queue-3.18/series b/queue-3.18/series index b38c446067b..e48840e67bf 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -65,3 +65,4 @@ raid10-increment-write-counter-after-bio-is-split.patch xfrm-policy-init-locks-early.patch xfrm_user-validate-xfrm_msg_newae-incoming-esn-size-harder.patch xfrm_user-validate-xfrm_msg_newae-xfrma_replay_esn_val-replay_window.patch +staging-android-ashmem-lseek-failed-due-to-no-fmode_lseek.patch diff --git a/queue-3.18/staging-android-ashmem-lseek-failed-due-to-no-fmode_lseek.patch b/queue-3.18/staging-android-ashmem-lseek-failed-due-to-no-fmode_lseek.patch new file mode 100644 index 00000000000..4764c7c4021 --- /dev/null +++ b/queue-3.18/staging-android-ashmem-lseek-failed-due-to-no-fmode_lseek.patch @@ -0,0 +1,39 @@ +From 97fbfef6bd597888485b653175fb846c6998b60c Mon Sep 17 00:00:00 2001 +From: Shuxiao Zhang +Date: Thu, 6 Apr 2017 22:30:29 +0800 +Subject: staging: android: ashmem: lseek failed due to no FMODE_LSEEK. + +From: Shuxiao Zhang + +commit 97fbfef6bd597888485b653175fb846c6998b60c upstream. + +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. + +Comment From Greg Hackmann: + 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. + +Fixes: 91360b02ab48 ("ashmem: use vfs_llseek()") +Signed-off-by: Shuxiao Zhang +Tested-by: Greg Hackmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/android/ashmem.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/staging/android/ashmem.c ++++ b/drivers/staging/android/ashmem.c +@@ -392,6 +392,7 @@ static int ashmem_mmap(struct file *file + ret = PTR_ERR(vmfile); + goto out; + } ++ vmfile->f_mode |= FMODE_LSEEK; + asma->file = vmfile; + } + get_file(asma->file);