<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pm24.git/fs/notify, branch v5.1</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://git.kobert.dev/pm24.git/atom?h=v5.1</id>
<link rel='self' href='https://git.kobert.dev/pm24.git/atom?h=v5.1'/>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/'/>
<updated>2019-04-28T20:14:50Z</updated>
<entry>
<title>fsnotify: Fix NULL ptr deref in fanotify_get_fsid()</title>
<updated>2019-04-28T20:14:50Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2019-04-24T16:39:57Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=b1da6a51871c6929dced1a7fad81990988b36ed6'/>
<id>urn:sha1:b1da6a51871c6929dced1a7fad81990988b36ed6</id>
<content type='text'>
fanotify_get_fsid() is reading mark-&gt;connector-&gt;fsid under srcu. It can
happen that it sees mark not fully initialized or mark that is already
detached from the object list. In these cases mark-&gt;connector
can be NULL leading to NULL ptr dereference. Fix the problem by
being careful when reading mark-&gt;connector and check it for being NULL.
Also use WRITE_ONCE when writing the mark just to prevent compiler from
doing something stupid.

Reported-by: syzbot+15927486a4f1bfcbaf91@syzkaller.appspotmail.com
Fixes: 77115225acc6 ("fanotify: cache fsid in fsnotify_mark_connector")
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>fanotify: Allow copying of file handle to userspace</title>
<updated>2019-03-19T08:29:07Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2019-03-12T11:42:37Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=b2d22b6bb33aac10c415e4ba13c8eade201c6f09'/>
<id>urn:sha1:b2d22b6bb33aac10c415e4ba13c8eade201c6f09</id>
<content type='text'>
When file handle is embedded inside fanotify_event and usercopy checks
are enabled, we get a warning like:

Bad or missing usercopy whitelist? Kernel memory exposure attempt detected
from SLAB object 'fanotify_event' (offset 40, size 8)!
WARNING: CPU: 1 PID: 7649 at mm/usercopy.c:78 usercopy_warn+0xeb/0x110
mm/usercopy.c:78

Annotate handling in fanotify_event properly to mark copying it to
userspace is fine.

Reported-by: syzbot+2c49971e251e36216d1f@syzkaller.appspotmail.com
Fixes: a8b13aa20afb ("fanotify: enable FAN_REPORT_FID init flag")
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>inotify: Fix fsnotify_mark refcount leak in inotify_update_existing_watch()</title>
<updated>2019-03-11T09:13:17Z</updated>
<author>
<name>ZhangXiaoxu</name>
<email>zhangxiaoxu5@huawei.com</email>
</author>
<published>2019-03-02T01:17:32Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=62c9d2674b31d4c8a674bee86b7edc6da2803aea'/>
<id>urn:sha1:62c9d2674b31d4c8a674bee86b7edc6da2803aea</id>
<content type='text'>
Commit 4d97f7d53da7dc83 ("inotify: Add flag IN_MASK_CREATE for
inotify_add_watch()") forgot to call fsnotify_put_mark() with
IN_MASK_CREATE after fsnotify_find_mark()

Fixes: 4d97f7d53da7dc83 ("inotify: Add flag IN_MASK_CREATE for inotify_add_watch()")
Signed-off-by: ZhangXiaoxu &lt;zhangxiaoxu5@huawei.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>fanotify: Make waits for fanotify events only killable</title>
<updated>2019-02-21T10:47:23Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2019-02-21T10:47:23Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=b51905798195eeb427c873643b3ada0d7bd991a7'/>
<id>urn:sha1:b51905798195eeb427c873643b3ada0d7bd991a7</id>
<content type='text'>
Making waits for response to fanotify permission events interruptible
can result in EINTR returns from open(2) or other syscalls when there's
e.g. AV software that's monitoring the file. Orion reports that e.g.
bash is complaining like:

bash: /etc/bash_completion.d/itweb-settings.bash: Interrupted system call

So for now convert the wait from interruptible to only killable one.
That is mostly invisible to userspace. Sadly this breaks hibernation
with fanotify permission events pending again but we have to put more
thought into how to fix this without regressing userspace visible
behavior.

Reported-by: Orion Poplawski &lt;orion@nwra.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>fanotify: Use interruptible wait when waiting for permission events</title>
<updated>2019-02-18T11:41:16Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2019-01-08T14:18:02Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=fabf7f29b3e2ce5ed9741bf06f3583cd7e82ed1c'/>
<id>urn:sha1:fabf7f29b3e2ce5ed9741bf06f3583cd7e82ed1c</id>
<content type='text'>
When waiting for response to fanotify permission events, we currently
use uninterruptible waits. That makes code simple however it can cause
lots of processes to end up in uninterruptible sleep with hard reboot
being the only alternative in case fanotify listener process stops
responding (e.g. due to a bug in its implementation). Uninterruptible
sleep also makes system hibernation fail if the listener gets frozen
before the process generating fanotify permission event.

Fix these problems by using interruptible sleep for waiting for response
to fanotify event. This is slightly tricky though - we have to
detect when the event got already reported to userspace as in that
case we must not free the event. Instead we push the responsibility for
freeing the event to the process that will write response to the
event.

Reported-by: Orion Poplawski &lt;orion@nwra.com&gt;
Reported-by: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>fanotify: Track permission event state</title>
<updated>2019-02-18T11:41:16Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2019-01-08T13:02:44Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=40873284d7106fc0f0f4d2deae74b38fb18342cc'/>
<id>urn:sha1:40873284d7106fc0f0f4d2deae74b38fb18342cc</id>
<content type='text'>
Track whether permission event got already reported to userspace and
whether userspace already answered to the permission event. Protect
stores to this field together with updates to -&gt;response field by
group-&gt;notification_lock. This will allow aborting wait for reply to
permission event from userspace.

Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>fanotify: Simplify cleaning of access_list</title>
<updated>2019-02-18T11:41:16Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2019-01-09T12:21:01Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=ca6f86998d810d4a9fe172bf4cb6d3353636881f'/>
<id>urn:sha1:ca6f86998d810d4a9fe172bf4cb6d3353636881f</id>
<content type='text'>
Simplify iteration cleaning access_list in fanotify_release(). That will
make following changes more obvious.

Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>fsnotify: Create function to remove event from notification list</title>
<updated>2019-02-18T11:41:16Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2019-01-09T12:15:23Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=f7db89accc9c51d8f765d79b8e9557cc623ec20e'/>
<id>urn:sha1:f7db89accc9c51d8f765d79b8e9557cc623ec20e</id>
<content type='text'>
Create function to remove event from the notification list. Later it will
be used from more places.

Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>fanotify: Move locking inside get_one_event()</title>
<updated>2019-02-18T11:40:46Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2019-01-08T12:52:31Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=8c5544666c9d88046bfd60aa7d5fea5c6d3d59bd'/>
<id>urn:sha1:8c5544666c9d88046bfd60aa7d5fea5c6d3d59bd</id>
<content type='text'>
get_one_event() has a single caller and that just locks
notification_lock around the call. Move locking inside get_one_event()
as that will make using -&gt;response field for permission event state
easier.

Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>fanotify: Fold dequeue_event() into process_access_response()</title>
<updated>2019-02-18T10:49:36Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2019-01-08T12:28:18Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=af6a51130626bfd3e60041d80335b2c31590d56d'/>
<id>urn:sha1:af6a51130626bfd3e60041d80335b2c31590d56d</id>
<content type='text'>
Fold dequeue_event() into process_access_response(). This will make
changes to use of -&gt;response field easier.

Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
</feed>
