From patchwork Fri Nov 18 14:36:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Boyer X-Patchwork-Id: 9436667 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 04B5260237 for ; Fri, 18 Nov 2016 14:47:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2FA329908 for ; Fri, 18 Nov 2016 14:47:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E78DB29909; Fri, 18 Nov 2016 14:47:19 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71B4129911 for ; Fri, 18 Nov 2016 14:47:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753438AbcKROrR (ORCPT ); Fri, 18 Nov 2016 09:47:17 -0500 Received: from esa5.dell-outbound.iphmx.com ([68.232.153.95]:37106 "EHLO esa5.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753050AbcKROrP (ORCPT ); Fri, 18 Nov 2016 09:47:15 -0500 DomainKey-Signature: s=smtpout; d=dell.com; c=simple; q=dns; h=Received:Received:Received:X-DKIM:Received:Received:From: To:Cc:Subject:Date:Message-Id:X-Mailer: X-RSA-Classifications:X-Sentrion-Hostname; b=uIGVlfuk1C4HFkfp24sI+0EmvrI9OCWgrd8/g41u2t5hZzXoEJzLO7IJ TaXe974Eq5ERvc2PixATUz2uHTFVKK/MC7HuZM2E1MorT/OGI9JxMxAuR BB+eLMihfj5i56DgvnW24/tLFhwV4GBPwILEeuy5DYuQ6i2hNUqRnopni E=; DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1479480435; x=1511016435; h=from:to:cc:subject:date:message-id; bh=f2gENvUsvkmzbOdHLGBb4e0jk40nBpUkYh01d7v/PUU=; b=d0g6sY5XpKldbX+obI1bhIcYxcyPz4dhYssZBXaVAFC0xyusINbXzV5t 2Ekel/5YOswN/JUNPQaZC+bhnhBQ3KsXcv8QYYH0B5CvIvPEfnAnMefXd 7wVZnUTtmNpa/spBkkjZLzU/tpcGJSeRGjwRJslx4gGA7NOrJ+qA/2jfK g=; Received: from esa1.dell-outbound2.iphmx.com ([68.232.153.201]) by esa5.dell-outbound.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Nov 2016 08:37:30 -0600 Received: from mailuogwhop.emc.com ([168.159.213.141]) by esa1.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Nov 2016 20:37:29 +0600 Received: from maildlpprd04.lss.emc.com (maildlpprd04.lss.emc.com [10.253.24.36]) by mailuogwprd02.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id uAIEbQrI018148 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 18 Nov 2016 09:37:27 -0500 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd02.lss.emc.com uAIEbQrI018148 Received: from mailapphubprd02.lss.emc.com (emcmail.lss.emc.com [10.253.24.52]) by maildlpprd04.lss.emc.com (RSA Interceptor); Fri, 18 Nov 2016 09:37:05 -0500 Received: from hopcyc-boyera-1.corp.emc.com (hopcyc-boyera-1.cec.lab.emc.com [10.244.91.191]) by mailapphubprd02.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id uAIEbBSq021870; Fri, 18 Nov 2016 09:37:11 -0500 From: Andrew Boyer To: monis@mellanox.com, linux-rdma@vger.kernel.org Cc: Andrew Boyer Subject: [PATCH 1/7] IB/rxe: Allocate enough space for an IPv6 addr Date: Fri, 18 Nov 2016 09:36:43 -0500 Message-Id: <1479479809-10798-1-git-send-email-andrew.boyer@dell.com> X-Mailer: git-send-email 1.8.3.1 X-RSA-Classifications: public X-Sentrion-Hostname: mailuogwprd02.lss.emc.com Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid smashing the stack when an ICRC error occurs on an IPv6 network. Signed-off-by: Andrew Boyer --- drivers/infiniband/sw/rxe/rxe_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c index 46f0628..b40ab8d 100644 --- a/drivers/infiniband/sw/rxe/rxe_recv.c +++ b/drivers/infiniband/sw/rxe/rxe_recv.c @@ -391,7 +391,7 @@ int rxe_rcv(struct sk_buff *skb) payload_size(pkt)); calc_icrc = cpu_to_be32(~calc_icrc); if (unlikely(calc_icrc != pack_icrc)) { - char saddr[sizeof(struct in6_addr)]; + char saddr[64]; if (skb->protocol == htons(ETH_P_IPV6)) sprintf(saddr, "%pI6", &ipv6_hdr(skb)->saddr);