shmem: fix LSM options parsing (fwd)

James Morris jmorris at namei.org
Thu Oct 10 23:00:33 UTC 2019


---------- Forwarded message ----------
Date: Thu, 10 Oct 2019 15:42:18 +0000
From: Linux Kernel Mailing List <linux-kernel at vger.kernel.org>
Reply-To: Al Viro <viro at zeniv.linux.org.uk>
To: git-commits-head at vger.kernel.org
Subject: shmem: fix LSM options parsing

Commit:     33f37c648812bdbe1bd1eea75ddab3e799d51e77
Parent:     a3bc18a48e2e678efe62f1f9989902f9cd19e0ff
Refname:    refs/heads/master
Web:        https://git.kernel.org/torvalds/c/33f37c648812bdbe1bd1eea75ddab3e799d51e77
Author:     Al Viro <viro at zeniv.linux.org.uk>
AuthorDate: Wed Oct 9 22:48:01 2019 -0400
Committer:  Al Viro <viro at zeniv.linux.org.uk>
CommitDate: Wed Oct 9 22:48:01 2019 -0400

    shmem: fix LSM options parsing
    
    ->parse_monolithic() there forgets to call security_sb_eat_lsm_opts()
    
    Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
---
 mm/shmem.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/mm/shmem.c b/mm/shmem.c
index 0f7fd4a85db6..8dcc8d04cbaf 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3482,6 +3482,12 @@ static int shmem_parse_options(struct fs_context *fc, void *data)
 {
 	char *options = data;
 
+	if (options) {
+		int err = security_sb_eat_lsm_opts(options, &fc->security);
+		if (err)
+			return err;
+	}
+
 	while (options != NULL) {
 		char *this_char = options;
 		for (;;) {



More information about the Linux-security-module-archive mailing list