Linux Security Modules development
 help / color / mirror / Atom feed
From: Vishal Goel <vishal.goel@samsung.com>
To: Casey Schaufler <casey@schaufler-ca.com>,
	"linux-security-module@vger.kernel.org" 
	<linux-security-module@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: AMIT SAHRAWAT <a.sahrawat@samsung.com>,
	Vaneet Narang <v.narang@samsung.com>,
	"linux-audit@redhat.com" <linux-audit@redhat.com>
Subject: RE: Re: [PATCH 1/1] Smack:- Fix the issue of wrong info printed in ptrace error logs
Date: Tue, 21 Dec 2021 22:12:33 +0900	[thread overview]
Message-ID: <20211221131233epcms5p2e334598b208dcd76f6efec26f879c784@epcms5p2> (raw)
In-Reply-To: <a648c816-3093-8023-d96c-b1b8d459430f@schaufler-ca.com>

Hi,

>>> Signed-off-by: Vishal Goel <vishal.goel@samsung.com>
> 
> What test case do you have that generates these records?

Test case for 1st log:-
void main(int argc,char *argv[])
{
        int pid;

        if (argc < 2) {
                printf("enter pid of the tracee process\n");
                exit(0);
        }

        pid = atoi(argv[1]);
        fprintf(stderr,"Inside\n");
        ptrace(PTRACE_ATTACH, pid,NULL,NULL);
        while(1)
        {
                sleep(10);
        }
}

Test case for 2nd log:-
void main(int argc,char *argv[])
{
        int pid;

        pid = getpid();
        fprintf(stderr,"Inside\n");
        ptrace(PTRACE_TRACEME, pid,NULL,NULL);
        while(1)
        {
               sleep(10);
        }
}

Test case for 3rd log:-
void main()
{
        int pid;
        char *argv[2];

        fprintf(stderr,"Inside\n");
        pid = fork();
        if(pid == 0) {
                argv[0] = "/tst_pt";
                argv[1] = NULL;

                if(ptrace(PTRACE_TRACEME, pid,NULL,NULL))
                        printf("attached child\n");

                printf("going for exec\n");
                execv("/tst_pt",argv);
        }
        else
        {
                while(1)
                {
                        sleep(10);
                }
        }
}

>>
>> Added linux-audit to the CC list.
>>

Thanks
Vishal Goel

  reply	other threads:[~2021-12-21 13:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20211220101352epcas5p3aec72d06d04f71a7c387570957a0f6c7@epcas5p3.samsung.com>
2021-12-20 10:13 ` [PATCH 1/1] Smack:- Fix the issue of wrong info printed in ptrace error logs Vishal Goel
2021-12-20 16:41   ` Casey Schaufler
2021-12-21  1:19     ` Casey Schaufler
2021-12-21 13:12       ` Vishal Goel [this message]
2021-12-21 17:01         ` Casey Schaufler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211221131233epcms5p2e334598b208dcd76f6efec26f879c784@epcms5p2 \
    --to=vishal.goel@samsung.com \
    --cc=a.sahrawat@samsung.com \
    --cc=casey@schaufler-ca.com \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=v.narang@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox