From: Takashi Iwai Subject: Re: [PATCH] ALSA: emu10k1: fix possible info leak to userspace on SNDRV_EMU10K1_IOCTL_INFO Date: Mon, 10 Sep 2018 17:34:51 +0200 Message-ID: References: <20180910151932.17300-1-tiwai@suse.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 5D9CD2676ED for ; Mon, 10 Sep 2018 17:34:52 +0200 (CEST) In-Reply-To: <20180910151932.17300-1-tiwai@suse.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: alsa-devel@alsa-project.org Cc: Willy Tarreau , Jann Horn List-Id: alsa-devel@alsa-project.org On Mon, 10 Sep 2018 17:19:32 +0200, Takashi Iwai wrote: > > From: Willy Tarreau > > snd_emu10k1_fx8010_ioctl(SNDRV_EMU10K1_IOCTL_INFO) allocates > memory using kmalloc() and partially fills it by calling > snd_emu10k1_fx8010_info() before returning the resulting > structure to userspace, leaving uninitialized holes. Let's > just use kzalloc() here. > > BugLink: http://blog.infosectcbr.com.au/2018/09/linux-kernel-infoleaks.html BTW, for avoiding someone falling into the same pitfall like me: you can forget about the case 2 in the URL above. It's invalid. We have a complete copy_from_user() at first, so no leak happens. Takashi