mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@163.com>
To: bcrl@kvack.org, Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-aio@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [BUG] fs/aio: A possible sleep-in-atomic bug in aio_migratepage
Date: Sat, 7 Oct 2017 09:36:48 +0800	[thread overview]
Message-ID: <dee03130-37ef-3958-455b-b1fca415b2c1@163.com> (raw)

According to fs/aio.c, cond_resched is called under a spinlock,
and the function call path is:
aio_migratepage (acquire the spinlock)
   migrate_page_copy
     copy_huge_page
       __copy_gigantic_page
         cond_resched
           might_sleep

This bug is found by my static analysis tool and my code review.
A possible fix is to remove cond_resched in __copy_gigantic_page.


Thanks,
Jia-Ju Bai

             reply	other threads:[~2017-10-07  1:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-07  1:36 Jia-Ju Bai [this message]
2017-10-07  2:31 ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dee03130-37ef-3958-455b-b1fca415b2c1@163.com \
    --to=baijiaju1990@163.com \
    --cc=bcrl@kvack.org \
    --cc=linux-aio@kvack.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®