* Re: [KJ] drivers\char\synclink.c
2005-11-25 20:47 [KJ] drivers\char\synclink.c Christophe Jaillet
@ 2005-11-25 21:34 ` Nish Aravamudan
2005-11-26 0:46 ` Matthew Wilcox
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Nish Aravamudan @ 2005-11-25 21:34 UTC (permalink / raw)
To: kernel-janitors
On 11/25/05, Christophe Jaillet <christophe.jaillet@wanadoo.fr> wrote:
>
> In file : \drivers\char\synclink.c
> In function : line_info(char *buf, struct mgsl_struct *info)
>
> The buffer *stat_buf* could be defined smaller.
Where's the patch?
Thanks,
Nish
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [KJ] drivers\char\synclink.c
2005-11-25 20:47 [KJ] drivers\char\synclink.c Christophe Jaillet
2005-11-25 21:34 ` Nish Aravamudan
@ 2005-11-26 0:46 ` Matthew Wilcox
2005-11-26 0:58 ` Nish Aravamudan
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2005-11-26 0:46 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 601 bytes --]
On Fri, Nov 25, 2005 at 01:34:03PM -0800, Nish Aravamudan wrote:
> On 11/25/05, Christophe Jaillet <christophe.jaillet@wanadoo.fr> wrote:
> >
> > In file : \drivers\char\synclink.c
> > In function : line_info(char *buf, struct mgsl_struct *info)
> >
> > The buffer *stat_buf* could be defined smaller.
>
>
> Where's the patch?
Never mind that. Is this a patch we even want? It's quite common to
overallocate these small string buffers so that when someone makes a
change and forgets to update the length, they don't overrun the buffer.
And what's with the backward slashes anyway?
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [KJ] drivers\char\synclink.c
2005-11-25 20:47 [KJ] drivers\char\synclink.c Christophe Jaillet
2005-11-25 21:34 ` Nish Aravamudan
2005-11-26 0:46 ` Matthew Wilcox
@ 2005-11-26 0:58 ` Nish Aravamudan
2005-11-26 9:21 ` walter harms
2005-11-26 17:12 ` Nish Aravamudan
4 siblings, 0 replies; 6+ messages in thread
From: Nish Aravamudan @ 2005-11-26 0:58 UTC (permalink / raw)
To: kernel-janitors
On 11/25/05, Matthew Wilcox <matthew@wil.cx> wrote:
> On Fri, Nov 25, 2005 at 01:34:03PM -0800, Nish Aravamudan wrote:
> > On 11/25/05, Christophe Jaillet <christophe.jaillet@wanadoo.fr> wrote:
> > >
> > > In file : \drivers\char\synclink.c
> > > In function : line_info(char *buf, struct mgsl_struct *info)
> > >
> > > The buffer *stat_buf* could be defined smaller.
> >
> >
> > Where's the patch?
>
> Never mind that. Is this a patch we even want? It's quite common to
> overallocate these small string buffers so that when someone makes a
> change and forgets to update the length, they don't overrun the buffer.
Valid point. And the savings by reducing it aren't significant enough
to justify the potential error you mention.
> And what's with the backward slashes anyway?
Good question...maybe Christophe is using Winblows to report Linux errors?
Thanks,
Nish
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [KJ] drivers\char\synclink.c
2005-11-25 20:47 [KJ] drivers\char\synclink.c Christophe Jaillet
` (2 preceding siblings ...)
2005-11-26 0:58 ` Nish Aravamudan
@ 2005-11-26 9:21 ` walter harms
2005-11-26 17:12 ` Nish Aravamudan
4 siblings, 0 replies; 6+ messages in thread
From: walter harms @ 2005-11-26 9:21 UTC (permalink / raw)
To: kernel-janitors
Nish Aravamudan wrote:
> On 11/25/05, Matthew Wilcox <matthew@wil.cx> wrote:
>> On Fri, Nov 25, 2005 at 01:34:03PM -0800, Nish Aravamudan wrote:
>>> On 11/25/05, Christophe Jaillet <christophe.jaillet@wanadoo.fr> wrote:
>>>> In file : \drivers\char\synclink.c
>>>> In function : line_info(char *buf, struct mgsl_struct *info)
>>>>
>>>> The buffer *stat_buf* could be defined smaller.
>>>
>>> Where's the patch?
>> Never mind that. Is this a patch we even want? It's quite common to
>> overallocate these small string buffers so that when someone makes a
>> change and forgets to update the length, they don't overrun the buffer.
>
> Valid point. And the savings by reducing it aren't significant enough
> to justify the potential error you mention.
>
>> And what's with the backward slashes anyway?
>
The problem with fixed size buffers is exactly THE problem if unwary
change the length they cause errors.
ppl writing into buffer should use snprintf() (and friends).
To find the lenght any can use snprintf(NULL,...).
that cost time but fixes any possible overflow.
re,
walter
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [KJ] drivers\char\synclink.c
2005-11-25 20:47 [KJ] drivers\char\synclink.c Christophe Jaillet
` (3 preceding siblings ...)
2005-11-26 9:21 ` walter harms
@ 2005-11-26 17:12 ` Nish Aravamudan
4 siblings, 0 replies; 6+ messages in thread
From: Nish Aravamudan @ 2005-11-26 17:12 UTC (permalink / raw)
To: kernel-janitors
On 11/26/05, walter harms <wharms@bfs.de> wrote:
>
>
> Nish Aravamudan wrote:
> > On 11/25/05, Matthew Wilcox <matthew@wil.cx> wrote:
> >> On Fri, Nov 25, 2005 at 01:34:03PM -0800, Nish Aravamudan wrote:
> >>> On 11/25/05, Christophe Jaillet <christophe.jaillet@wanadoo.fr> wrote:
> >>>> In file : \drivers\char\synclink.c
> >>>> In function : line_info(char *buf, struct mgsl_struct *info)
> >>>>
> >>>> The buffer *stat_buf* could be defined smaller.
> >>>
> >>> Where's the patch?
> >> Never mind that. Is this a patch we even want? It's quite common to
> >> overallocate these small string buffers so that when someone makes a
> >> change and forgets to update the length, they don't overrun the buffer.
> >
> > Valid point. And the savings by reducing it aren't significant enough
> > to justify the potential error you mention.
> >
> >> And what's with the backward slashes anyway?
> >
>
> The problem with fixed size buffers is exactly THE problem if unwary
> change the length they cause errors.
> ppl writing into buffer should use snprintf() (and friends).
> To find the lenght any can use snprintf(NULL,...).
> that cost time but fixes any possible overflow.
I believe Matthew is referring to changing the code and not updating
the length? Not at run-time, but at compile-time, that is. CMIIW
Thanks,
Nish
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 6+ messages in thread