[PATCH] staging: for dgrp, nd_ps_desc buffer length need be

Bill Pemberton wfp5p at viridian.itc.virginia.edu
Fri Apr 26 13:09:12 UTC 2013

Dan Carpenter writes:
> On Wed, Apr 24, 2013 at 11:18:03AM +0800, Chen Gang wrote:
> > 
> > For dgrp, the buffer length of 'nd->nd_ps_desc' is 'MAX_DESC_LEN + 1', so
> > the buffer length of 'getnode.nd_ps_desc' also need be 'MAX_DESC_LEN + 1',
> > then can fully copy from 'nd->nd_ps_desc' to 'getnode.nd_ps_desc'.
> > 
> This is a user space change so someone needs to check that it
> doesn't break anything.

The only utility that uses the DIGI_GETNODE ioctl is dparp.  The
digi_node struct would need to be changed for it too.  dparp isn't
needed to make the device work and dparp isn't even built in the
version of the user space tools I have on github.

However, I don't know if folks actually use that utility, so I think
the version of this patch that uses strlcpy is a better way go.  In
addition, I think nd_ps_desc in the nd_struct struct should be changed
to MAX_DESC_LEN to avoid this confusion down the road.


More information about the devel mailing list