[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200716033048.GG1167@sol.localdomain>
Date: Wed, 15 Jul 2020 20:30:48 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Suren Baghdasaryan <surenb@...gle.com>
Cc: gregkh@...uxfoundation.org, arve@...roid.com, tkjos@...roid.com,
maco@...roid.com, joel@...lfernandes.org, christian@...uner.io,
hridya@...gle.com, mhocko@...nel.org, hdanton@...a.com,
devel@...verdev.osuosl.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, kernel-team@...roid.com
Subject: Re: [PATCH 1/1] staging: android: ashmem: Fix lockdep warning for
write operation
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/0000000000000b5f9d059aa2037f@google.com/
>
> Signed-off-by: Suren Baghdasaryan <surenb@...gle.com>
Please add proper tags:
Reported-by: syzbot+7a0d9d0b26efefe61780@...kaller.appspotmail.com
Fixes: ...
Cc: stable@...r.kernel.org
The Reported-by tag to use was given in the original syzbot report.
- Eric
Powered by blists - more mailing lists