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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88F2EC433E6 for ; Thu, 11 Mar 2021 01:57:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60AA661585 for ; Thu, 11 Mar 2021 01:57:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229467AbhCKB47 (ORCPT ); Wed, 10 Mar 2021 20:56:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229641AbhCKB4o (ORCPT ); Wed, 10 Mar 2021 20:56:44 -0500 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 569A3C061760 for ; Wed, 10 Mar 2021 17:56:44 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id j3so422588edp.11 for ; Wed, 10 Mar 2021 17:56:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fgYrALYRpO2A+WbpiwGj0OYEpcJcSYMExr2Frk/9tDY=; b=1E3lSM66GDUj8+2H5YW3qnZLn0D7P5Yt9K3k3O22IkOF3ek944c4v6s93WHq94exbC PiwcX1xNUoNzpHG9B4WSai8YNsbRbXXgmL1yPOYZrqH1ZYASt8IFSKpjhBd7ldxMVosK DUDd3ytAojBD0SKpfiQjJhvWP5fAka8u/2vqJKsI3YqiinOHrsfFhV2AwkJtbRV5ofPL oD6exRJ1jpYIWqSE29SU+J6/0+3c3/GGnSP7/Ju0s5gdvnWTGzBpQJ5Y1mip9x5tp4Ht 2fmq3d5H0TDBN/FwOSjEZZHsTvaULWJ60+M5cFhtIv1wHUwB3yBn8u3NGz0ra5Ifr9V9 BDPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fgYrALYRpO2A+WbpiwGj0OYEpcJcSYMExr2Frk/9tDY=; b=BwcMsp/M9JJJ3QwYAGQEdS3BEwP7+z8TNLDZ4CCTVdowT9tgSaOyhBeZjb15HPPxNq pu10oXlOXStC8YVj57Y0NOL8RjwMKTBqK+r+2c+b/ei7k0HNI2UFW2Fu13m6EWu8OuAD k2xgenLkzmJ4opuZpCw4PegMTkUujEhNE2evvJtnMwsPqHBydfisazhuYYz6RRb6CmNI UPx6ofmSjB1MMAqC982rsEnP5KUtLQsJDhfVXmJpLM7VKzl5cbNWN+fT7Q2ST1IxwhaF VcpJR1G2wWdmUB3JSsbAdFVDawPN8WvUm3DauvcFtLBFGqqxAXRptmW177Q37/+Ojbtp ZpRg== X-Gm-Message-State: AOAM531g7dn6B+/SYB7D9qgJac4kr6X/euQVEsoHJLZ4/4GrceHeaOEv TFYesa4VQScytozLe6KraP/TZj8kSD9UoKqqCbjR X-Google-Smtp-Source: ABdhPJwnYcNSoXOULX46ASJXgAFM3cjksNO9omg612I1jwKt1VXSvvAQTA89A9jfj8hUGY9t6MKDJx70wQ43U0b/7e4= X-Received: by 2002:aa7:db4f:: with SMTP id n15mr6176265edt.12.1615427802976; Wed, 10 Mar 2021 17:56:42 -0800 (PST) MIME-Version: 1.0 References: <161377712068.87807.12246856567527156637.stgit@sifl> <161377734508.87807.8537642254664217815.stgit@sifl> In-Reply-To: From: Paul Moore Date: Wed, 10 Mar 2021 20:56:31 -0500 Message-ID: Subject: Re: [RFC PATCH 1/4] lsm: separate security_task_getsecid() into subjective and objective variants To: Jeffrey Vander Stoep Cc: LSM List , SElinux list , Casey Schaufler , John Johansen , linux-audit@redhat.com, James Morris Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org On Wed, Mar 10, 2021 at 3:21 AM Jeffrey Vander Stoep wrote: > On Fri, Mar 5, 2021 at 12:44 AM Paul Moore wrote: > > > > On Thu, Mar 4, 2021 at 5:04 AM Jeffrey Vander Stoep wrote: > > > On Sat, Feb 20, 2021 at 3:45 PM Paul Moore wrote: > > > > On Fri, Feb 19, 2021 at 9:57 PM James Morris wrote: > > > > > On Fri, 19 Feb 2021, Paul Moore wrote: > > > > > > diff --git a/drivers/android/binder.c b/drivers/android/binder.c > > > > > > index c119736ca56ac..39d501261108d 100644 > > > > > > --- a/drivers/android/binder.c > > > > > > +++ b/drivers/android/binder.c > > > > > > @@ -2700,7 +2700,7 @@ static void binder_transaction(struct binder_proc *proc, > > > > > > u32 secid; > > > > > > size_t added_size; > > > > > > > > > > > > - security_task_getsecid(proc->tsk, &secid); > > > > > > + security_task_getsecid_subj(proc->tsk, &secid); > > > > > > ret = security_secid_to_secctx(secid, &secctx, &secctx_sz); > > > > > > if (ret) { > > > > > > return_error = BR_FAILED_REPLY; > > > > > > > > > > Can someone from the Android project confirm this is correct for binder? > > > > > > This looks correct to me. > > > > Thanks for the verification. Should I assume the SELinux specific > > binder changes looked okay too? > > > Yes, those also look good to me. Thanks, that binder changes were the one area I wasn't 100% on, I appreciate the verification. -- paul moore www.paul-moore.com 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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 046F4C433DB for ; Thu, 11 Mar 2021 01:56:59 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C76D64DDA for ; Thu, 11 Mar 2021 01:56:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C76D64DDA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=paul-moore.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=linux-audit-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-278-MYAftRkIOa6Y-4H37sKZOg-1; Wed, 10 Mar 2021 20:56:55 -0500 X-MC-Unique: MYAftRkIOa6Y-4H37sKZOg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0489A80432D; Thu, 11 Mar 2021 01:56:52 +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 98AA05C23E; Thu, 11 Mar 2021 01:56:51 +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 4C5E41809C86; Thu, 11 Mar 2021 01:56:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12B1umgu006899 for ; Wed, 10 Mar 2021 20:56:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8BF1F80566; Thu, 11 Mar 2021 01:56:48 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 869B685774 for ; Thu, 11 Mar 2021 01:56:46 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 206DA185A7BC for ; Thu, 11 Mar 2021 01:56:46 +0000 (UTC) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-546-GKSi3N5kMIC8jBpuzVNMZg-1; Wed, 10 Mar 2021 20:56:44 -0500 X-MC-Unique: GKSi3N5kMIC8jBpuzVNMZg-1 Received: by mail-ed1-f43.google.com with SMTP id i61so423861edd.7 for ; Wed, 10 Mar 2021 17:56:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fgYrALYRpO2A+WbpiwGj0OYEpcJcSYMExr2Frk/9tDY=; b=mHPOWuf14XWqUf08gKH+siudZVOLnanMR4egCu3bffB30bvSL4Q+X/dQqRV4/ovI6u Tuy3idPFeorupo+tVRgweFX/uV7lBaKfcf0znQ+qAbbkKwIqZ+SrSqiE06SyMj6baHgM kHdfJhSb6nQ+eVlYhQszgPKgktl2Z21pOIMcnxcxrSWyCcssFpdC5M+K4+pvOsepwRD2 VqOLsw4hz9+7HdOmjO6vGekpAKybpr9YmNGzM2/XKP9drSgxXwLEU/LSltN6ki1wPwbY x5eqtG9MJgY9lIfSNLplbQFfM5272lpASxnd766eFeZDCyh6gkPQcHpCdGrSsYLa0A8X 5hog== X-Gm-Message-State: AOAM531W7Z8DSp7EC/qc42IjgR4MKdYxzw1YkwKD62Rz4gi1KJ3l7ATn 4ydrnqO0n4999Ot4IpgIdaXVhN86ehcjBjN4+/Lq X-Google-Smtp-Source: ABdhPJwnYcNSoXOULX46ASJXgAFM3cjksNO9omg612I1jwKt1VXSvvAQTA89A9jfj8hUGY9t6MKDJx70wQ43U0b/7e4= X-Received: by 2002:aa7:db4f:: with SMTP id n15mr6176265edt.12.1615427802976; Wed, 10 Mar 2021 17:56:42 -0800 (PST) MIME-Version: 1.0 References: <161377712068.87807.12246856567527156637.stgit@sifl> <161377734508.87807.8537642254664217815.stgit@sifl> In-Reply-To: From: Paul Moore Date: Wed, 10 Mar 2021 20:56:31 -0500 Message-ID: Subject: Re: [RFC PATCH 1/4] lsm: separate security_task_getsecid() into subjective and objective variants To: Jeffrey Vander Stoep 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.79 on 10.11.54.5 X-loop: linux-audit@redhat.com Cc: John Johansen , SElinux list , James Morris , LSM List , 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.16 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 Wed, Mar 10, 2021 at 3:21 AM Jeffrey Vander Stoep wrote: > On Fri, Mar 5, 2021 at 12:44 AM Paul Moore wrote: > > > > On Thu, Mar 4, 2021 at 5:04 AM Jeffrey Vander Stoep wrote: > > > On Sat, Feb 20, 2021 at 3:45 PM Paul Moore wrote: > > > > On Fri, Feb 19, 2021 at 9:57 PM James Morris wrote: > > > > > On Fri, 19 Feb 2021, Paul Moore wrote: > > > > > > diff --git a/drivers/android/binder.c b/drivers/android/binder.c > > > > > > index c119736ca56ac..39d501261108d 100644 > > > > > > --- a/drivers/android/binder.c > > > > > > +++ b/drivers/android/binder.c > > > > > > @@ -2700,7 +2700,7 @@ static void binder_transaction(struct binder_proc *proc, > > > > > > u32 secid; > > > > > > size_t added_size; > > > > > > > > > > > > - security_task_getsecid(proc->tsk, &secid); > > > > > > + security_task_getsecid_subj(proc->tsk, &secid); > > > > > > ret = security_secid_to_secctx(secid, &secctx, &secctx_sz); > > > > > > if (ret) { > > > > > > return_error = BR_FAILED_REPLY; > > > > > > > > > > Can someone from the Android project confirm this is correct for binder? > > > > > > This looks correct to me. > > > > Thanks for the verification. Should I assume the SELinux specific > > binder changes looked okay too? > > > Yes, those also look good to me. Thanks, that binder changes were the one area I wasn't 100% on, I appreciate the verification. -- paul moore www.paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit