Skip to content

Commit

Permalink
cifs_dbg() outputs an uninitialized buffer in cifs_readdir()
Browse files Browse the repository at this point in the history
In some cases tmp_bug can be not filled in cifs_filldir and stay uninitialized,
therefore its printk with "%s" modifier can leak content of kernelspace memory.
If old content of this buffer does not contain '\0' access bejond end of
allocated object can crash the host.

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: Steve French <sfrench@localhost.localdomain>
CC: Stable <stable@vger.kernel.org>
  • Loading branch information
Vasily Averin authored and Steve French committed Jan 14, 2016
1 parent 820962d commit 01b9b0b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/cifs/readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@ int cifs_readdir(struct file *file, struct dir_context *ctx)
* if buggy server returns . and .. late do we want to
* check for that here?
*/
*tmp_buf = 0;
rc = cifs_filldir(current_entry, file, ctx,
tmp_buf, max_len);
if (rc) {
Expand Down

0 comments on commit 01b9b0b

Please sign in to comment.