On Wed, Jul 15, 2020 at 8:30 PM Eric Biggers <[email protected]> wrote: > > On Wed, Jul 15, 2020 at 07:45:27PM -0700, Suren Baghdasaryan wrote: > > syzbot report [1] describes a deadlock when write operation against an > > ashmem fd executed at the time when ashmem is shrinking its cache results > > in the following lock sequence: > > > > Possible unsafe locking scenario: > > > > CPU0 CPU1 > > ---- ---- > > lock(fs_reclaim); > > lock(&sb->s_type->i_mutex_key#13); > > lock(fs_reclaim); > > lock(&sb->s_type->i_mutex_key#13); > > > > kswapd takes fs_reclaim and then inode_lock while generic_perform_write > > takes inode_lock and then fs_reclaim. However ashmem does not support > > writing into backing shmem with a write syscall. The only way to change > > its content is to mmap it and operate on mapped memory. Therefore the race > > that lockdep is warning about is not valid. Resolve this by introducing a > > separate lockdep class for the backing shmem inodes. > > > > [1]: https://lkml.kernel.org/lkml/[email protected]/ > > > > Signed-off-by: Suren Baghdasaryan <[email protected]> > > Please add proper tags: > > Reported-by: [email protected] > Fixes: ... > Cc: [email protected] > > > The Reported-by tag to use was given in the original syzbot report.
Will add in v2. Thanks! > > - Eric _______________________________________________ devel mailing list [email protected] http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
