Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754751AbdDLQWJ (ORCPT ); Wed, 12 Apr 2017 12:22:09 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:36611 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753313AbdDLQWD (ORCPT ); Wed, 12 Apr 2017 12:22:03 -0400 MIME-Version: 1.0 In-Reply-To: References: <1491734530-25002-1-git-send-email-tixxdz@gmail.com> <1491734530-25002-2-git-send-email-tixxdz@gmail.com> <2698e97b-397e-0fc0-84a1-dc9a4226117a@schaufler-ca.com> From: Djalal Harouni Date: Wed, 12 Apr 2017 18:22:01 +0200 Message-ID: Subject: Re: [kernel-hardening] Re: [PATCH RFC v2 1/3] LSM: Allow per LSM module per "struct task_struct" blob. To: Kees Cook Cc: Casey Schaufler , Linux Kernel Mailing List , Andy Lutomirski , Andrew Morton , "kernel-hardening@lists.openwall.com" , LSM List , Linux API , Dongsu Park , James Morris , "Serge E. Hallyn" , Paul Moore , Tetsuo Handa , Greg Kroah-Hartman Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1408 Lines: 30 On Tue, Apr 11, 2017 at 6:43 AM, Kees Cook wrote: > On Mon, Apr 10, 2017 at 1:00 PM, Djalal Harouni wrote: >> On Mon, Apr 10, 2017 at 9:26 PM, Casey Schaufler wrote: >>> I think that would be the prudent approach. There is still >>> the possibility that blob sharing (or full stacking, if you >>> prefer) won't be accepted any time soon. >> >> Ok Casey! I will wait for more feedback, and if other maintainers do >> not object, I will convert it back to rhashtables in next iterations >> making sure that it should be simple to convert later to a blob >> sharing mechanism. > > Would it be possible just to add a single field to task_struct if this > LSM is built in? I feel like rhashtables is a huge overhead when a > single field is all that's needed. Well, yes rhashtables can have an overhead especially when reclaiming memory back, I could not identify a way how to separate tables unless we use cgroups as an ID. Anyway this of course could be added in task_struct and updated to work like the capability security hooks rather than a proper LSM with its own name. But as noted in the other response, we may need task->security field for Yama anyway. I'm open to suggestion ? I may try to converge the task->security blob with what Casey is proposing and see! otherwise fallback to task_struct as a last resort! Thanks! -- tixxdz