Received: by 10.223.185.111 with SMTP id b44csp908857wrg; Fri, 9 Mar 2018 16:35:30 -0800 (PST) X-Google-Smtp-Source: AG47ELvRzCg2Nx4dTU/R9K4T0n0On/Tlf+TNvafKFApQrxbDtvB2ibsFWNXIagpodsnXwuhI+IY4 X-Received: by 10.98.162.26 with SMTP id m26mr320224pff.217.1520642130049; Fri, 09 Mar 2018 16:35:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520642130; cv=none; d=google.com; s=arc-20160816; b=ZLRgxgtamTQz8UXT6AUF8q1XND5Gq7bMnjOxkc6uDAZMi4YzlPR0R8aaTlNrlO6SEf w5R4lhXHsizarxU+dAU55h7p6VfP6EpwBqf1D3duQug2J62LJXJqQzB1JkZThJZk0mIq QeJMHA7RnJIcEKuQ5W2Vz/bOvGYo2vzlTY/HFIyvniXKgwo+8FPn/F+RIGh6KWXVJ4AM pKEG18W1hAFM6am/iGEvorqBQnZQiA1KytDoR3Xc66usMu5rCkVPIQ2Yy87QVDs5CmNK NChjM7NJoXT2FY7WTI7HWtQ3O3FsMuizbH2is379lcWY5rdqCNvOnn1XgRkKrdKlWeZH TLFw== 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=2XUXyGXYFlXujtH0RE/lWs5RHKsv1biPl/tYP0iScfo=; b=oAUXfIPIDyaq4+LktI+yRRAh9SCsc2iu1hP8s3jWtPN8tvVAG7uAM4zuRUGjdqLXjn Um5knyfr9YumrgR/JKrAwxDbyBQw/q7E4DJxMaI1B8sOjevW68BOqrxpQKPeMxdy/4FY WSmgWZnDL2QWPTBVlPBkDUN1GRr7ZkROM5GqxlGZYLQA9M40TanvHyEYsm7S00N1BekF 8JVgH61CublR+RHnuODlCYYFGLgUyVX4aMry1YOgKrhAEnOiPDA2VBvui8bAxAexotSJ RnEcn+o2/hNav6ekVryOi3UwbyDOu4m7kqb1R3QoY1JEoBa/s7cgRHagiXiS4GDB2+iV X6og== 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 13-v6si1749835ple.157.2018.03.09.16.35.15; Fri, 09 Mar 2018 16:35:30 -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 S933815AbeCJAdR (ORCPT + 99 others); Fri, 9 Mar 2018 19:33:17 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39990 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751906AbeCJAWY (ORCPT ); Fri, 9 Mar 2018 19:22:24 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6ADFAFE0; Sat, 10 Mar 2018 00:22:23 +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.9 49/65] s390/qeth: fix underestimated count of buffer elements Date: Fri, 9 Mar 2018 16:18:49 -0800 Message-Id: <20180310001828.887685873@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180310001824.927996722@linuxfoundation.org> References: <20180310001824.927996722@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.9-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 @@ -849,7 +849,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)