]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - Documentation/kernel-parameters.txt
ima: use ahash API for file hash calculation
authorDmitry Kasatkin <d.kasatkin@samsung.com>
Wed, 26 Feb 2014 15:05:20 +0000 (17:05 +0200)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Thu, 17 Jul 2014 13:35:10 +0000 (09:35 -0400)
commit3bcced39ea7d1b0da0a991e221f53de480c6b60b
treea45834814cd073987f9605b616e7b8dd094d94fd
parent7e9001f663636116fdc2ea7978f0350849ced624
ima: use ahash API for file hash calculation

Async hash API allows the use of HW acceleration for hash calculation.
It may give significant performance gain and/or reduce power consumption,
which might be very beneficial for battery powered devices.

This patch introduces hash calculation using ahash API. ahash performance
depends on the data size and the particular HW. Depending on the specific
system, shash performance may be better.

This patch defines 'ahash_minsize' module parameter, which is used to
define the minimal file size to use with ahash.  If this minimum file size
is not set or the file is smaller than defined by the parameter, shash will
be used.

Changes in v3:
- kernel parameter replaced with module parameter
- pr_crit replaced with pr_crit_ratelimited
- more comment changes - Mimi

Changes in v2:
- ima_ahash_size became as ima_ahash
- ahash pre-allocation moved out from __init code to be able to use
  ahash crypto modules. Ahash allocated once on the first use.
- hash calculation falls back to shash if ahash allocation/calculation fails
- complex initialization separated from variable declaration
- improved comments

Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Documentation/kernel-parameters.txt
security/integrity/ima/ima_crypto.c