Received: by 10.223.185.116 with SMTP id b49csp5441064wrg; Wed, 7 Mar 2018 11:48:29 -0800 (PST) X-Google-Smtp-Source: AG47ELv2zP+p+p8zVmLF4HrcR43/YdxpUGJyz3Y72i1wq2O/2R0aX41liw3ZXxUUswXgZfWTU+FQ X-Received: by 10.98.18.143 with SMTP id 15mr23988134pfs.104.1520452109589; Wed, 07 Mar 2018 11:48:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520452109; cv=none; d=google.com; s=arc-20160816; b=QlZCIX16o6XTG+ko3MU7jOpWeW0KZV2nQ/aHEVLcbo4uk+e7M0LwyEn/25kE04G+H+ FbA9KAgGEG4dFzffcWWN95aKHg6Cf1Th0lvdstUYs8GxPIR7CtPZ/VAxXxyL/18nvhgy +8fktji4B4P4FPu6U/zb5i/Qdz/ZQGJuhlP6hRiR9jW4dIE1x4DVJfWmA1eFuxvjTqsq Fp+CjH7hl/4R//o5BIZaBIJPlOQ/u4d1vT+FQu8bgIlZbtTZzNtvNF2k0vCBcSjiPBnD v1nsYBDObO3G0dtbu30oGWCrbR8toNG4IHW9W6A3pK3FOBRy8ffV/FP0MWSynA1h3vy4 gJVw== 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=rehVNyzVcPSGrOUWrztU300cWBUh8toLdmIb6XoMjWA=; b=vAB1Nze7UNog0GpNmBF1YR5E7aBgizp5l3oLez0ybkqWD2m7nNARfYW/Kilexl+hAz u5XQugr4aSHx3Cveke7+zoXUi6glOrL3WmPpVBOomjRIkCba+pyshpc/3Ip+x3UrB2/L kVnWbNOR6Uy7lfHrj19MnXisf4UGPSPz2KhfHBN+YUN70k0F4qr7CxRDqqnB9Epc34RN OrhIMyj7f445wmmzgqoz6ZekOx2g//+xXQXBDB8J1w8tKj8UgFQcpUdfii+D53tz4wkI Y2liG6eryHK4plZUknVRykPIMNy19Rk+vGRSoUOCJ9giPwzxANqdTjvGfEmdhnS3/pqH W06g== 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 f31-v6si13405810plb.636.2018.03.07.11.48.14; Wed, 07 Mar 2018 11:48:29 -0800 (PST) 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 S965661AbeCGTrB (ORCPT + 99 others); Wed, 7 Mar 2018 14:47:01 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44842 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965642AbeCGTq7 (ORCPT ); Wed, 7 Mar 2018 14:46:59 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C2DC410DA; Wed, 7 Mar 2018 19:46:58 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ursula Braun , Julian Wiedmann , "David S. Miller" Subject: [PATCH 4.14 075/110] s390/qeth: fix underestimated count of buffer elements Date: Wed, 7 Mar 2018 11:38:58 -0800 Message-Id: <20180307191049.269265984@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191039.748351103@linuxfoundation.org> References: <20180307191039.748351103@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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ursula Braun [ Upstream commit 89271c65edd599207dd982007900506283c90ae3 ] For a memory range/skb where the last byte falls onto a page boundary (ie. 'end' is of the form xxx...xxx001), the PFN_UP() part of the calculation currently doesn't round up to the next PFN due to an off-by-one error. Thus qeth believes that the skb occupies one page less than it actually does, and may select a IO buffer that doesn't have enough spare buffer elements to fit all of the skb's data. HW detects this as a malformed buffer descriptor, and raises an exception which then triggers device recovery. Fixes: 2863c61334aa ("qeth: refactor calculation of SBALE count") Signed-off-by: Ursula Braun Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/s390/net/qeth_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h @@ -834,7 +834,7 @@ struct qeth_trap_id { */ static inline int qeth_get_elements_for_range(addr_t start, addr_t end) { - return PFN_UP(end - 1) - PFN_DOWN(start); + return PFN_UP(end) - PFN_DOWN(start); } static inline int qeth_get_micros(void)