[PATCH v4] ubifs: make ubifs_[get|set]xattr atomic

Artem Bityutskiy dedekind1 at gmail.com
Tue Aug 18 01:43:51 PDT 2015


On Tue, 2015-08-18 at 12:38 +0800, Dongsheng Yang wrote:
> This commit make the ubifs_[get|set]xattr protected by ui_mutex.
> 
> Originally, there is a possibility that ubifs_getxattr to get
> a wrong value.
> 
>   P1                                  P2
> ----------                  	----------
> ubifs_getxattr                      ubifs_setxattr
> 					- kfree()
> - memcpy()
> 					- kmemdup()
> 
> Then ubifs_getxattr() would get a non-sense data. To solve this
> problem, this commit make the xattr of ubifs_inode updated in
> atomic.

Picked this one, thanks!



More information about the linux-mtd mailing list