All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [LTP] [PATCH] clock_settime03: do not set outside address space tp
       [not found] ` <51DA8370.1000209@cn.fujitsu.com>
@ 2013-07-08 10:48   ` chrubis
  0 siblings, 0 replies; 2+ messages in thread
From: chrubis @ 2013-07-08 10:48 UTC (permalink / raw)
  To: Wanlong Gao; +Cc: Garrett Cooper, LTP, Mike Frysinger

Hi!
> > Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
> 
> Any objections?

I will have a look soon enough, sorry it takes so long.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] clock_settime03: do not set outside address space tp
       [not found] <1372658141-4384-1-git-send-email-gaowanlong@cn.fujitsu.com>
       [not found] ` <51DA8370.1000209@cn.fujitsu.com>
@ 2013-07-08 16:06 ` chrubis
  1 sibling, 0 replies; 2+ messages in thread
From: chrubis @ 2013-07-08 16:06 UTC (permalink / raw)
  To: Wanlong Gao; +Cc: Garrett Cooper, LTP, Mike Frysinger

Hi!
> Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
> ---
>  .../kernel/timers/clock_settime/clock_settime03.c    | 20 ++------------------
>  1 file changed, 2 insertions(+), 18 deletions(-)
> 
> diff --git a/testcases/kernel/timers/clock_settime/clock_settime03.c b/testcases/kernel/timers/clock_settime/clock_settime03.c
> index a949303..0b24e6d 100644
> --- a/testcases/kernel/timers/clock_settime/clock_settime03.c
> +++ b/testcases/kernel/timers/clock_settime/clock_settime03.c
> @@ -49,8 +49,8 @@ int testcases[] = {
>  	EINVAL,			/* Invalid timespec     */
>  	EINVAL,			/* NSEC_PER_SEC + 1     */
>  	EPERM,			/* non-root user        */
> -	0,
> -	0,
> +	EINVAL,			/* PROCESS_CPUTIME_ID	*/
> +	EINVAL,			/* THREAD_CPUTIME_ID	*/
>  };
>  
>  char *TCID = "clock_settime03";
> @@ -70,17 +70,6 @@ int main(int ac, char **av)
>  	if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
>  		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
>  
> -	/* PROCESS_CPUTIME_ID & THREAD_CPUTIME_ID are not supported on
> -	 * kernel versions lower than 2.6.12 and changed back in 2.6.38
> -	 */
> -	if ((tst_kvercmp(2, 6, 12)) < 0 || (tst_kvercmp(2, 6, 38)) >= 0) {
> -		testcases[7] = EINVAL;
> -		testcases[8] = EINVAL;
> -	} else {
> -		testcases[7] = EFAULT;
> -		testcases[8] = EFAULT;
> -	}
> -
>  	setup();
>  
>  	for (lc = 0; TEST_LOOPING(lc); lc++) {
> @@ -168,11 +157,6 @@ static int setup_test(int option)
>  			return -1;
>  		}
>  		break;
> -	case 7:
> -	case 8:
> -		/* Make tp argument bad pointer */
> -		if (tst_kvercmp(2, 6, 12) >= 0)
> -			temp = (struct timespec *)-1;
>  	}
>  	return 0;
>  }

If I'm getting this right the order of checks in kernel was probably
changed (userspace address validation vs timer id validation) and
because of that the errno values were not stable. And as the test passes
invalid pointer in first testcase (with correct timer id) the invalid
pointer codepath in kernel is covered by the test allready.

Acked.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-08 16:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1372658141-4384-1-git-send-email-gaowanlong@cn.fujitsu.com>
     [not found] ` <51DA8370.1000209@cn.fujitsu.com>
2013-07-08 10:48   ` [LTP] [PATCH] clock_settime03: do not set outside address space tp chrubis
2013-07-08 16:06 ` chrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.