From: Dmitry Kasatkin <d.kasatkin@samsung.com>
To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
viro@zeniv.linux.org.uk, linux-security-module@vger.kernel.org,
zohar@linux.vnet.ibm.com, jmorris@namei.org
Cc: dmitry.kasatkin@gmail.com, Dmitry Kasatkin <d.kasatkin@samsung.com>
Subject: [PATCH 0/2] ima: directory integrity appraisal
Date: Mon, 18 Nov 2013 22:24:57 +0200 [thread overview]
Message-ID: <cover.1384806012.git.d.kasatkin@samsung.com> (raw)
Hello,
This patchset provides extension to IMA to protect appraisal of directories.
Both IMA-appraisal and EVM protect the integrity of regular files.
IMA protects file data integrity, while EVM protects the file meta-data
integrity, such as file attributes and extended attributes. This patch
set adds offline directory integrity protection.
An inode itself does not have any file name associated with it. The
association of the file name to inode is done via directory entries.
On a running system, mandatory and/or discretionary access control prevent
unprivileged file deletion, file name change, or hardlink creation.
In an offline attack, without these protections, the association between
a file name and an inode is unprotected. Files can be deleted, renamed
or moved from one directory to another. In all of these cases,
the integrity of the file data and metadata are good.
To prevent such attacks, it is necessary to protect the integrity of the
directory content. This patchset calculates a hash of the directory content
and verify this hash against good reference value stored in 'security.ima'
extended attribute. The directory hash is a hash over the list of directory
entries, that includes name, ino, d_type. Initial idea how to calculate the
directory hash was suggested by Jayant Mangalampalli (Intel).
This patchset adds 2 new hooks for directory integrity protection:
ima_dir_check() and ima_dir_update().
ima_dir_check() verifies the directory integrity during the initial path
lookup, when the dentry is just being created and may block. It allocates
the needed data structures and performs the integrity verification.
The results of which are cached. Subsequent calls mostly happen under
RCU locking, when the code may not block, and returns immediately with
the cached verification status. So ima_dir_check() does not interrupt
RCU path walk.
ima_dir_update(), which is called from several places in namei.c when
the directory content is changing, for updating the directory hash.
- Dmitry
Dmitry Kasatkin (2):
ima: hooks for directory integrity protection
ima: directory integrity protection implementation
fs/namei.c | 42 ++++-
fs/open.c | 6 +
include/linux/ima.h | 23 +++
net/unix/af_unix.c | 2 +
security/integrity/ima/Kconfig | 10 +
security/integrity/ima/Makefile | 1 +
security/integrity/ima/ima.h | 3 +-
security/integrity/ima/ima_dir.c | 358 ++++++++++++++++++++++++++++++++++++
security/integrity/ima/ima_main.c | 3 +
security/integrity/ima/ima_policy.c | 2 +
10 files changed, 446 insertions(+), 4 deletions(-)
create mode 100644 security/integrity/ima/ima_dir.c
--
1.8.3.2
next reply other threads:[~2013-11-18 20:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-18 20:24 Dmitry Kasatkin [this message]
2013-11-18 20:24 ` [PATCH 1/2] ima: hooks for directory integrity protection Dmitry Kasatkin
2013-12-11 14:57 ` Dmitry Kasatkin
2013-12-12 13:39 ` Mimi Zohar
2013-12-23 8:54 ` Dmitry Kasatkin
2013-12-23 11:45 ` Mimi Zohar
2013-11-18 20:24 ` [PATCH 2/2] ima: directory integrity protection implementation Dmitry Kasatkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1384806012.git.d.kasatkin@samsung.com \
--to=d.kasatkin@samsung.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=jmorris@namei.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=zohar@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox