From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amit Shah Subject: Re: [PATCH 05/10] virtio: console: update private_data in struct file only on successful open Date: Tue, 23 Jul 2013 13:48:19 +0530 Message-ID: <20130723081819.GB25551@amit-x200.redhat.com> References: <87ip03b1e7.fsf@rustcorp.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <87ip03b1e7.fsf@rustcorp.com.au> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Rusty Russell Cc: stable@vger.kernel.org, Virtualization List List-Id: virtualization@lists.linuxfoundation.org On (Mon) 22 Jul 2013 [15:07:52], Rusty Russell wrote: > Amit Shah writes: > > Mateusz Guzik points out that we update the 'file' struct's private_data > > field before we've successfully done all our checks. This means we can > > return an error with the private_data field updated. This could lead to > > problems. > > > > Fix by moving the assignment after all checks are done. > > No, this is a bit weird, but it's fine. > > If we fail open, filp will be destroyed; we won't be told about it, and > private_data will never be accessed. Thanks! Will drop this. Amit