diff mbox series

workingset: add missing rcu_read_unlock() in lru_gen_refault()

Message ID 610781bc-cf11-fc89-a46f-87cb8235d439@I-love.SAKURA.ne.jp (mailing list archive)
State New
Headers show
Series workingset: add missing rcu_read_unlock() in lru_gen_refault() | expand

Commit Message

Tetsuo Handa May 9, 2023, 10:22 p.m. UTC
syzbot is reporting sleep in RCU context, for commit d66c718d28ac
("workingset: refactor LRU refault to expose refault recency check")
missed rcu_read_unlock().

Reported-by: syzbot <syzbot+3c6cac1550288f8e7060@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=3c6cac1550288f8e7060
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Fixes: d66c718d28ac ("workingset: refactor LRU refault to expose refault recency check")
---
 mm/workingset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Johannes Weiner May 9, 2023, 11:12 p.m. UTC | #1
On Wed, May 10, 2023 at 07:22:55AM +0900, Tetsuo Handa wrote:
> syzbot is reporting sleep in RCU context, for commit d66c718d28ac
> ("workingset: refactor LRU refault to expose refault recency check")
> missed rcu_read_unlock().
> 
> Reported-by: syzbot <syzbot+3c6cac1550288f8e7060@syzkaller.appspotmail.com>
> Closes: https://syzkaller.appspot.com/bug?extid=3c6cac1550288f8e7060
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Fixes: d66c718d28ac ("workingset: refactor LRU refault to expose refault recency check")

Oops! Thanks for the fix.

Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Nhat Pham May 9, 2023, 11:59 p.m. UTC | #2
On Tue, May 9, 2023 at 3:23 PM Tetsuo Handa <
penguin-kernel@i-love.sakura.ne.jp> wrote:

> syzbot is reporting sleep in RCU context, for commit d66c718d28ac
> ("workingset: refactor LRU refault to expose refault recency check")
> missed rcu_read_unlock().
>
> Reported-by: syzbot <syzbot+3c6cac1550288f8e7060@syzkaller.appspotmail.com
> >
> Closes: https://syzkaller.appspot.com/bug?extid=3c6cac1550288f8e7060
> Signed-off-by
> <https://syzkaller.appspot.com/bug?extid=3c6cac1550288f8e7060Signed-off-by>:
> Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Fixes: d66c718d28ac ("workingset: refactor LRU refault to expose refault
> recency check")
> ---
>  mm/workingset.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/workingset.c b/mm/workingset.c
> index d81f9dafc9f1..90ae785d4c9c 100644
> --- a/mm/workingset.c
> +++ b/mm/workingset.c
> @@ -303,7 +303,7 @@ static void lru_gen_refault(struct folio *folio, void
> *shadow)
>                 goto unlock;
>
>         if (pgdat != folio_pgdat(folio))
> -               return;
> +               goto unlock;
>
>         lruvec = mem_cgroup_lruvec(memcg, pgdat);
>         lrugen = &lruvec->lrugen;
> --
> 2.18.4
>

Thanks for the fix!
Acked-by: Nhat Pham <nphamcs@gmail.com>

>
>
diff mbox series

Patch

diff --git a/mm/workingset.c b/mm/workingset.c
index d81f9dafc9f1..90ae785d4c9c 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -303,7 +303,7 @@  static void lru_gen_refault(struct folio *folio, void *shadow)
 		goto unlock;
 
 	if (pgdat != folio_pgdat(folio))
-		return;
+		goto unlock;
 
 	lruvec = mem_cgroup_lruvec(memcg, pgdat);
 	lrugen = &lruvec->lrugen;