From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20103C43331 for ; Mon, 11 Nov 2019 18:32:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E421B214E0 for ; Mon, 11 Nov 2019 18:32:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497173; bh=lL80g6IMfsV+v4nooyOLe3Ozp7kI7FqeBAch5eZ9wiQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fLMr4gmuJ+WX0lj02iDalQC6RRAosNMFCB7TI5n0xrmZe7dfdgRN/EgVuEN0GXL2E PckcJoZJ293c5ICBIXmayVXz4gsMqsaF+g8s5PBvtH8hkLMpBXvTYevc0HHLCTRFow 75PTroCmMPpRyqBhZLHo9a9CuDbQBNt4QCEqC8VU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbfKKScv (ORCPT ); Mon, 11 Nov 2019 13:32:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:50142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728034AbfKKScr (ORCPT ); Mon, 11 Nov 2019 13:32:47 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6ED95214E0; Mon, 11 Nov 2019 18:32:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497166; bh=lL80g6IMfsV+v4nooyOLe3Ozp7kI7FqeBAch5eZ9wiQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zPyNNwe7+dppiDNpWrVrsBJ3A8SIdjLZeHEiVQnYuWONJQQgaGXtKqnS6gaQRUZ3s QElu2roEfGeSbpqRAFZ4BkkTMHs2vbRVQgJ2GLvS5SdVp6VOoY3S2LpIRdo74T6b1R awb0t9rYmdhL7WtM4dr9ftPYOpM3o9hB05LbxCsg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+863724e7128e14b26732@syzkaller.appspotmail.com, Johan Hovold , Marc Kleine-Budde Subject: [PATCH 4.9 26/65] can: peak_usb: fix slab info leak Date: Mon, 11 Nov 2019 19:28:26 +0100 Message-Id: <20191111181345.895508122@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181331.917659011@linuxfoundation.org> References: <20191111181331.917659011@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit f7a1337f0d29b98733c8824e165fca3371d7d4fd upstream. Fix a small slab info leak due to a failure to clear the command buffer at allocation. The first 16 bytes of the command buffer are always sent to the device in pcan_usb_send_cmd() even though only the first two may have been initialised in case no argument payload is provided (e.g. when waiting for a response). Fixes: bb4785551f64 ("can: usb: PEAK-System Technik USB adapters driver core") Cc: stable # 3.4 Reported-by: syzbot+863724e7128e14b26732@syzkaller.appspotmail.com Signed-off-by: Johan Hovold Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/usb/peak_usb/pcan_usb_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c @@ -774,7 +774,7 @@ static int peak_usb_create_dev(const str dev = netdev_priv(netdev); /* allocate a buffer large enough to send commands */ - dev->cmd_buf = kmalloc(PCAN_USB_MAX_CMD_LEN, GFP_KERNEL); + dev->cmd_buf = kzalloc(PCAN_USB_MAX_CMD_LEN, GFP_KERNEL); if (!dev->cmd_buf) { err = -ENOMEM; goto lbl_free_candev;