Re: [PATCH] fix a race between /proc/lock_stat and module unloading

2015-06-02 Thread Peter Zijlstra
On Tue, Jun 02, 2015 at 04:15:24PM +0200, Jerome Marchand wrote: > Yes, I can't reproduce the issue anymore. Great; queued the below. Slight changes - s/WRITE_ONCE/RCU_INIT_POINTER/ which should be similar but more descriptive - const char *cname to avoid a compile warn. --- Subject: lockdep:

Re: [PATCH] fix a race between /proc/lock_stat and module unloading

2015-06-02 Thread Jerome Marchand
On 06/02/2015 12:50 PM, Peter Zijlstra wrote: > On Tue, Jun 02, 2015 at 11:54:13AM +0200, Jerome Marchand wrote: >> >> I guess I jumped to conclusion here and my explanation is wrong. However >> there is still a bug which occurs when the kernel tries to access >> class->name is seq_stats: >> >> [

Re: [PATCH] fix a race between /proc/lock_stat and module unloading

2015-06-02 Thread Peter Zijlstra
On Tue, Jun 02, 2015 at 11:54:13AM +0200, Jerome Marchand wrote: > > I guess I jumped to conclusion here and my explanation is wrong. However > there is still a bug which occurs when the kernel tries to access > class->name is seq_stats: > > [ 43.533732] BUG: unable to handle kernel paging requ

Re: [PATCH] fix a race between /proc/lock_stat and module unloading

2015-06-02 Thread Jerome Marchand
On 06/02/2015 11:30 AM, Peter Zijlstra wrote: > 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

Re: [PATCH] fix a race between /proc/lock_stat and module unloading

2015-06-02 Thread Peter Zijlstra
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,

[PATCH] fix a race between /proc/lock_stat and module unloading

2015-05-29 Thread Jerome Marchand
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