Files
i2som-imx-linux/include/net
Tomas Bortoli 3665a4d9dc 9p: Add refcount to p9_req_t
[ Upstream commit 728356dede ]

To avoid use-after-free(s), use a refcount to keep track of the
usable references to any instantiated struct p9_req_t.

This commit adds p9_req_put(), p9_req_get() and p9_req_try_get() as
wrappers to kref_put(), kref_get() and kref_get_unless_zero().
These are used by the client and the transports to keep track of
valid requests' references.

p9_free_req() is added back and used as callback by kref_put().

Add SLAB_TYPESAFE_BY_RCU as it ensures that the memory freed by
kmem_cache_free() will not be reused for another type until the rcu
synchronisation period is over, so an address gotten under rcu read
lock is safe to inc_ref() without corrupting random memory while
the lock is held.

Link: http://lkml.kernel.org/r/1535626341-20693-1-git-send-email-asmadeus@codewreck.org
Co-developed-by: Dominique Martinet <dominique.martinet@cea.fr>
Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>
Reported-by: syzbot+467050c1ce275af2a5b8@syzkaller.appspotmail.com
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-07-03 13:14:42 +02:00
..
2019-07-03 13:14:42 +02:00
2019-06-17 19:51:56 +02:00
2019-03-23 20:09:51 +01:00
2018-08-21 12:45:45 -07:00
2019-02-23 09:07:27 +01:00
2018-09-26 20:22:19 -07:00
2018-07-30 09:10:25 -07:00
2018-07-18 15:08:31 -07:00
2019-03-10 07:17:19 +01:00
2018-06-22 13:43:27 +09:00
2018-06-22 13:43:27 +09:00
2019-06-17 19:51:56 +02:00