Re: [Cluster-devel] [PATCH] gfs2: move from strlcpy with unused retval to strscpy

2022-08-26 Thread Andreas Gruenbacher
Wolfram and Andy,

On Thu, Aug 25, 2022 at 11:33 AM Andrew Price  wrote:
> On 24/08/2022 21:08, Wolfram Sang wrote:
> > 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?
>
> Yes, please. I can't speak for the gfs2 maintainers but I think it would
> be a good plan, as the combination of strscpy and the size change fixes
> a bug.

thanks, I've fixed this in for-next now:

https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git/commit/?h=for-next=204c0300c4e99707e9fb6e57840aa1127060e63f

Andreas



Re: [Cluster-devel] kernel BUG in gfs2_fill_super

2022-08-26 Thread Andreas Gruenbacher
On Tue, Aug 23, 2022 at 3:52 AM 王海弛  wrote:
> Dear Linux maintainers and reviewers:
>
> We would like to report a linux kernel bug, found by a modified version of 
> syzkaller.
>
> May affected file: fs/gfs2/ops_fstype.c

Thank you.

Andreas