From: Jens Axboe <axboe@kernel.dk>
To: Breno Leitao <leitao@debian.org>,
asml.silence@gmail.com, io-uring@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, gustavold@meta.com, leit@meta.com,
kasan-dev@googlegroups.com, Breno Leitao <leit@fb.com>
Subject: Re: [PATCH v2 2/2] io_uring: Add KASAN support for alloc_caches
Date: Wed, 22 Feb 2023 11:30:15 -0700 [thread overview]
Message-ID: <b0c82199-fb96-08a2-6158-cb1655b6ba3d@kernel.dk> (raw)
In-Reply-To: <20230222180035.3226075-3-leitao@debian.org>
On 2/22/23 11:00?AM, Breno Leitao wrote:
> -static inline struct io_cache_entry *io_alloc_cache_get(struct io_alloc_cache *cache)
> +static inline struct io_cache_entry *io_alloc_cache_get(struct io_alloc_cache *cache,
> + size_t size)
> {
> if (cache->list.next) {
> struct io_cache_entry *entry;
> entry = container_of(cache->list.next, struct io_cache_entry, node);
> + kasan_unpoison_range(entry, size);
> cache->list.next = cache->list.next->next;
> return entry;
> }
Does this generate the same code if KASAN isn't enabled? Since there's a
4-byte hole in struct io_alloc_cache(), might be cleaner to simply add
the 'size' argument to io_alloc_cache_init() and store it in the cache.
Then the above just becomes:
kasan_unpoison_range(entry, cache->elem_size);
instead and that'd definitely generate the same code as before if KASAN
isn't enabled.
--
Jens Axboe
prev parent reply other threads:[~2023-02-22 18:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-22 18:00 [PATCH v2 0/2] io_uring: Add KASAN support for alloc caches Breno Leitao
2023-02-22 18:00 ` [PATCH v2 1/2] io_uring: Move from hlist to io_wq_work_node Breno Leitao
2023-02-22 18:00 ` [PATCH v2 2/2] io_uring: Add KASAN support for alloc_caches Breno Leitao
2023-02-22 18:30 ` Jens Axboe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b0c82199-fb96-08a2-6158-cb1655b6ba3d@kernel.dk \
--to=axboe@kernel.dk \
--cc=asml.silence@gmail.com \
--cc=gustavold@meta.com \
--cc=io-uring@vger.kernel.org \
--cc=kasan-dev@googlegroups.com \
--cc=leit@fb.com \
--cc=leit@meta.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®