OSDN Git Service

Fix dnotify/close race (CVE-2008-1375)
authorWilly Tarreau <w@1wt.eu>
Sat, 5 Apr 2008 13:31:59 +0000 (15:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 5 May 2008 20:42:06 +0000 (22:42 +0200)
commit141787e66243b24109d3da653168f3a813f6db2b
tree0b2828fb4377ec639a91abc7fc12186e828c4e6e
parent0062f7f041ff38f71670a2420c5f8633eb15b69b
Fix dnotify/close race (CVE-2008-1375)

Issue reported by Al Viro with description taken from 2.6 commit
214b7049a7929f03bbd2786aaef04b8b79db34e2 :

We have a race between fcntl() and close() that can lead to
dnotify_struct inserted into inode's list *after* the last descriptor
had been gone from current->files.

Since that's the only point where dnotify_struct gets evicted, we are
screwed - it will stick around indefinitely.  Even after struct file in
question is gone and freed.  Worse, we can trigger send_sigio() on it at
any later point, which allows to send an arbitrary signal to arbitrary
process if we manage to apply enough memory pressure to get the page
that used to host that struct file and fill it with the right pattern...
fs/dnotify.c