Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756037AbbFBJay (ORCPT ); Tue, 2 Jun 2015 05:30:54 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:41799 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752309AbbFBJaq (ORCPT ); Tue, 2 Jun 2015 05:30:46 -0400 Date: Tue, 2 Jun 2015 11:30:43 +0200 From: Peter Zijlstra To: Jerome Marchand Cc: Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH] fix a race between /proc/lock_stat and module unloading Message-ID: <20150602093043.GY19282@twins.programming.kicks-ass.net> References: <1432903635-27272-1-git-send-email-jmarchan@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1432903635-27272-1-git-send-email-jmarchan@redhat.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 747 Lines: 16 On Fri, May 29, 2015 at 02:47:15PM +0200, Jerome Marchand wrote: > When opening /proc/lock_stat, lock_stat_open() makes a copy of > all_lock_classes list in the form of an array of ad hoc structures > lock_stat_data that reference lock_class, so it can be sorted and > passed to seq_read(). However, nothing prevents module unloading code > to free some of these lock_class structures before seq_read() tries to > access them. Well, how about lock_class being from a static array in lockdep.c:138 ? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/