mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 14:13:01 -04:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: (30 commits) MAINTAINERS: Add tomoyo-dev-en ML. SELinux: define permissions for DCB netlink messages encrypted-keys: style and other cleanup encrypted-keys: verify datablob size before converting to binary trusted-keys: kzalloc and other cleanup trusted-keys: additional TSS return code and other error handling syslog: check cap_syslog when dmesg_restrict Smack: Transmute labels on specified directories selinux: cache sidtab_context_to_sid results SELinux: do not compute transition labels on mountpoint labeled filesystems This patch adds a new security attribute to Smack called SMACK64EXEC. It defines label that is used while task is running. SELinux: merge policydb_index_classes and policydb_index_others selinux: convert part of the sym_val_to_name array to use flex_array selinux: convert type_val_to_struct to flex_array flex_array: fix flex_array_put_ptr macro to be valid C SELinux: do not set automatic i_ino in selinuxfs selinux: rework security_netlbl_secattr_to_sid SELinux: standardize return code handling in selinuxfs.c SELinux: standardize return code handling in selinuxfs.c SELinux: standardize return code handling in policydb.c ...
This commit is contained in:
commit
e0e736fc0d
37 changed files with 3914 additions and 1074 deletions
|
|
@ -246,7 +246,6 @@ struct cpu_vfs_cap_data {
|
|||
/* Allow configuration of the secure attention key */
|
||||
/* Allow administration of the random device */
|
||||
/* Allow examination and configuration of disk quotas */
|
||||
/* Allow configuring the kernel's syslog (printk behaviour) */
|
||||
/* Allow setting the domainname */
|
||||
/* Allow setting the hostname */
|
||||
/* Allow calling bdflush() */
|
||||
|
|
@ -352,7 +351,11 @@ struct cpu_vfs_cap_data {
|
|||
|
||||
#define CAP_MAC_ADMIN 33
|
||||
|
||||
#define CAP_LAST_CAP CAP_MAC_ADMIN
|
||||
/* Allow configuring the kernel's syslog (printk behaviour) */
|
||||
|
||||
#define CAP_SYSLOG 34
|
||||
|
||||
#define CAP_LAST_CAP CAP_SYSLOG
|
||||
|
||||
#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ void *flex_array_get(struct flex_array *fa, unsigned int element_nr);
|
|||
int flex_array_shrink(struct flex_array *fa);
|
||||
|
||||
#define flex_array_put_ptr(fa, nr, src, gfp) \
|
||||
flex_array_put(fa, nr, &(void *)(src), gfp)
|
||||
flex_array_put(fa, nr, (void *)&(src), gfp)
|
||||
|
||||
void *flex_array_get_ptr(struct flex_array *fa, unsigned int element_nr);
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@
|
|||
|
||||
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
|
||||
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
|
||||
|
||||
/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */
|
||||
#define roundup(x, y) ( \
|
||||
{ \
|
||||
const typeof(y) __y = y; \
|
||||
|
|
@ -263,6 +265,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
|
|||
}
|
||||
|
||||
extern int hex_to_bin(char ch);
|
||||
extern void hex2bin(u8 *dst, const char *src, size_t count);
|
||||
|
||||
/*
|
||||
* General tracing related utility functions - trace_printk(),
|
||||
|
|
|
|||
|
|
@ -1058,8 +1058,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
|
|||
* @cred points to the credentials to provide the context against which to
|
||||
* evaluate the security data on the key.
|
||||
* @perm describes the combination of permissions required of this key.
|
||||
* Return 1 if permission granted, 0 if permission denied and -ve it the
|
||||
* normal permissions model should be effected.
|
||||
* Return 0 if permission is granted, -ve error otherwise.
|
||||
* @key_getsecurity:
|
||||
* Get a textual representation of the security context attached to a key
|
||||
* for the purposes of honouring KEYCTL_GETSECURITY. This function
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf);
|
||||
extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash);
|
||||
extern int tpm_send(u32 chip_num, void *cmd, size_t buflen);
|
||||
#else
|
||||
static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) {
|
||||
return -ENODEV;
|
||||
|
|
@ -38,5 +39,8 @@ static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) {
|
|||
static inline int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash) {
|
||||
return -ENODEV;
|
||||
}
|
||||
static inline int tpm_send(u32 chip_num, void *cmd, size_t buflen) {
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
28
include/linux/tpm_command.h
Normal file
28
include/linux/tpm_command.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef __LINUX_TPM_COMMAND_H__
|
||||
#define __LINUX_TPM_COMMAND_H__
|
||||
|
||||
/*
|
||||
* TPM Command constants from specifications at
|
||||
* http://www.trustedcomputinggroup.org
|
||||
*/
|
||||
|
||||
/* Command TAGS */
|
||||
#define TPM_TAG_RQU_COMMAND 193
|
||||
#define TPM_TAG_RQU_AUTH1_COMMAND 194
|
||||
#define TPM_TAG_RQU_AUTH2_COMMAND 195
|
||||
#define TPM_TAG_RSP_COMMAND 196
|
||||
#define TPM_TAG_RSP_AUTH1_COMMAND 197
|
||||
#define TPM_TAG_RSP_AUTH2_COMMAND 198
|
||||
|
||||
/* Command Ordinals */
|
||||
#define TPM_ORD_GETRANDOM 70
|
||||
#define TPM_ORD_OSAP 11
|
||||
#define TPM_ORD_OIAP 10
|
||||
#define TPM_ORD_SEAL 23
|
||||
#define TPM_ORD_UNSEAL 24
|
||||
|
||||
/* Other constants */
|
||||
#define SRKHANDLE 0x40000000
|
||||
#define TPM_NONCE_SIZE 20
|
||||
|
||||
#endif
|
||||
|
|
@ -40,9 +40,13 @@
|
|||
#define XATTR_SMACK_SUFFIX "SMACK64"
|
||||
#define XATTR_SMACK_IPIN "SMACK64IPIN"
|
||||
#define XATTR_SMACK_IPOUT "SMACK64IPOUT"
|
||||
#define XATTR_SMACK_EXEC "SMACK64EXEC"
|
||||
#define XATTR_SMACK_TRANSMUTE "SMACK64TRANSMUTE"
|
||||
#define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX
|
||||
#define XATTR_NAME_SMACKIPIN XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN
|
||||
#define XATTR_NAME_SMACKIPOUT XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT
|
||||
#define XATTR_NAME_SMACKEXEC XATTR_SECURITY_PREFIX XATTR_SMACK_EXEC
|
||||
#define XATTR_NAME_SMACKTRANSMUTE XATTR_SECURITY_PREFIX XATTR_SMACK_TRANSMUTE
|
||||
|
||||
#define XATTR_CAPS_SUFFIX "capability"
|
||||
#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
|
||||
|
|
|
|||
Loading…
Reference in a new issue