Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6074127imm; Wed, 12 Sep 2018 16:11:04 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZFInLBlSB/7HglnlAvSB/vuO4vKJXps3/1Booz3mrOtM5IXEFK4YIKq8Ren4F7MKQOkIjj X-Received: by 2002:a17:902:82c9:: with SMTP id u9-v6mr4503429plz.138.1536793864506; Wed, 12 Sep 2018 16:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536793864; cv=none; d=google.com; s=arc-20160816; b=FkzNVKH6EFQSer/BYk5JwXX7mnAAAZ2m/1lgdHH/Y1mxLS6iMVUeXPrJjYvQqPOzAw UIepZn9Vjbce8KcQblNfMUiXyBGWgCjiIOF1aypvznNoDdz3OsE07r4oOlfM0PcVIZsj CdSObjPCaCKU4Pxy/uw+4ShqcM9s3aKdgyjQEXGdh1M2uj/kA5k90KFY15MgYoQmSLif VALf2QAKUFuwPDxtgN2NaSgztspTmO+tssZG2fl1MYFlURfAHjDq8m8xsB31qgwipEFM WfEddiVKcSBLgV4ClxSnsCMZ8YgEYA9gYLNLuKJWhm6+JE6azhFHhK569eHvNBusFdgw AbCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=VBpOXpCINY2YeLFfXYjVRFqff0/PcTakTrlP2W3g5fI=; b=0B6uwBfE2wtkxw4N2T+Sj/PDvZhPTk/c34dUmbKiDiQQgQ1/Sdwk76Paf7HfzZ3seg KjUCd7jAsdGNFQvPTi2sb6PtJ6q6om+JLAnDKJto8bJ1pJhVCvRA8RcnPHcLcmpnOKEi 3uod9CqgKGzOGvQKbcKGYC/1oOHsYR8YjOd6NdBkfAO4zZcZBcxyrXOcSsaw+KKFnERV 30ApYKCTE9pdyx6t9VMqKMagqdWYpI/ysnpzYed25kGYEoW4MPTPi9HNlw4AoVFwH+Gv e4hqUD1ZFUfpy3TUJ1CS6R0OnoLkOF7GZMFra/MmU2ms0LkiY2HbvVZOn9yGaQSsB3V7 D6sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RzfNcAQ1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f15-v6si2377421pli.194.2018.09.12.16.10.49; Wed, 12 Sep 2018 16:11:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RzfNcAQ1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726855AbeIMERM (ORCPT + 99 others); Thu, 13 Sep 2018 00:17:12 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:37889 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726616AbeIMERM (ORCPT ); Thu, 13 Sep 2018 00:17:12 -0400 Received: by mail-yb1-f194.google.com with SMTP id e18-v6so2506248ybq.5 for ; Wed, 12 Sep 2018 16:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VBpOXpCINY2YeLFfXYjVRFqff0/PcTakTrlP2W3g5fI=; b=RzfNcAQ1ZCDn8oGFMHHI8PQJpvatFpgB5RF8JkT/HruzKLHIpOmIwqSa4ZKDOHGvbq liMEwOHa3+zslDJCOXfJYnaxwlxqhs6kLlhnkT+faRHMlGZmFp+hWZzGjf52hP07+0vH KOzzrn3EKAKyVSX1VfvNjkZRMhBAWvQi5Rz44= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VBpOXpCINY2YeLFfXYjVRFqff0/PcTakTrlP2W3g5fI=; b=lQ3wG90aQvjjlWpklcbXuOJ/aFLu1+2s1AJ2HQbWMi1niAw1MMhmEA31W8WIt+Y8w6 qNq13UK/95D/IYIxdbLBmWbKkaUk1x1V9rghtQD7GM+LAeFmWhp4RKTvbpYC5g0ZSxUn jnri/OAEvKRsBwI2xqMWLF1eOOj2pyDi/52h/nPpgtjknRcKGgoIxG1rC2C9Tp8KIRgL YTAbJXINS0JHPY5v+WU8L0UFd6etYsQyiSfUuQqxOhSQskl1KeSdecIZ63UUEDzbgm0/ cLf0j5rTQpu5b81M5pvCArx4eQZ+EVNbrP5q0bRmJACFP74EFqpVfpJlDoMwXN9RxkIJ EYhQ== X-Gm-Message-State: APzg51CXUlo+BkVIY0oAqslh5PM4pBL67hbp3mUx74gCV2qnPmugTKoq fZiR/+oEOwrydbQP/4qeNvTdd38B3fA= X-Received: by 2002:a25:2183:: with SMTP id h125-v6mr2166019ybh.339.1536793828499; Wed, 12 Sep 2018 16:10:28 -0700 (PDT) Received: from mail-yw1-f42.google.com (mail-yw1-f42.google.com. [209.85.161.42]) by smtp.gmail.com with ESMTPSA id l3-v6sm588711ywd.98.2018.09.12.16.10.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 16:10:27 -0700 (PDT) Received: by mail-yw1-f42.google.com with SMTP id y134-v6so410747ywg.1 for ; Wed, 12 Sep 2018 16:10:26 -0700 (PDT) X-Received: by 2002:a81:4e01:: with SMTP id c1-v6mr2229904ywb.237.1536793826425; Wed, 12 Sep 2018 16:10:26 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:5f04:0:0:0:0:0 with HTTP; Wed, 12 Sep 2018 16:10:25 -0700 (PDT) In-Reply-To: <39bcaa18-4c53-f386-5e89-8903a49a3256@schaufler-ca.com> References: <39bcaa18-4c53-f386-5e89-8903a49a3256@schaufler-ca.com> From: Kees Cook Date: Wed, 12 Sep 2018 16:10:25 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 03/10] SELinux: Abstract use of cred security blob To: Casey Schaufler Cc: LSM , James Morris , LKLM , SE Linux , John Johansen , Tetsuo Handa , Paul Moore , Stephen Smalley , "linux-fsdevel@vger.kernel.org" , Alexey Dobriyan , "Schaufler, Casey" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 11, 2018 at 9:41 AM, Casey Schaufler wrote: > Don't use the cred->security pointer directly. > Provide a helper function that provides the security blob pointer. > > Signed-off-by: Casey Schaufler Like smack, this seems to be largely: s/$identifier->security/selinux_cred($identifier)/ s/current_security()/selinux_cred(current_cred())/ Is that right? The one __task_cred() use seemed to be fully contained under rcu read lock. Reviewed-by: Kees Cook -Kees -- Kees Cook Pixel Security