From patchwork Fri Sep 26 14:00:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 4985251 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 363679FAAF for ; Fri, 26 Sep 2014 14:42:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B0FB2022D for ; Fri, 26 Sep 2014 14:42:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5503B201FE for ; Fri, 26 Sep 2014 14:42:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755175AbaIZOmt (ORCPT ); Fri, 26 Sep 2014 10:42:49 -0400 Received: from cmexedge1.ext.emulex.com ([138.239.224.99]:17113 "EHLO CMEXEDGE1.ext.emulex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755185AbaIZOms (ORCPT ); Fri, 26 Sep 2014 10:42:48 -0400 Received: from CMEXHTCAS1.ad.emulex.com (138.239.115.217) by CMEXEDGE1.ext.emulex.com (138.239.224.99) with Microsoft SMTP Server (TLS) id 14.3.174.1; Fri, 26 Sep 2014 07:42:32 -0700 Received: from neo01-el64.lab.bg.emulex.com (10.192.204.8) by smtp.emulex.com (138.239.115.207) with Microsoft SMTP Server id 14.3.174.1; Fri, 26 Sep 2014 07:42:19 -0700 From: Devesh Sharma To: CC: , , , Devesh Sharma Subject: [PATCH V1] IB/core: memset attr variable to prevent garbage data Date: Fri, 26 Sep 2014 19:30:40 +0530 X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Message-ID: <1303ef19-9e66-4ad0-9788-995faadb05ab@CMEXHTCAS1.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 prevents the same. Fixes: dd5f03beb4f7 ('IB/core: Ethernet L2 attributes in verbs/cm structures') Signed-off-by: Devesh Sharma Signed-off-by: Devesh Sharma --- 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);