All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] ALSA: compress: info leak in snd_compr_get_caps()
@ 2013-04-21 11:07 ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2013-04-21 11:07 UTC (permalink / raw)
  To: Jaroslav Kysela
  Cc: alsa-devel, Takashi Iwai, kernel-janitors, Vinod Koul, Jeeja KP,
	Namarta Kohli

If the ->get_caps() function doesn't clear the buffer then there would
stack information leaked to userspace.  For example,
soc_compr_get_caps() can return success without clearing the buffer.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Perhaps the soc_compr_get_caps() function should return an error code
if the platform->driver->compr_ops is NULL.  I'm not sure about that,
and it's a separate issue anyway.

diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index c84abc8..8d3190a 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -375,6 +375,7 @@ snd_compr_get_caps(struct snd_compr_stream *stream, unsigned long arg)
 	if (!stream->ops->get_caps)
 		return -ENXIO;
 
+	memset(&caps, 0, sizeof(caps));
 	retval = stream->ops->get_caps(stream, &caps);
 	if (retval)
 		goto out;

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-04-22  9:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-21 11:07 [patch] ALSA: compress: info leak in snd_compr_get_caps() Dan Carpenter
2013-04-21 11:07 ` Dan Carpenter
2013-04-21 11:40 ` walter harms
2013-04-21 11:40   ` walter harms
2013-04-21 16:39   ` Dan Carpenter
2013-04-21 16:39     ` Dan Carpenter
2013-04-22  8:42 ` Takashi Iwai
2013-04-22  8:42   ` Takashi Iwai
2013-04-22  8:38   ` Vinod Koul
2013-04-22  8:50     ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.