9pfs: use g_malloc0 to allocate space for xattr
commit7bd92756303f2158a68d5166264dc30139b813b6
authorPrasad J Pandit <pjp@fedoraproject.org>
Mon, 16 Oct 2017 12:21:59 +0000 (16 14:21 +0200)
committerGreg Kurz <groug@kaod.org>
Mon, 16 Oct 2017 12:21:59 +0000 (16 14:21 +0200)
tree8aa940b57f17c97518b7fae6890ba1a4f3624ba9
parent40a1e8ac2e10155b5df13a2508ac080b00cd7e23
9pfs: use g_malloc0 to allocate space for xattr

9p back-end first queries the size of an extended attribute,
allocates space for it via g_malloc() and then retrieves its
value into allocated buffer. Race between querying attribute
size and retrieving its could lead to memory bytes disclosure.
Use g_malloc0() to avoid it.

Reported-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: Greg Kurz <groug@kaod.org>
hw/9pfs/9p.c