Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2578949imm; Thu, 16 Aug 2018 11:50:23 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxsdh0aVwQYWPDO52s07TBP3eKUtgxxk8QOn/v8W+ByNhci02DP0AedLQBww38L5Bx7LCyO X-Received: by 2002:a62:5882:: with SMTP id m124-v6mr32510184pfb.249.1534445423449; Thu, 16 Aug 2018 11:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534445423; cv=none; d=google.com; s=arc-20160816; b=X1K4eSHSH8hqE6U2FG67nkxxOAh64O+PmY0bhB0GTD6gfOYMnMhfoD6QEMf4g7TTGL WzbvA+bqWIKKCkWdzlGwqHgfYFBEExoAs3Hm5368JjUUPNXPPj8eaNxoU2ByHqt3LhqA vAPdwdQ75CedvnHAL1BWNWK+qRhevWjKNMDpz0Ds+cSMRU+TWTPNrKfccVdcOsTZp9FW +p7mnnQnLqsz1FjGYZLVMfD4V0BXc6xKu9OStT9iCoqYhbFnp+gziBg+0lsgnKqX+YgR vnWcgzgargu9kVsbRxZzlC1mcW+fclZzldtG4DcQ9A4jsCLA3a8ul+GH7Nh6jbIby9KX pRlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Eih0mkf+cvU62cXg7o+pjEtGlAS6MVHzalP1OaST4D8=; b=xzrcXdO5SgKA1A6wDlMHeMJLcFJhUKbi+YlNwzoDV28CunPHEjK6VsN8bG4XdH8Ozj 60PNo9cNIdPcr5ucNJsuqlmxLYyQr4/K9tpElD8IiI2Eu+5ncXSdTVWkvhWgJKSF0dFZ 7S9uwF86MBqOeotf0+TGr9CnvIPqAw1dPXHBvG8OWAvtVUA7u17itRyY7t+L6Ex0fN6p 9UMlhTkGVfoCGWSZ3Ou+EjK9Uunx39BtvvwYozO1ygVJjLXbVwueIEe7rzTDY4zo8/dF QlkmInvcm/fnD7ZfzLvMNhU4dD/+P12p6S7IrwhowV0jhHkLbscoMTRpxlg0uwzGbSGo hm8w== 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 95-v6si50782pla.205.2018.08.16.11.50.07; Thu, 16 Aug 2018 11:50:23 -0700 (PDT) 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 S1728452AbeHPVmd (ORCPT + 99 others); Thu, 16 Aug 2018 17:42:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56072 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728344AbeHPVmc (ORCPT ); Thu, 16 Aug 2018 17:42:32 -0400 Received: from localhost (unknown [194.244.16.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6ADB0CB7; Thu, 16 Aug 2018 18:42:23 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Salyzyn , Marcel Holtmann , Johan Hedberg , "David S. Miller" , Kees Cook , Benjamin Tissoires , linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, security@kernel.org, kernel-team@android.com Subject: [PATCH 3.18 15/15] Bluetooth: hidp: buffer overflow in hidp_process_report Date: Thu, 16 Aug 2018 20:41:52 +0200 Message-Id: <20180816171634.138355244@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180816171633.546734046@linuxfoundation.org> References: <20180816171633.546734046@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mark Salyzyn commit 7992c18810e568b95c869b227137a2215702a805 upstream. CVE-2018-9363 The buffer length is unsigned at all layers, but gets cast to int and checked in hidp_process_report and can lead to a buffer overflow. Switch len parameter to unsigned int to resolve issue. This affects 3.18 and newer kernels. Signed-off-by: Mark Salyzyn Fixes: a4b1b5877b514b276f0f31efe02388a9c2836728 ("HID: Bluetooth: hidp: make sure input buffers are big enough") Cc: Marcel Holtmann Cc: Johan Hedberg Cc: "David S. Miller" Cc: Kees Cook Cc: Benjamin Tissoires Cc: linux-bluetooth@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: security@kernel.org Cc: kernel-team@android.com Acked-by: Kees Cook Signed-off-by: Marcel Holtmann Signed-off-by: Greg Kroah-Hartman --- net/bluetooth/hidp/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c @@ -416,8 +416,8 @@ static void hidp_del_timer(struct hidp_s del_timer(&session->timer); } -static void hidp_process_report(struct hidp_session *session, - int type, const u8 *data, int len, int intr) +static void hidp_process_report(struct hidp_session *session, int type, + const u8 *data, unsigned int len, int intr) { if (len > HID_MAX_BUFFER_SIZE) len = HID_MAX_BUFFER_SIZE;