From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752801AbdBAQjT (ORCPT ); Wed, 1 Feb 2017 11:39:19 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38952 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750950AbdBAQjS (ORCPT ); Wed, 1 Feb 2017 11:39:18 -0500 Date: Wed, 1 Feb 2017 17:39:21 +0100 From: Greg Kroah-Hartman To: Olaf Weber Cc: James Simmons , Dan Carpenter , devel@driverdev.osuosl.org, Linux Kernel Mailing List , Oleg Drokin , Amir Shehata , Lustre Development List Subject: Re: [lustre-devel] [PATCH 60/60] staging: lustre: libcfs: fix minimum size check for libcfs ioctl Message-ID: <20170201163921.GA25524@kroah.com> References: <1485648328-2141-1-git-send-email-jsimmons@infradead.org> <1485648328-2141-61-git-send-email-jsimmons@infradead.org> <20170130105156.GA6881@mwanda> <57e8b9b1-e1c8-a5df-e34d-7124671c6888@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57e8b9b1-e1c8-a5df-e34d-7124671c6888@sgi.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 01, 2017 at 02:32:13PM +0100, Olaf Weber wrote: > On 31-01-17 03:25, James Simmons wrote: > > [...] > > > > Also I'm uncomfortable with: > > > > > > data = container_of(hdr, struct libcfs_ioctl_data, ioc_hdr); > > > > > > If hdr isn't the first member of the struct then the code is broken but > > > container_of() implies that that isn't a hard requirement. It should > > > just be: > > > > > > data = (struct libcfs_ioctl_data *)hdr; > > > > Don't know if hdr being first is a hard requirment. Doug, Amir do you know > > if it is an requirement? > > It's a requirement. That's horrid. Use container_of to be "safe" here please...