HomeFreeBSD

Clear the cookie pointer on error in tmpfs_readdir().

Description

Clear the cookie pointer on error in tmpfs_readdir().

It is otherwise left dangling, and callers that request cookies always free
the cookie buffer, even when VOP_READDIR(9) returns an error. This results
in a double free if tmpfs_readdir() returns an error to the NFS server or
the Linux getdents(2) emulation code.

Reported by: pho
MFC after: 1 week
Security: double free of malloc(9)-backed memory
Sponsored by: EMC / Isilon Storage Division

Details

Provenance
markjAuthored on
Parents
rS295573: Remove duplicate definition (CPL_TRACE_PKT_T5).
Branches
Unknown
Tags
Unknown