Re: [PATCH 4.9 0/3] fanotify: Fix notification subsystem hang

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 11, 2019 at 03:24:27PM +1200, Matthew Ruffell wrote:
BugLink: https://bugs.launchpad.net/bugs/1775165

[Note to upstream]
I understand that this patch is a little long for -stable, but this patch series
fixes a real issue, seen by real users, is testable, and is made up from
upstream commits. Please consider it.

[Impact]

When userspace tasks which are processing fanotify permission events act
incorrectly, the fsnotify_mark_srcu SRCU is held indefinitely which causes
the whole notification subsystem to hang.

This has been seen in production, and it can also be seen when running the
Linux Test Project testsuite, specifically fanotify07.

[Fix]

Instead of holding the SRCU lock while waiting for userspace to respond,
which may never happen, or not in the order we are expecting, we drop the
fsnotify_mark_srcu SRCU lock before waiting for userspace response, and then
reacquire the lock again when userspace responds.

The fixes are from a series of upstream commits:

05f0e38724e8449184acd8fbf0473ee5a07adc6c (cherry-pick)
9385a84d7e1f658bb2d96ab798393e4b16268aaa (backport)
abc77577a669f424c5d0c185b9994f2621c52aa4 (backport)

[Testcase]

You can reproduce the problem pretty quickly with the Linux Test Project:

Steps (with root):
 1. sudo apt-get install git xfsprogs -y
 2. git clone --depth=1 https://github.com/linux-test-project/ltp.git
 3. cd ltp
 4. make autotools
 5. ./configure
 6. make; make install
 7. cd /opt/ltp
 8. echo -e "fanotify07 fanotify07 \nfanotify08 fanotify08" > /tmp/jobs
 9. ./runltp -f /tmp/jobs

I've queued up this and the 4.4 patches, thank you!

--
Thanks,
Sasha



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux