From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Andrew Price <anprice@redhat.com>
Cc: cluster-devel@redhat.com, linux-kernel@vger.kernel.org,
Andreas Gruenbacher <agruenba@redhat.com>,
Bob Peterson <rpeterso@redhat.com>
Subject: Re: [Cluster-devel] [PATCH] gfs2: move from strlcpy with unused retval to strscpy
Date: Wed, 24 Aug 2022 22:08:38 +0200 [thread overview]
Message-ID: <YwaFRvWw5hi/uWYs@shikoro> (raw)
In-Reply-To: <bd7275c6-4ebe-de99-75c2-400cfa2e5026@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 921 bytes --]
Hi Andy.
> > - strlcpy(sdp->sd_proto_name, proto, GFS2_FSNAME_LEN);
> > - strlcpy(sdp->sd_table_name, table, GFS2_FSNAME_LEN);
> > + strscpy(sdp->sd_proto_name, proto, GFS2_FSNAME_LEN);
> > + strscpy(sdp->sd_table_name, table, GFS2_FSNAME_LEN);
>
> Perhaps the size should be changed to GFS2_LOCKNAME_LEN to match the size of
> the destination, too.
>
> With that addition, this patch fixes this syzkaller report:
>
> https://listman.redhat.com/archives/cluster-devel/2022-August/022755.html
Linus wrote another summary about strlcpy vs. strscpy use[1]. So, the
size argument should be the size of the smaller buffer if the buffers
are of different size. GFS2_LOCKNAME_LEN is smaller, so that looks
suitable. Shall I resend the patch with the suggested change?
All the best,
Wolfram
[1] https://lore.kernel.org/lkml/CAHk-=wi+xbVq++uqW9YgWpHjyBHNB8a-xad+Xp23-B+eodLCEA@mail.gmail.com/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-08-24 20:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-18 21:01 Wolfram Sang
2022-08-23 9:37 ` [Cluster-devel] " Andrew Price
2022-08-24 20:08 ` Wolfram Sang [this message]
2022-08-25 9:32 ` Andrew Price
2022-08-26 13:28 ` Andreas Gruenbacher
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=YwaFRvWw5hi/uWYs@shikoro \
--to=wsa+renesas@sang-engineering.com \
--cc=agruenba@redhat.com \
--cc=anprice@redhat.com \
--cc=cluster-devel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rpeterso@redhat.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
all inboxes | Powered by JetHome®