[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ltp-list
Subject:    Re: [LTP] Setgroups01_16 Test Failure
From:       Subrata Modak <subrata () linux ! vnet ! ibm ! com>
Date:       2008-10-20 12:59:36
Message-ID: 1224506856.5152.97.camel () subratamodak ! linux ! ibm ! com
[Download RAW message or body]

> > 
> > Not sure why ??
> 
> I just sent some patches for setgroups02_16 - looks like it's a similar
> problem for setgroups01_16 (for some reason setgroups01_16 didn't failed for
> me, only setgroups02_16)
> 
> Anyway, i guess the reason is the use of the uninitialized groups list and
> passing the _full_ length to the syscalls.
> 
> Could you try attached patch?

Yes, the attached Patch solves the problem reported on x86_64 and does
not interfere with architectures where it was already passing. Thanks
for this.

Before Patching on x86_64:

# ./testcases/kernel/syscalls/setgroups/setgroups01_16
setgroups01_16    1  FAIL  :  setgroups(65536, list) Failed, errno=14 :
Bad address
# ./testcases/kernel/syscalls/setgroups/setgroups02_16
setgroups02_16    1  FAIL  :  setgroups(65536, groups_list) Failed,
errno=14 : Bad address
# ./testcases/kernel/syscalls/setgroups/setgroups03_16
setgroups03_16    1  PASS  :  setgroups(65537) fails, Size is >
sysconf(_SC_NGROUPS_MAX), errno=22
setgroups03_16    2  PASS  :  setgroups(65536) fails, Permission denied,
not super-user, errno=1
# ./testcases/kernel/syscalls/setgroups/setgroups04_16
setgroups04_16    1  PASS  :  setgroups() fails with expected error
EFAULT errno:14

Post Patching, the problem gets solved for setgroups01_16, but FAIL will
remain for setgroups02_16 as your corresponding Patch is yet to arrive.

# ./testcases/kernel/syscalls/setgroups/setgroups01_16
setgroups01_16    1  PASS  :  setgroups(65536, list) returned 0
# ./testcases/kernel/syscalls/setgroups/setgroups02_16
setgroups02_16    1  FAIL  :  setgroups(65536, groups_list) Failed,
errno=14 : Bad address
# ./testcases/kernel/syscalls/setgroups/setgroups03_16
setgroups03_16    1  PASS  :  setgroups(65537) fails, Size is >
sysconf(_SC_NGROUPS_MAX), errno=22
setgroups03_16    2  PASS  :  setgroups(65536) fails, Permission denied,
not super-user, errno=1
# ./testcases/kernel/syscalls/setgroups/setgroups04_16
setgroups04_16    1  PASS  :  setgroups() fails with expected error
EFAULT errno:14

Regards--
Subrata


Regards--
Subrata

> 
> best regards,
> Daniel
> 
> ---
> 
> Index: ltp-full-20081020/testcases/kernel/syscalls/setgroups/compat_16.h
> ===================================================================
> --- ltp-full-20081020.orig/testcases/kernel/syscalls/setgroups/compat_16.h
> +++ ltp-full-20081020/testcases/kernel/syscalls/setgroups/compat_16.h
> @@ -54,7 +54,7 @@ GETGROUPS(size_t size16, GID_T *list16)
>  	if (r < 0)
>  	  goto out;
>    
> -	for (i = 0; i < size16; i++) {
> +	for (i = 0; i < r; i++) {
>  		if (!GID_SIZE_CHECK(list32[i]))
>  		  tst_brkm(TBROK,
>  			   cleanup,
> Index: ltp-full-20081020/testcases/kernel/syscalls/setgroups/setgroups01.c
> ===================================================================
> --- ltp-full-20081020.orig/testcases/kernel/syscalls/setgroups/setgroups01.c
> +++ ltp-full-20081020/testcases/kernel/syscalls/setgroups/setgroups01.c
> @@ -130,7 +130,7 @@ TCID_DEFINE(setgroups01); 	/* Test progr
>  int TST_TOTAL=1;    		/* Total number of test cases. */
>  extern int Tst_count;		/* Test Case counter for tst_* routines */
> 
> -int len = NGROUPS; 
> +int len = NGROUPS, ngrps = 0; 
>  GID_T list[NGROUPS];
> 
>  int
> @@ -163,7 +163,7 @@ main(int ac, char **av)
>  	/* 
>  	 * Call setgroups(2) 
>  	 */
> -	TEST(SETGROUPS(len, list));
> +	TEST(SETGROUPS(ngrps, list));
>  	
>  	/* check return code */
>  	if ( TEST_RETURN == -1 ) {
> @@ -205,7 +205,7 @@ setup()
>      /* Pause if that option was specified */
>      TEST_PAUSE;
> 
> -    if (GETGROUPS(len, list) == -1) {
> +    if ((ngrps = GETGROUPS(len, list)) == -1) {
>         tst_brkm(TBROK, cleanup,
>  		"getgroups(%d, list) Failure. errno=%d : %s",
>  		len, errno, strerror(errno));


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic