Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13852286pxu; Mon, 4 Jan 2021 06:19:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhnK1wBI+O5Y1PHIV3/5F5s82dxvPTp52W2Uy0NhtBujif5yA4SbqamYTWDxTlIHcp4yhm X-Received: by 2002:a17:906:af49:: with SMTP id ly9mr64235747ejb.38.1609769942074; Mon, 04 Jan 2021 06:19:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609769942; cv=none; d=google.com; s=arc-20160816; b=eZiI7IYHFt39KLy1+eJGL/lv/JIII3ZIPR0/RlQurFl0a4p5WBatOpzqgf++jYNkp+ NjXq3a/uFVOYBLa1wUE+B86El4Z22nlmtJUZkxIS6/TnRPl+kSluBA8JLfapsg3yZgG/ vl6uALLPEASFb2AMHKRmGn18CGsPAQvWwfDTXigjorU2HCpr5SZomSSNt6ev/xzAWhUr hg/LlJIyNsa2nIUYHL7isp6EFHIIqD9hBqaNPcGL66ThNc/+VU5b3I5bOQ284WvYJe61 I/c0X+HX/DaIha8bfLIwFiq69U0apcKV3X89t+knxiVZ1QKCxxz5tXaNQrHgFrTnvTHk mMug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=i5CNFkVFgsA9BzNgX/I+jI3gR5jn/LsiIfWVngBWCIo=; b=MNa/lHeJrnrNi6fmI2BuHdMUhv5z/FbqqwMUNINToUW4zTXhm2tpC5uNL+F4AGfJ6C fsCVQkqixMdfArci6WIFKqWw8RieTqa7KEpqpfGTVU5/P7wdGqiQ7dZJot4V9pWndvRT rlpud78XLlSRNd7OOXyTuykfIb1E3fMF0EZE7uEduXxqnbg4UX/pJBx6ESymLIZfrTX1 5n6CpWRWcBmnTOosrw0pU0Tt/7pVMRoPKWDs2pdy7EhgJuY/hf3lN4wlx9rqR8MPWgf0 0AYdUUzikRBV00436gKg0V+uuboiZTDw/xFX4h+NgV23kV8RqswjFbXdDaraQsj/l75a QZrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="lrB/U4f+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si31885645ejd.607.2021.01.04.06.18.38; Mon, 04 Jan 2021 06:19:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="lrB/U4f+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727126AbhADOR2 (ORCPT + 99 others); Mon, 4 Jan 2021 09:17:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726396AbhADOR1 (ORCPT ); Mon, 4 Jan 2021 09:17:27 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EC5FC061574; Mon, 4 Jan 2021 06:16:47 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id m25so64568952lfc.11; Mon, 04 Jan 2021 06:16:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=i5CNFkVFgsA9BzNgX/I+jI3gR5jn/LsiIfWVngBWCIo=; b=lrB/U4f+X00uogk3MEbesYfb4TzdSeycj7JvT0MRsMg5ipEeIJPTYY0FHeLrcjCKmK NEQnEIhA4BnBFtjxZ2FBPaz2Jn7zj1CVD7xmcTjU9L3Y9W8CBrMhPi1Rnp9bzoKbcBQI 5Ax5RINcChzD9QF0oJzx147Evo+dV2/qx3W36Sz08uqf4aI9DkCKRSxQZtDY86NZRBUM 2xha5Cxl5mpL3Y8YgkA2GSnQ83nE8tgtGgoyx9W+n/5yYqIBa85ZTrv4wu/VjAo3DdVh omkJOCzU4iy814/Ltl6aqvFXaRhWk6l8rLdf+XU9ohcrhL5B7zCS+gyI2BtbeLZCZWIa k1tg== 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=i5CNFkVFgsA9BzNgX/I+jI3gR5jn/LsiIfWVngBWCIo=; b=I8vZdre3ZFo/zcv1djmODHPXx8Ttmqs+HiS0Yc2ppvimg1pri5HYhmmGQJ4eXDHxjn yEH3P2eBN8O+UynZRB37mVb2z0FGxSZuCgwtRcV8+ig7250l0YLfG035V8HoH31jdGcE NVLEF92ur4uHp7plsoeL9q0DsoG68mFK6hPRVwzTRc0Z4WrD5LyeBTHTfqwGQRMQJSAc d8SWkpOPnaG4+PaoIi3hFjy6xAr3eFA1mUqW30/2BPhBDTEF6aScW85I37+PwC80oOpy ci5fZRbQgx7BFZUirE+RKgai0Kz6g/eyEVH8qsUnmJ5Uy0SIsSz2dFoPaYWwFLVJ9sgj o3bA== X-Gm-Message-State: AOAM533QbbYZke7zpHPW6IuKnYeDodDEOLWp/OmoXu3Ojb0h3hQEUszD 5y23H+Nn78uteBKUeWPyuCyVdVPlwSEbHnQ6Smg= X-Received: by 2002:a05:651c:200a:: with SMTP id s10mr34175031ljo.492.1609769805661; Mon, 04 Jan 2021 06:16:45 -0800 (PST) MIME-Version: 1.0 References: <20201219000616.197585-1-stephen.s.brennan@oracle.com> <20201219000616.197585-2-stephen.s.brennan@oracle.com> In-Reply-To: <20201219000616.197585-2-stephen.s.brennan@oracle.com> From: Stephen Smalley Date: Mon, 4 Jan 2021 09:16:34 -0500 Message-ID: Subject: Re: [PATCH v3 2/2] proc: ensure security hook is called after exec To: Stephen Brennan Cc: Alexey Dobriyan , James Morris , "Serge E. Hallyn" , LSM List , Paul Moore , Eric Paris , SElinux list , Casey Schaufler , Eric Biederman , Alexander Viro , Linux FS Devel , linux-kernel , Matthew Wilcox Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 18, 2020 at 7:06 PM Stephen Brennan wrote: > > Smack needs its security_task_to_inode() hook to be called when a task > execs a new executable. Store the self_exec_id of the task and call the > hook via pid_update_inode() whenever the exec_id changes. > > Signed-off-by: Stephen Brennan Sorry to be late in responding, but the proc inode security structure needs to be updated not only upon a context-changing exec but also upon a setcon(3) aka write to /proc/self/attr/current just like the uid/gid needs to be updated not only upon a setuid exec but also upon a setuid(2). I'm also unclear as to why you can't call security_task_to_inode during RCU lookup; it doesn't block/sleep AFAICT. All it does is take a spinlock and update a few fields.