From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756560AbbDKAcI (ORCPT ); Fri, 10 Apr 2015 20:32:08 -0400 Received: from ozlabs.org ([103.22.144.67]:49566 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753337AbbDKAbi (ORCPT ); Fri, 10 Apr 2015 20:31:38 -0400 From: Rusty Russell To: Greg KH , Tom Van Braeckel Cc: lguest@lists.ozlabs.org, linux-kernel@vger.kernel.org, fengguang.wu@intel.com, lkp@01.org Subject: Re: [PATCH] lguest: explicitly setup /dev/lguest private_data In-Reply-To: <20150407083616.GA14409@kroah.com> References: <20150406121022.GA3867@wfg-t540p.sh.intel.com> <1428394698-16938-1-git-send-email-tomvanbraeckel@gmail.com> <20150407083616.GA14409@kroah.com> User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Fri, 10 Apr 2015 12:58:35 +0930 Message-ID: <87r3rszmos.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Greg KH writes: > On Tue, Apr 07, 2015 at 10:18:18AM +0200, Tom Van Braeckel wrote: >> The private_data member of the /dev/lguest device file is used to hold >> the current struct lguest and needs to be set to NULL to signify that >> no initialization has taken place. >> >> We explicitly set it to NULL to be independent of whatever value the >> misc subsystem initializes it to. >> >> Signed-off-by: Tom Van Braeckel >> --- >> Backstory: >> ========== >> The misc subsystem used to initialize a file's private_data to point to >> the misc device when a driver had registered a custom open file >> operation and initialized it to NULL when a custom open file operation >> had *not* been provided. >> >> This subtle quirk was confusing, to the point where kernel code >> registered *empty* file open operations to have private_data point to >> the misc device structure. >> >> And it lead to bugs, where the addition or removal of a custom open >> file operation surprisingly changed the initial contents of a file's >> private_data structure. >> >> The misc subsystem is currently underdoing changes to *always* set >> private_data to point to the misc device instead of only doing this >> when a custom open file operation has been registered. >> >> Intel's 0day kernel testing robot discovered that the lguest driver >> depended on it implicitly being initialized to NULL, as Fengguang Wu >> reported. Thanks a lot for all the hard work! >> >> drivers/lguest/lguest_user.c | 14 +++++++++++++- >> 1 file changed, 13 insertions(+), 1 deletion(-) > > I can take this through my char-misc tree, where this misc core change > was, if the lguest maintainer (i.e. Rusty) acks it. Acked-by: Rusty Russell Cheers, Rusty.