From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932150AbdAaCZj (ORCPT ); Mon, 30 Jan 2017 21:25:39 -0500 Received: from casper.infradead.org ([85.118.1.10]:58952 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752551AbdAaCZi (ORCPT ); Mon, 30 Jan 2017 21:25:38 -0500 Date: Tue, 31 Jan 2017 02:25:22 +0000 (GMT) From: James Simmons To: Dan Carpenter cc: Liang Zhen , Amir Shehata , Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin , Linux Kernel Mailing List , Lustre Development List , Doug Oucharek Subject: Re: [PATCH 60/60] staging: lustre: libcfs: fix minimum size check for libcfs ioctl In-Reply-To: <20170130105156.GA6881@mwanda> Message-ID: References: <1485648328-2141-1-git-send-email-jsimmons@infradead.org> <1485648328-2141-61-git-send-email-jsimmons@infradead.org> <20170130105156.GA6881@mwanda> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170131_022522_107184_F5451017 X-CRM114-Status: GOOD ( 15.49 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > It looks like what happened is there were two patches applied out of > sync. Let's add a fixes tag and CC the original author. So the only problem here is the commit message. I will update it then. > Fixes: ed2f549dc0f6 ("staging: lustre: libcfs: test if userland data is to small") > > This patch was probably correct when it was written but commit > 1290932728e5 ("staging: lustre: Dynamic LNet Configuration (DLC) IOCTL > changes") ended up getting applied first so the size was wrong. > > The lstcon_ioctl_entry() function doesn't have enough size checking. This sounds like a separate patch. I will open a ticket about this and your comments below. > 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?