Received: by 2002:ac0:adb4:0:0:0:0:0 with SMTP id o49-v6csp6435imb; Tue, 10 Jul 2018 19:28:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeElcbai+Yv0LnfZjNAdFmYGKNKCUEhMOLFjYpI/93A/xTQ7udUPyEXOxwCNv5b3hvtxp2O X-Received: by 2002:a63:3c4a:: with SMTP id i10-v6mr24751884pgn.415.1531276094298; Tue, 10 Jul 2018 19:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531276094; cv=none; d=google.com; s=arc-20160816; b=Ng+34NfWzVdOPOXARyfsBE+KlY/4CO4ELxP/DB03sNLbpUBZg89hvUCBE7nddicoJv UMf08v0KfpsURsKymtE5WtolY5Gf8lwzXpCXv2RHMcf80ebUuplQVjX2XVk0BUKsVTgS NZZ4xtQfPmfMYDVwAcX5wrHahy7W7j4yw9sQbgXB5crQycpcK4eLDPWFi8Zya3NTpBNT 2Ka2jssJpJENS47j+GDrTnXqdkCgJzvoxUGCixdUdxrYcbNfLtitOTc0WkQSLLEzFGTc NPUyDI13UNjrZd3s56FTGyX9/QJ+P1ceeGEV7WrZQprIVYifPp1M+uQpqkVZKtcyk240 BCgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=4QyG88VipvjTvCsOXKT4xVyYE6XugTMvfX0Y/bEbt5E=; b=vCeL6rpsUp/Yjy1etwzMQ8q6+YoPzRM6g7XY/OMGJFnk6POag3ll0iEWW07QKMWB37 AIPTomoZGNprilXaMqZa9eLx8fsjW1/WLfTb/pX6t7HJScjm++sL0tKWcGdOzIRO9u7t CEVpT/YcxW2OO37B3bTmq9b+5rZl7htMbKsccnjKMXYdL8kAxRZas0z6+B6/+KCzKJYK RM+iB1p4YQNcnS1/0JwIqc2VtzJnLxki8sitx/hHIo04Tfm0+5FWTPmbJHVf4D4I0x1D EsJJQ0WAjazQeYHDNW7R9uTWgTulfGey51eTaNpC3Sg58VS2PN1oZCLqaIC1xIZlUP4I Ps8Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r63-v6si17908636plb.366.2018.07.10.19.27.52; Tue, 10 Jul 2018 19:28:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732595AbeGKC2e (ORCPT + 99 others); Tue, 10 Jul 2018 22:28:34 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:45530 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732378AbeGKCYE (ORCPT ); Tue, 10 Jul 2018 22:24:04 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fd4lb-0003IL-6l; Wed, 11 Jul 2018 02:22:07 +0000 From: Al Viro To: Linus Torvalds Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Miklos Szeredi Subject: [RFC][PATCH 11/42] security_file_open(): lose cred argument Date: Wed, 11 Jul 2018 03:21:35 +0100 Message-Id: <20180711022206.12571-11-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180711022206.12571-1-viro@ZenIV.linux.org.uk> References: <20180711021136.GN30522@ZenIV.linux.org.uk> <20180711022206.12571-1-viro@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro Signed-off-by: Al Viro --- fs/open.c | 2 +- include/linux/security.h | 5 ++--- security/security.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/open.c b/fs/open.c index c8fd5126c50e..008a65e82de5 100644 --- a/fs/open.c +++ b/fs/open.c @@ -779,7 +779,7 @@ static int do_dentry_open(struct file *f, goto cleanup_all; } - error = security_file_open(f, f->f_cred); + error = security_file_open(f); if (error) goto cleanup_all; diff --git a/include/linux/security.h b/include/linux/security.h index 63030c85ee19..88d30fc975e7 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -309,7 +309,7 @@ void security_file_set_fowner(struct file *file); int security_file_send_sigiotask(struct task_struct *tsk, struct fown_struct *fown, int sig); int security_file_receive(struct file *file); -int security_file_open(struct file *file, const struct cred *cred); +int security_file_open(struct file *file); int security_task_alloc(struct task_struct *task, unsigned long clone_flags); void security_task_free(struct task_struct *task); int security_cred_alloc_blank(struct cred *cred, gfp_t gfp); @@ -858,8 +858,7 @@ static inline int security_file_receive(struct file *file) return 0; } -static inline int security_file_open(struct file *file, - const struct cred *cred) +static inline int security_file_open(struct file *file) { return 0; } diff --git a/security/security.c b/security/security.c index 68f46d849abe..235b35f58a65 100644 --- a/security/security.c +++ b/security/security.c @@ -970,11 +970,11 @@ int security_file_receive(struct file *file) return call_int_hook(file_receive, 0, file); } -int security_file_open(struct file *file, const struct cred *cred) +int security_file_open(struct file *file) { int ret; - ret = call_int_hook(file_open, 0, file, cred); + ret = call_int_hook(file_open, 0, file, file->f_cred); if (ret) return ret; -- 2.11.0