Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1226a53f authored by Fred Oh's avatar Fred Oh
Browse files

msm: audio: initialize the structure before sending to user space



If uninitialzied structure is passed from kernel to user space, it
may contain contain sensitive information that will be leaked.

Change-Id: I4926185703b84c38710dd7d1271d3684aab5361e
Signed-off-by: default avatarFred Oh <fred@codeaurora.org>
parent 0d6eafbe
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -913,6 +913,7 @@ static long audio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)

	if (cmd == AUDIO_GET_STATS) {
		struct msm_audio_stats stats;
		memset(&stats, 0, sizeof(struct msm_audio_stats));
		stats.byte_count = audpp_avsync_byte_count(audio->dec_id);
		stats.sample_count = audpp_avsync_sample_count(audio->dec_id);
		if (copy_to_user((void *)arg, &stats, sizeof(stats)))
+1 −0
Original line number Diff line number Diff line
@@ -1189,6 +1189,7 @@ long audio_aio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
	case AUDIO_GET_STATS: {
		struct msm_audio_stats stats;
		uint64_t timestamp;
		memset(&stats, 0, sizeof(struct msm_audio_stats));
		stats.byte_count = atomic_read(&audio->in_bytes);
		stats.sample_count = atomic_read(&audio->in_samples);
		rc = q6asm_get_session_time(audio->ac, &timestamp);