Re: [PATCH 1/3] lib/vsprintf: add snprintf_noterm

2019-06-15 Thread Jeff Layton
On Fri, 2019-06-14 at 19:58 -0700, Joe Perches wrote: > On Sat, 2019-06-15 at 10:41 +0800, Yan, Zheng wrote: > > On Fri, Jun 14, 2019 at 9:48 PM Jeff Layton wrote: > > > The getxattr interface returns a length after filling out the value > > > buffer, and the convention with xattrs is to not NULL

Re: [PATCH 1/3] lib/vsprintf: add snprintf_noterm

2019-06-15 Thread Jeff Layton
On Sat, 2019-06-15 at 10:41 +0800, Yan, Zheng wrote: > On Fri, Jun 14, 2019 at 9:48 PM Jeff Layton wrote: > > The getxattr interface returns a length after filling out the value > > buffer, and the convention with xattrs is to not NULL terminate string > > data. > > > > CephFS implements some vir

Re: [PATCH 1/3] lib/vsprintf: add snprintf_noterm

2019-06-14 Thread Joe Perches
On Sat, 2019-06-15 at 10:41 +0800, Yan, Zheng wrote: > On Fri, Jun 14, 2019 at 9:48 PM Jeff Layton wrote: > > The getxattr interface returns a length after filling out the value > > buffer, and the convention with xattrs is to not NULL terminate string > > data. > > > > CephFS implements some vir

Re: [PATCH 1/3] lib/vsprintf: add snprintf_noterm

2019-06-14 Thread Yan, Zheng
On Fri, Jun 14, 2019 at 9:48 PM Jeff Layton wrote: > > The getxattr interface returns a length after filling out the value > buffer, and the convention with xattrs is to not NULL terminate string > data. > > CephFS implements some virtual xattrs by using snprintf to fill the > buffer, but that alw

[PATCH 1/3] lib/vsprintf: add snprintf_noterm

2019-06-14 Thread Jeff Layton
The getxattr interface returns a length after filling out the value buffer, and the convention with xattrs is to not NULL terminate string data. CephFS implements some virtual xattrs by using snprintf to fill the buffer, but that always NULL terminates the string. If userland sends down a buffer t