Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d8d2ceb authored by Amir Samuelov's avatar Amir Samuelov
Browse files

platform: msm: add Per-File-Tagger (PFT) driver



This driver is part of the Per-File-Encryption (PFE) feature.
It allows to tag enterprise files and encrypt them
while keeping the user private files untagged and plain text.

Change-Id: I2ba8bffb2a8815991dc3994a1f94a0c52b937a25
Signed-off-by: default avatarNir Ofry <nofry@codeaurora.org>
Signed-off-by: default avatarAmir Samuelov <amirs@codeaurora.org>
parent 77a1f98a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -159,6 +159,16 @@ config QCA1530
	  To compile this driver as a module, choose M here: the module
	  will be called qca1530.

config PFT
	bool "Per-File-Tagger driver"
	default n
	help
		This driver is used for tagging enterprise files.
		It is part of the Per-File-Encryption (PFE) feature.
		The driver is tagging files when created by
		registered application.
		Tagged files are encrypted using the dm-req-crypt driver.

config MSM_SPSS
	tristate "MSM SPSS driver"
	default n
+2 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
#

ccflags-y += -Idrivers/misc/

ccflags-y += -Isecurity/selinux -Isecurity/selinux/include

obj-$(CONFIG_MSM_BUS_SCALING) += msm_bus/
obj-$(CONFIG_BUS_TOPOLOGY_ADHOC) += msm_bus/
@@ -19,6 +19,7 @@ obj-$(CONFIG_MSM_AVTIMER) += avtimer.o
obj-$(CONFIG_SSM) += ssm.o
obj-$(CONFIG_QPNP_REVID) += qpnp-revid.o
obj-$(CONFIG_QPNP_USB_DETECT) += qpnp-usbdetect.o
obj-$(CONFIG_PFT) += pft.o
obj-$(CONFIG_QCA1530) += qca1530.o
obj-$(CONFIG_KLM) += msm_klmd.o
obj-$(CONFIG_MSM_SPSS) += spss.o
+1758 −0

File added.

Preview size limit exceeded, changes collapsed.

include/linux/pft.h

0 → 100644
+92 −0
Original line number Diff line number Diff line
/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef PFT_H_
#define PFT_H_

#include <linux/types.h>
#include <linux/fs.h>

#ifdef CONFIG_PFT

/* dm-req-crypt API */
int pft_get_key_index(struct inode *inode, u32 *key_index,
		      bool *is_encrypted, bool *is_inplace);

/* block layer API */
bool pft_allow_merge_bio(struct bio *bio1, struct bio *bio2);

/* --- security hooks , called from selinux --- */
int pft_inode_create(struct inode *dir, struct dentry *dentry, umode_t mode);

int pft_inode_post_create(struct inode *dir, struct dentry *dentry,
			  umode_t mode);

int pft_file_open(struct file *filp, const struct cred *cred);

int pft_file_permission(struct file *file, int mask);

int pft_file_close(struct file *filp);

int pft_inode_unlink(struct inode *dir, struct dentry *dentry);

int pft_inode_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
		    dev_t dev);

int pft_inode_rename(struct inode *inode, struct dentry *dentry,
		     struct inode *new_inode, struct dentry *new_dentry);

int pft_inode_set_xattr(struct dentry *dentry, const char *name);


#else
static inline int pft_get_key_index(struct inode *inode, u32 *key_index,
				    bool *is_encrypted, bool *is_inplace)
{ return -ENODEV; }

static inline bool pft_allow_merge_bio(struct bio *bio1, struct bio *bio2)
{ return true; }

static inline int pft_file_permission(struct file *file, int mask)
{ return 0; }

static inline int pft_inode_create(
	struct inode *dir, struct dentry *dentry, umode_t mode)
{ return 0; }

static inline int pft_inode_post_create(
	struct inode *dir, struct dentry *dentry, umode_t mode)
{ return 0; }

static inline int pft_file_open(struct file *filp, const struct cred *cred)
{ return 0; }

static inline int pft_file_close(struct file *filp)
{ return 0; }

static inline int pft_inode_unlink(struct inode *dir, struct dentry *dentry)
{ return 0; }

static inline int pft_inode_mknod(struct inode *dir, struct dentry *dentry,
				  umode_t mode, dev_t dev)
{ return 0; }

static inline int pft_inode_rename(struct inode *inode, struct dentry *dentry,
		     struct inode *new_inode, struct dentry *new_dentry)
{ return 0; }

static inline int pft_inode_set_xattr(struct dentry *dentry, const char *name)
{ return 0; }

#endif /* CONFIG_PFT */

#endif /* PFT_H */
+1 −0
Original line number Diff line number Diff line
@@ -292,6 +292,7 @@ header-y += msm_audio_sbc.h
header-y += msm_ipc.h
header-y += msm_charm.h
header-y += msm_rmnet.h
header-y += msm_pft.h
header-y += rmnet_data.h
header-y += mtio.h
header-y += n_r3964.h
Loading