~kmously/ubuntu/+source/linux/+git/bionic:kamal-pull2

Last commit made on 2018-06-06
Get this branch:
git clone -b kamal-pull2 https://git.launchpad.net/~kmously/ubuntu/+source/linux/+git/bionic
Only Khaled El Mously can upload to this branch. If you are Khaled El Mously please log in for upload directions.

Branch merges

Branch information

Name:
kamal-pull2
Repository:
lp:~kmously/ubuntu/+source/linux/+git/bionic

Recent commits

7632554... by Tetsuo Handa <email address hidden> on 2018-04-04

mm,vmscan: Allow preallocating memory for register_shrinker().

BugLink: http://bugs.launchpad.net/bugs/1774063

commit 8e04944f0ea8b838399049bdcda920ab36ae3b04 upstream.

syzbot is catching so many bugs triggered by commit 9ee332d99e4d5a97
("sget(): handle failures of register_shrinker()"). That commit expected
that calling kill_sb() from deactivate_locked_super() without successful
fill_super() is safe, but the reality was different; some callers assign
attributes which are needed for kill_sb() after sget() succeeds.

For example, [1] is a report where sb->s_mode (which seems to be either
FMODE_READ | FMODE_EXCL | FMODE_WRITE or FMODE_READ | FMODE_EXCL) is not
assigned unless sget() succeeds. But it does not worth complicate sget()
so that register_shrinker() failure path can safely call
kill_block_super() via kill_sb(). Making alloc_super() fail if memory
allocation for register_shrinker() failed is much simpler. Let's avoid
calling deactivate_locked_super() from sget_userns() by preallocating
memory for the shrinker and making register_shrinker() in sget_userns()
never fail.

[1] https://syzkaller.appspot.com/bug?id=588996a25a2587be2e3a54e8646728fb9cae44e7

Signed-off-by: Tetsuo Handa <email address hidden>
Reported-by: syzbot <email address hidden>
Cc: Al Viro <email address hidden>
Cc: Michal Hocko <email address hidden>
Signed-off-by: Al Viro <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>
Signed-off-by: Kamal Mostafa <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

Some recent commit information could not be fetched.