[arch-commits] Commit in linux-hardened/trunk (5 files)

Levente Polyak anthraxx at archlinux.org
Thu Jan 18 22:26:15 UTC 2018


    Date: Thursday, January 18, 2018 @ 22:26:14
  Author: anthraxx
Revision: 283998

upgpkg: linux-hardened 4.14.14.a-1

Modified:
  linux-hardened/trunk/PKGBUILD
  linux-hardened/trunk/config.x86_64
Deleted:
  linux-hardened/trunk/CVE-2017-17741-KVM-Fix-stack-out-of-bounds-read-in-write_mmio.patch
  linux-hardened/trunk/cgroup-fix-css_task_iter-crash-on-CSS_TASK_ITER_PROC.patch
  linux-hardened/trunk/e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch

---------------------------------------------------------------------+
 CVE-2017-17741-KVM-Fix-stack-out-of-bounds-read-in-write_mmio.patch |  161 ----------
 PKGBUILD                                                            |   18 -
 cgroup-fix-css_task_iter-crash-on-CSS_TASK_ITER_PROC.patch          |  132 --------
 config.x86_64                                                       |    4 
 e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch          |   73 ----
 5 files changed, 8 insertions(+), 380 deletions(-)

Deleted: CVE-2017-17741-KVM-Fix-stack-out-of-bounds-read-in-write_mmio.patch
===================================================================
--- CVE-2017-17741-KVM-Fix-stack-out-of-bounds-read-in-write_mmio.patch	2018-01-18 22:25:01 UTC (rev 283997)
+++ CVE-2017-17741-KVM-Fix-stack-out-of-bounds-read-in-write_mmio.patch	2018-01-18 22:26:14 UTC (rev 283998)
@@ -1,161 +0,0 @@
-From e39d200fa5bf5b94a0948db0dae44c1b73b84a56 Mon Sep 17 00:00:00 2001
-From: Wanpeng Li <wanpeng.li at hotmail.com>
-Date: Thu, 14 Dec 2017 17:40:50 -0800
-Subject: [PATCH] KVM: Fix stack-out-of-bounds read in write_mmio
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Reported by syzkaller:
-
-  BUG: KASAN: stack-out-of-bounds in write_mmio+0x11e/0x270 [kvm]
-  Read of size 8 at addr ffff8803259df7f8 by task syz-executor/32298
-
-  CPU: 6 PID: 32298 Comm: syz-executor Tainted: G           OE    4.15.0-rc2+ #18
-  Hardware name: LENOVO ThinkCentre M8500t-N000/SHARKBAY, BIOS FBKTC1AUS 02/16/2016
-  Call Trace:
-   dump_stack+0xab/0xe1
-   print_address_description+0x6b/0x290
-   kasan_report+0x28a/0x370
-   write_mmio+0x11e/0x270 [kvm]
-   emulator_read_write_onepage+0x311/0x600 [kvm]
-   emulator_read_write+0xef/0x240 [kvm]
-   emulator_fix_hypercall+0x105/0x150 [kvm]
-   em_hypercall+0x2b/0x80 [kvm]
-   x86_emulate_insn+0x2b1/0x1640 [kvm]
-   x86_emulate_instruction+0x39a/0xb90 [kvm]
-   handle_exception+0x1b4/0x4d0 [kvm_intel]
-   vcpu_enter_guest+0x15a0/0x2640 [kvm]
-   kvm_arch_vcpu_ioctl_run+0x549/0x7d0 [kvm]
-   kvm_vcpu_ioctl+0x479/0x880 [kvm]
-   do_vfs_ioctl+0x142/0x9a0
-   SyS_ioctl+0x74/0x80
-   entry_SYSCALL_64_fastpath+0x23/0x9a
-
-The path of patched vmmcall will patch 3 bytes opcode 0F 01 C1(vmcall)
-to the guest memory, however, write_mmio tracepoint always prints 8 bytes
-through *(u64 *)val since kvm splits the mmio access into 8 bytes. This
-leaks 5 bytes from the kernel stack (CVE-2017-17741).  This patch fixes
-it by just accessing the bytes which we operate on.
-
-Before patch:
-
-syz-executor-5567  [007] .... 51370.561696: kvm_mmio: mmio write len 3 gpa 0x10 val 0x1ffff10077c1010f
-
-After patch:
-
-syz-executor-13416 [002] .... 51302.299573: kvm_mmio: mmio write len 3 gpa 0x10 val 0xc1010f
-
-Reported-by: Dmitry Vyukov <dvyukov at google.com>
-Reviewed-by: Darren Kenny <darren.kenny at oracle.com>
-Reviewed-by: Marc Zyngier <marc.zyngier at arm.com>
-Tested-by: Marc Zyngier <marc.zyngier at arm.com>
-Cc: Paolo Bonzini <pbonzini at redhat.com>
-Cc: Radim Krčmář <rkrcmar at redhat.com>
-Cc: Marc Zyngier <marc.zyngier at arm.com>
-Cc: Christoffer Dall <christoffer.dall at linaro.org>
-Signed-off-by: Wanpeng Li <wanpeng.li at hotmail.com>
-Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
----
- arch/x86/kvm/x86.c         | 8 ++++----
- include/trace/events/kvm.h | 7 +++++--
- virt/kvm/arm/mmio.c        | 6 +++---
- 3 files changed, 12 insertions(+), 9 deletions(-)
-
-diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
-index 3a82f2d4333b..1cec2c62a0b0 100644
---- a/arch/x86/kvm/x86.c
-+++ b/arch/x86/kvm/x86.c
-@@ -4384,7 +4384,7 @@ static int vcpu_mmio_read(struct kvm_vcpu *vcpu, gpa_t addr, int len, void *v)
- 					 addr, n, v))
- 		    && kvm_io_bus_read(vcpu, KVM_MMIO_BUS, addr, n, v))
- 			break;
--		trace_kvm_mmio(KVM_TRACE_MMIO_READ, n, addr, *(u64 *)v);
-+		trace_kvm_mmio(KVM_TRACE_MMIO_READ, n, addr, v);
- 		handled += n;
- 		addr += n;
- 		len -= n;
-@@ -4643,7 +4643,7 @@ static int read_prepare(struct kvm_vcpu *vcpu, void *val, int bytes)
- {
- 	if (vcpu->mmio_read_completed) {
- 		trace_kvm_mmio(KVM_TRACE_MMIO_READ, bytes,
--			       vcpu->mmio_fragments[0].gpa, *(u64 *)val);
-+			       vcpu->mmio_fragments[0].gpa, val);
- 		vcpu->mmio_read_completed = 0;
- 		return 1;
- 	}
-@@ -4665,14 +4665,14 @@ static int write_emulate(struct kvm_vcpu *vcpu, gpa_t gpa,
- 
- static int write_mmio(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes, void *val)
- {
--	trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, bytes, gpa, *(u64 *)val);
-+	trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, bytes, gpa, val);
- 	return vcpu_mmio_write(vcpu, gpa, bytes, val);
- }
- 
- static int read_exit_mmio(struct kvm_vcpu *vcpu, gpa_t gpa,
- 			  void *val, int bytes)
- {
--	trace_kvm_mmio(KVM_TRACE_MMIO_READ_UNSATISFIED, bytes, gpa, 0);
-+	trace_kvm_mmio(KVM_TRACE_MMIO_READ_UNSATISFIED, bytes, gpa, NULL);
- 	return X86EMUL_IO_NEEDED;
- }
- 
-diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
-index e4b0b8e09932..2c735a3e6613 100644
---- a/include/trace/events/kvm.h
-+++ b/include/trace/events/kvm.h
-@@ -211,7 +211,7 @@ TRACE_EVENT(kvm_ack_irq,
- 	{ KVM_TRACE_MMIO_WRITE, "write" }
- 
- TRACE_EVENT(kvm_mmio,
--	TP_PROTO(int type, int len, u64 gpa, u64 val),
-+	TP_PROTO(int type, int len, u64 gpa, void *val),
- 	TP_ARGS(type, len, gpa, val),
- 
- 	TP_STRUCT__entry(
-@@ -225,7 +225,10 @@ TRACE_EVENT(kvm_mmio,
- 		__entry->type		= type;
- 		__entry->len		= len;
- 		__entry->gpa		= gpa;
--		__entry->val		= val;
-+		__entry->val		= 0;
-+		if (val)
-+			memcpy(&__entry->val, val,
-+			       min_t(u32, sizeof(__entry->val), len));
- 	),
- 
- 	TP_printk("mmio %s len %u gpa 0x%llx val 0x%llx",
-diff --git a/virt/kvm/arm/mmio.c b/virt/kvm/arm/mmio.c
-index b6e715fd3c90..dac7ceb1a677 100644
---- a/virt/kvm/arm/mmio.c
-+++ b/virt/kvm/arm/mmio.c
-@@ -112,7 +112,7 @@ int kvm_handle_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run)
- 		}
- 
- 		trace_kvm_mmio(KVM_TRACE_MMIO_READ, len, run->mmio.phys_addr,
--			       data);
-+			       &data);
- 		data = vcpu_data_host_to_guest(vcpu, data, len);
- 		vcpu_set_reg(vcpu, vcpu->arch.mmio_decode.rt, data);
- 	}
-@@ -182,14 +182,14 @@ int io_mem_abort(struct kvm_vcpu *vcpu, struct kvm_run *run,
- 		data = vcpu_data_guest_to_host(vcpu, vcpu_get_reg(vcpu, rt),
- 					       len);
- 
--		trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, len, fault_ipa, data);
-+		trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, len, fault_ipa, &data);
- 		kvm_mmio_write_buf(data_buf, len, data);
- 
- 		ret = kvm_io_bus_write(vcpu, KVM_MMIO_BUS, fault_ipa, len,
- 				       data_buf);
- 	} else {
- 		trace_kvm_mmio(KVM_TRACE_MMIO_READ_UNSATISFIED, len,
--			       fault_ipa, 0);
-+			       fault_ipa, NULL);
- 
- 		ret = kvm_io_bus_read(vcpu, KVM_MMIO_BUS, fault_ipa, len,
- 				      data_buf);
--- 
-2.15.1
-

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-01-18 22:25:01 UTC (rev 283997)
+++ PKGBUILD	2018-01-18 22:26:14 UTC (rev 283998)
@@ -5,7 +5,7 @@
 
 pkgbase=linux-hardened
 _srcname=linux-4.14
