From patchwork Sun Nov 14 09:22:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasiliy Kulikov X-Patchwork-Id: 323152 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAE9N60F006189 for ; Sun, 14 Nov 2010 09:23:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754612Ab0KNJXF (ORCPT ); Sun, 14 Nov 2010 04:23:05 -0500 Received: from mail-ey0-f174.google.com ([209.85.215.174]:55345 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754260Ab0KNJW6 (ORCPT ); Sun, 14 Nov 2010 04:22:58 -0500 Received: by eye27 with SMTP id 27so2558778eye.19 for ; Sun, 14 Nov 2010 01:22:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=QCaUb3T1wUZV0PpZXWtDTz6GGZN7Ls0iSuMPBOVOaJk=; b=gbMIeiO52dKHfrqNfN9QLwkoS/ovhZyEzq78ptpwqLtyTUG9aUyO4a1DR3HeRTOpKc etaEvsueuVm4y1oZI9uFW7YZjda2vjaRz46JrW/6ZWAyHgbjHqvShEPoHca17eEdyUvx t6DuFbqfnBR2uTsPc+Lx+JKT2F/8feEy/UvWE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=BfOn6y0gNaIHFLeuj2DYGBXAuV8FBBJW83yPdyUtlUHRf5KhMyOHukOstCFzrigxDB DZuwy8j9/TKwoxsuf2S/7ePg10yGluEkmzoFM17qYoJVVYW2lkNd14qbgSCoYGtDmp1B kAdal/rRc//ftVqHlutWw40HwJVufS68MZI3E= Received: by 10.213.17.135 with SMTP id s7mr3749560eba.21.1289726577067; Sun, 14 Nov 2010 01:22:57 -0800 (PST) Received: from localhost (ppp85-140-234-48.pppoe.mtu-net.ru [85.140.234.48]) by mx.google.com with ESMTPS id v56sm5281706eeh.2.2010.11.14.01.22.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 14 Nov 2010 01:22:55 -0800 (PST) Date: Sun, 14 Nov 2010 12:22:52 +0300 From: Vasiliy Kulikov To: "Hefty, Sean" Cc: Roland Dreier , "kernel-janitors@vger.kernel.org" , Roland Dreier , Hal Rosenstock , Alex Chiang , Andi Kleen , Greg Kroah-Hartman , Julia Lawall , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH v2] infiniband: core: fix information leak to userspace Message-ID: <20101114092252.GA5323@albatros> References: <1289054481-18145-1-git-send-email-segooon@gmail.com> <20101112180844.GA11533@albatros> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 14 Nov 2010 09:23:07 +0000 (UTC) diff --git a/drivers/infiniband/core/uverbs_marshall.c b/drivers/infiniband/core/uverbs_marshall.c index 5440da0..1b1146f 100644 --- a/drivers/infiniband/core/uverbs_marshall.c +++ b/drivers/infiniband/core/uverbs_marshall.c @@ -40,18 +40,21 @@ void ib_copy_ah_attr_to_user(struct ib_uverbs_ah_attr *dst, dst->grh.sgid_index = src->grh.sgid_index; dst->grh.hop_limit = src->grh.hop_limit; dst->grh.traffic_class = src->grh.traffic_class; + memset(&dst->grh.reserved, 0, sizeof(dst->grh.reserved)); dst->dlid = src->dlid; dst->sl = src->sl; dst->src_path_bits = src->src_path_bits; dst->static_rate = src->static_rate; dst->is_global = src->ah_flags & IB_AH_GRH ? 1 : 0; dst->port_num = src->port_num; + dst->reserved = 0; } EXPORT_SYMBOL(ib_copy_ah_attr_to_user); void ib_copy_qp_attr_to_user(struct ib_uverbs_qp_attr *dst, struct ib_qp_attr *src) { + dst->qp_state = src->qp_state; dst->cur_qp_state = src->cur_qp_state; dst->path_mtu = src->path_mtu; dst->path_mig_state = src->path_mig_state; @@ -83,6 +86,7 @@ void ib_copy_qp_attr_to_user(struct ib_uverbs_qp_attr *dst, dst->rnr_retry = src->rnr_retry; dst->alt_port_num = src->alt_port_num; dst->alt_timeout = src->alt_timeout; + memset(dst->reserved, 0, sizeof(dst->reserved)); } EXPORT_SYMBOL(ib_copy_qp_attr_to_user);