From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751914AbdIEOkr (ORCPT ); Tue, 5 Sep 2017 10:40:47 -0400 Received: from mga07.intel.com ([134.134.136.100]:5437 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751031AbdIEOko (ORCPT ); Tue, 5 Sep 2017 10:40:44 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,480,1498546800"; d="scan'208";a="148324902" Date: Tue, 5 Sep 2017 09:40:41 -0500 From: Chien Tin Tung To: Colin King Cc: Faisal Latif , Doug Ledford , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][V2] RDMA/nes: do not leak uninitialized resp.reserved to userspace Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-ID: <20170905144041.GA13068@ctung-MOBL3.amr.corp.intel.com> References: <20170904133705.3980-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170904133705.3980-1-colin.king@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 04, 2017 at 02:37:05PM +0100, Colin King wrote: > From: Colin Ian King > > resp.reserved has not been initialized and so the copy_to_user (via > ib_copy_to_udata) is copying uninitialized data from the stack back > to user space which is a potential information leak. Fix this by > initializing all of resp to zero. Reserved field is not copied as the length of reserved is subtracted from the size of resp and passed to ib_copy_to_udata. if (ib_copy_to_udata(udata, &resp, sizeof resp - sizeof resp.reserved)) { This patch is not necessary. Chien