From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f193.google.com ([209.85.210.193]:42029 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728890AbeIFXVT (ORCPT ); Thu, 6 Sep 2018 19:21:19 -0400 Received: by mail-pf1-f193.google.com with SMTP id l9-v6so5714876pff.9 for ; Thu, 06 Sep 2018 11:44:33 -0700 (PDT) From: Andrei Vagin To: David Howells Cc: linux-fsdevel@vger.kernel.org, Andrei Vagin Subject: [PATCH dhowells/mount-api] fs: return -ENOPARAM from security_fs_context_parse_param by default Date: Thu, 6 Sep 2018 11:44:26 -0700 Message-Id: <20180906184426.32413-1-avagin@openvz.org> In-Reply-To: <18703.1536228984@warthog.procyon.org.uk> References: <18703.1536228984@warthog.procyon.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: Andrei Vagin It returns 0 to indicate that it processed the argument and that the argument doesn't belong to the filesystem. It returns -ENOPARAM to indicate that the argument should be passed along to the filesystem. Any other error is an actual error. // David Howells Signed-off-by: Andrei Vagin --- include/linux/lsm_hooks.h | 4 ++++ include/linux/security.h | 2 +- security/security.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index ceb487c3fbc7..d333ceebf056 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -103,6 +103,10 @@ * Validate the filesystem context preparatory to applying it. This is * done after all the options have been parsed. * @fc indicates the filesystem context. + * Returns 0 to indicate that it processed the argument and that the argument + * doesn't belong to the filesystem. It returns -ENOPARAM to indicate that + * the argument should be passed along to the filesystem. Any other error is + * an actual error. * @sb_get_tree: * Assign the security to a newly created superblock. * @fc indicates the filesystem context. diff --git a/include/linux/security.h b/include/linux/security.h index dbed5326b45c..bae191a96c73 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -576,7 +576,7 @@ static inline void security_fs_context_free(struct fs_context *fc) static inline int security_fs_context_parse_param(struct fs_context *fc, struct fs_parameter *param) { - return 0; + return -ENOPARAM; } static inline int security_fs_context_validate(struct fs_context *fc) { diff --git a/security/security.c b/security/security.c index 94420f3616a7..64304d20aae1 100644 --- a/security/security.c +++ b/security/security.c @@ -380,7 +380,7 @@ void security_fs_context_free(struct fs_context *fc) int security_fs_context_parse_param(struct fs_context *fc, struct fs_parameter *param) { - return call_int_hook(fs_context_parse_param, 0, fc, param); + return call_int_hook(fs_context_parse_param, -ENOPARAM, fc, param); } int security_fs_context_validate(struct fs_context *fc) -- 2.17.1