Peng Haitao | 3 Jul 2011 05:40
Favicon

[POSIX] [PATCH] aio_cancel/7-1: fix fail occasionally due to aio_error() returns EBADF


Signed-off-by: Peng Haitao <penght@...>
---
 .../conformance/interfaces/aio_cancel/7-1.c        |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c
index c37f184..756b0af 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c
 <at>  <at>  -112,8 +112,6  <at>  <at>  int main()
 		return PTS_FAIL;
 	}

-	close(fd);
-
 	do {
 		in_progress = 0;
 		for (i = 0; i < BUF_NB; i++)
 <at>  <at>  -161,5 +159,7  <at>  <at>  int main()
 		}
 	} while (in_progress);

+	close(fd);
+
 	return PTS_UNRESOLVED;
-}
\ No newline at end of file
+}
--

-- 
(Continue reading)

Carmelo AMOROSO | 5 Jul 2011 16:24

[PATCH] mq_timedsend01: do not write out of the array boundaries.

When preparing the message to be sent, limit the number of written bytes
to the array's size, otherwise it will be detected as a stack smashing attack
and the test case will be killed, as from the output below:

<<<test_start>>>
tag=mq_timedsend01 stime=948808768
cmdline="mq_timedsend01"
contacts=""
analysis=exit
<<<test_output>>>
incrementing stop

... [SNIP] ...

mq_timedsend01    0  TINFO  :  (case04) START
EXPECT: return value(ret)=-1 errno=90 (Message too long)
RESULT: return value(ret)=-1 errno=90 (Message too long)
stack smashing detected: mq_timedsend01 terminated()
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=signaled termination_id=6 corefile=no
cutime=0 cstime=2
<<<test_end>>>

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@...>
---
 .../kernel/syscalls/mq_timedsend/mq_timedsend01.c  |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/testcases/kernel/syscalls/mq_timedsend/mq_timedsend01.c b/testcases/kernel/syscalls/mq_timedsend/mq_timedsend01.c
(Continue reading)

tangchen | 6 Jul 2011 09:23
Favicon

[POSIX] [PATCH] mlockall/3-7.c: fix the wrong file path.

hi,

There is a little bug in mlockall/3-7.c.
Here is the patch.
Thanks.:)

Signed-off-by: Tang Chen <tangchen@...>
---
 .../conformance/interfaces/mlockall/3-7.c          |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-7.c b/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-7.c
index 93eb300..f357b33 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-7.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-7.c
 <at>  <at>  -31,7 +31,7  <at>  <at>  int main() {
 		return PTS_UNRESOLVED;
 	}

-	fd = open("conformance/interfaces/mlockall/3-7.c", O_RDONLY);
+	fd = open("./3-7.c", O_RDONLY);
 	if (fd == -1) {
 		perror("An error occurs when calling open()");
 		return PTS_UNRESOLVED;
 <at>  <at>  -64,4 +64,4  <at>  <at>  int main() {
 	}
 	perror("Unexpected error");
 	return PTS_UNRESOLVED;
-}
\ No newline at end of file
(Continue reading)

tangchen | 7 Jul 2011 04:34
Favicon

[POSIX] [PATCH] sched_setscheduler/17-5.c: Add the missing scheduling policies.


hi,

On linux, I found the scheduling policies are defined as follow:

in /usr/include/bits/sched.h

/* Scheduling algorithms.  */
#define SCHED_OTHER             0
#define SCHED_FIFO              1
#define SCHED_RR                2
#ifdef __USE_GNU
# define SCHED_BATCH            3
# define SCHED_IDLE             5

# define SCHED_RESET_ON_FORK    0x40000000
#endif

So besides SCHED_OTHER, SCHED_FIFO and SCHED_RR, there are another 
two policies, SCHED_BATCH and SCHED_IDLE. And 3 is a valid value 
for the scheduling policy, which causes the test returns UNSOLVED 
on linux system.

Here is the patch, please comment!
Thanks.:)

Signed-off-by: Tang Chen <tangchen@...>
---
 .../interfaces/sched_setscheduler/17-5.c           |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
(Continue reading)

Wanlong Gao | 7 Jul 2011 08:17
Favicon
Gravatar

[PATCH] clock_getcpuclockid:5-1.c:make setgid before setuid

Call setgid() before setuid(), because that when setuid()
set this process' uid to an unprivileged one, then it can't
do the setgid() operation.

Signed-off-by: Wanlong Gao <gaowanlong@...>
---
 .../interfaces/clock_getcpuclockid/5-1.c           |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c
index 07218f6..933f669 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c
 <at>  <at>  -37,8 +37,8  <at>  <at>  int main(int argc, char *argv[])

 		pwd = getpwnam("nobody");
 		if (pwd != NULL) {
-			setuid(pwd->pw_uid);
 			setgid(pwd->pw_gid);
+			setuid(pwd->pw_uid);
 		}

 	}
 <at>  <at>  -62,4 +62,4  <at>  <at>  int main(int argc, char *argv[])
 	printf("Test PASSED\n");
 	return PTS_PASS;
 #endif
-}
\ No newline at end of file
+}
(Continue reading)

Cyril Hrubis | 7 Jul 2011 16:47
Picon

Re: [PATCH] mq_timedsend01: do not write out of the array boundaries.

