Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3915794imm; Mon, 8 Oct 2018 11:37:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV62qkxCwJKXsYEORd5uZOGVa3/Mdl+aBEPPUrbSGozaWYVgAKm8qeLu7++7SxAR+1nwkZZad X-Received: by 2002:a63:6746:: with SMTP id b67-v6mr22514734pgc.310.1539023869535; Mon, 08 Oct 2018 11:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539023869; cv=none; d=google.com; s=arc-20160816; b=BYZ1iIZ6EITMYmy+WPG1trRei7wKq7LLjYVyO02v5z6AVp+N3MBneip4oyZOx6jFoc wV1KDTaqFpDmecZDZRihAZv7EXWeocFfbyWYuLxu1aNsF9kW5M90eLA9QNfaLeeurO4V rGJlE81JC5GECp9QLZa1I+Xmxsjyo6MoUuB87tgOdHxITBU/5pPSc5o0ylBdCZDOU6VN BF9WCNnnbTIPrwiy/2Gaw57lBuELbwtbbIGEgkI7qLz5HOT4s7S+4qcl3Z65KcM/4tT0 +WTgWAXbWHWkaVHxmzmZr9CSWz24PJu90RQoe40DQbjeqONLUaG0uBJwwY+GSsdLmBSB GzjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4+mBKSSyZ9NHsXoC5LtUuSHtaMeRqE0+iFjCD0/P0jQ=; b=uGQ+xKcp1TacXuNoPSlcbHjN9nyUgJTcPTI5PkyUqhHsHZ/unbWq6+EKklHTLqUnfm LAR4Q+fhe6TGAyljfh2jlo61h9yJejE9ZNHqw0YpVVfiPGN2suzzz+jSjyai5/RwlBVm u3q4BU/W3cO+iZQgIlH7y/3vPYRJ458RNtVzwEzCFsUqZHD8ft0rpJGUYqxri9vVgOGv 7wbikczY89b1ERFBSIoz/2eAKcZzXA1hFM0xqU2Busu0gbuUHjFo4o4+UX+1T/Q2DQHd NU/BE3wX5ziwM+MIngHMadf5Q47Noo8J68D5gFeEd1KHo26fCoRmEqAH+VP/dceNAOxz es7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rL5nzwWU; 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 y34-v6si19121879plb.46.2018.10.08.11.37.34; Mon, 08 Oct 2018 11:37:49 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=rL5nzwWU; 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 S1728273AbeJIBsd (ORCPT + 99 others); Mon, 8 Oct 2018 21:48:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:60870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726522AbeJIBsc (ORCPT ); Mon, 8 Oct 2018 21:48:32 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1579D2089D; Mon, 8 Oct 2018 18:35:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539023729; bh=PE583mAPgUmFfdfUi6i94ryENIyZHNGafAfjOhYh+28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rL5nzwWUM4KSo9jIEO8JJQTKqNLhdli4vHieVRh7Dy3n8IGGP+cLZsIHImgfAYoNf kn0KwFWN3MdUJZ0+jsPlym+Ndadju4f/1NxQCVXFD7GzB0BTBIDJ1YXz+FCQtEEaQY rMvvBuNxw0Vl+fmALBBsdpTB7uYKz86GraHqN01U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Huazhong Tan , Salil Mehta , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 065/113] net: hns: fix length and page_offset overflow when CONFIG_ARM64_64K_PAGES Date: Mon, 8 Oct 2018 20:31:06 +0200 Message-Id: <20181008175534.530438770@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175530.864641368@linuxfoundation.org> References: <20181008175530.864641368@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Huazhong Tan [ Upstream commit 3ed614dce3ca9912d22be215ff0f11104b69fe62 ] When enable the config item "CONFIG_ARM64_64K_PAGES", the size of PAGE_SIZE is 65536(64K). But the type of length and page_offset are u16, they will overflow. So change them to u32. Fixes: 6fe6611ff275 ("net: add Hisilicon Network Subsystem hnae framework support") Signed-off-by: Huazhong Tan Signed-off-by: Salil Mehta Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/hisilicon/hns/hnae.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/hisilicon/hns/hnae.h +++ b/drivers/net/ethernet/hisilicon/hns/hnae.h @@ -171,10 +171,10 @@ struct hnae_desc_cb { /* priv data for the desc, e.g. skb when use with ip stack*/ void *priv; - u16 page_offset; - u16 reuse_flag; + u32 page_offset; + u32 length; /* length of the buffer */ - u16 length; /* length of the buffer */ + u16 reuse_flag; /* desc type, used by the ring user to mark the type of the priv data */ u16 type;