Re: [PATCH 2/4] libmpathpersist: format_transportids(): avoid PROUT overflow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2020-03-14 at 18:15 -0500, Benjamin Marzinski wrote:
> On Sat, Mar 07, 2020 at 12:06:03AM +0100, mwilck@xxxxxxxx wrote:
> > From: Martin Wilck <mwilck@xxxxxxxx>
> > 
> > This limits the PERSISTENT RESERVE OUT data size to max. 8192
> > bytes.
> > 
> > Signed-off-by: Martin Wilck <mwilck@xxxxxxxx>
> > ---
> >  libmpathpersist/mpath_pr_ioctl.c | 26 ++++++++++++++++++++++++--
> >  1 file changed, 24 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libmpathpersist/mpath_pr_ioctl.c
> > b/libmpathpersist/mpath_pr_ioctl.c
> > index 1a28cba7..8bf16c0d 100644
> > --- a/libmpathpersist/mpath_pr_ioctl.c
> > +++ b/libmpathpersist/mpath_pr_ioctl.c
> > @@ -1,5 +1,6 @@
> >  #include <stdio.h>
> >  #include <stdlib.h>
> > +#include <stddef.h>
> >  
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> > @@ -138,38 +139,59 @@ retry :
> >  	return status;
> >  }
> >  
> > +#define check_overflow(ofs, n, start, label)			
> > 	\
> > +	do {								
> > \
> > +		if ((ofs) + 4 + (n) +					
> > \
> 
> I don't get where the 4 comes from here, since buff_offset starts
> at 4. Maybe I'm just missing something.
> 

No. It's wrong, buff_offset includes these 4 bytes inded. Thanks for
spotting it. I'll resubmit the series.

Regards,
Martin



--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux