possible deadlock in shmem_file_llseek

syzbot syzbot+8ec30bb7bf1a981a2012 at syzkaller.appspotmail.com
Wed Jan 24 18:42:47 UTC 2018


Hello,

syzbot tried to test the proposed patch but build/boot failed:

patch is already applied


Tested on https://github.com/joelagnel/linux.git/test-ashmem commit
32f813bb0d06c1e189ac336f8c3c7377f85c71f0 (Wed Jan 24 01:45:04 2018 +0000)
ashmem: Fix lockdep issue during llseek

compiler: gcc (GCC) 7.1.1 20170620
Patch is attached.



-------------- next part --------------
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -343,7 +343,9 @@ static loff_t ashmem_llseek(struct file *file, loff_t offset, int origin)
 		goto out;
 	}
 
+	mutex_unlock(&ashmem_mutex);
 	ret = vfs_llseek(asma->file, offset, origin);
+	mutex_lock(&ashmem_mutex);
 	if (ret < 0)
 		goto out;
 


More information about the devel mailing list