From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755006Ab0INTqv (ORCPT ); Tue, 14 Sep 2010 15:46:51 -0400 Received: from thunk.org ([69.25.196.29]:60339 "EHLO thunker.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754423Ab0INTqt (ORCPT ); Tue, 14 Sep 2010 15:46:49 -0400 Date: Tue, 14 Sep 2010 15:46:41 -0400 From: "Ted Ts'o" To: Sergey Senozhatsky Cc: Andreas Dilger , Jan Kara , Eric Sandeen , Christoph Hellwig , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: NULL pointer dereference in print_daily_error_info Message-ID: <20100914194641.GB3730@thunk.org> Mail-Followup-To: Ted Ts'o , Sergey Senozhatsky , Andreas Dilger , Jan Kara , Eric Sandeen , Christoph Hellwig , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org References: <20100914125102.GA5318@swordfish.minsk.epam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100914125102.GA5318@swordfish.minsk.epam.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on thunker.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 14, 2010 at 03:51:02PM +0300, Sergey Senozhatsky wrote: > Hello, > > This patch fixes NULL pointer dereference in print_daily_error_info, when > called > on unmounted fs (EXT4_SB(sb) returns NULL). Deleting error reporting timer > in > ext4_put_super fixes oops. Good catch! Thanks for the patch. I will include this into ext4 tree, and I will probably push it separately to Linus so that it gets into 2.6.36, since this is a regresssion. You didn't add a Signed-off-by: line, which is needed for Developer's Certification of Origin (see section 1, subsection 16 of Documentation/SubmittingPatches in the Linux source tree). Can you send confirmation that it's OK for me to add a Signed-off-by line for you? Thanks!! > By the way, isn't print_daily_error_info racy? Is it safe to call > print_daily_error_info > (by timer event (softirq)) when we'are remounting fs, etc.? It should be fine. Remounting doesn't actually change out the struct superblock. There is a chance that the information might not be fully complete if an error is printed exactly as the same time as print_daily_error_info() is run, but I'm not sure it's worth trying to protect against that race, since the worst that this will mean is a confusing report in the /var/log/messages file, and the ext4 error message will be printed right next to it, which will have all of the information the system administrator will need. - Ted