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

From: Assar
Date: Tue Sep 13 2005 - 15:55:52 EST


Peter Staubach <staubach@xxxxxxxxxx> writes:
> NFS uses XDR to encode C strings. They are encoded as counted byte arrays
> and are _not_ null terminated. The space containing the string is rounded
> up to the next 4 byte boundary though and, usually, this space is zero
> filled.
> The number of bytes in the string is encoded as a big endian integer in the
> first four bytes.

Yes, but fs/nfs/nfs2xdr.c:nfs_xdr_readlinkres on 2.4.31 writes a 0 at
the end of string after having received it, which is what started this
thread. Look at the end of nfs_xdr_readlinkres.
-
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/