static void __io_submit_flush_completions(struct io_ring_ctx *ctx);
static __cold void io_fallback_tw(struct io_uring_task *tctx);
-static struct kmem_cache *req_cachep;
+struct kmem_cache *req_cachep;
struct sock *io_uring_get_socket(struct file *file)
{
static inline void io_req_add_to_cache(struct io_kiocb *req, struct io_ring_ctx *ctx)
{
wq_stack_add_head(&req->comp_list, &ctx->submit_state.free_list);
+ kasan_poison_object_data(req_cachep, req);
}
static __cold void io_ring_ctx_ref_free(struct percpu_ref *ref)
#include <linux/errno.h>
#include <linux/lockdep.h>
#include <linux/resume_user_mode.h>
+#include <linux/kasan.h>
#include <linux/io_uring_types.h>
#include <uapi/linux/eventpoll.h>
#include "io-wq.h"
return true;
}
+extern struct kmem_cache *req_cachep;
+
static inline struct io_kiocb *io_alloc_req(struct io_ring_ctx *ctx)
{
- struct io_wq_work_node *node;
+ struct io_kiocb *req;
- node = wq_stack_extract(&ctx->submit_state.free_list);
- return container_of(node, struct io_kiocb, comp_list);
+ req = container_of(ctx->submit_state.free_list.next, struct io_kiocb, comp_list);
+ kasan_unpoison_object_data(req_cachep, req);
+ wq_stack_extract(&ctx->submit_state.free_list);
+ return req;
}
static inline bool io_allowed_defer_tw_run(struct io_ring_ctx *ctx)