Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-16 Thread Chen Gang
On 10/16/2013 10:07 AM, Chen Gang wrote: > On 10/15/2013 10:47 PM, Paul E. McKenney wrote: >> > On Tue, Oct 15, 2013 at 08:32:41PM +0800, Chen Gang wrote: >>> >> Yeah, that is a way for it. It seems you (related maintainer) like >>> >> additional fix for it. >>> >> >>> >> Hmm... I will try within

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-16 Thread Chen Gang
On 10/16/2013 10:07 AM, Chen Gang wrote: On 10/15/2013 10:47 PM, Paul E. McKenney wrote: On Tue, Oct 15, 2013 at 08:32:41PM +0800, Chen Gang wrote: Yeah, that is a way for it. It seems you (related maintainer) like additional fix for it. Hmm... I will try within this week (although I

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-15 Thread Chen Gang
On 10/15/2013 10:47 PM, Paul E. McKenney wrote: > On Tue, Oct 15, 2013 at 08:32:41PM +0800, Chen Gang wrote: >> Yeah, that is a way for it. It seems you (related maintainer) like >> additional fix for it. >> >> Hmm... I will try within this week (although I don't think it is quite >> necessary to

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-15 Thread Paul E. McKenney
On Tue, Oct 15, 2013 at 08:32:41PM +0800, Chen Gang wrote: > On 10/15/2013 04:26 PM, Paul E. McKenney wrote: > > On Tue, Oct 15, 2013 at 09:51:42AM +0800, Chen Gang wrote: > >>> One simple way: using snprintf() instead of scnprintf() in the related > >>> printing functions. Then call them with

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-15 Thread Chen Gang
On 10/15/2013 04:26 PM, Paul E. McKenney wrote: > On Tue, Oct 15, 2013 at 09:51:42AM +0800, Chen Gang wrote: >>> One simple way: using snprintf() instead of scnprintf() in the related >>> printing functions. Then call them with "buffer == NULL" to get buffer >>> size, next allocate it and call it

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-15 Thread Paul E. McKenney
On Tue, Oct 15, 2013 at 09:51:42AM +0800, Chen Gang wrote: > On 10/15/2013 08:54 AM, Chen Gang wrote: > > On 10/14/2013 07:28 PM, Paul E. McKenney wrote: > >> On Mon, Oct 14, 2013 at 04:38:55PM +0800, Chen Gang wrote: > >>> If the contents is more than 4096 bytes (e.g. if have 1K cpus), current >

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-15 Thread Chen Gang
On 10/15/2013 10:47 PM, Paul E. McKenney wrote: On Tue, Oct 15, 2013 at 08:32:41PM +0800, Chen Gang wrote: Yeah, that is a way for it. It seems you (related maintainer) like additional fix for it. Hmm... I will try within this week (although I don't think it is quite necessary to me). :-)

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-15 Thread Paul E. McKenney
On Tue, Oct 15, 2013 at 09:51:42AM +0800, Chen Gang wrote: On 10/15/2013 08:54 AM, Chen Gang wrote: On 10/14/2013 07:28 PM, Paul E. McKenney wrote: On Mon, Oct 14, 2013 at 04:38:55PM +0800, Chen Gang wrote: If the contents is more than 4096 bytes (e.g. if have 1K cpus), current sprintf()

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-15 Thread Chen Gang
On 10/15/2013 04:26 PM, Paul E. McKenney wrote: On Tue, Oct 15, 2013 at 09:51:42AM +0800, Chen Gang wrote: One simple way: using snprintf() instead of scnprintf() in the related printing functions. Then call them with buffer == NULL to get buffer size, next allocate it and call it again ...

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-15 Thread Paul E. McKenney
On Tue, Oct 15, 2013 at 08:32:41PM +0800, Chen Gang wrote: On 10/15/2013 04:26 PM, Paul E. McKenney wrote: On Tue, Oct 15, 2013 at 09:51:42AM +0800, Chen Gang wrote: One simple way: using snprintf() instead of scnprintf() in the related printing functions. Then call them with buffer == NULL

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-14 Thread Chen Gang
On 10/15/2013 08:54 AM, Chen Gang wrote: > On 10/14/2013 07:28 PM, Paul E. McKenney wrote: >> On Mon, Oct 14, 2013 at 04:38:55PM +0800, Chen Gang wrote: >>> If the contents is more than 4096 bytes (e.g. if have 1K cpus), current >>> sprintf() will cause memory overflow. >>> >>> They are all test

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-14 Thread Chen Gang
On 10/14/2013 07:28 PM, Paul E. McKenney wrote: > On Mon, Oct 14, 2013 at 04:38:55PM +0800, Chen Gang wrote: >> If the contents is more than 4096 bytes (e.g. if have 1K cpus), current >> sprintf() will cause memory overflow. >> >> They are all test information which can be truncated, so use

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-14 Thread Paul E. McKenney
On Mon, Oct 14, 2013 at 04:38:55PM +0800, Chen Gang wrote: > If the contents is more than 4096 bytes (e.g. if have 1K cpus), current > sprintf() will cause memory overflow. > > They are all test information which can be truncated, so use scnprintf() > instead of sprintf(), also add 'max'

[PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-14 Thread Chen Gang
If the contents is more than 4096 bytes (e.g. if have 1K cpus), current sprintf() will cause memory overflow. They are all test information which can be truncated, so use scnprintf() instead of sprintf(), also add 'max' parameter for related functions, also notice 80 columns boundary and

[PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-14 Thread Chen Gang
If the contents is more than 4096 bytes (e.g. if have 1K cpus), current sprintf() will cause memory overflow. They are all test information which can be truncated, so use scnprintf() instead of sprintf(), also add 'max' parameter for related functions, also notice 80 columns boundary and

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-14 Thread Paul E. McKenney
On Mon, Oct 14, 2013 at 04:38:55PM +0800, Chen Gang wrote: If the contents is more than 4096 bytes (e.g. if have 1K cpus), current sprintf() will cause memory overflow. They are all test information which can be truncated, so use scnprintf() instead of sprintf(), also add 'max' parameter for

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-14 Thread Chen Gang
On 10/14/2013 07:28 PM, Paul E. McKenney wrote: On Mon, Oct 14, 2013 at 04:38:55PM +0800, Chen Gang wrote: If the contents is more than 4096 bytes (e.g. if have 1K cpus), current sprintf() will cause memory overflow. They are all test information which can be truncated, so use scnprintf()

Re: [PATCH] kernel/rcutorture.c: use scnprintf() instead of sprintf()

2013-10-14 Thread Chen Gang
On 10/15/2013 08:54 AM, Chen Gang wrote: On 10/14/2013 07:28 PM, Paul E. McKenney wrote: On Mon, Oct 14, 2013 at 04:38:55PM +0800, Chen Gang wrote: If the contents is more than 4096 bytes (e.g. if have 1K cpus), current sprintf() will cause memory overflow. They are all test information