- 06 2月, 2013 1 次提交
-
-
由 Dmitry Kasatkin 提交于
EVM uses the same key for all file systems to calculate the HMAC, making it possible to paste inodes from one file system on to another one, without EVM being able to detect it. To prevent such an attack, it is necessary to make the EVM HMAC file system specific. This patch uses the file system UUID, a file system unique identifier, to bind the EVM HMAC to the file system. The value inode->i_sb->s_uuid is used for the HMAC hash calculation, instead of using it for deriving the file system specific key. Initializing the key for every inode HMAC calculation is a bit more expensive operation than adding the uuid to the HMAC hash. Changing the HMAC calculation method or adding additional info to the calculation, requires existing EVM labeled file systems to be relabeled. This patch adds a Kconfig HMAC version option for backwards compatability. Changelog v1: - squash "hmac version setting" Changelog v0: - add missing Kconfig depends (Mimi) Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com> Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
-
- 05 2月, 2013 24 次提交
-
-
由 Kent Yoder 提交于
Reported-by: NPeter Hüwe <peterhuewe@gmx.de> Reviewed-by: NPeter Huewe <peterhuewe@gmx.de> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Peter Huewe 提交于
We don't need a temporary variable just to store the return value which gets return in the next statement. Signed-off-by: NPeter Huewe <peterhuewe@gmx.de> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Peter Huewe 提交于
Err is never read before it is assigned again -> remove the dead assigment. Found with clang static analyzer Signed-off-by: NPeter Huewe <peterhuewe@gmx.de> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Peter Huewe 提交于
With the HOTPLUG changes 3.8 this attribute is going away. Signed-off-by: NPeter Huewe <peterhuewe@gmx.de> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Peter Huewe 提交于
We don't need to call memcpy for one byte, but assign it directly. And to make the offset clearer we use the array syntax on the subsequent call to memset to make the relationship clearer. Signed-off-by: NPeter Huewe <peterhuewe@gmx.de> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Kent Yoder 提交于
Reported-by: NPeter Hüwe <PeterHuewe@gmx.de> Signed-off-by: NPeter Hüwe <PeterHuewe@gmx.de> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Jason Gunthorpe 提交于
The TIS specification (pg 47) says the valid bit must be set, but the TPM will not set it until it has completed its internal startup. The driver checks that the valid bit is set during request_locality, but it issues a TPM_ACCESS_REQUEST_USE without validating the valid bit is set. Some TPMs will ignore the TPM_ACCESS_REQUEST_USE, until valid is set which causes the request_locality to timeout, which breaks the driver attach. Wait one timeout unit for valid to assert. If valid does not assert then assume -ENODEV. Seen on embedded with a: 1.2 TPM (device-id 0x3204, rev-id 64) Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Stefan Berger 提交于
Support cancellation of TPM commands when driver is used in interrupt mode. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Stefan Berger 提交于
On one of my machines the cancellation of TPM commands does not work. The reason is that by writing into sysfs 'cancel' the tpm_tis_ready call causes the status flag TPM_STS_VALID to be set in the statusregister. However, the TIS driver seems to wait for TPM_STS_COMMAND_READY. Once a 2nd time sysfs 'cancel' is written to, the TPM_STS_COMMAND_READY flag also gets set, resulting in TPM_STS_VALID|TPM_STS_COMMAND_READY to be read from the status register. This patch now converts req_canceled into a function to enable more complex comparisons against possible cancellation status codes. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Stefan Berger 提交于
Store the TPM vendor ID for later use. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Jason Gunthorpe 提交于
We've been testing an alternative TPM for our embedded products and found random kernel boot failures due to time outs after the continue self test command. This was happening randomly, and has been *very* hard to track down, but it looks like with this chip there is some kind of race with the tpm_tis_status() check of TPM_STS_COMMAND_READY. If things get there 'too fast' then it sees the chip is ready, or tpm_tis_ready() works. Otherwise it takes somewhere over 400ms before the chip will return TPM_STS_COMMAND_READY. Adding some delay after tpm_continue_selftest() makes things reliably hit the failure path, otherwise it is a crapshot. The spec says it should be returning TPM_WARN_DOING_SELFTEST, not holding off on ready.. Boot log during this event looks like this: tpm_tis 70030000.tpm_tis: 1.2 TPM (device-id 0x3204, rev-id 64) tpm_tis 70030000.tpm_tis: Issuing TPM_STARTUP tpm_tis 70030000.tpm_tis: tpm_transmit: tpm_send: error -62 tpm_tis 70030000.tpm_tis: [Hardware Error]: TPM command timed out during continue self test tpm_tis 70030000.tpm_tis: tpm_transmit: tpm_send: error -62 tpm_tis 70030000.tpm_tis: [Hardware Error]: TPM command timed out during continue self test tpm_tis 70030000.tpm_tis: tpm_transmit: tpm_send: error -62 tpm_tis 70030000.tpm_tis: [Hardware Error]: TPM command timed out during continue self test tpm_tis 70030000.tpm_tis: tpm_transmit: tpm_send: error -62 tpm_tis 70030000.tpm_tis: [Hardware Error]: TPM command timed out during continue self test The other TPM vendor we use doesn't show this wonky behaviour: tpm_tis 70030000.tpm_tis: 1.2 TPM (device-id 0xFE, rev-id 70) Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Kent Yoder 提交于
When no i2c bus exists, user-space can cause an oops by triggering a device probe through a message sent to an i2c "new_device" sysfs entry. Adding a check for a NULL i2c client structure in the probe function closes the hole. This patch also fixes accessing the NULL client struct in the print function call reporting the error. Reported-by: NPeter Hüwe <PeterHuewe@gmx.de> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Peter Huewe 提交于
This patch converts the suspend and resume functions for tpm_i2c_stm_st33 to the new dev_pm_ops. Signed-off-by: NPeter Huewe <peterhuewe@gmx.de> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Mathias Leblanc 提交于
* STMicroelectronics version 1.2.0, Copyright (C) 2010 * STMicroelectronics comes with ABSOLUTELY NO WARRANTY. * This is free software, and you are welcome to redistribute it * under certain conditions. This is the driver for TPM chip from ST Microelectronics. If you have a TPM security chip from STMicroelectronics working with an I2C, in menuconfig or .config choose the tpm driver on device --> tpm and activate the protocol of your choice before compiling the kernel. The driver will be accessible from within Linux. Tested on linux x86/x64, beagleboard REV B & XM REV C and CHROMIUM OS Signed-off-by: NMathias Leblanc <mathias.leblanc@st.com> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Kent Yoder 提交于
Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Kent Yoder 提交于
Store the i2c_client struct in the vendor private pointer. Get rid of the unnecessary include/linux/i2c/ header. Moved include files into the driver c file. Fix smatch warnings. Make use of module_i2c_driver(). Removed unused code from the tpm_stm_st33_i2c.h file. Fix return variable signedness in tpm_stm_i2c_send() and tpm_st33_i2c_probe(). Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Kent Yoder 提交于
"data" was too generic a name for what's being used as a generic private pointer by vendor-specific code. Rename it to "priv" and provide a #define for users. Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Mathias Leblanc 提交于
* STMicroelectronics version 1.2.0, Copyright (C) 2010 * STMicroelectronics comes with ABSOLUTELY NO WARRANTY. * This is free software, and you are welcome to redistribute it * under certain conditions. This is the driver for TPM chip from ST Microelectronics. If you have a TPM security chip from STMicroelectronics working with an I2C, in menuconfig or .config choose the tpm driver on device --> tpm and activate the protocol of your choice before compiling the kernel. The driver will be accessible from within Linux. Tested on linux x86/x64 on kernel 3.x Signed-off-by: NMathias Leblanc <mathias.leblanc@st.com> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Peter Huewe 提交于
Bool initializations should use true and false. Bool tests don't need comparisons. Based on contributions from Joe Perches, Rusty Russell and Bruce W Allan. The semantic patch that makes this output is available in scripts/coccinelle/misc/boolinit.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/Signed-off-by: NPeter Huewe <peterhuewe@gmx.de> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Jason Gunthorpe 提交于
This seems to be preferred these days. Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com> Reviewed-by: NPeter Huewe <peterhuewe@gmx.de> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Jason Gunthorpe 提交于
The TPM will respond to TPM_GET_CAP with TPM_ERR_INVALID_POSTINIT if TPM_STARTUP has not been issued. Detect this and automatically issue TPM_STARTUP. This is for embedded applications where the kernel is the first thing to touch the TPM. Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com> Tested-by: NPeter Huewe <peter.huewe@infineon.com> Reviewed-by: NPeter Huewe <peter.huewe@infineon.com> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Peter Huewe 提交于
This patch changes the semantics of the duration calculation for an ordinal, by masking out the higher bits of a tpm command, which specify whether it's an TPM_PROTECTED_COMMAND, TPM_UNPROTECTED_COMMAND, TPM_CONNECTION_COMMAND, TPM_CONNECTION_COMMAND, TPM_VENDOR_COMMAND. (See TPM Main Spec Part 2 Section 17 for details). For all TPM_PROTECTED and TPM_CONNECTION commands the results are unchanged. The TPM_UNPROTECTED commands are TSS commands and thus irrelevant as they are not sent to the tpm. For vendor commands the semantics change for ordinals 10 and 11 but they were probably wrong anyway. For everything else which has the ordinal set to 10 or 11 the semantics change as it now uses TPM_UNDEFINED instead of TPM_SHORT which was probably wrong anyway (but irrelevant as not defined by the standard). This patch also gets rid of the (false positive) smatch warning: drivers/char/tpm/tpm.c:360 tpm_calc_ordinal_duration() error: buffer overflow 'tpm_protected_ordinal_duration' 12 <= 243 Signed-off-by: NPeter Huewe <peterhuewe@gmx.de> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Peter Huewe 提交于
The entries in tpm_protected_ordinal_duration are exactly the same as the first 12 in tpm_ordinal_duration, so we can simply remove this one, and save some bytes. This does not change the behavior of the driver. Signed-off-by: NPeter Huewe <peterhuewe@gmx.de> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
由 Kent Yoder 提交于
Reviewed-by: NPeter Huewe <peter.huewe@infineon.com> Signed-off-by: NKent Yoder <key@linux.vnet.ibm.com>
-
- 01 2月, 2013 2 次提交
-
-
由 Andy Shevchenko 提交于
Remove MIN, MAX and ABS macros that are duplicates kernel's native implementation. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NJames Morris <james.l.morris@oracle.com>
-
由 Dmitry Kasatkin 提交于
In existing use case, copying of the decoded data is unnecessary in pkcs_1_v1_5_decode_emsa. It is just enough to get pointer to the message. Removing copying and extra buffer allocation. Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com> Signed-off-by: NJames Morris <james.l.morris@oracle.com>
-
- 23 1月, 2013 4 次提交
-
-
由 Mimi Zohar 提交于
Different hooks can require different methods for appraising a file's integrity. As a result, an integrity appraisal status is cached on a per hook basis. Only a hook specific rule, requires the inode to be re-appraised. This patch eliminates unnecessary appraisals. Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com> Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
-
由 Mimi Zohar 提交于
With the new IMA policy 'appraise_type=' option, different hooks can require different methods for appraising a file's integrity. For example, the existing 'ima_appraise_tcb' policy defines a generic rule, requiring all root files to be appraised, without specfying the appraisal method. A more specific rule could require all kernel modules, for example, to be signed. appraise fowner=0 func=MODULE_CHECK appraise_type=imasig appraise fowner=0 As a result, the integrity appraisal results for the same inode, but for different hooks, could differ. This patch caches the integrity appraisal results on a per hook basis. Changelog v2: - Rename ima_cache_status() to ima_set_cache_status() - Rename and move get_appraise_status() to ima_get_cache_status() Changelog v0: - include IMA_APPRAISE/APPRAISED_SUBMASK in IMA_DO/DONE_MASK (Dmitry) - Support independent MODULE_CHECK appraise status. - fixed IMA_XXXX_APPRAISE/APPRAISED flags Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com> Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
-
由 Mimi Zohar 提交于
In preparation for hook specific appraise status results, increase the iint flags size. Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com> Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
-
由 Dmitry Kasatkin 提交于
The 'security.ima' extended attribute may contain either the file data's hash or a digital signature. This patch adds support for requiring a specific extended attribute type. It extends the IMA policy with a new keyword 'appraise_type=imasig'. (Default is hash.) Changelog v2: - Fixed Documentation/ABI/testing/ima_policy option syntax Changelog v1: - Differentiate between 'required' vs. 'actual' extended attribute Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com> Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
-
- 17 1月, 2013 9 次提交
-
-
由 Dmitry Kasatkin 提交于
This patch forbids write access to files with digital signatures, as they are considered immutable. Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com> Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
-
由 Dmitry Kasatkin 提交于
Define a new function ima_d_path(), which returns the full pathname. This function will be used further, for example, by the directory verification code. Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com> Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
-
由 Dmitry Kasatkin 提交于
This patch reduces size of the iint structure by 8 bytes. It saves about 15% of iint cache memory. Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com> Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
-
由 Mimi Zohar 提交于
Rename FILE_MMAP hook to MMAP_CHECK to be consistent with the other hook names. Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
-
由 Dmitry Kasatkin 提交于
Hexdump is not really helping. Audit messages prints error messages. Remove it. Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com> Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
-
由 Dmitry Kasatkin 提交于
Based on the IMA appraisal policy, files are appraised. For those files appraised, the IMA hooks return the integrity appraisal result, assuming IMA-appraisal is in enforcing mode. This patch combines both of these criteria (in policy and enforcing file integrity), removing the checking duplication. Changelog v1: - Update hook comments Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com> Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
-
由 Dmitry Kasatkin 提交于
When a file system is mounted read-only, setting the xattr value in fix mode fails with an error code -EROFS. The xattr should be fixed after the file system is remounted read-write. This patch verifies that the set xattr succeeds, before setting the appraise status value to INTEGRITY_PASS. Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com> Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
-
由 Dmitry Kasatkin 提交于
EVM cannot be built as a kernel module. Remove the unncessary __exit functions. Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com> Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
-
由 Mimi Zohar 提交于
Although the IMA policy does not change, the LSM policy can be reloaded, leaving the IMA LSM based rules referring to the old, stale LSM policy. This patch updates the IMA LSM based rules to reflect the reloaded LSM policy. Reported-by: NSven Vermeulen <sven.vermeulen@siphos.be> tested-by: NSven Vermeulen <sven.vermeulen@siphos.be> Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com> Cc: Eric Paris <eparis@parisplace.org> Cc: Casey Schaufler <casey@schaufler-ca.com>
-