1
0
Fork 0

ALSA: info: Avoid leaking kernel memory

Make sure that the allocated buffer for reading the proc file won't
expose the uncleared kernel memory.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
hifive-unleashed-5.1
Takashi Iwai 2013-03-13 12:01:13 +01:00
parent eb7c06e8e9
commit 0d861ac238
1 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ static int resize_info_buffer(struct snd_info_buffer *buffer,
char *nbuf;
nsize = PAGE_ALIGN(nsize);
nbuf = krealloc(buffer->buffer, nsize, GFP_KERNEL);
nbuf = krealloc(buffer->buffer, nsize, GFP_KERNEL | __GFP_ZERO);
if (! nbuf)
return -ENOMEM;
@ -353,7 +353,7 @@ static int snd_info_entry_open(struct inode *inode, struct file *file)
goto __nomem;
data->rbuffer = buffer;
buffer->len = PAGE_SIZE;
buffer->buffer = kmalloc(buffer->len, GFP_KERNEL);
buffer->buffer = kzalloc(buffer->len, GFP_KERNEL);
if (buffer->buffer == NULL)
goto __nomem;
}