From 92535930f21ea63ad38102935ab7ae9a5bdddb4b Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Wed, 11 Dec 2019 17:29:37 -0500
Subject: [PATCH] Add some patches from Red Hat CVE Database

search: kernel
range: 2019-11-21 to 2019-12-11
---
 .../{^5.3.13 => 4.19-^5.3.13}/0001.patch      |   0
 CVE-2019-19462/^5.4.1/0001.patch              | 152 +++++++
 CVE-2019-19532/^5.3.9/0001.patch              | 409 ++++++++++++++++++
 Kernel_CVE_Patch_List.txt                     |   8 +-
 4 files changed, 567 insertions(+), 2 deletions(-)
 rename CVE-2019-19252/{^5.3.13 => 4.19-^5.3.13}/0001.patch (100%)
 create mode 100644 CVE-2019-19462/^5.4.1/0001.patch
 create mode 100644 CVE-2019-19532/^5.3.9/0001.patch

diff --git a/CVE-2019-19252/^5.3.13/0001.patch b/CVE-2019-19252/4.19-^5.3.13/0001.patch
similarity index 100%
rename from CVE-2019-19252/^5.3.13/0001.patch
rename to CVE-2019-19252/4.19-^5.3.13/0001.patch
diff --git a/CVE-2019-19462/^5.4.1/0001.patch b/CVE-2019-19462/^5.4.1/0001.patch
new file mode 100644
index 000000000..1509c3917
--- /dev/null
+++ b/CVE-2019-19462/^5.4.1/0001.patch
@@ -0,0 +1,152 @@
+From mboxrd@z Thu Jan  1 00:00:00 1970
+Return-Path: <SRS0=nTU8=ZV=vger.kernel.org=linux-kernel-owner@kernel.org>
+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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,
+	DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,
+	SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham
+	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 935B6C432C0
+	for <linux-kernel@archiver.kernel.org>; Fri, 29 Nov 2019 01:37:54 +0000 (UTC)
+Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
+	by mail.kernel.org (Postfix) with ESMTP id 605902158A
+	for <linux-kernel@archiver.kernel.org>; Fri, 29 Nov 2019 01:37:54 +0000 (UTC)
+Authentication-Results: mail.kernel.org;
+	dkim=pass (1024-bit key) header.d=axtens.net header.i=@axtens.net header.b="erTACxUD"
+Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
+        id S1726754AbfK2Bhx (ORCPT
+        <rfc822;linux-kernel@archiver.kernel.org>);
+        Thu, 28 Nov 2019 20:37:53 -0500
+Received: from mail-pj1-f66.google.com ([209.85.216.66]:36066 "EHLO
+        mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
+        with ESMTP id S1726696AbfK2Bhw (ORCPT
+        <rfc822;linux-kernel@vger.kernel.org>);
+        Thu, 28 Nov 2019 20:37:52 -0500
+Received: by mail-pj1-f66.google.com with SMTP id n96so1342701pjc.3
+        for <linux-kernel@vger.kernel.org>; Thu, 28 Nov 2019 17:37:51 -0800 (PST)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+        d=axtens.net; s=google;
+        h=from:to:cc:subject:date:message-id:mime-version
+         :content-transfer-encoding;
+        bh=k3v9fPmWBvPWOvk0SjUoi4f+APOY7zLlhiQMCyWJoH8=;
+        b=erTACxUD1Kt3C9eaiEpltWhj1WInSir/xn0VsOuiEQX/pyXUZ7DuQzxBRnMdhH4evB
+         NLUKZ45k7V+j8TbI4mhm/4AVtGxnR7M16uLkyfVv8zF2a8swgCYUpRwphykj1uhdPZyc
+         LQ2hFAbKEttOytooysFhBXcQiVMkt8xT5oOQ0=
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+        d=1e100.net; s=20161025;
+        h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
+         :content-transfer-encoding;
+        bh=k3v9fPmWBvPWOvk0SjUoi4f+APOY7zLlhiQMCyWJoH8=;
+        b=rQ2lSmAP1PT17mFtUlzc/JpHrnIPMC/RgugtZqjeo2XJsvrPiaStFTikAKyYASSONB
+         HR/cwp4JD4BvgkRvzenWL4TgMWz+Fi6/I6C2aZdR/Hc4Jed4PQn0QaS8y08YUgRBV2GM
+         MLEz22tJYFsW8AW9qMdoA996bZ9HuqJ9xfIyQkgxyMR9EfaBA7TXNFW5lyTn43hSaUpT
+         hJrzLwAFiqBRtFQDEmppiN7PD+uw8RMGGXS9EB7swwdobwDHSgXZHYTnQ05Hn5D3Vtah
+         ludoPriLpE1FDdXI0EIwMnc6Xny3gUULivlWqTtMnthkpKza/eVTCDlZTvA2okd3FY4v
+         TfPQ==
+X-Gm-Message-State: APjAAAVHMtwmtpQpDy+DmQkfWlvYXL6AM/eL0+rbAPi7mWyVozVtIXs8
+        ym7rvJYu2mW06IOIgYMwtKgRZHOYhg8=
+X-Google-Smtp-Source: APXvYqw559/nrItIpXQo+aum94P8JTRI4qBdChHdQQz6QBllmcOTS5Kgy+G3u+tLSdbfyoBFXfeZtg==
+X-Received: by 2002:a17:902:8f98:: with SMTP id z24mr12544679plo.35.1574991470396;
+        Thu, 28 Nov 2019 17:37:50 -0800 (PST)
+Received: from localhost (2001-44b8-111e-5c00-a4ac-b85f-e5f8-ea9e.static.ipv6.internode.on.net. [2001:44b8:111e:5c00:a4ac:b85f:e5f8:ea9e])
+        by smtp.gmail.com with ESMTPSA id h5sm5418014pfk.30.2019.11.28.17.37.48
+        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
+        Thu, 28 Nov 2019 17:37:49 -0800 (PST)
+From:   Daniel Axtens <dja@axtens.net>
+To:     linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk
+Cc:     akash.goel@intel.com, ajd@linux.ibm.com,
+        Daniel Axtens <dja@axtens.net>,
+        syzbot+1e925b4b836afe85a1c6@syzkaller-ppc64.appspotmail.com,
+        syzbot+587b2421926808309d21@syzkaller-ppc64.appspotmail.com,
+        syzbot+58320b7171734bf79d26@syzkaller.appspotmail.com,
+        syzbot+d6074fb08bdb2e010520@syzkaller.appspotmail.com
+Subject: [PATCH] relay: handle alloc_percpu returning NULL in relay_open
+Date:   Fri, 29 Nov 2019 12:37:45 +1100
+Message-Id: <20191129013745.7168-1-dja@axtens.net>
+X-Mailer: git-send-email 2.20.1
+MIME-Version: 1.0
+Content-Transfer-Encoding: 8bit
+Sender: linux-kernel-owner@vger.kernel.org
+Precedence: bulk
+List-ID: <linux-kernel.vger.kernel.org>
+X-Mailing-List: linux-kernel@vger.kernel.org
+Archived-At: <https://lore.kernel.org/lkml/20191129013745.7168-1-dja@axtens.net/>
+List-Archive: <https://lore.kernel.org/lkml/>
+List-Post: <mailto:linux-kernel@vger.kernel.org>
+
+alloc_percpu() may return NULL, which means chan->buf may be set to
+NULL. In that case, when we do *per_cpu_ptr(chan->buf, ...), we
+dereference an invalid pointer:
+
+BUG: Unable to handle kernel data access at 0x7dae0000
+Faulting instruction address: 0xc0000000003f3fec
+...
+NIP [c0000000003f3fec] relay_open+0x29c/0x600
+LR [c0000000003f3fc0] relay_open+0x270/0x600
+Call Trace:
+[c000000054353a70] [c0000000003f3fb4] relay_open+0x264/0x600 (unreliable)
+[c000000054353b00] [c000000000451764] __blk_trace_setup+0x254/0x600
+[c000000054353bb0] [c000000000451b78] blk_trace_setup+0x68/0xa0
+[c000000054353c10] [c0000000010da77c] sg_ioctl+0x7bc/0x2e80
+[c000000054353cd0] [c000000000758cbc] do_vfs_ioctl+0x13c/0x1300
+[c000000054353d90] [c000000000759f14] ksys_ioctl+0x94/0x130
+[c000000054353de0] [c000000000759ff8] sys_ioctl+0x48/0xb0
+[c000000054353e20] [c00000000000bcd0] system_call+0x5c/0x68
+
+Check if alloc_percpu returns NULL. Because we can readily catch and
+handle this situation, switch to alloc_cpu_gfp and pass in __GFP_NOWARN.
+
+This was found by syzkaller both on x86 and powerpc, and the reproducer
+it found on powerpc is capable of hitting the issue as an unprivileged
+user.
+
+Fixes: 017c59c042d0 ("relay: Use per CPU constructs for the relay channel buffer pointers")
+Reported-by: syzbot+1e925b4b836afe85a1c6@syzkaller-ppc64.appspotmail.com
+Reported-by: syzbot+587b2421926808309d21@syzkaller-ppc64.appspotmail.com
+Reported-by: syzbot+58320b7171734bf79d26@syzkaller.appspotmail.com
+Reported-by: syzbot+d6074fb08bdb2e010520@syzkaller.appspotmail.com
+Cc: Akash Goel <akash.goel@intel.com>
+Cc: Andrew Donnellan <ajd@linux.ibm.com> # syzkaller-ppc64
+Cc: stable@vger.kernel.org # v4.10+
+Signed-off-by: Daniel Axtens <dja@axtens.net>
+
+--
+
+There's a syz reproducer on the powerpc syzbot that eventually hits
+the bug, but it can take up to an hour or so before it keels over on a
+kernel with all the syzkaller debugging on, and even longer on a
+production kernel. I have been able to reproduce it once on a stock
+Ubuntu 5.0 ppc64le kernel.
+
+I will ask MITRE for a CVE - while only the process doing the syscall
+gets killed, it gets killed while holding the relay_channels_mutex,
+so it blocks all future relay activity.
+---
+ kernel/relay.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/kernel/relay.c b/kernel/relay.c
+index ade14fb7ce2e..a376cc6b54ec 100644
+--- a/kernel/relay.c
++++ b/kernel/relay.c
+@@ -580,7 +580,13 @@ struct rchan *relay_open(const char *base_filename,
+ 	if (!chan)
+ 		return NULL;
+ 
+-	chan->buf = alloc_percpu(struct rchan_buf *);
++	chan->buf = alloc_percpu_gfp(struct rchan_buf *,
++				     GFP_KERNEL | __GFP_NOWARN);
++	if (!chan->buf) {
++		kfree(chan);
++		return NULL;
++	}
++
+ 	chan->version = RELAYFS_CHANNEL_VERSION;
+ 	chan->n_subbufs = n_subbufs;
+ 	chan->subbuf_size = subbuf_size;
+-- 
+2.20.1
+
+
diff --git a/CVE-2019-19532/^5.3.9/0001.patch b/CVE-2019-19532/^5.3.9/0001.patch
new file mode 100644
index 000000000..2a2b9703a
--- /dev/null
+++ b/CVE-2019-19532/^5.3.9/0001.patch
@@ -0,0 +1,409 @@
+From d9d4b1e46d9543a82c23f6df03f4ad697dab361b Mon Sep 17 00:00:00 2001
+From: Alan Stern <stern@rowland.harvard.edu>
+Date: Thu, 3 Oct 2019 14:53:59 -0400
+Subject: HID: Fix assumption that devices have inputs
+
+The syzbot fuzzer found a slab-out-of-bounds write bug in the hid-gaff
+driver.  The problem is caused by the driver's assumption that the
+device must have an input report.  While this will be true for all
+normal HID input devices, a suitably malicious device can violate the
+assumption.
+
+The same assumption is present in over a dozen other HID drivers.
+This patch fixes them by checking that the list of hid_inputs for the
+hid_device is nonempty before allowing it to be used.
+
+Reported-and-tested-by: syzbot+403741a091bf41d4ae79@syzkaller.appspotmail.com
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+CC: <stable@vger.kernel.org>
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+---
+ drivers/hid/hid-axff.c           | 11 +++++++++--
+ drivers/hid/hid-dr.c             | 12 +++++++++---
+ drivers/hid/hid-emsff.c          | 12 +++++++++---
+ drivers/hid/hid-gaff.c           | 12 +++++++++---
+ drivers/hid/hid-holtekff.c       | 12 +++++++++---
+ drivers/hid/hid-lg2ff.c          | 12 +++++++++---
+ drivers/hid/hid-lg3ff.c          | 11 +++++++++--
+ drivers/hid/hid-lg4ff.c          | 11 +++++++++--
+ drivers/hid/hid-lgff.c           | 11 +++++++++--
+ drivers/hid/hid-logitech-hidpp.c | 11 +++++++++--
+ drivers/hid/hid-microsoft.c      | 12 +++++++++---
+ drivers/hid/hid-sony.c           | 12 +++++++++---
+ drivers/hid/hid-tmff.c           | 12 +++++++++---
+ drivers/hid/hid-zpff.c           | 12 +++++++++---
+ 14 files changed, 126 insertions(+), 37 deletions(-)
+
+diff --git a/drivers/hid/hid-axff.c b/drivers/hid/hid-axff.c
+index 6654c1550e2e..fbe4e16ab029 100644
+--- a/drivers/hid/hid-axff.c
++++ b/drivers/hid/hid-axff.c
+@@ -63,13 +63,20 @@ static int axff_init(struct hid_device *hid)
+ {
+ 	struct axff_device *axff;
+ 	struct hid_report *report;
+-	struct hid_input *hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
++	struct hid_input *hidinput;
+ 	struct list_head *report_list =&hid->report_enum[HID_OUTPUT_REPORT].report_list;
+-	struct input_dev *dev = hidinput->input;
++	struct input_dev *dev;
+ 	int field_count = 0;
+ 	int i, j;
+ 	int error;
+ 
++	if (list_empty(&hid->inputs)) {
++		hid_err(hid, "no inputs found\n");
++		return -ENODEV;
++	}
++	hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
++	dev = hidinput->input;
++
+ 	if (list_empty(report_list)) {
+ 		hid_err(hid, "no output reports found\n");
+ 		return -ENODEV;
+diff --git a/drivers/hid/hid-dr.c b/drivers/hid/hid-dr.c
+index 17e17f9a597b..947f19f8685f 100644
+--- a/drivers/hid/hid-dr.c
++++ b/drivers/hid/hid-dr.c
+@@ -75,13 +75,19 @@ static int drff_init(struct hid_device *hid)
+ {
+ 	struct drff_device *drff;
+ 	struct hid_report *report;
+-	struct hid_input *hidinput = list_first_entry(&hid->inputs,
+-						struct hid_input, list);
++	struct hid_input *hidinput;
+ 	struct list_head *report_list =
+ 			&hid->report_enum[HID_OUTPUT_REPORT].report_list;
+-	struct input_dev *dev = hidinput->input;
++	struct input_dev *dev;
+ 	int error;
+ 
++	if (list_empty(&hid->inputs)) {
++		hid_err(hid, "no inputs found\n");
++		return -ENODEV;
++	}
++	hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
++	dev = hidinput->input;
++
+ 	if (list_empty(report_list)) {
+ 		hid_err(hid, "no output reports found\n");
+ 		return -ENODEV;
+diff --git a/drivers/hid/hid-emsff.c b/drivers/hid/hid-emsff.c
+index 7cd5651872d3..c34f2e5a049f 100644
+--- a/drivers/hid/hid-emsff.c
++++ b/drivers/hid/hid-emsff.c
+@@ -47,13 +47,19 @@ static int emsff_init(struct hid_device *hid)
+ {
+ 	struct emsff_device *emsff;
+ 	struct hid_report *report;
+-	struct hid_input *hidinput = list_first_entry(&hid->inputs,
+-						struct hid_input, list);
++	struct hid_input *hidinput;
+ 	struct list_head *report_list =
+ 			&hid->report_enum[HID_OUTPUT_REPORT].report_list;
+-	struct input_dev *dev = hidinput->input;
++	struct input_dev *dev;
+ 	int error;
+ 
++	if (list_empty(&hid->inputs)) {
++		hid_err(hid, "no inputs found\n");
++		return -ENODEV;
++	}
++	hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
++	dev = hidinput->input;
++
+ 	if (list_empty(report_list)) {
+ 		hid_err(hid, "no output reports found\n");
+ 		return -ENODEV;
+diff --git a/drivers/hid/hid-gaff.c b/drivers/hid/hid-gaff.c
+index 0f95c96b70f8..ecbd3995a4eb 100644
+--- a/drivers/hid/hid-gaff.c
++++ b/drivers/hid/hid-gaff.c
+@@ -64,14 +64,20 @@ static int gaff_init(struct hid_device *hid)
+ {
+ 	struct gaff_device *gaff;
+ 	struct hid_report *report;
+-	struct hid_input *hidinput = list_entry(hid->inputs.next,
+-						struct hid_input, list);
++	struct hid_input *hidinput;
+ 	struct list_head *report_list =
+ 			&hid->report_enum[HID_OUTPUT_REPORT].report_list;
+ 	struct list_head *report_ptr = report_list;
+-	struct input_dev *dev = hidinput->input;
++	struct input_dev *dev;
+ 	int error;
+ 
++	if (list_empty(&hid->inputs)) {
++		hid_err(hid, "no inputs found\n");
++		return -ENODEV;
++	}
++	hidinput = list_entry(hid->inputs.next, struct hid_input, list);
++	dev = hidinput->input;
++
+ 	if (list_empty(report_list)) {
+ 		hid_err(hid, "no output reports found\n");
+ 		return -ENODEV;
+diff --git a/drivers/hid/hid-holtekff.c b/drivers/hid/hid-holtekff.c
+index 10a720558830..8619b80c834c 100644
+--- a/drivers/hid/hid-holtekff.c
++++ b/drivers/hid/hid-holtekff.c
+@@ -124,13 +124,19 @@ static int holtekff_init(struct hid_device *hid)
+ {
+ 	struct holtekff_device *holtekff;
+ 	struct hid_report *report;
+-	struct hid_input *hidinput = list_entry(hid->inputs.next,
+-						struct hid_input, list);
++	struct hid_input *hidinput;
+ 	struct list_head *report_list =
+ 			&hid->report_enum[HID_OUTPUT_REPORT].report_list;
+-	struct input_dev *dev = hidinput->input;
++	struct input_dev *dev;
+ 	int error;
+ 
++	if (list_empty(&hid->inputs)) {
++		hid_err(hid, "no inputs found\n");
++		return -ENODEV;
++	}
++	hidinput = list_entry(hid->inputs.next, struct hid_input, list);
++	dev = hidinput->input;
++
+ 	if (list_empty(report_list)) {
+ 		hid_err(hid, "no output report found\n");
+ 		return -ENODEV;
+diff --git a/drivers/hid/hid-lg2ff.c b/drivers/hid/hid-lg2ff.c
+index dd1a6c3a7de6..73d07e35f12a 100644
+--- a/drivers/hid/hid-lg2ff.c
++++ b/drivers/hid/hid-lg2ff.c
+@@ -50,11 +50,17 @@ int lg2ff_init(struct hid_device *hid)
+ {
+ 	struct lg2ff_device *lg2ff;
+ 	struct hid_report *report;
+-	struct hid_input *hidinput = list_entry(hid->inputs.next,
+-						struct hid_input, list);
+-	struct input_dev *dev = hidinput->input;
++	struct hid_input *hidinput;
++	struct input_dev *dev;
+ 	int error;
+ 
++	if (list_empty(&hid->inputs)) {
++		hid_err(hid, "no inputs found\n");
++		return -ENODEV;
++	}
++	hidinput = list_entry(hid->inputs.next, struct hid_input, list);
++	dev = hidinput->input;
++
+ 	/* Check that the report looks ok */
+ 	report = hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7);
+ 	if (!report)
+diff --git a/drivers/hid/hid-lg3ff.c b/drivers/hid/hid-lg3ff.c
+index 9ecb6fd06203..b7e1949f3cf7 100644
+--- a/drivers/hid/hid-lg3ff.c
++++ b/drivers/hid/hid-lg3ff.c
+@@ -117,12 +117,19 @@ static const signed short ff3_joystick_ac[] = {
+ 
+ int lg3ff_init(struct hid_device *hid)
+ {
+-	struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
+-	struct input_dev *dev = hidinput->input;
++	struct hid_input *hidinput;
++	struct input_dev *dev;
+ 	const signed short *ff_bits = ff3_joystick_ac;
+ 	int error;
+ 	int i;
+ 
++	if (list_empty(&hid->inputs)) {
++		hid_err(hid, "no inputs found\n");
++		return -ENODEV;
++	}
++	hidinput = list_entry(hid->inputs.next, struct hid_input, list);
++	dev = hidinput->input;
++
+ 	/* Check that the report looks ok */
+ 	if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 35))
+ 		return -ENODEV;
+diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c
+index 03f0220062ca..5e6a0cef2a06 100644
+--- a/drivers/hid/hid-lg4ff.c
++++ b/drivers/hid/hid-lg4ff.c
+@@ -1253,8 +1253,8 @@ static int lg4ff_handle_multimode_wheel(struct hid_device *hid, u16 *real_produc
+ 
+ int lg4ff_init(struct hid_device *hid)
+ {
+-	struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
+-	struct input_dev *dev = hidinput->input;
++	struct hid_input *hidinput;
++	struct input_dev *dev;
+ 	struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;
+ 	struct hid_report *report = list_entry(report_list->next, struct hid_report, list);
+ 	const struct usb_device_descriptor *udesc = &(hid_to_usb_dev(hid)->descriptor);
+@@ -1266,6 +1266,13 @@ int lg4ff_init(struct hid_device *hid)
+ 	int mmode_ret, mmode_idx = -1;
+ 	u16 real_product_id;
+ 
++	if (list_empty(&hid->inputs)) {
++		hid_err(hid, "no inputs found\n");
++		return -ENODEV;
++	}
++	hidinput = list_entry(hid->inputs.next, struct hid_input, list);
++	dev = hidinput->input;
++
+ 	/* Check that the report looks ok */
+ 	if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7))
+ 		return -1;
+diff --git a/drivers/hid/hid-lgff.c b/drivers/hid/hid-lgff.c
+index c79a6ec43745..aed4ddc397a9 100644
+--- a/drivers/hid/hid-lgff.c
++++ b/drivers/hid/hid-lgff.c
+@@ -115,12 +115,19 @@ static void hid_lgff_set_autocenter(struct input_dev *dev, u16 magnitude)
+ 
+ int lgff_init(struct hid_device* hid)
+ {
+-	struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
+-	struct input_dev *dev = hidinput->input;
++	struct hid_input *hidinput;
++	struct input_dev *dev;
+ 	const signed short *ff_bits = ff_joystick;
+ 	int error;
+ 	int i;
+ 
++	if (list_empty(&hid->inputs)) {
++		hid_err(hid, "no inputs found\n");
++		return -ENODEV;
++	}
++	hidinput = list_entry(hid->inputs.next, struct hid_input, list);
++	dev = hidinput->input;
++
+ 	/* Check that the report looks ok */
+ 	if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7))
+ 		return -ENODEV;
+diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
+index 0179f7ed77e5..1ac1ecc1e67c 100644
+--- a/drivers/hid/hid-logitech-hidpp.c
++++ b/drivers/hid/hid-logitech-hidpp.c
+@@ -2084,8 +2084,8 @@ static void hidpp_ff_destroy(struct ff_device *ff)
+ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)
+ {
+ 	struct hid_device *hid = hidpp->hid_dev;
+-	struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
+-	struct input_dev *dev = hidinput->input;
++	struct hid_input *hidinput;
++	struct input_dev *dev;
+ 	const struct usb_device_descriptor *udesc = &(hid_to_usb_dev(hid)->descriptor);
+ 	const u16 bcdDevice = le16_to_cpu(udesc->bcdDevice);
+ 	struct ff_device *ff;
+@@ -2094,6 +2094,13 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)
+ 	int error, j, num_slots;
+ 	u8 version;
+ 
++	if (list_empty(&hid->inputs)) {
++		hid_err(hid, "no inputs found\n");
++		return -ENODEV;
++	}
++	hidinput = list_entry(hid->inputs.next, struct hid_input, list);
++	dev = hidinput->input;
++
+ 	if (!dev) {
+ 		hid_err(hid, "Struct input_dev not set!\n");
+ 		return -EINVAL;
+diff --git a/drivers/hid/hid-microsoft.c b/drivers/hid/hid-microsoft.c
+index 2cf83856f2e4..2d8b589201a4 100644
+--- a/drivers/hid/hid-microsoft.c
++++ b/drivers/hid/hid-microsoft.c
+@@ -328,11 +328,17 @@ static int ms_play_effect(struct input_dev *dev, void *data,
+ 
+ static int ms_init_ff(struct hid_device *hdev)
+ {
+-	struct hid_input *hidinput = list_entry(hdev->inputs.next,
+-						struct hid_input, list);
+-	struct input_dev *input_dev = hidinput->input;
++	struct hid_input *hidinput;
++	struct input_dev *input_dev;
+ 	struct ms_data *ms = hid_get_drvdata(hdev);
+ 
++	if (list_empty(&hdev->inputs)) {
++		hid_err(hdev, "no inputs found\n");
++		return -ENODEV;
++	}
++	hidinput = list_entry(hdev->inputs.next, struct hid_input, list);
++	input_dev = hidinput->input;
++
+ 	if (!(ms->quirks & MS_QUIRK_FF))
+ 		return 0;
+ 
+diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
+index 73c0f7a95e2d..4c6ed6ef31f1 100644
+--- a/drivers/hid/hid-sony.c
++++ b/drivers/hid/hid-sony.c
+@@ -2254,9 +2254,15 @@ static int sony_play_effect(struct input_dev *dev, void *data,
+ 
+ static int sony_init_ff(struct sony_sc *sc)
+ {
+-	struct hid_input *hidinput = list_entry(sc->hdev->inputs.next,
+-						struct hid_input, list);
+-	struct input_dev *input_dev = hidinput->input;
++	struct hid_input *hidinput;
++	struct input_dev *input_dev;
++
++	if (list_empty(&sc->hdev->inputs)) {
++		hid_err(sc->hdev, "no inputs found\n");
++		return -ENODEV;
++	}
++	hidinput = list_entry(sc->hdev->inputs.next, struct hid_input, list);
++	input_dev = hidinput->input;
+ 
+ 	input_set_capability(input_dev, EV_FF, FF_RUMBLE);
+ 	return input_ff_create_memless(input_dev, NULL, sony_play_effect);
+diff --git a/drivers/hid/hid-tmff.c b/drivers/hid/hid-tmff.c
+index bdfc5ff3b2c5..90acef304536 100644
+--- a/drivers/hid/hid-tmff.c
++++ b/drivers/hid/hid-tmff.c
+@@ -124,12 +124,18 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits)
+ 	struct tmff_device *tmff;
+ 	struct hid_report *report;
+ 	struct list_head *report_list;
+-	struct hid_input *hidinput = list_entry(hid->inputs.next,
+-							struct hid_input, list);
+-	struct input_dev *input_dev = hidinput->input;
++	struct hid_input *hidinput;
++	struct input_dev *input_dev;
+ 	int error;
+ 	int i;
+ 
++	if (list_empty(&hid->inputs)) {
++		hid_err(hid, "no inputs found\n");
++		return -ENODEV;
++	}
++	hidinput = list_entry(hid->inputs.next, struct hid_input, list);
++	input_dev = hidinput->input;
++
+ 	tmff = kzalloc(sizeof(struct tmff_device), GFP_KERNEL);
+ 	if (!tmff)
+ 		return -ENOMEM;
+diff --git a/drivers/hid/hid-zpff.c b/drivers/hid/hid-zpff.c
+index f90959e94028..3abaca045869 100644
+--- a/drivers/hid/hid-zpff.c
++++ b/drivers/hid/hid-zpff.c
+@@ -54,11 +54,17 @@ static int zpff_init(struct hid_device *hid)
+ {
+ 	struct zpff_device *zpff;
+ 	struct hid_report *report;
+-	struct hid_input *hidinput = list_entry(hid->inputs.next,
+-						struct hid_input, list);
+-	struct input_dev *dev = hidinput->input;
++	struct hid_input *hidinput;
++	struct input_dev *dev;
+ 	int i, error;
+ 
++	if (list_empty(&hid->inputs)) {
++		hid_err(hid, "no inputs found\n");
++		return -ENODEV;
++	}
++	hidinput = list_entry(hid->inputs.next, struct hid_input, list);
++	dev = hidinput->input;
++
+ 	for (i = 0; i < 4; i++) {
+ 		report = hid_validate_values(hid, HID_OUTPUT_REPORT, 0, i, 1);
+ 		if (!report)
+-- 
+cgit 1.2-0.3.lf.el7
+
diff --git a/Kernel_CVE_Patch_List.txt b/Kernel_CVE_Patch_List.txt
index 6955fe713..32421728e 100644
--- a/Kernel_CVE_Patch_List.txt
+++ b/Kernel_CVE_Patch_List.txt
@@ -1,4 +1,4 @@
-#Last checked 2019/12/02
+#Last checked 2019/12/11
 #This is a combined list from the following sources
 #	https://source.android.com/security/bulletin
 #	https://source.android.com/security/bulletin/pixel
@@ -5448,7 +5448,11 @@ CVE-2019-19078
 CVE-2019-19082
 	Link - ^5.3.11 - https://github.com/torvalds/linux/commit/104c307147ad379617472dd91a5bcb368d72bd6d
 CVE-2019-19252
-	Link - ^5.3.13 - https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git/commit/?h=tty-testing&id=0c9acb1af77a3cb8707e43f45b72c95266903cee
+	Link - 4.19-^5.3.13 - https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git/commit/?h=tty-testing&id=0c9acb1af77a3cb8707e43f45b72c95266903cee
+CVE-2019-19462
+	Link - ^5.4.1 - https://lore.kernel.org/lkml/20191129013745.7168-1-dja@axtens.net/raw
+CVE-2019-19532
+	Link - ^5.3.9 - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d9d4b1e46d9543a82c23f6df03f4ad697dab361b
 LVT-2017-0001
 	Link - 3.0 - https://review.lineageos.org/#/c/171511
 	Link - 3.4 - https://review.lineageos.org/#/c/170648
-- 
GitLab