Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp31410pxf; Wed, 24 Mar 2021 19:59:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydu8HAjVWK+EjUbEvUm/t6iXqYUcQKLSBhA4HTdvuotS2w5eEz3oAnoHavm2VWgYi/IdQk X-Received: by 2002:a17:906:94ca:: with SMTP id d10mr6853058ejy.107.1616641171560; Wed, 24 Mar 2021 19:59:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616641171; cv=none; d=google.com; s=arc-20160816; b=EV+0Aki+wBwTrMNZRrr/BpaGPj9DRXKHgJxyKY3R/7ZNZx0a5DEMhI+E3ZhbRpZw+n sWGA058pZiGnZGBJZRdhM+dYZwPjvVzWZNhpg00VDrT1gLPBt3sKXuNBJHwMWP4hYJfs mywamETxsXZ1RJ/m/tXe4xoxV4PfhBEbkczvqVnkRNJfh6sBDfEKTFceKeUKJvAAhklu 2LmK3G/L2gZ5xzzrfwZl/B2kHTbxGMWzizrwqzZuwDv2IwjEZTlaQpRVJTHrB+gChYxD npkCl2UHg9r8tZAEUsy6AzFrZzEwTu6r+3GutYkQqRGgq2KthdH4gEIjrlvjIKhcFUVt de5A== 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=E19TEuvX44zTRKr5TDA3GuLli/wt/Gp44osX4iYRJ3I=; b=gJO+DXBIRSqUKyEcYRhilJQolXhIl2Lyn1PfaeETjUK4hdHXOfJUJeI0RfRfZt4OJ2 lvLcl6HYQk66CJb6b1m1uxXb+50/Kh+iFZ7dFiT1UdE8pgTQLoIGbp9P/DAOOLYF+rP0 lEmOGq6tpMzCVj4JXgwi5NndWDwV07q3UN/25+Fh96BPy9vOl7nc5EOzxXOCUlx4aJ3x oLSaMckytBvun8mT3BMrIH2tM6JoFvOSBlyoxdtyyLJeKFzvu8jGFFKGs//IxwbpXP02 N9qYntQSprP78ReTOZFyITsHTT/NBrJxlGraZgx0JzJQsdP1attvRLaibQp66aSMbW/f HneA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EasYVsqF; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j5si3028906edh.218.2021.03.24.19.59.08; Wed, 24 Mar 2021 19:59:31 -0700 (PDT) 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=@google.com header.s=20161025 header.b=EasYVsqF; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230062AbhCXLiH (ORCPT + 99 others); Wed, 24 Mar 2021 07:38:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230381AbhCXLhg (ORCPT ); Wed, 24 Mar 2021 07:37:36 -0400 Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8046C061763 for ; Wed, 24 Mar 2021 04:37:36 -0700 (PDT) Received: by mail-qk1-x729.google.com with SMTP id g20so17586809qkk.1 for ; Wed, 24 Mar 2021 04:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=E19TEuvX44zTRKr5TDA3GuLli/wt/Gp44osX4iYRJ3I=; b=EasYVsqFNBZNE9BpTHv2ij/vzUXMWcqnSGBz0GgxkYhJJrCIlDzTyXWuwUHFd4G5Wb fIMD51n3s35jMGUiweEcXLUgE6xGSJhvZtyLdmN9Q/XmSs2h7hbEbf+otr8un77zYNNW s4C6FlmIoPAsr+QNxuMB3vcxwrJ7o34W5wlEOfLgl8oC0/xBZIQI8e0urTzVkSN8WF+V zGeKQxo49TEk4AB6qj+x7v79B2cTZMcFJt2VsCIHsQw39ZOz/LXEir6lsr+WQjmvdQTX r4wQ5pun/bhRM/TRAJNL/GjArtamZpiv2hBMmgW4tzVvaahP+PVAV4yxvoZGLo2rLbc/ Qf2A== 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=E19TEuvX44zTRKr5TDA3GuLli/wt/Gp44osX4iYRJ3I=; b=jkrofpwTf0BJ5k3OvcftCvVKnDCO4VC8jmyqrbIVmAiaOEGz/W5JTtgrx1zlKf6hno JDoBnZN4lNwXcDG6LEUBzLbwiWrWJsuhb842C70FT4kx/+hRJaQHGwhNA73R4IHDGzTW tO23H+Tefgryo+StqJbt8buWHQ1ynW5F0wDv734ewzL8XeMWxprxGPnk6wBpHVlIXNfe gpi80QiiQOzECPfe0qF/Hx/W+X/SNgwcwMyP4326LyWovzYhB8gO8rMeGpdpXGmusfxY agYcazlL995xlceYxQ+9vxqUBd9JH0iAIFPYyXVs8FkH1Y4t/fT/O9k4ypmIDxqx8tuA 7TsQ== X-Gm-Message-State: AOAM533WfJpp4ILqLQadWoSmeLdRAPTfgfNL9/a17KlJfiadLUs/sqp7 x3C8nykRnXV1x/BAGd2F7meg4F29XdzPA8Yo4qTAXA== X-Received: by 2002:a05:620a:981:: with SMTP id x1mr2381201qkx.501.1616585849962; Wed, 24 Mar 2021 04:37:29 -0700 (PDT) MIME-Version: 1.0 References: <20210319200358.22816-1-zohar@linux.ibm.com> <20210319200358.22816-2-zohar@linux.ibm.com> <8450c80a-104a-3f36-0963-0ae8fa69e0f2@i-love.sakura.ne.jp> <1a2245c6-3cab-7085-83d3-55b083619303@i-love.sakura.ne.jp> <8039976be3df9bd07374fe4f1931b8ce28b89dab.camel@linux.ibm.com> <8a8763a7-eeeb-3578-d50c-c15919fbe1f9@i-love.sakura.ne.jp> <3ed2004413e0ac07c7bd6f10294d6b6fac6fdbf3.camel@linux.ibm.com> <721b4f8d38b014babb0f4ae829d76014bbf7734e.camel@linux.ibm.com> <0a0c5cc5-0e1b-ef01-60c4-5247af2124f4@i-love.sakura.ne.jp> <37aeaf361bfbd800e29db761f5160f2ce1869298.camel@linux.ibm.com> <05ca20d0-9596-152e-4da2-1ffe28c52055@i-love.sakura.ne.jp> In-Reply-To: <05ca20d0-9596-152e-4da2-1ffe28c52055@i-love.sakura.ne.jp> From: Dmitry Vyukov Date: Wed, 24 Mar 2021 12:37:18 +0100 Message-ID: Subject: Re: [RFC PATCH 2/2] integrity: double check iint_cache was initialized To: Tetsuo Handa Cc: Mimi Zohar , linux-integrity@vger.kernel.org, James Morris , "Serge E . Hallyn" , linux-security-module , LKML , Eric Biggers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 24, 2021 at 12:21 PM Tetsuo Handa wrote: > > On 2021/03/24 20:10, Mimi Zohar wrote: > > On Wed, 2021-03-24 at 19:10 +0900, Tetsuo Handa wrote: > >> On 2021/03/24 1:13, Mimi Zohar wrote: > >>> On Wed, 2021-03-24 at 00:14 +0900, Tetsuo Handa wrote: > >>>> On 2021/03/23 23:47, Mimi Zohar wrote: > >>>>> Initially I also questioned making "integrity" an LSM. Perhaps it's > >>>>> time to reconsider. For now, it makes sense to just fix the NULL > >>>>> pointer dereferencing. > >>>> > >>>> Do we think calling panic() as "fix the NULL pointer dereferencing" ? > >>> > >>> Not supplying "integrity" as an "lsm=" option is a user error. There > >>> are only two options - allow or deny the caller to proceed. If the > >>> user is expecting the integrity subsystem to be properly working, > >>> returning a NULL and allowing the system to boot (RFC patch version) > >>> does not make sense. Better to fail early. > >> > >> What does the "user" mean? Those who load the vmlinux? > >> Only the "root" user (so called administrators)? > >> Any users including other than "root" user? > >> > >> If the user means those who load the vmlinux, that user is explicitly asking > >> for disabling "integrity" for some reason. In that case, it is a bug if > >> booting with "integrity" disabled is impossible. > >> > >> If the user means something other than those who load the vmlinux, > >> is there a possibility that that user (especially non "root" users) is > >> allowed to try to use "integrity" ? If processes other than global init > >> process can try to use "integrity", wouldn't it be a DoS attack vector? > >> Please explain in the descripotion why calling panic() does not cause > >> DoS attack vector. > > > > User in this case, is anyone rebooting the system and is intentionally > > changing the default values, dropping the "integrity" option on the > > boot command line. > > OK. Then, I expect that the system boots instead of calling panic(). > That user is explicitly asking for disabling "integrity" for some reason. That was actually my intention. The prebuilt kernel that I use for things has all LSMs enabled, but then I needed to try some workload with only 1 specific LSM, so I gave a different lsm= argument.