Re: [PATCH] nfs client, kernel 2.4.31: readlink result overflow

From: Assar
Date: Tue Sep 13 2005 - 15:01:58 EST


Marcelo Tosatti <marcelo.tosatti@xxxxxxxxxxxx> writes:
> > That's one problem.
> >
> > > If thats the reason, you don't need the "-1" there?
> >
> > It also writes a 0 byte. I think it looks like this:
> >
> > ---- ------------ -
> > len string... 0
>
> If an overflow happens (len > rcvbuf->page_len) the last character will get
> truncated anyway, so there is no need for the "-1" AFAICS.

I'm not sure I follow.

The code writes a 0 at rcvbuf->pages[0][sizeof(u32) + len], right?
Doesn't that make the maximum allowed value of len should be
'rcvbuf->page_len - sizeof(u32) - 1' ?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/