Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp3861849ima; Tue, 23 Oct 2018 12:29:01 -0700 (PDT) X-Google-Smtp-Source: ACcGV62t0iBuWZQEcIDzbkTIc4lhET71fo2z/7LvFuno1MDpbAfXAoA/+on5lXbJc+lJfHtwOa7c X-Received: by 2002:a17:902:7c84:: with SMTP id y4-v6mr20079628pll.221.1540322941705; Tue, 23 Oct 2018 12:29:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540322941; cv=none; d=google.com; s=arc-20160816; b=ohohHYjoqBGN+KHGjGFDZ+15hJ2VvyJfntLj3vfhwTTLC366Pqr9dR4DW82pjkXCzk NjvO7cjqHoFYAlEiXhsJkzOcmsXcvH9DUJZfP6MZ5W0EhWsi+2X1sV3MUTr9llf5fGjv 0m+G2jgedU/4PitF8tPlbKLzO/+ZKUTG6LnixcC1t0ZkjeP2yx5vtbVwHt3cP9ALphkO rqnxXi9AMUfrPlgVh8krh+WDRG/So3/LTfLdjmHxldEo2XWXngl080aAN+Zm7HbG7nzQ FcV9u2gS4xqvSFNMUiURve0tej9uzjGNVAbMt1EsmtRi7ajKleL9QRPwi0WifIKPSSfM rZLw== 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=4a2jqM3lTjp6nqzy1986zEqtztKHIkw357dzpSSRP/s=; b=P83EJ+8+lZY1C3Gk3aVyvgDAmhPL7hOn+csGsp4JpnwVlAAe75wgAmXgHhnAzM56GW lQ/G3e8MLkunNoskq+fOEsLkuB6OWV7II9MB6+3YiLp6PhWe+VicC6MaI7MlcbYVwsZr 509tDgrFsH0Ecq/fjZGcvALUrVFD8zEaakzw7YUF+6miGrW+cnoraEhuCB51KvFBA9Zf 40v2c5NdWSoNftQjOrWHofkdguvCyVqiwjlfJMFavQlRUvNrrj4+MycfhmNIUGTVey1S koHxNVBy9IheCwHLtpGBMGXFIs+u+lKCxsJofKGQJ09QSE43hiBBzpBV9cdCfgkwqE8x brBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IEjiVUR4; 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 e1-v6si2151399pld.277.2018.10.23.12.28.46; Tue, 23 Oct 2018 12:29:01 -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=IEjiVUR4; 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 S1728828AbeJXDwu (ORCPT + 99 others); Tue, 23 Oct 2018 23:52:50 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:46751 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727758AbeJXDwu (ORCPT ); Tue, 23 Oct 2018 23:52:50 -0400 Received: by mail-yb1-f196.google.com with SMTP id o8-v6so1053660ybk.13 for ; Tue, 23 Oct 2018 12:28:04 -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=4a2jqM3lTjp6nqzy1986zEqtztKHIkw357dzpSSRP/s=; b=IEjiVUR4gUGHyGBDhdUsILPziQ4j0v1TzwuMhwCoIsT07lZ6Y20WteLAZidD2eqcit fEmCAXQ9JXdRGb5GUQdidDJ7EI+omct2X9vjsJ/ayayaz9sb2NrBmlpbOWFHze4k9mQo vfPhGt1VHmyYUcgV6uoLkJQVv+uF4ZLYM8sSs= 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=4a2jqM3lTjp6nqzy1986zEqtztKHIkw357dzpSSRP/s=; b=kKNU8Mzp/cXJz5hm/mrY7/LrIEFFFnebycHucTL2S6iTNCJFtzmMGDPQR2RsTN3W3d td6SQflPw8Sx/9bu0VqDLzwC+ymK61CB6FC5jcq48XDPZVpeflNm5kQIg4i3YtlpqUGA Tkti7ug2kIDzHVmexYtJWMsYNli+uJOdPh0VlWdCVWGpuwzoD0Q/eOZw+B4j67peC21l jKNyTskSwce7ExmRUwpQhJ2/Isq3kpHlVfYGw2KkZQr/g2kjMaz2KGxGARgmzawAiB3L bQRt2ZYu/3AJrYHPJMtYVU6liTvKEMK3DPuo+nm7mDVUQkiY2ijl8adMZC+RL5A4l7Xe 7E3w== X-Gm-Message-State: ABuFfojZV2LSIAscYiBd5oK5p3rwX60t9WyyUcG4CO4D8OJpnPUY0hzm 56/l+GIwnJWQ1NT/RVnso/vlKgceI08= X-Received: by 2002:a25:ba0f:: with SMTP id t15-v6mr35917220ybg.334.1540322883949; Tue, 23 Oct 2018 12:28:03 -0700 (PDT) Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com. [209.85.219.174]) by smtp.gmail.com with ESMTPSA id p7-v6sm1077343ywd.75.2018.10.23.12.28.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 12:28:02 -0700 (PDT) Received: by mail-yb1-f174.google.com with SMTP id o8-v6so1053593ybk.13 for ; Tue, 23 Oct 2018 12:28:02 -0700 (PDT) X-Received: by 2002:a25:c6c8:: with SMTP id k191-v6mr1008226ybf.171.1540322881687; Tue, 23 Oct 2018 12:28:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:3990:0:0:0:0:0 with HTTP; Tue, 23 Oct 2018 12:28:01 -0700 (PDT) In-Reply-To: <20181023110837.27840-1-efremov@linux.com> References: <20181023110837.27840-1-efremov@linux.com> From: Kees Cook Date: Tue, 23 Oct 2018 12:28:01 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/9] security: fix documentation for the socket_post_create hook To: efremov@linux.com Cc: James Morris , "Serge E. Hallyn" , Eric Paris , Paul Moore , John Johansen , 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 Tue, Oct 23, 2018 at 4:08 AM, wrote: > From: Denis Efremov > > This patch slightly fixes the documentation for the > socket_post_create hook. The documentation states that > i_security field is accessible through inode field of socket > structure (i.e., 'sock->inode->i_security'). There is no inode > field in the socket structure. The i_security field is accessible > through SOCK_INODE macro. The patch fixes the documentation accordingly. > > Signed-off-by: Denis Efremov Reviewed-by: Kees Cook -Kees > --- > include/linux/lsm_hooks.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h > index 8f84ef819e00..accf6f34ac8e 100644 > --- a/include/linux/lsm_hooks.h > +++ b/include/linux/lsm_hooks.h > @@ -752,9 +752,9 @@ > * socket structure, but rather, the socket security information is stored > * in the associated inode. Typically, the inode alloc_security hook will > * allocate and and attach security information to > - * sock->inode->i_security. This hook may be used to update the > - * sock->inode->i_security field with additional information that wasn't > - * available when the inode was allocated. > + * SOCK_INODE(sock)->i_security. This hook may be used to update the > + * SOCK_INODE(sock)->i_security field with additional information that > + * wasn't available when the inode was allocated. > * @sock contains the newly created socket structure. > * @family contains the requested protocol family. > * @type contains the requested communications type. > -- > 2.17.2 > -- Kees Cook