From: Bart Van Assche <bvanassche@acm.org>
To: Omar Sandoval <osandov@osandov.com>, linux-block@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>,
kernel-team@fb.com, Jordan Glover <Golden_Miller83@protonmail.ch>
Subject: Re: [PATCH] kyber: fix wrong strlcpy() size in trace_kyber_latency()
Date: Sun, 11 Nov 2018 11:11:17 -0800 [thread overview]
Message-ID: <db1b2fd6-c7b3-50cb-bd76-38cf17b221af@acm.org> (raw)
In-Reply-To: <8233c3aac03494d50bf463787661edc523292ae4.1541957005.git.osandov@fb.com>
On 11/11/18 9:25 AM, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
>
> When copying to the latency type, we should be passing LATENCY_TYPE_LEN,
> not DOMAIN_LEN. This isn't a problem in practice because we only pass
> "total" or "I/O", but let's fix it.
>
> Reported-by: Jordan Glover <Golden_Miller83@protonmail.ch>
> Signed-off-by: Omar Sandoval <osandov@fb.com>
> ---
> include/trace/events/kyber.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/trace/events/kyber.h b/include/trace/events/kyber.h
> index a9834c37ac40..7aaa298375ad 100644
> --- a/include/trace/events/kyber.h
> +++ b/include/trace/events/kyber.h
> @@ -32,7 +32,7 @@ TRACE_EVENT(kyber_latency,
> TP_fast_assign(
> __entry->dev = disk_devt(dev_to_disk(kobj_to_dev(q->kobj.parent)));
> strlcpy(__entry->domain, domain, DOMAIN_LEN);
> - strlcpy(__entry->type, type, DOMAIN_LEN);
> + strlcpy(__entry->type, type, LATENCY_TYPE_LEN);
> __entry->percentile = percentile;
> __entry->numerator = numerator;
> __entry->denominator = denominator;
Can both strlcpy() invocations be changed such that the third argument
is a sizeof() expression instead of an explicit constant? I think that
would make the Kyber tracing code easier to verify for humans.
Thanks,
Bart.
prev parent reply other threads:[~2018-11-11 19:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-11 17:25 [PATCH] kyber: fix wrong strlcpy() size in trace_kyber_latency() Omar Sandoval
2018-11-11 18:13 ` Omar Sandoval
2018-11-11 19:11 ` Bart Van Assche [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=db1b2fd6-c7b3-50cb-bd76-38cf17b221af@acm.org \
--to=bvanassche@acm.org \
--cc=Golden_Miller83@protonmail.ch \
--cc=axboe@kernel.dk \
--cc=kernel-team@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=osandov@osandov.com \
/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