From patchwork Fri Sep 26 15:15:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 4986341 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5C7879FAAF for ; Fri, 26 Sep 2014 15:57:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8CAC6201FE for ; Fri, 26 Sep 2014 15:57:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 29F7A20166 for ; Fri, 26 Sep 2014 15:57:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755608AbaIZP5a (ORCPT ); Fri, 26 Sep 2014 11:57:30 -0400 Received: from cmexedge2.ext.emulex.com ([138.239.224.100]:18208 "EHLO CMEXEDGE2.ext.emulex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755292AbaIZP5a (ORCPT ); Fri, 26 Sep 2014 11:57:30 -0400 Received: from CMEXHTCAS2.ad.emulex.com (138.239.115.218) by CMEXEDGE2.ext.emulex.com (138.239.224.100) with Microsoft SMTP Server (TLS) id 14.3.174.1; Fri, 26 Sep 2014 08:57:03 -0700 Received: from neo01-el64.lab.bg.emulex.com (10.192.204.8) by smtp.emulex.com (138.239.115.208) with Microsoft SMTP Server id 14.3.174.1; Fri, 26 Sep 2014 08:56:56 -0700 From: Devesh Sharma To: CC: Devesh Sharma , Matan Barak , Or Gerlitz , Yann Droneaud Subject: [PATCH V2] IB/core: memset attr variable to prevent garbage data Date: Fri, 26 Sep 2014 20:45:32 +0530 X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Message-ID: <324c3cc3-3b26-42d1-880f-60484698d68f@CMEXHTCAS2.ad.emulex.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP During create-ah from user land, uverbs is sending garbage data in attr.dmac and attr.vlan_id. This patch memset attr.dmac and attr.vlan_id to zero. Fixes: dd5f03beb4f7 ('IB/core: Ethernet L2 attributes in verbs/cm structures') Signed-off-by: Devesh Sharma Cc: Matan Barak Cc: Or Gerlitz Cc: Yann Droneaud --- drivers/infiniband/core/uverbs_cmd.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 0600c50..5ba2a86 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -2518,6 +2518,8 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file, attr.grh.sgid_index = cmd.attr.grh.sgid_index; attr.grh.hop_limit = cmd.attr.grh.hop_limit; attr.grh.traffic_class = cmd.attr.grh.traffic_class; + attr.vlan_id = 0; + memset(&attr.dmac, 0, sizeof(attr.dmac)); memcpy(attr.grh.dgid.raw, cmd.attr.grh.dgid, 16); ah = ib_create_ah(pd, &attr);