[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <505C3FEB.7030606@linux.vnet.ibm.com>
Date: Fri, 21 Sep 2012 15:52:35 +0530
From: Raghavendra K T <raghavendra.kt@...ux.vnet.ibm.com>
To: David Rientjes <rientjes@...gle.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Konrad Rzeszutek Wilk <konrad@...nel.org>,
Dave Jones <davej@...hat.com>,
Linux Kernel <linux-kernel@...r.kernel.org>,
Srivatsa Vaddagiri <vatsa@...ux.vnet.ibm.com>,
Suzuki Poulose <suzuki@...ibm.com>
Subject: Re: [patch for-3.6] fs, debugfs: fix race in u32_array_read and allocate
array at open
On 09/21/2012 02:46 PM, David Rientjes wrote:
> u32_array_open() is racy when multiple threads read from a file with a
> seek position of zero, i.e. when two or more simultaneous reads are
> occurring after the non-seekable files are created. It is possible that
> file->private_data is double-freed because the threads races between
>
> kfree(file->private-data);
>
> and
>
> file->private_data = NULL;
>
> The fix is to only do format_array_alloc() when the file is opened and
> free it when it is closed. This means that any thread that holds the
> file open and reads multiple times will see persistent data;
I think you meant we can read data only once. second time onwards we
don't see any data. (except when fd is forked by child/ races in
threads).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists