From patchwork Fri Sep 26 10:19: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: 4981741 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 778489F2BB for ; Fri, 26 Sep 2014 11:01:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 969C4201B4 for ; Fri, 26 Sep 2014 11:01:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1467E20149 for ; Fri, 26 Sep 2014 11:01:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754161AbaIZLBm (ORCPT ); Fri, 26 Sep 2014 07:01:42 -0400 Received: from cmexedge1.ext.emulex.com ([138.239.224.99]:14881 "EHLO CMEXEDGE1.ext.emulex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753890AbaIZLBl (ORCPT ); Fri, 26 Sep 2014 07:01:41 -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 04:01:19 -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 04:01:07 -0700 From: Devesh Sharma To: CC: Devesh Sharma Subject: [PATCH] IB/core: memset attr variable to prevent garbage data Date: Fri, 26 Sep 2014 15:49:40 +0530 X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Message-ID: <45be0302-ea5d-4f35-892a-47617edd27ec@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. Signed-off-by: Devesh Sharma --- drivers/infiniband/core/uverbs_cmd.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 0600c50..0b1ce71 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -2508,6 +2508,7 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file, goto err; } + memset(&attr, 0, sizeof(attr)); attr.dlid = cmd.attr.dlid; attr.sl = cmd.attr.sl; attr.src_path_bits = cmd.attr.src_path_bits;