Hi!
> When preparing the message to be sent, limit the number of written bytes
> to the array's size, otherwise it will be detected as a stack smashing attack
> and the test case will be killed, as from the output below:
> 
> <<<test_start>>>
> tag=mq_timedsend01 stime=948808768
> cmdline="mq_timedsend01"
> contacts=""
> analysis=exit
> <<<test_output>>>
> incrementing stop
> 
> ... [SNIP] ...
> 
> mq_timedsend01    0  TINFO  :  (case04) START
> EXPECT: return value(ret)=-1 errno=90 (Message too long)
> RESULT: return value(ret)=-1 errno=90 (Message too long)
> stack smashing detected: mq_timedsend01 terminated()
> <<<execution_status>>>
> initiation_status="ok"
> duration=0 termination_type=signaled termination_id=6 corefile=no
> cutime=0 cstime=2
> <<<test_end>>>
> 
> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@...>
> ---
>  .../kernel/syscalls/mq_timedsend/mq_timedsend01.c  |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
(Continue reading)

Peng Haitao | 8 Jul 2011 04:18
Favicon

[POSIX] [PATCH v2] Forget initializing struct aiocb before using it


There are 2 changes in this patch.

1. Initialize the aiocb struct before using it
2. If Prioritized Input and Output option is supported, submit the aiocb with
   invalid aio_reqprio, else submit the aiocb with invalid aio_fildes

   The aio_buf points to NULL is undefined, please refer to POSIX spec.

   NAME
    aio_read - asynchronous read from a file
   SYNOPSIS
    #include <aio.h>

    int aio_read(struct aiocb *aiocbp);
   DESCRIPTION
       The aiocbp argument points to an aiocb structure. If the buffer
       pointed to by aiocbp->aio_buf or the control block pointed to by aiocbp
       becomes an illegal address prior to asynchronous I/O completion, then
       the behavior is undefined.

Signed-off-by: Bian Naimeng <biannm@...>
Signed-off-by: Peng Haitao <penght@...>
---
 .../conformance/interfaces/aio_read/8-1.c          |   12 +++++++++---
 .../conformance/interfaces/aio_write/6-1.c         |   12 +++++++++---
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/8-1.c
index 8ec568c..2923f3b 100644
(Continue reading)

Carmelo AMOROSO | 8 Jul 2011 07:08

Re: [PATCH] mq_timedsend01: do not write out of the array boundaries.

On 07/07/2011 16.47, Cyril Hrubis wrote:
> Hi!
>> When preparing the message to be sent, limit the number of written bytes
>> to the array's size, otherwise it will be detected as a stack smashing attack
>> and the test case will be killed, as from the output below:
>>
>> <<<test_start>>>
>> tag=mq_timedsend01 stime=948808768
>> cmdline="mq_timedsend01"
>> contacts=""
>> analysis=exit
>> <<<test_output>>>
>> incrementing stop
>>
>> ... [SNIP] ...
>>
>> mq_timedsend01    0  TINFO  :  (case04) START
>> EXPECT: return value(ret)=-1 errno=90 (Message too long)
>> RESULT: return value(ret)=-1 errno=90 (Message too long)
>> stack smashing detected: mq_timedsend01 terminated()
>> <<<execution_status>>>
>> initiation_status="ok"
>> duration=0 termination_type=signaled termination_id=6 corefile=no
>> cutime=0 cstime=2
>> <<<test_end>>>
>>
>> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@...>
>> ---
>>  .../kernel/syscalls/mq_timedsend/mq_timedsend01.c  |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
(Continue reading)

Oliver Hartkopp | 10 Jul 2011 14:18
Favicon

Update for CAN LTP tests

Subrata Modak wrote:

> Would you also like to send a patch to update the testcases for CAN in LTP
> (http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/network/can/filter-tests/) ?
> These tests were originally picked up from:
> http://svn.berlios.de/wsvn/socketcan/trunk/test/?rev=877&amp;sc=1

Dear Subrata,

attached you'll find a major update for the LTP tests dealing with CAN filters
and the CAN frame flow down to the CAN netdevice and vice versa.

The patch removes all the obsolete stuff from the source code directory you
originally picked the tests from. I added two new tools that also reside on
the referenced SVN:

tst-filter: New filter test tool in *one* programm (easy to use & handle)
tst-rcv-own-msgs: Checks the CAN frame flow inside the networking stack

Additionally the virtual CAN driver needs to be loaded with a special
commandline option to perform the CAN frame flow test correctly.

The tests & the scripts are much clearer to me now. If it meets your
requirements consider to apply this patch to the LTP repository.

Best regards,
Oliver

Attachment (can-ltp-update.patch): text/x-patch, 154 KiB
(Continue reading)

Cyril Hrubis | 11 Jul 2011 15:16
Picon

Re: [PATCH v4] [syscalls] getrusage03: test ru_maxrss

Hi!
> getrusage03 - test ru_maxrss behaviors in struct rusage
> 
> This test program is backported from upstream commit:
> 1f10206cf8e945220f7220a809d8bfc15c21f9a5, which fills ru_maxrss
> value in struct rusage according to rss hiwater mark. To make sure
> this feature works correctly, a series of tests are executed in
> this program.
> 
> Signed-off-by: Caspar Zhang <czhang@...>

Commited, thanks.

--

-- 
Cyril Hrubis
chrubis@...

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2

Gmane