From: Alasdair G Kergon Subject: Re: [PATCH] dm ioctl: prevent stack leak in dm ioctl call Date: Wed, 26 Apr 2017 01:42:45 +0100 Message-ID: <20170426004245.GB7433@agk-dp.fab.redhat.com> References: <20170425233129.GA155598@google.com> <20170426001117.GA7433@agk-dp.fab.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Adrian Salido Cc: dm-devel@redhat.com, snitzer@redhat.com, agk@redhat.com List-Id: dm-devel.ids On Tue, Apr 25, 2017 at 05:33:19PM -0700, Adrian Salido wrote: > it's actually the data portion of the struct under a custom user ioctl > where (param_kernel->data_size - minimum_data_size) < > sizeof(param_kernel->data) > Will update the patch to be clear Yes - but before updating the patch, we need to be clearer about the requirements of the ioctl here. Why are two different minimum data sizes used? If we let userspace send a truncated dm_ioctl struct, why are we not returning the same truncated one? Is this the bug? param->data_size = sizeof(*param); Alasdair