From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E14AC433F5 for ; Tue, 1 Feb 2022 14:07:41 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-655-o5b7bsZ9OLaGmsqD0c7bMQ-1; Tue, 01 Feb 2022 09:07:37 -0500 X-MC-Unique: o5b7bsZ9OLaGmsqD0c7bMQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4CAA5100CCC7; Tue, 1 Feb 2022 14:07:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 428557B03E; Tue, 1 Feb 2022 14:07:31 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F23F01809C88; Tue, 1 Feb 2022 14:07:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 211E5bdN012783 for ; Tue, 1 Feb 2022 09:05:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 445C040885B0; Tue, 1 Feb 2022 14:05:37 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4067440885A5 for ; Tue, 1 Feb 2022 14:05:37 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E3DDF3804064 for ; Tue, 1 Feb 2022 14:05:36 +0000 (UTC) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-543-URwjuEI9O6GAGDprQTR1Jg-1; Tue, 01 Feb 2022 09:05:34 -0500 X-MC-Unique: URwjuEI9O6GAGDprQTR1Jg-1 Received: by mail-ej1-f47.google.com with SMTP id s5so54355775ejx.2 for ; Tue, 01 Feb 2022 06:05:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=gWYLu6owdDkjhldrciDPRlrD59Q0Lgu+mL3R/lRj2lk=; b=tK6OkTeopG7P+VFFGxmlcYBLEL/zRKJ+Ms4FMD0+t1dWrPU6JRkpH1hxAPHDhfRm/G USPNib3RtxKQPnGG76TmQatY2LGg6t13DABwDqApK25hcck9d1+P2fi+yPtCK4HUNGma vJvLfb+UvY043j2LTG2TI3l8AEZePzRJcCAPJBE0GcujfXHwpgvYexs5cQGthNXDoTUZ oH+Ys3OAbepo0q/08IDTVOCo8aIC8xoebypXS+nCJRyryt5OUug7MnYZ93eF/T8XaXLd eEEbbDD5FxzKnBI3h6EsjlNreVa35D593KAam83tsT8fHBLU7Cp0vatjFvHpFcDztn+h gM0A== X-Gm-Message-State: AOAM533303TomFykW0foTfWwNZMKvo1A4ZZYdyQwMA5QlYa9Cg6fnL9f ljvCXcCnQS2YV92aodzG/oCVog+dJjfq6uU7uNzJDn6rOA== X-Google-Smtp-Source: ABdhPJxOjhgYizPkms/j97+GYG/6NgK7A+g2OS3EqdR3HLHDjG815ybhqob3k5L6LfRSLdKkfCICqpUHG3Q3+otF8kI= X-Received: by 2002:a17:906:1e06:: with SMTP id g6mr20957176ejj.517.1643724333297; Tue, 01 Feb 2022 06:05:33 -0800 (PST) MIME-Version: 1.0 References: <20211220101318.3538824-1-vishal.goel@samsung.com> <27fb7b74-e454-a6d6-721b-fcef5a3f924b@schaufler-ca.com> <20220201075453epcms5p8b19a7d3a419a04bad456cb7a248e557a@epcms5p8> In-Reply-To: <20220201075453epcms5p8b19a7d3a419a04bad456cb7a248e557a@epcms5p8> From: Paul Moore Date: Tue, 1 Feb 2022 09:05:21 -0500 Message-ID: Subject: Re: Re: [PATCH 1/1] Smack:- Fix the issue of wrong info printed in ptrace error logs To: vishal.goel@samsung.com X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 211E5bdN012783 X-loop: linux-audit@redhat.com Cc: Vaneet Narang , AMIT SAHRAWAT , "linux-audit@redhat.com" X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=linux-audit-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Tue, Feb 1, 2022 at 2:55 AM Vishal Goel wrote: > >>> Currently tracer process info is printed in object field in > >>> smack error log for ptrace check which is wrong. > >>> Object process should print the tracee process info. > >>> Tracee info is not printed in the smack error logs. > >>> So it is not possible to debug the ptrace smack issues. > >>> > >>> Now changes has been done to print both tracer and tracee > >>> process info in smack error logs for ptrace scenarios > >>> > >>> Old logs:- > >>> [ 378.098330] audit: type=1400 audit(1637212273.300:2): lsm=SMACK fn=smack_ptrace_access_check action=denied subject="Tracer_lbl" object="Tracee_lbl" requested= pid=9397 comm="tst_pt" opid=9397 ocomm="tst_pt" > >>> [ 520.261605] audit: type=1400 audit(1637212415.464:3): lsm=SMACK fn=smack_ptrace_traceme action=denied subject="Tracer_lbl" object="Tracee_lbl" requested= pid=12685 comm="tst_pt_me" opid=12563 ocomm="bash" > >>> [ 1445.259319] audit: type=1400 audit(1637213340.460:5): lsm=SMACK fn=smack_bprm_set_creds action=denied subject="Tracer_lbl" object="Tracee_lbl" requested= pid=1778 comm="tst_bprm" opid=1776 ocomm="tst_bprm" > >>> > >>> New logs:- > >>> [ 378.098330] audit: type=1400 audit(1637212273.300:2): lsm=SMACK fn=smack_ptrace_access_check action=denied subject="Tracer_lbl" object="Tracee_lbl" requested= tracer-pid=5189 tracer-comm="tst_pt" pid=5189 comm="tst_pt" tracee-pid=962 tracee-comm="test_tracee" > >>> [ 520.261605] audit: type=1400 audit(1637212415.464:3): lsm=SMACK fn=smack_ptrace_traceme action=denied subject="Tracer_lbl" object="Tracee_lbl" requested= tracer-pid=6161 tracer-comm="bash" pid=6310 comm="tst_pt_me" tracee-pid=6310 tracee-comm="tst_pt_me" > >>> [ 1445.259319] audit: type=1400 audit(1637213340.460:5): lsm=SMACK fn=smack_bprm_set_creds action=denied subject="Tracer_lbl" object="Tracee_lbl" requested= tracer-pid=6435 tracer-comm="tst_bprm" pid=6436 comm="tst_bprm" tracee-pid=6436 tracee-comm="tst_bprm" > >>> > >>> Signed-off-by: Vishal Goel > >> > >> Does anyone from the audit side object to my taking this > >> in the Smack tree? > > > The audit subsystem already has the "opid" and "ocomm" fields for > > reporting on the object task info and this is even available in > > dump_common_audit_data() via LSM_AUDIT_DATA_TASK; is there a reason > > that can't be used instead? > > That info is not sufficient for debugging smack issues in ptrace calls. > Tracee information is not printed in the logs. For eg. in below log- > [ 378.098330] audit: type=1400 audit(1637212273.300:2): lsm=SMACK fn=smack_ptrace_access_check action=denied subject="Tracer_lbl" object="Tracee_lbl" requested= pid=9397 comm="tst_pt" opid=9397 ocomm="tst_pt" > > There is no information of the tracee process. > So to debug such ptrace issues, both tracer and tracee information is needed. > That's why added new type to print both info specifically for ptrace scenarios. [NOTE: please only send plaintext email to the lists] >>From what I saw you are trying to record information about the tracer and the tracee, yes? The "pid", "comm", "opid", and "ocomm" fields should be used instead of adding new fields. -- paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit