RE: [PATCH 3.18 36/68] Handle mismatched open calls

From: Pavel Shilovskiy
Date: Wed Jul 19 2017 - 14:39:22 EST


2017-07-14 9:43 Ben Hutchings <ben@xxxxxxxxxxxxxxx>:
> On Fri, 2017-05-05 at 11:32 -0700, Greg Kroah-Hartman wrote:
> > 3.18-stable review patch.ÂÂIf anyone has any objections, please let me know.
> >
> > ------------------
> >
> > From: Sachin Prabhu <sprabhu@xxxxxxxxxx>
> >
> > commit 38bd49064a1ecb67baad33598e3d824448ab11ec upstream.
> [...]
> > --- a/fs/cifs/smb2ops.c
> > +++ b/fs/cifs/smb2ops.c
> > @@ -1461,6 +1461,8 @@ struct smb_version_operations smb21_oper
> > Â .clear_stats = smb2_clear_stats,
> > Â .print_stats = smb2_print_stats,
> > Â .is_oplock_break = smb2_is_valid_oplock_break,
> > + .handle_cancelled_mid = smb2_handle_cancelled_mid,
> > + .handle_cancelled_mid = smb2_handle_cancelled_mid,
> > Â .downgrade_oplock = smb2_downgrade_oplock,
> > Â .need_neg = smb2_need_neg,
> > Â .negotiate = smb2_negotiate,
> > @@ -1542,6 +1544,8 @@ struct smb_version_operations smb30_oper
> > Â .print_stats = smb2_print_stats,
> > Â .dump_share_caps = smb2_dump_share_caps,
> > Â .is_oplock_break = smb2_is_valid_oplock_break,
> > + .handle_cancelled_mid = smb2_handle_cancelled_mid,
> > + .handle_cancelled_mid = smb2_handle_cancelled_mid,
> > Â .downgrade_oplock = smb2_downgrade_oplock,
> > Â .need_neg = smb2_need_neg,
> > Â .negotiate = smb2_negotiate,
> [...]
>
> This doesn't look right. handle_cancelled_mid should be initialised once in each of the 3 smb_version_operations structures, shouldn't it?
>
> Ben.

Yes, you are right. Thanks for pointing it out.

Greg, I provided the patch to fix the above bug (see the attachment). Could you please look at it and apply to the 3.18.x kernel if it is suitable?

Best regards,
Pavel Shilovsky

Attachment: 0001-CIFS-Fix-handle_cancelled_mid-callback-initializatio.patch
Description: 0001-CIFS-Fix-handle_cancelled_mid-callback-initializatio.patch