mbox series

[Trusty,SRU,0/1] getxattr: use correct xattr length

Message ID 20181017041744.1232-1-po-hsu.lin@canonical.com
Headers show
Series getxattr: use correct xattr length | expand

Message

Po-Hsu Lin Oct. 17, 2018, 4:17 a.m. UTC
== Justification ==
This issue has been addressed in bug 1789746 for other kernels.

When the getxattr05 test in ubuntu_ltp_syscalls test suite, the test will failed with:

tag=getxattr05 stime=1539663573
cmdline="getxattr05"
contacts=""
analysis=exit
<<<test_output>>>
incrementing stop
tst_test.c:1072: INFO: Timeout per run is 0h 05m 00s
getxattr05.c:85: PASS: Got same data when acquiring the value of system.posix_acl_access twice
getxattr05.c:80: FAIL: Got different data(00 != ffffffff) at 16
getxattr05.c:85: PASS: Got same data when acquiring the value of system.posix_acl_access twice

Summary:
passed 2
failed 1
skipped 0
warnings 0

This is caused by posix_acl_fix_xattr_to_user() being passed the total buffer size and not the actual size of the xattr as returned by vfs_getxattr().

== Fix ==
82c9a927bc5d ("getxattr: use correct xattr length")

A test kernel for Trusty could be found here:
http://people.canonical.com/~phlin/kernel/lp-1798013-getxattr05/

== Regression Potential ==
Low, this one-liner fix just passes the actual length of the xattr as returned by vfs_getxattr() down.

== Test Case ==
Run the getxattr05 test in ubuntu_ltp_syscalls test suite. And it will pass with the patched kernel.


Christian Brauner (1):
  getxattr: use correct xattr length

 fs/xattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Khalid Elmously Oct. 22, 2018, 7:18 a.m. UTC | #1
On 2018-10-17 12:17:43 , Po-Hsu Lin wrote:
> == Justification ==
> This issue has been addressed in bug 1789746 for other kernels.
> 
> When the getxattr05 test in ubuntu_ltp_syscalls test suite, the test will failed with:
> 
> tag=getxattr05 stime=1539663573
> cmdline="getxattr05"
> contacts=""
> analysis=exit
> <<<test_output>>>
> incrementing stop
> tst_test.c:1072: INFO: Timeout per run is 0h 05m 00s
> getxattr05.c:85: PASS: Got same data when acquiring the value of system.posix_acl_access twice
> getxattr05.c:80: FAIL: Got different data(00 != ffffffff) at 16
> getxattr05.c:85: PASS: Got same data when acquiring the value of system.posix_acl_access twice
> 
> Summary:
> passed 2
> failed 1
> skipped 0
> warnings 0
> 
> This is caused by posix_acl_fix_xattr_to_user() being passed the total buffer size and not the actual size of the xattr as returned by vfs_getxattr().
> 
> == Fix ==
> 82c9a927bc5d ("getxattr: use correct xattr length")
> 
> A test kernel for Trusty could be found here:
> http://people.canonical.com/~phlin/kernel/lp-1798013-getxattr05/
> 
> == Regression Potential ==
> Low, this one-liner fix just passes the actual length of the xattr as returned by vfs_getxattr() down.
> 
> == Test Case ==
> Run the getxattr05 test in ubuntu_ltp_syscalls test suite. And it will pass with the patched kernel.
> 
> 
> Christian Brauner (1):
>   getxattr: use correct xattr length
> 
>  fs/xattr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> -- 
> 1.9.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team