public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [Bug Fix] Skip first case in adjtimex02 test by a safer method
@ 2010-12-29  9:35 Vivi
  2010-12-29 16:35 ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Vivi @ 2010-12-29  9:35 UTC (permalink / raw)
  To: LTP mailing list


[-- Attachment #1.1: Type: text/plain, Size: 2029 bytes --]

The method to skip case 1 of adjtimex02 in uclinux platform will make case 3
and 4 fail.

--
root:/> ./adjtimex02
adjtimex02    1  PASS  :  Test Passed, adjtimex() returned -1 with errno: 22
adjtimex02    2  PASS  :  Test Passed, adjtimex() returned -1 with errno: 22
adjtimex02    3  FAIL  :  Test Failed, adjtimex()returned 5, errno = 0 :
Success
adjtimex02    4  FAIL  :  Test Failed, adjtimex()returned 5, errno = 0 :
Success
adjtimex02    5  PASS  :  Test Passed, adjtimex() returned -1 with errno: 1
root:/>
--


--
Index: testcases/kernel/syscalls/adjtimex/adjtimex02.c
===================================================================
--- testcases/kernel/syscalls/adjtimex/adjtimex02.c
+++ testcases/kernel/syscalls/adjtimex/adjtimex02.c
@@ -122,12 +122,7 @@
        void (*cleanup) ();
        int exp_errno;
 } test_cases[] = {
-#ifndef UCLINUX
-       /* Skip since uClinux does not implement memory protection */
-       {
-       (struct timex *)-1, NULL, NULL, EFAULT},
-#endif
-       {
+       { (struct timex *)-1, NULL, NULL, EFAULT},{
        &buff, setup2, NULL, EINVAL}, {
        &buff, setup3, NULL, EINVAL}, {
        &buff, setup4, NULL, EINVAL}, {
@@ -159,7 +154,18 @@
                Tst_count = 0;

                for (i = 0; i < TST_TOTAL; ++i) {
+#ifdef UCLINUX
                        /*
+                        * Skip first case since uClinux does not implement
+                        * memory protection.
+                        */
+                       if (i == 0) {
+                               tst_resm(TCONF, "uClinux does not implement"
+                                               " memory protection.");
+                               continue;
+                       }
+#endif
+                       /*
                         * since Linux 2.6.26, if buf.offset value is
outside
                         * the acceptable range, it is simply normalized
instead
                         * of letting the syscall fail. so just skip this
test
--



Best regards,
Vivi Li

[-- Attachment #1.2: Type: text/html, Size: 2272 bytes --]

[-- Attachment #2: Type: text/plain, Size: 371 bytes --]

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [Bug Fix] Skip first case in adjtimex02 test by a safer method
  2010-12-29  9:35 [LTP] [Bug Fix] Skip first case in adjtimex02 test by a safer method Vivi
@ 2010-12-29 16:35 ` Mike Frysinger
  2011-01-15  5:34   ` Garrett Cooper
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2010-12-29 16:35 UTC (permalink / raw)
  To: ltp-list


[-- Attachment #1.1: Type: Text/Plain, Size: 1400 bytes --]

On Wednesday, December 29, 2010 04:35:29 Vivi wrote:
> --- testcases/kernel/syscalls/adjtimex/adjtimex02.c
> +++ testcases/kernel/syscalls/adjtimex/adjtimex02.c
> @@ -122,12 +122,7 @@
>         void (*cleanup) ();
>         int exp_errno;
>  } test_cases[] = {
> -#ifndef UCLINUX
> -       /* Skip since uClinux does not implement memory protection */
> -       {
> -       (struct timex *)-1, NULL, NULL, EFAULT},
> -#endif
> -       {
> +       { (struct timex *)-1, NULL, NULL, EFAULT},{
>         &buff, setup2, NULL, EINVAL}, {
>         &buff, setup3, NULL, EINVAL}, {
>         &buff, setup4, NULL, EINVAL}, {
> @@ -159,7 +154,18 @@
>                 Tst_count = 0;
> 
>                 for (i = 0; i < TST_TOTAL; ++i) {
> +#ifdef UCLINUX
>                         /*
> +                        * Skip first case since uClinux does not implement
> +                        * memory protection.
> +                        */
> +                       if (i == 0) {
> +                               tst_resm(TCONF, "uClinux does not
> implement" +                                               " memory
> protection."); +                               continue;
> +                       }
> +#endif

we should be able to handle bad pointers like -1 and NULL.  the kernel's check 
access func should force EFAULT.  so why do we need this new if code ?
-mike

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 371 bytes --]

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [Bug Fix] Skip first case in adjtimex02 test by a safer method
  2010-12-29 16:35 ` Mike Frysinger
@ 2011-01-15  5:34   ` Garrett Cooper
  2011-01-16  1:21     ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Garrett Cooper @ 2011-01-15  5:34 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: ltp-list

On Wed, Dec 29, 2010 at 8:35 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Wednesday, December 29, 2010 04:35:29 Vivi wrote:
>> --- testcases/kernel/syscalls/adjtimex/adjtimex02.c
>> +++ testcases/kernel/syscalls/adjtimex/adjtimex02.c
>> @@ -122,12 +122,7 @@
>>         void (*cleanup) ();
>>         int exp_errno;
>>  } test_cases[] = {
>> -#ifndef UCLINUX
>> -       /* Skip since uClinux does not implement memory protection */
>> -       {
>> -       (struct timex *)-1, NULL, NULL, EFAULT},
>> -#endif
>> -       {
>> +       { (struct timex *)-1, NULL, NULL, EFAULT},{
>>         &buff, setup2, NULL, EINVAL}, {
>>         &buff, setup3, NULL, EINVAL}, {
>>         &buff, setup4, NULL, EINVAL}, {
>> @@ -159,7 +154,18 @@
>>                 Tst_count = 0;
>>
>>                 for (i = 0; i < TST_TOTAL; ++i) {
>> +#ifdef UCLINUX
>>                         /*
>> +                        * Skip first case since uClinux does not implement
>> +                        * memory protection.
>> +                        */
>> +                       if (i == 0) {
>> +                               tst_resm(TCONF, "uClinux does not
>> implement" +                                               " memory
>> protection."); +                               continue;
>> +                       }
>> +#endif
>
> we should be able to handle bad pointers like -1 and NULL.  the kernel's check
> access func should force EFAULT.  so why do we need this new if code ?

    If so, then there's a lot of code in LTP that needs to be fixed.
Thanks,
-Garrett

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [Bug Fix] Skip first case in adjtimex02 test by a safer method
  2011-01-15  5:34   ` Garrett Cooper
@ 2011-01-16  1:21     ` Mike Frysinger
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2011-01-16  1:21 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list


[-- Attachment #1.1: Type: Text/Plain, Size: 1977 bytes --]

On Saturday, January 15, 2011 00:34:23 Garrett Cooper wrote:
> On Wed, Dec 29, 2010 at 8:35 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> > On Wednesday, December 29, 2010 04:35:29 Vivi wrote:
> >> --- testcases/kernel/syscalls/adjtimex/adjtimex02.c
> >> +++ testcases/kernel/syscalls/adjtimex/adjtimex02.c
> >> @@ -122,12 +122,7 @@
> >>         void (*cleanup) ();
> >>         int exp_errno;
> >>  } test_cases[] = {
> >> -#ifndef UCLINUX
> >> -       /* Skip since uClinux does not implement memory protection */
> >> -       {
> >> -       (struct timex *)-1, NULL, NULL, EFAULT},
> >> -#endif
> >> -       {
> >> +       { (struct timex *)-1, NULL, NULL, EFAULT},{
> >>         &buff, setup2, NULL, EINVAL}, {
> >>         &buff, setup3, NULL, EINVAL}, {
> >>         &buff, setup4, NULL, EINVAL}, {
> >> @@ -159,7 +154,18 @@
> >>                 Tst_count = 0;
> >> 
> >>                 for (i = 0; i < TST_TOTAL; ++i) {
> >> +#ifdef UCLINUX
> >>                         /*
> >> +                        * Skip first case since uClinux does not
> >> implement +                        * memory protection.
> >> +                        */
> >> +                       if (i == 0) {
> >> +                               tst_resm(TCONF, "uClinux does not
> >> implement" +                                               " memory
> >> protection."); +                               continue;
> >> +                       }
> >> +#endif
> > 
> > we should be able to handle bad pointers like -1 and NULL.  the kernel's
> > check access func should force EFAULT.  so why do we need this new if
> > code ?
> 
>     If so, then there's a lot of code in LTP that needs to be fixed.

NOMMU can handle a few "magic" bad pointers like -1 and NULL, but only in so 
much where the kernel is given the pointer via a syscall.  in the past, this 
wasnt the case, so i imagine a lot of checks have slipped in that can be 
backed out.
-mike

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 372 bytes --]

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2011-01-16  1:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-29  9:35 [LTP] [Bug Fix] Skip first case in adjtimex02 test by a safer method Vivi
2010-12-29 16:35 ` Mike Frysinger
2011-01-15  5:34   ` Garrett Cooper
2011-01-16  1:21     ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox