diff options
-rw-r--r-- | CVE-2017-17741-KVM-Fix-stack-out-of-bounds-read-in-write_mmio.patch | 161 | ||||
-rw-r--r-- | PKGBUILD | 21 | ||||
-rw-r--r-- | cgroup-fix-css_task_iter-crash-on-CSS_TASK_ITER_PROC.patch | 132 | ||||
-rw-r--r-- | config.x86_64 | 2 | ||||
-rw-r--r-- | e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch | 73 |
5 files changed, 7 insertions, 382 deletions
diff --git a/CVE-2017-17741-KVM-Fix-stack-out-of-bounds-read-in-write_mmio.patch b/CVE-2017-17741-KVM-Fix-stack-out-of-bounds-read-in-write_mmio.patch deleted file mode 100644 index 3718243..0000000 --- a/CVE-2017-17741-KVM-Fix-stack-out-of-bounds-read-in-write_mmio.patch +++ /dev/null @@ -1,161 +0,0 @@ -From e39d200fa5bf5b94a0948db0dae44c1b73b84a56 Mon Sep 17 00:00:00 2001 -From: Wanpeng Li <wanpeng.li@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@google.com> -Reviewed-by: Darren Kenny <darren.kenny@oracle.com> -Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> -Tested-by: Marc Zyngier <marc.zyngier@arm.com> -Cc: Paolo Bonzini <pbonzini@redhat.com> -Cc: Radim Krčmář <rkrcmar@redhat.com> -Cc: Marc Zyngier <marc.zyngier@arm.com> -Cc: Christoffer Dall <christoffer.dall@linaro.org> -Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com> -Signed-off-by: Paolo Bonzini <pbonzini@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 - @@ -5,7 +5,7 @@ pkgbase=linux-libre-hardened _majver=4.14 -_minver=13 +_minver=14 _fullver=${_majver}.${_minver} _basever=${_majver}-gnu _pkgver=${_fullver}-gnu @@ -26,38 +26,30 @@ source=(https://linux-libre.fsfla.org/pub/linux-libre/releases/${_basever}/linux 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 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 ) sha256sums=('70f0098d823472402619a053211532423d15bfef628de7f49616014c81658278' 'SKIP' - '3d1ab381d7c0ff298cce8785c90d9ed2da4788d0dfe56659303119f291c793b0' + '018b03f8ce45005c408c25631214c3879d880820956af0cc4658932bc4292087' 'SKIP' - '6b12f95c7eecfc3629fe94079f5a82d509a31621f689503dd91225c730ed0371' + '0ee89f7c93da3708047467041d4fed7f2f19e07d2a46c3184f61d8ba5d36a80a' 'SKIP' - '705ceb98f0ea2e22be30087ac28cf65d2b66d33ca0190cb4e53d3ff806902150' + 'a059fdf35987ec422940dc50e55eb64621699b63cb0d7db5851813de99208fdd' 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919' 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65' - 'c6e7db7dfd6a07e1fd0e20c3a5f0f315f9c2a366fe42214918b756f9a1c9bfa3' '294c928b8252112d621df1d13fbfeade13f28ddea034d44e89db41b66d2b7d45' - '721c387db986d883a6df6b0da17941ce6d59811b0647ae6653b978c5ee144f19' 'c08d12c699398ef88b764be1837b9ee11f2efd3188bd1bf4e8f85dfbeee58148' '6be803c62b7ce41f1b4de6c867715398812b1c1a3e68a0078512f2872e2a3fa9' 'b833ad4354fcd2cc6ee60c971088f77aa5b06a58fce346c40268c0b05b1e8cb5' - '72efa781c8ee1175a8865e6a12568aaf3bac4b76d4285819c6a75a3e5fe41435' - 'ee125179fdd295266aba52e1aebaef97cb41f4a05d9cd1c2b11b4ce83746e197') + '72efa781c8ee1175a8865e6a12568aaf3bac4b76d4285819c6a75a3e5fe41435') validpgpkeys=( '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva '65EEFE022108E2B708CBFCF7F9E712E59AF5F22A' # Daniel Micay @@ -74,13 +66,10 @@ prepare() { chmod +x tools/objtool/sync-check.sh # Hotfixes - patch -p1 -i "${srcdir}/cgroup-fix-css_task_iter-crash-on-CSS_TASK_ITER_PROC.patch" patch -p1 -i "${srcdir}/CVE-2017-8824-dccp-use-after-free-in-DCCP-code.patch" patch -p1 -i "${srcdir}/CVE-2017-17448-netfilter-nfnetlink_cthelper-Add-missing-permission-checks.patch" patch -p1 -i "${srcdir}/CVE-2017-17450-netfilter-xt_osf-Add-missing-permission-checks.patch" - patch -p1 -i "${srcdir}/CVE-2017-17741-KVM-Fix-stack-out-of-bounds-read-in-write_mmio.patch" patch -p1 -i "${srcdir}/drm-i915-edp-Only-use-the-alternate-fixed-mode-if-its-asked-for.patch" - patch -p1 -i "${srcdir}/e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch" patch -p1 -i "${srcdir}/xfrm-Fix-stack-out-of-bounds-read-on-socket-policy-lookup.patch" # linux hardened patch diff --git a/cgroup-fix-css_task_iter-crash-on-CSS_TASK_ITER_PROC.patch b/cgroup-fix-css_task_iter-crash-on-CSS_TASK_ITER_PROC.patch deleted file mode 100644 index fc84559..0000000 --- a/cgroup-fix-css_task_iter-crash-on-CSS_TASK_ITER_PROC.patch +++ /dev/null @@ -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@kernel.org> -X-Patchwork-Id: 10125801 -Message-Id: <20171220151331.GA3413940@devbig577.frc2.facebook.com> -To: Laura Abbott <labbott@redhat.com> -Cc: Zefan Li <lizefan@huawei.com>, linux-kernel@vger.kernel.org, - cgroups@vger.kernel.org, regressions@leemhuis.info, - Bronek Kozicki <brok@incorrekt.com>, George Amanakis <gamanakis@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@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@kernel.org> -Fixes: bc2fb7ed089f ("cgroup: add @flags to css_task_iter_start() and implement CSS_TASK_ITER_PROCS") -Cc: stable@vger.kernel.org # v4.14+ -Reported-by: Laura Abbott <labbott@redhat.com> -Reported-by: Bronek Kozicki <brok@incorrekt.com> -Reported-by: George Amanakis <gamanakis@gmail.com> -Signed-off-by: Tejun Heo <tj@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 && diff --git a/config.x86_64 b/config.x86_64 index bf7ec87..b470c61 100644 --- a/config.x86_64 +++ b/config.x86_64 @@ -455,6 +455,7 @@ CONFIG_X86_FAST_FEATURE_TESTS=y 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_DEV_COREDUMP=y 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 diff --git a/e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch b/e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch deleted file mode 100644 index 7e3ecbd..0000000 --- a/e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch +++ /dev/null @@ -1,73 +0,0 @@ -From c3c1af44db713ac6624e729ea4832d0ce70685e0 Mon Sep 17 00:00:00 2001 -Message-Id: <c3c1af44db713ac6624e729ea4832d0ce70685e0.1513282811.git.jan.steffens@gmail.com> -From: Benjamin Poirier <bpoirier@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@eworm.de> -Reported-by: Gabriel C <nix.or.die@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@eworm.de> -Signed-off-by: Benjamin Poirier <bpoirier@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 - |