Re: [PATCH -next 2/3] batman-adv: Use seq_overflow

2013-12-11 Thread Al Viro
On Wed, Dec 11, 2013 at 12:26:17AM -0800, Joe Perches wrote: > On Wed, 2013-12-11 at 08:05 +, Al Viro wrote: > > On Wed, Dec 11, 2013 at 07:55:26AM +, Al Viro wrote: > > > > > This sucker should return 0. Insufficiently large buffer will be handled > > > by caller, TYVM, if you give that

Re: [PATCH -next 2/3] batman-adv: Use seq_overflow

2013-12-11 Thread Joe Perches
On Wed, 2013-12-11 at 08:05 +, Al Viro wrote: > On Wed, Dec 11, 2013 at 07:55:26AM +, Al Viro wrote: > > > This sucker should return 0. Insufficiently large buffer will be handled > > by caller, TYVM, if you give that caller a chance to do so. Returning 1 > > from ->show() is a bug in al

Re: [PATCH -next 2/3] batman-adv: Use seq_overflow

2013-12-11 Thread Al Viro
On Wed, Dec 11, 2013 at 07:55:26AM +, Al Viro wrote: > This sucker should return 0. Insufficiently large buffer will be handled > by caller, TYVM, if you give that caller a chance to do so. Returning 1 > from ->show() is a bug in almost all cases, and definitely so in this one. > > Just in

Re: [B.A.T.M.A.N.] [PATCH -next 2/3] batman-adv: Use seq_overflow

2013-12-10 Thread Al Viro
On Wed, Dec 11, 2013 at 08:31:35AM +0100, Antonio Quartulli wrote: > Joe, > > we have other places in the batman-adv code where we use seq_printf, but > at the moment we don't check the return value and we always return 0 at > the end of the function. > > I think we could use seq_overflow here as

Re: [PATCH -next 2/3] batman-adv: Use seq_overflow

2013-12-10 Thread Al Viro
On Tue, Dec 10, 2013 at 09:12:43PM -0800, Joe Perches wrote: > diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c > index 2449afa..dfa5d2d 100644 > --- a/net/batman-adv/gateway_client.c > +++ b/net/batman-adv/gateway_client.c > @@ -517,29 +517,28 @@ static int batadv_wr

Re: [PATCH -next 2/3] batman-adv: Use seq_overflow

2013-12-10 Thread Antonio Quartulli
On 11/12/13 06:12, Joe Perches wrote: > Convert the uses of the return of seq_printf to > instead check seq_overflow to determine if a buffer > overflow has occurred. > > This will eventually allow seq_printf & seq_puts to > be converted to a void return instead of the often > misused return that

Re: [B.A.T.M.A.N.] [PATCH -next 2/3] batman-adv: Use seq_overflow

2013-12-10 Thread Antonio Quartulli
Joe, we have other places in the batman-adv code where we use seq_printf, but at the moment we don't check the return value and we always return 0 at the end of the function. I think we could use seq_overflow here as well? Thanks, -- Antonio Quartulli signature.asc Description: OpenPGP di

[PATCH -next 2/3] batman-adv: Use seq_overflow

2013-12-10 Thread Joe Perches
Convert the uses of the return of seq_printf to instead check seq_overflow to determine if a buffer overflow has occurred. This will eventually allow seq_printf & seq_puts to be converted to a void return instead of the often misused return that is often assumed to be an int for the number of byte