Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3021071imm; Sun, 30 Sep 2018 09:57:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV61G5OAU1YgLqYV3ZoNmVAe3TiHOODaOZjr+eprn8OTIsYLG7MtwcdfE03BRYTMXOiqJ9gVJ X-Received: by 2002:a63:66c3:: with SMTP id a186-v6mr7070326pgc.330.1538326663150; Sun, 30 Sep 2018 09:57:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538326663; cv=none; d=google.com; s=arc-20160816; b=rK4IOtcYXPqS9AyWyoddzp2W/gSmmKUmhaO6tkGDM9fci6WCbBq0EkVwLhfkvCVbs9 C/Iy71lcAnRUKTrdzl4w4nApkrU28qIWf0mNNXp/THNW9UOIiWNNusAPL5XDbUuCauAC O+t0NVUVEy68u7WOvph5Gf2kZxjPmlRXG+566qXLZM02oYh2COqPc8vO2x3zKJScrcSX 9t35u9kdx60XGlycxmg4SSvAUMkgpzxmGy53aK0NhKaNmiL7jEM1o5XDgUsYTugjBOes Xh0+ke9FioFfeetvpYxW30eBw/VMHyJOV90H0nyh/gb6Vf3+3Gnm/4qvMbPvE0sgihCN qbTw== 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=jt+YDrRX2EglLGgJgZ/5VjbfR6ozVNQfeBU8ewRjsMI=; b=tOC7Y29DW0np4OWg1FdgnhMZghq7S2ZThp43dJMxcWq6zKTltnhVu//+wbSN6OA5uB yO1zLg45zGerYkf4nhNeQkjL2G1wFUpgwYyZ9rj5OvsWmG8xjcm0PuaMnGipdlkfatlV 71+6kOiWTotFV6iQCZMrES8NyK62uHvLKkG1Xe2Kpbr8caeoi0BjIVmDFveC3vjyJq7T Dwv0OYxE0JkBsD8+Q+ZHtSH6yDNo2TDrIlQ/3e1TAH5FcVOMsUhPteKExX0bTMfw7hGJ 1FUT1WF2wrvlPX4FeQko/VXL3f1FCUFte4D+31Ushnh5NyGz8FjnjIl3Rj0vefKNahPq E2/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="l1auv6I/"; 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 w6-v6si9931180pgp.42.2018.09.30.09.57.28; Sun, 30 Sep 2018 09:57:43 -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="l1auv6I/"; 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 S1728510AbeI3Xa6 (ORCPT + 99 others); Sun, 30 Sep 2018 19:30:58 -0400 Received: from mail-yw1-f65.google.com ([209.85.161.65]:46700 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728192AbeI3Xa5 (ORCPT ); Sun, 30 Sep 2018 19:30:57 -0400 Received: by mail-yw1-f65.google.com with SMTP id j202-v6so87543ywa.13 for ; Sun, 30 Sep 2018 09:57:10 -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=jt+YDrRX2EglLGgJgZ/5VjbfR6ozVNQfeBU8ewRjsMI=; b=l1auv6I/viu1eURjkIoidQvCha3tZW0l7e210B/rPP2fiEeoRt1l9iVVQ0JIf3w1gK YJgK3k/w/7f3Ah7ZEZN4gh/cOh24+SkV4lsIfBJg2++UlsDtF1gAIDve0FqehK4PLJj+ pzDgDE4UvrWHIv2r9sS3lNqBN4xjptmsX6I3U= 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=jt+YDrRX2EglLGgJgZ/5VjbfR6ozVNQfeBU8ewRjsMI=; b=mjUa6IfMTQYk/DtmvlX/J7oqnaY50AK58DwRFAkWpyM/sM30kQtSZn3rW41EhRzPDt RJU2ZteVWI8uFTFO8H34WPoosvRFJhCOiztTmhGi/ag2azTElfrjt/6m/oHqQeavVbyL xr3buOdn/LOZIwPhEpUuQiKYTKWtJVs+OTEMNvFLQTt35+mCKgjb/2UqLpbVNkRJOoFq sWjCX35/waVwTsUQjlBmvvTtlyG3rzKuebSrDV2CZii5xd+nrT/FJljYZiTGd39yF7yI nkJvpbmy3UwSnuivYEigIG26iEy57z46UGHFAqcuQSO3hJpHmKl850JGlYS5LCJ6fGtM ZARQ== X-Gm-Message-State: ABuFfoiw10cBVZ7ThQw40r3mq4fUfKDuQ+cMnHAsweoJqYKDDy6od2tZ /cu39xyJQdKGiy2PJ1rCEbggoUQncQo= X-Received: by 2002:a0d:ff83:: with SMTP id p125-v6mr3998878ywf.65.1538326629790; Sun, 30 Sep 2018 09:57:09 -0700 (PDT) Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com. [209.85.219.178]) by smtp.gmail.com with ESMTPSA id n6-v6sm4195899ywe.89.2018.09.30.09.57.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 09:57:07 -0700 (PDT) Received: by mail-yb1-f178.google.com with SMTP id d14-v6so4660904ybs.8 for ; Sun, 30 Sep 2018 09:57:07 -0700 (PDT) X-Received: by 2002:a25:dd82:: with SMTP id u124-v6mr3911015ybg.171.1538326626727; Sun, 30 Sep 2018 09:57:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:d116:0:0:0:0:0 with HTTP; Sun, 30 Sep 2018 09:57:05 -0700 (PDT) In-Reply-To: <67c14d95-10f6-37d5-ee8a-c1fb6a6d460a@i-love.sakura.ne.jp> References: <20180925001832.18322-1-keescook@chromium.org> <67c14d95-10f6-37d5-ee8a-c1fb6a6d460a@i-love.sakura.ne.jp> From: Kees Cook Date: Sun, 30 Sep 2018 09:57:05 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH security-next v3 00/29] LSM: Explict LSM ordering To: Tetsuo Handa Cc: Casey Schaufler , James Morris , John Johansen , Paul Moore , Stephen Smalley , "Schaufler, Casey" , LSM , Jonathan Corbet , "open list:DOCUMENTATION" , linux-arch , LKML 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 Sat, Sep 29, 2018 at 7:36 PM, Tetsuo Handa wrote: > On 2018/09/30 3:18, Kees Cook wrote: >>> Just wondering what is "__lsm_name_##lsm" for... >>> >>> +#define DEFINE_LSM(lsm) \ >>> + static const char __lsm_name_##lsm[] __initconst \ >>> + __aligned(1) = #lsm; \ >>> + static struct lsm_info __lsm_##lsm \ >>> + __used __section(.lsm_info.init) \ >>> + __aligned(sizeof(unsigned long)) \ >>> + = { \ >>> + .name = __lsm_name_##lsm, \ >>> + >>> +#define END_LSM } >> >> I wasn't super happy with the END_LSM thing, but I wanted to be able >> to declare the name as __initconst, otherwise it needlessly stays in >> memory after init. That said, it's not a huge deal, and maybe >> readability trumps a tiny meory savings? > > The value of .name field is a few bytes string, and is not sensitive > information. Keeping such string in non-__initdata section unlikely > increases total memory pages required for that module. > > Unless we need to generate unique address of such string for some reason, > I think that this saving is pointless. Okay, sounds good. I will adjust the macro and respin with a v4. Thanks! -Kees -- Kees Cook Pixel Security