-_pkgver=4.14.13
+_pkgver=4.14.14
 pkgver=${_pkgver}.a
 pkgrel=1
 url='https://github.com/copperhead/linux-hardened'
@@ -23,12 +23,8 @@
         90-linux.hook  # pacman hook for initramfs regeneration
         linux.preset   # standard config files for mkinitcpio ramdisk
 
-        # https://bugs.archlinux.org/task/56575
-        e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch
         # https://bugs.archlinux.org/task/56605
         xfrm-Fix-stack-out-of-bounds-read-on-socket-policy-lookup.patch
-        # https://bugs.archlinux.org/task/56846
-        cgroup-fix-css_task_iter-crash-on-CSS_TASK_ITER_PROC.patch
         # https://bugs.archlinux.org/task/56711
         drm-i915-edp-Only-use-the-alternate-fixed-mode-if-its-asked-for.patch
 
@@ -35,27 +31,23 @@
         CVE-2017-8824-dccp-use-after-free-in-DCCP-code.patch
         CVE-2017-17448-netfilter-nfnetlink_cthelper-Add-missing-permission-checks.patch
         CVE-2017-17450-netfilter-xt_osf-Add-missing-permission-checks.patch
-        CVE-2017-17741-KVM-Fix-stack-out-of-bounds-read-in-write_mmio.patch
 )
 replaces=('linux-grsec')
 sha256sums=('f81d59477e90a130857ce18dc02f4fbe5725854911db1e7ba770c7cd350f96a7'
             'SKIP'
-            'ce897f467e80452f29d7a7a8809e8585ea12192a2c32e4d18578f64b043e802e'
+            '62d656b98f0dc143216cb9650bd9b96cd83d92925731e9f0bec5eb4d6358e603'
             'SKIP'
-            '6b12f95c7eecfc3629fe94079f5a82d509a31621f689503dd91225c730ed0371'
+            '0ee89f7c93da3708047467041d4fed7f2f19e07d2a46c3184f61d8ba5d36a80a'
             'SKIP'
-            '769908e5438c4aec49341aa84bbe1a24e3e14bff18de595bfa1f6359c677f647'
+            'a5f733c271b5f11049efe5d100e97e424716d0f3cc7ae7267ad440424ca5b4b5'
             'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
             '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919'
             'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65'
-            'c6e7db7dfd6a07e1fd0e20c3a5f0f315f9c2a366fe42214918b756f9a1c9bfa3'
             '294c928b8252112d621df1d13fbfeade13f28ddea034d44e89db41b66d2b7d45'
-            '721c387db986d883a6df6b0da17941ce6d59811b0647ae6653b978c5ee144f19'
             'c08d12c699398ef88b764be1837b9ee11f2efd3188bd1bf4e8f85dfbeee58148'
             '6be803c62b7ce41f1b4de6c867715398812b1c1a3e68a0078512f2872e2a3fa9'
             'b833ad4354fcd2cc6ee60c971088f77aa5b06a58fce346c40268c0b05b1e8cb5'
-            '72efa781c8ee1175a8865e6a12568aaf3bac4b76d4285819c6a75a3e5fe41435'
-            'ee125179fdd295266aba52e1aebaef97cb41f4a05d9cd1c2b11b4ce83746e197')
+            '72efa781c8ee1175a8865e6a12568aaf3bac4b76d4285819c6a75a3e5fe41435')
 validpgpkeys=(
               'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
               '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman

Deleted: cgroup-fix-css_task_iter-crash-on-CSS_TASK_ITER_PROC.patch
===================================================================
--- cgroup-fix-css_task_iter-crash-on-CSS_TASK_ITER_PROC.patch	2018-01-18 22:25:01 UTC (rev 283997)
+++ cgroup-fix-css_task_iter-crash-on-CSS_TASK_ITER_PROC.patch	2018-01-18 22:26:14 UTC (rev 283998)
@@ -1,132 +0,0 @@
-From patchwork Wed Dec 20 15:13:31 2017
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [cgroup/for-4.15-fixes] cgroup: fix css_task_iter crash on
- CSS_TASK_ITER_PROC
-From: Tejun Heo <tj at kernel.org>
-X-Patchwork-Id: 10125801
-Message-Id: <20171220151331.GA3413940 at devbig577.frc2.facebook.com>
-To: Laura Abbott <labbott at redhat.com>
-Cc: Zefan Li <lizefan at huawei.com>, linux-kernel at vger.kernel.org,
- cgroups at vger.kernel.org, regressions at leemhuis.info,
- Bronek Kozicki <brok at incorrekt.com>, George Amanakis <gamanakis at gmail.com>
-Date: Wed, 20 Dec 2017 07:13:31 -0800
-
-Hello,
-
-Applied the following to cgroup/for-4.15-fixes.  Will push out to
-linus later this week.  I could reproduce the problem reliably and am
-pretty sure this is the right fix but I'd greatly appreciate if you
-guys can confirm the fix too.
-
-Thank you very much.
-
------- 8< ------
->From 74d0833c659a8a54735e5efdd44f4b225af68586 Mon Sep 17 00:00:00 2001
-From: Tejun Heo <tj at kernel.org>
-Date: Wed, 20 Dec 2017 07:09:19 -0800
-
-While teaching css_task_iter to handle skipping over tasks which
-aren't group leaders, bc2fb7ed089f ("cgroup: add @flags to
-css_task_iter_start() and implement CSS_TASK_ITER_PROCS") introduced a
-silly bug.
-
-CSS_TASK_ITER_PROCS is implemented by repeating
-css_task_iter_advance() while the advanced cursor is pointing to a
-non-leader thread.  However, the cursor variable, @l, wasn't updated
-when the iteration has to advance to the next css_set and the
-following repetition would operate on the terminal @l from the
-previous iteration which isn't pointing to a valid task leading to
-oopses like the following or infinite looping.
-
-  BUG: unable to handle kernel NULL pointer dereference at 0000000000000254
-  IP: __task_pid_nr_ns+0xc7/0xf0
-  PGD 0 P4D 0
-  Oops: 0000 [#1] SMP
-  ...
-  CPU: 2 PID: 1 Comm: systemd Not tainted 4.14.4-200.fc26.x86_64 #1
-  Hardware name: System manufacturer System Product Name/PRIME B350M-A, BIOS 3203 11/09/2017
-  task: ffff88c4baee8000 task.stack: ffff96d5c3158000
-  RIP: 0010:__task_pid_nr_ns+0xc7/0xf0
-  RSP: 0018:ffff96d5c315bd50 EFLAGS: 00010206
-  RAX: 0000000000000000 RBX: ffff88c4b68c6000 RCX: 0000000000000250
-  RDX: ffffffffa5e47960 RSI: 0000000000000000 RDI: ffff88c490f6ab00
-  RBP: ffff96d5c315bd50 R08: 0000000000001000 R09: 0000000000000005
-  R10: ffff88c4be006b80 R11: ffff88c42f1b8004 R12: ffff96d5c315bf18
-  R13: ffff88c42d7dd200 R14: ffff88c490f6a510 R15: ffff88c4b68c6000
-  FS:  00007f9446f8ea00(0000) GS:ffff88c4be680000(0000) knlGS:0000000000000000
-  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
-  CR2: 0000000000000254 CR3: 00000007f956f000 CR4: 00000000003406e0
-  Call Trace:
-   cgroup_procs_show+0x19/0x30
-   cgroup_seqfile_show+0x4c/0xb0
-   kernfs_seq_show+0x21/0x30
-   seq_read+0x2ec/0x3f0
-   kernfs_fop_read+0x134/0x180
-   __vfs_read+0x37/0x160
-   ? security_file_permission+0x9b/0xc0
-   vfs_read+0x8e/0x130
-   SyS_read+0x55/0xc0
-   entry_SYSCALL_64_fastpath+0x1a/0xa5
-  RIP: 0033:0x7f94455f942d
-  RSP: 002b:00007ffe81ba2d00 EFLAGS: 00000293 ORIG_RAX: 0000000000000000
-  RAX: ffffffffffffffda RBX: 00005574e2233f00 RCX: 00007f94455f942d
-  RDX: 0000000000001000 RSI: 00005574e2321a90 RDI: 000000000000002b
-  RBP: 0000000000000000 R08: 00005574e2321a90 R09: 00005574e231de60
-  R10: 00007f94458c8b38 R11: 0000000000000293 R12: 00007f94458c8ae0
-  R13: 00007ffe81ba3800 R14: 0000000000000000 R15: 00005574e2116560
-  Code: 04 74 0e 89 f6 48 8d 04 76 48 8d 04 c5 f0 05 00 00 48 8b bf b8 05 00 00 48 01 c7 31 c0 48 8b 0f 48 85 c9 74 18 8b b2 30 08 00 00 <3b> 71 04 77 0d 48 c1 e6 05 48 01 f1 48 3b 51 38 74 09 5d c3 8b
-  RIP: __task_pid_nr_ns+0xc7/0xf0 RSP: ffff96d5c315bd50
-
-Fix it by moving the initialization of the cursor below the repeat
-label.  While at it, rename it to @next for readability.
-
-Signed-off-by: Tejun Heo <tj at kernel.org>
-Fixes: bc2fb7ed089f ("cgroup: add @flags to css_task_iter_start() and implement CSS_TASK_ITER_PROCS")
-Cc: stable at vger.kernel.org # v4.14+
-Reported-by: Laura Abbott <labbott at redhat.com>
-Reported-by: Bronek Kozicki <brok at incorrekt.com>
-Reported-by: George Amanakis <gamanakis at gmail.com>
-Signed-off-by: Tejun Heo <tj at kernel.org>
----
- kernel/cgroup/cgroup.c | 14 ++++++--------
- 1 file changed, 6 insertions(+), 8 deletions(-)
-
-diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
-index f4c2f8c..2cf06c2 100644
---- a/kernel/cgroup/cgroup.c
-+++ b/kernel/cgroup/cgroup.c
-@@ -4125,26 +4125,24 @@ static void css_task_iter_advance_css_set(struct css_task_iter *it)
- 
- static void css_task_iter_advance(struct css_task_iter *it)
- {
--	struct list_head *l = it->task_pos;
-+	struct list_head *next;
- 
- 	lockdep_assert_held(&css_set_lock);
--	WARN_ON_ONCE(!l);
--
- repeat:
- 	/*
- 	 * Advance iterator to find next entry.  cset->tasks is consumed
- 	 * first and then ->mg_tasks.  After ->mg_tasks, we move onto the
- 	 * next cset.
- 	 */
--	l = l->next;
-+	next = it->task_pos->next;
- 
--	if (l == it->tasks_head)
--		l = it->mg_tasks_head->next;
-+	if (next == it->tasks_head)
-+		next = it->mg_tasks_head->next;
- 
--	if (l == it->mg_tasks_head)
-+	if (next == it->mg_tasks_head)
- 		css_task_iter_advance_css_set(it);
- 	else
--		it->task_pos = l;
-+		it->task_pos = next;
- 
- 	/* if PROCS, skip over tasks which aren't group leaders */
- 	if ((it->flags & CSS_TASK_ITER_PROCS) && it->task_pos &&

Modified: config.x86_64
===================================================================
--- config.x86_64	2018-01-18 22:25:01 UTC (rev 283997)
+++ config.x86_64	2018-01-18 22:26:14 UTC (rev 283998)
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/x86 4.14.13 Kernel Configuration
+# Linux/x86 4.14.14 Kernel Configuration
 #
 CONFIG_64BIT=y
 CONFIG_X86_64=y
@@ -455,6 +455,7 @@
 CONFIG_X86_X2APIC=y
 CONFIG_X86_MPPARSE=y
 # CONFIG_GOLDFISH is not set
+CONFIG_RETPOLINE=y
 CONFIG_INTEL_RDT=y
 # CONFIG_X86_EXTENDED_PLATFORM is not set
 CONFIG_X86_INTEL_LPSS=y
@@ -1851,6 +1852,7 @@
 CONFIG_SYS_HYPERVISOR=y
 # CONFIG_GENERIC_CPU_DEVICES is not set
 CONFIG_GENERIC_CPU_AUTOPROBE=y
+CONFIG_GENERIC_CPU_VULNERABILITIES=y
 CONFIG_REGMAP=y
 CONFIG_REGMAP_I2C=y
 CONFIG_REGMAP_SPI=y

Deleted: e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch
===================================================================
--- e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch	2018-01-18 22:25:01 UTC (rev 283997)
+++ e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch	2018-01-18 22:26:14 UTC (rev 283998)
@@ -1,73 +0,0 @@
-From c3c1af44db713ac6624e729ea4832d0ce70685e0 Mon Sep 17 00:00:00 2001
-Message-Id: <c3c1af44db713ac6624e729ea4832d0ce70685e0.1513282811.git.jan.steffens at gmail.com>
-From: Benjamin Poirier <bpoirier at suse.com>
-Date: Mon, 11 Dec 2017 16:26:40 +0900
-Subject: [PATCH 1/2] e1000e: Fix e1000_check_for_copper_link_ich8lan return
- value.
-
-e1000e_check_for_copper_link() and e1000_check_for_copper_link_ich8lan()
-are the two functions that may be assigned to mac.ops.check_for_link when
-phy.media_type == e1000_media_type_copper. Commit 19110cfbb34d ("e1000e:
-Separate signaling for link check/link up") changed the meaning of the
-return value of check_for_link for copper media but only adjusted the first
-function. This patch adjusts the second function likewise.
-
-Reported-by: Christian Hesse <list at eworm.de>
-Reported-by: Gabriel C <nix.or.die at gmail.com>
-Link: https://bugzilla.kernel.org/show_bug.cgi?id=198047
-Fixes: 19110cfbb34d ("e1000e: Separate signaling for link check/link up")
-Tested-by: Christian Hesse <list at eworm.de>
-Signed-off-by: Benjamin Poirier <bpoirier at suse.com>
----
- drivers/net/ethernet/intel/e1000e/ich8lan.c | 11 ++++++++---
- 1 file changed, 8 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
-index d6d4ed7acf031172..31277d3bb7dc1241 100644
---- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
-+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
-@@ -1367,22 +1367,25 @@ static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
-  *  Checks to see of the link status of the hardware has changed.  If a
-  *  change in link status has been detected, then we read the PHY registers
-  *  to get the current speed/duplex if link exists.
-+ *
-+ *  Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (link
-+ *  up).
-  **/
- static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
- {
- 	struct e1000_mac_info *mac = &hw->mac;
- 	s32 ret_val, tipg_reg = 0;
- 	u16 emi_addr, emi_val = 0;
- 	bool link;
- 	u16 phy_reg;
- 
- 	/* We only want to go out to the PHY registers to see if Auto-Neg
- 	 * has completed and/or if our link status has changed.  The
- 	 * get_link_status flag is set upon receiving a Link Status
- 	 * Change or Rx Sequence Error interrupt.
- 	 */
- 	if (!mac->get_link_status)
--		return 0;
-+		return 1;
- 
- 	/* First we want to see if the MII Status Register reports
- 	 * link.  If so, then we want to get the current speed/duplex
-@@ -1613,10 +1616,12 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
- 	 * different link partner.
- 	 */
- 	ret_val = e1000e_config_fc_after_link_up(hw);
--	if (ret_val)
-+	if (ret_val) {
- 		e_dbg("Error configuring flow control\n");
-+		return ret_val;
-+	}
- 
--	return ret_val;
-+	return 1;
- }
- 
- static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter)
--- 
-2.15.1
-



More information about the arch-commits mailing list