Skip to content

Commit 0d12457

Browse files
isilenceaxboe
authored andcommitted
io_uring: remove !KASAN guards from cache free
Test setups (with KASAN) will avoid !KASAN sections, and so it's not testing paths that would be exercised otherwise. That's bad as to be sure that your code works you now have to specifically test both KASAN and !KASAN configs. Remove !CONFIG_KASAN guards from io_netmsg_cache_free() and io_rw_cache_free(). The free functions should always be getting valid entries, and even though for KASAN iovecs should already be cleared, that's better than skipping the chunks completely. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de> Link: https://lore.kernel.org/r/d6078a51c7137a243f9d00849bc3daa660873209.1738087204.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 86e6235 commit 0d12457

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

io_uring/net.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,10 +1813,8 @@ void io_netmsg_cache_free(const void *entry)
18131813
{
18141814
struct io_async_msghdr *kmsg = (struct io_async_msghdr *) entry;
18151815

1816-
#if !defined(CONFIG_KASAN)
18171816
if (kmsg->free_iov)
18181817
io_netmsg_iovec_free(kmsg);
1819-
#endif
18201818
kfree(kmsg);
18211819
}
18221820
#endif

io_uring/rw.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,9 +1309,7 @@ void io_rw_cache_free(const void *entry)
13091309
{
13101310
struct io_async_rw *rw = (struct io_async_rw *) entry;
13111311

1312-
#if !defined(CONFIG_KASAN)
13131312
if (rw->free_iovec)
13141313
io_rw_iovec_free(rw);
1315-
#endif
13161314
kfree(rw);
13171315
}

0 commit comments

Comments
 (0)