From patchwork Tue Sep 25 03:37:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 10613281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BCE414BD for ; Tue, 25 Sep 2018 03:37:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2566D29FFD for ; Tue, 25 Sep 2018 03:37:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17B3F2A012; Tue, 25 Sep 2018 03:37:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C874C29FFD for ; Tue, 25 Sep 2018 03:37:41 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 60F7021F84F; Mon, 24 Sep 2018 20:37:40 -0700 (PDT) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 1FB7721F80F for ; Mon, 24 Sep 2018 20:37:39 -0700 (PDT) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id C9BA1100674D; Mon, 24 Sep 2018 23:37:37 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id C4B002A1; Mon, 24 Sep 2018 23:37:37 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Mon, 24 Sep 2018 23:37:30 -0400 Message-Id: <1537846650-8490-1-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 Subject: [lustre-devel] [PATCH] lustre: lnet: copy the correct amountof cpts to lnet_cpts X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" X-Virus-Scanned: ClamAV using ClamSMTP The incorrect size was used in the memory copy of the requested cpts to net->lnet_cpts. This lead to the following in testing RIP: 0010:lnet_match2mt.isra.8+0x2b/0x40 [lnet] lnet_mt_of_attach+0x72/0x1b0 [lnet] LNetMEAttach+0x60/0x1f0 [lnet] ptl_send_rpc+0x26f/0xbb0 [ptlrpc] libcfs_debug_msg+0x57/0x80 [libcfs] ptlrpc_send_new_req+0x4c9/0x860 [ptlrpc] ptlrpc_check_set.part.21+0x855/0x18b0 [ptlrpc] ? try_to_del_timer_sync+0x4d/0x80 ? del_timer_sync+0x35/0x40 ptlrpcd_check+0x3ae/0x3f0 [ptlrpc] ptlrpcd+0x2be/0x320 [ptlrpc] ? wait_woken+0x80/0x80 Changing the size from ncpts to ncpts * sizeof(*net->net_cpts) Signed-off-by: James Simmons WC-bug-id: https://jira.whamcloud.com/browse/LU-11424 Reviewed-on: https://review.whamcloud.com/33229 --- drivers/staging/lustre/lnet/lnet/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index c11821a..4c22416 100644 --- a/drivers/staging/lustre/lnet/lnet/config.c +++ b/drivers/staging/lustre/lnet/lnet/config.c @@ -174,7 +174,7 @@ struct lnet_text_buf { /* tmp struct for parsing routes */ GFP_KERNEL); if (!net->net_cpts) return -ENOMEM; - memcpy(net->net_cpts, cpts, ncpts); + memcpy(net->net_cpts, cpts, ncpts * sizeof(*net->net_cpts)); net->net_ncpts = ncpts; return 0; }