Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2988549imu; Sun, 9 Dec 2018 14:24:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/WFFh5a/SyXKD/2D/8udlJ2p1Dvtfy5W+9FNIa0/T79xCHm3xZfsQ4SQm1AX/LQ/S5wtjfR X-Received: by 2002:a63:955a:: with SMTP id t26mr8884305pgn.449.1544394268739; Sun, 09 Dec 2018 14:24:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544394268; cv=none; d=google.com; s=arc-20160816; b=xp9e7kH7L2OGEwUwM6yRPMS9teuCYETWPsIXagIWjGEFV1Y8KZxprprqM8uSAm7+Uv g4afh5z1tORCvQqYWLGDuEP+TcEpMpHiPjjritPSsL6MF+sLq7vCSa2tt0fP5plRzLFo xwhR6r4INzICzND9dplE3ynVC9I8saacDVMCq6X25rR0wgiQs6ZM5xvp0Rq6VDFHiHxS AOZx1LQDGr+1fZ1nlguCEegL9TOfIOjfOtJmlCglvW3HxBDtYG0rflQK7qRO4SOAD2FO 3S+tYQk4WypZtBOjlqVxF1kCM8uM7YbH6linrjiLNJ80SJh6l8DHJy4A9eezVE7Hh1xi zdxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=kuPMkb45BYL7e9CXLYfCcS/DoH6pkKZbD75vtUpyOmg=; b=eUjvUAKQOuD3OgaVU3vN50yJQGN+MgvmAjpDARnxO+zVeJlbOSRnCbQ8tQQ7KoNjom mM0GdMhVukFlo9Jp0w4DcgCi8bFtd+WBtDqftErtryvjTNv+2Qr9Fq4aSQkTR8I+KfxO H7EP9mCSjr+Gy44JsytXCX14tTFFKMeczqc5/l/DCIU2WVfnDusk4bYlHlb5K358bXHO Db2L3egOiMNuSHl24dgumBJVvYMjmWBCjlnpisZXcMSmIE+vu3IfBP2nwKMs5OE4sWR8 KbyrX+4BW15Xe4bueMvYODwMTJ8/1V3Do/8ihXFJbCrm0QDIyjDOnxt/r0JWwJ6rdCey A0pQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i33si8619022pld.329.2018.12.09.14.24.13; Sun, 09 Dec 2018 14:24:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728520AbeLIWWy (ORCPT + 99 others); Sun, 9 Dec 2018 17:22:54 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35174 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbeLIVzV (ORCPT ); Sun, 9 Dec 2018 16:55:21 -0500 Received: from pub.yeoldevic.com ([81.174.156.145] helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gW72k-0002ic-6o; Sun, 09 Dec 2018 21:55:18 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gW72h-0003Yd-GZ; Sun, 09 Dec 2018 21:55:15 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Jann Horn" , "Takashi Iwai" , "Willy Tarreau" Date: Sun, 09 Dec 2018 21:50:33 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 228/328] ALSA: emu10k1: fix possible info leak to userspace on SNDRV_EMU10K1_IOCTL_INFO In-Reply-To: X-SA-Exim-Connect-IP: 81.174.156.145 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.62-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Willy Tarreau commit 49434c6c575d2008c0abbc93e615019f39e01252 upstream. 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 Signed-off-by: Willy Tarreau Cc: Jann Horn Signed-off-by: Takashi Iwai Signed-off-by: Ben Hutchings --- sound/pci/emu10k1/emufx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/pci/emu10k1/emufx.c +++ b/sound/pci/emu10k1/emufx.c @@ -2521,7 +2521,7 @@ static int snd_emu10k1_fx8010_ioctl(stru emu->support_tlv = 1; return put_user(SNDRV_EMU10K1_VERSION, (int __user *)argp); case SNDRV_EMU10K1_IOCTL_INFO: - info = kmalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc(sizeof(*info), GFP_KERNEL); if (!info) return -ENOMEM; snd_emu10k1_fx8010_info(emu, info);