[ofa-general] Re: [PATCH] IB/srp: enforce protocol limit on srp_sg_tablesize

Roland Dreier rdreier at cisco.com
Mon Mar 17 12:34:21 PDT 2008


 > The current SRP initiator will allow unlimited s/g entries in the
 > indirect descriptors lists, but the entry count field in the SRP_CMD
 > request is 8 bits, so setting srp_sg_tablesize too large will open the
 > possibility of wrapping the count and generating invalid requests.

makes sense, but...

 > +	if (srp_sg_tablesize > 255) {
 > +		printk(KERN_ERR PFX "srp_sg_tablesize too large\n");
 > +		return -EINVAL;
 > +	}

friendlier to clamp it to 255 and print a warning?  what do you think?



More information about the general mailing list