<HTML><HEAD>
<META content=IE=5 http-equiv=X-UA-Compatible>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE id=mysingle_style type=text/css>.search-word {
        BACKGROUND-COLOR: #ffee94
}
P {
        FONT-SIZE: 10pt; MARGIN-BOTTOM: 5px; FONT-FAMILY: Arial, arial; MARGIN-TOP: 5px
}
TD {
        FONT-SIZE: 10pt; MARGIN-BOTTOM: 5px; FONT-FAMILY: Arial, arial; MARGIN-TOP: 5px
}
LI {
        FONT-SIZE: 10pt; MARGIN-BOTTOM: 5px; FONT-FAMILY: Arial, arial; MARGIN-TOP: 5px
}
BODY {
        FONT-SIZE: 10pt; FONT-FAMILY: Arial, arial
}
</STYLE>

<STYLE id=knox_style type=text/css>P {
        FONT-SIZE: 10pt; MARGIN-BOTTOM: 5px; FONT-FAMILY: Arial, arial; MARGIN-TOP: 5px
}
</STYLE>

<META name=GENERATOR content=ActiveSquare></HEAD>
<BODY style="OVERFLOW: auto">
<P>Hi,</P>
<P> </P>
<P>>>>>> Signed-off-by: Vishal Goel <<A href="mailto:vishal.goel@samsung.com">vishal.goel@samsung.com</A>><BR>>>> What test case do you have that generates these records?</P>
<P>>Could you include a permissive license with this code?<BR>>I'd like to add it or a derivative of it to the Smack test suite.</P>
<P> </P>
<P>You can use below license:-</P>
<P># SPDX-License-Identifier: GPL-2.0-or-later<BR># Smack Ptrace test cases for smack testsuite infrastructure.<BR># Copyright (C) Vishal Goel <<A href="mailto:vishal.goel@samsung.com">vishal.goel@samsung.com</A>> 2021</P>
<P>>> Test case for 1st log:-<BR>>> void main(int argc,char *argv[])<BR>>> {<BR>>>          int pid;<BR>>><BR>>>          if (argc < 2) {<BR>>>                  printf("enter pid of the tracee process\n");<BR>>>                  exit(0);<BR>>>          }<BR>>><BR>>>          pid = atoi(argv[1]);<BR>>>          fprintf(stderr,"Inside\n");<BR>>>          ptrace(PTRACE_ATTACH, pid,NULL,NULL);<BR>>>          while(1)<BR>>>          {<BR>>>                  sleep(10);<BR>>>          }<BR>>> }<BR>>><BR>>> Test case for 2nd log:-<BR>>> void main(int argc,char *argv[])<BR>>> {<BR>>>          int pid;<BR>>><BR>>>          pid = getpid();<BR>>>          fprintf(stderr,"Inside\n");<BR>>>          ptrace(PTRACE_TRACEME, pid,NULL,NULL);<BR>>>          while(1)<BR>>>          {<BR>>>                 sleep(10);<BR>>>          }<BR>>> }<BR>>><BR>>> Test case for 3rd log:-<BR>>> void main()<BR>>> {<BR>>>          int pid;<BR>>>          char *argv[2];<BR>>><BR>>>          fprintf(stderr,"Inside\n");<BR>>>          pid = fork();<BR>>>          if(pid == 0) {<BR>>>                  argv[0] = "/tst_pt";<BR>>>                  argv[1] = NULL;<BR>>><BR>>>                  if(ptrace(PTRACE_TRACEME, pid,NULL,NULL))<BR>>>                          printf("attached child\n");<BR>>><BR>>>                  printf("going for exec\n");<BR>>>                  execv("/tst_pt",argv);<BR>>>          }<BR>>>          else<BR>>>          {<BR>>>                  while(1)<BR>>>                  {<BR>>>                          sleep(10);<BR>>>                  }<BR>>>          }<BR>>> }<BR>>><BR>>>>> Added linux-audit to the CC list.<BR>>>>></P>
<P>Thanks<BR>Vishal Goel<BR></P><table id=bannersignimg data-cui-lock="true" namo_lock><tr><td><div id="cafe-note-contents" style="margin:10px;font-family:Arial;font-size:10pt;"><p> </p></div></td></tr></table><table id=confidentialsignimg data-cui-lock="true" namo_lock><tr><td><div id="cafe-note-contents" style="margin:10px;font-family:Arial;font-size:10pt;"><p><img unselectable="on" data-cui-image="true" style="display: inline-block; border: 0px solid; width: 520px; height: 144px;" src="cid:cafe_image_0@s-core.co.kr"><br></p></div></td></tr></table></BODY></HTML><table style='display: none;'><tbody><tr><td><img style='display: none;' border=0 src='http://ext.samsung.net/mail/ext/v1/external/status/update?userid=vishal.goel&do=bWFpbElEPTIwMjExMjI0MDUwNDU2ZXBjbXM1cDYzNTAxMTU5MGMwNDdiNTdlNDZiZjIwMzg3MTEzOGU2OCZyZWNpcGllbnRBZGRyZXNzPWxpbnV4LWF1ZGl0QHJlZGhhdC5jb20_' width=0 height=0></td></tr></tbody></table>