26 Sep, 2018

1 commit

  • [ Upstream commit e2861fa71641c6414831d628a1f4f793b6562580 ]

    When EVM attempts to appraise a file signed with a crypto algorithm the
    kernel doesn't have support for, it will cause the kernel to trigger a
    module load. If the EVM policy includes appraisal of kernel modules this
    will in turn call back into EVM - since EVM is holding a lock until the
    crypto initialisation is complete, this triggers a deadlock. Add a
    CRYPTO_NOLOAD flag and skip module loading if it's set, and add that flag
    in the EVM case in order to fail gracefully with an error message
    instead of deadlocking.

    Signed-off-by: Matthew Garrett
    Acked-by: Herbert Xu
    Signed-off-by: Mimi Zohar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Matthew Garrett
     

03 Aug, 2018

1 commit

  • [ Upstream commit fd90bc559bfba743ae8de87ff23b92a5e4668062 ]

    Don't differentiate, for now, between kernel_read_file_id READING_FIRMWARE
    and READING_FIRMWARE_PREALLOC_BUFFER enumerations.

    Fixes: a098ecd firmware: support loading into a pre-allocated buffer (since 4.8)
    Signed-off-by: Mimi Zohar
    Cc: Luis R. Rodriguez
    Cc: David Howells
    Cc: Kees Cook
    Cc: Serge E. Hallyn
    Cc: Stephen Boyd
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Mimi Zohar
     

30 May, 2018

3 commits

  • [ Upstream commit ab60368ab6a452466885ef4edf0cefd089465132 ]

    IMA requires having it's hash algorithm be compiled-in due to it's
    early use. The default IMA algorithm is protected by Kconfig to be
    compiled-in.

    The ima_hash kernel parameter allows to choose the hash algorithm. When
    the specified algorithm is not available or available as a module, IMA
    initialization fails, which leads to a kernel panic (mknodat syscall calls
    ima_post_path_mknod()). Therefore as fallback we force IMA to use
    the default builtin Kconfig hash algorithm.

    Fixed crash:

    $ grep CONFIG_CRYPTO_MD4 .config
    CONFIG_CRYPTO_MD4=m

    [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.12.14-2.3-default root=UUID=74ae8202-9ca7-4e39-813b-22287ec52f7a video=1024x768-16 plymouth.ignore-serial-consoles console=ttyS0 console=tty resume=/dev/disk/by-path/pci-0000:00:07.0-part3 splash=silent showopts ima_hash=md4
    ...
    [ 1.545190] ima: Can not allocate md4 (reason: -2)
    ...
    [ 2.610120] BUG: unable to handle kernel NULL pointer dereference at (null)
    [ 2.611903] IP: ima_match_policy+0x23/0x390
    [ 2.612967] PGD 0 P4D 0
    [ 2.613080] Oops: 0000 [#1] SMP
    [ 2.613080] Modules linked in: autofs4
    [ 2.613080] Supported: Yes
    [ 2.613080] CPU: 0 PID: 1 Comm: systemd Not tainted 4.12.14-2.3-default #1
    [ 2.613080] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014
    [ 2.613080] task: ffff88003e2d0040 task.stack: ffffc90000190000
    [ 2.613080] RIP: 0010:ima_match_policy+0x23/0x390
    [ 2.613080] RSP: 0018:ffffc90000193e88 EFLAGS: 00010296
    [ 2.613080] RAX: 0000000000000000 RBX: 000000000000000c RCX: 0000000000000004
    [ 2.613080] RDX: 0000000000000010 RSI: 0000000000000001 RDI: ffff880037071728
    [ 2.613080] RBP: 0000000000008000 R08: 0000000000000000 R09: 0000000000000000
    [ 2.613080] R10: 0000000000000008 R11: 61c8864680b583eb R12: 00005580ff10086f
    [ 2.613080] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000008000
    [ 2.613080] FS: 00007f5c1da08940(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
    [ 2.613080] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [ 2.613080] CR2: 0000000000000000 CR3: 0000000037002000 CR4: 00000000003406f0
    [ 2.613080] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [ 2.613080] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    [ 2.613080] Call Trace:
    [ 2.613080] ? shmem_mknod+0xbf/0xd0
    [ 2.613080] ima_post_path_mknod+0x1c/0x40
    [ 2.613080] SyS_mknod+0x210/0x220
    [ 2.613080] entry_SYSCALL_64_fastpath+0x1a/0xa5
    [ 2.613080] RIP: 0033:0x7f5c1bfde570
    [ 2.613080] RSP: 002b:00007ffde1c90dc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000085
    [ 2.613080] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f5c1bfde570
    [ 2.613080] RDX: 0000000000000000 RSI: 0000000000008000 RDI: 00005580ff10086f
    [ 2.613080] RBP: 00007ffde1c91040 R08: 00005580ff10086f R09: 0000000000000000
    [ 2.613080] R10: 0000000000104000 R11: 0000000000000246 R12: 00005580ffb99660
    [ 2.613080] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000002
    [ 2.613080] Code: 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 57 41 56 44 8d 14 09 41 55 41 54 55 53 44 89 d3 09 cb 48 83 ec 38 48 8b 05 c5 03 29 01 8b 20 4c 39 e0 0f 84 d7 01 00 00 4c 89 44 24 08 89 54 24 20
    [ 2.613080] RIP: ima_match_policy+0x23/0x390 RSP: ffffc90000193e88
    [ 2.613080] CR2: 0000000000000000
    [ 2.613080] ---[ end trace 9a9f0a8a73079f6a ]---
    [ 2.673052] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
    [ 2.673052]
    [ 2.675337] Kernel Offset: disabled
    [ 2.676405] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009

    Signed-off-by: Petr Vorel
    Signed-off-by: Mimi Zohar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Petr Vorel
     
  • [ Upstream commit fac37c628fd5d68fd7298d9b57ae8601ee1b4723 ]

    TPM_CRB driver provides TPM CRB 2.0 support. If it is built as a
    module, the TPM chip is registered after IMA init. tpm_pcr_read() in
    IMA fails and displays the following message even though eventually
    there is a TPM chip on the system.

    ima: No TPM chip found, activating TPM-bypass! (rc=-19)

    Fix IMA Kconfig to select TPM_CRB so TPM_CRB driver is built in the kernel
    and initializes before IMA.

    Signed-off-by: Jiandi An
    Signed-off-by: Mimi Zohar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Jiandi An
     
  • [ Upstream commit 120f3b11ef88fc38ce1d0ff9c9a4b37860ad3140 ]

    security/integrity/digsig.c has build errors on some $ARCH due to a
    missing header file, so add it.

    security/integrity/digsig.c:146:2: error: implicit declaration of function 'vfree' [-Werror=implicit-function-declaration]

    Reported-by: Michael Ellerman
    Signed-off-by: Randy Dunlap
    Cc: Mimi Zohar
    Cc: linux-integrity@vger.kernel.org
    Link: http://kisskb.ellerman.id.au/kisskb/head/13396/
    Signed-off-by: James Morris
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     

19 Mar, 2018

1 commit

  • [ Upstream commit b7e27bc1d42e8e0cc58b602b529c25cd0071b336 ]

    Custom policies can require file signatures based on LSM labels. These
    files are normally created and only afterwards labeled, requiring them
    to be signed.

    Instead of requiring file signatures based on LSM labels, entire
    filesystems could require file signatures. In this case, we need the
    ability of writing new files without requiring file signatures.

    The definition of a "new" file was originally defined as any file with
    a length of zero. Subsequent patches redefined a "new" file to be based
    on the FILE_CREATE open flag. By combining the open flag with a file
    size of zero, this patch relaxes the file signature requirement.

    Fixes: 1ac202e978e1 ima: accept previously set IMA_NEW_FILE
    Signed-off-by: Mimi Zohar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Mimi Zohar
     

04 Feb, 2018

1 commit

  • commit 36447456e1cca853188505f2a964dbbeacfc7a7a upstream.

    The switch to uuid_t invereted the logic of verfication that &entry->fsuuid
    is zero during parsing of "fsuuid=" rule. Instead of making sure the
    &entry->fsuuid field is not attempted to be overwritten, we bail out for
    perfectly correct rule.

    Fixes: 787d8c530af7 ("ima/policy: switch to use uuid_t")
    Signed-off-by: Mike Rapoport
    Signed-off-by: Mimi Zohar
    Signed-off-by: Greg Kroah-Hartman

    Mike Rapoport
     

10 Dec, 2017

1 commit

  • [ Upstream commit ebe7c0a7be92bbd34c6ff5b55810546a0ee05bee ]

    The hash_setup function always sets the hash_setup_done flag, even
    when the hash algorithm is invalid. This prevents the default hash
    algorithm defined as CONFIG_IMA_DEFAULT_HASH from being used.

    This patch sets hash_setup_done flag only for valid hash algorithms.

    Fixes: e7a2ad7eb6f4 "ima: enable support for larger default filedata hash algorithms"
    Signed-off-by: Boshi Wang
    Signed-off-by: Mimi Zohar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Boshi Wang
     

24 Nov, 2017

1 commit

  • commit 020aae3ee58c1af0e7ffc4e2cc9fe4dc630338cb upstream.

    Commit b65a9cfc2c38 ("Untangling ima mess, part 2: deal with counters")
    moved the call of ima_file_check() from may_open() to do_filp_open() at a
    point where the file descriptor is already opened.

    This breaks the assumption made by IMA that file descriptors being closed
    belong to files whose access was granted by ima_file_check(). The
    consequence is that security.ima and security.evm are updated with good
    values, regardless of the current appraisal status.

    For example, if a file does not have security.ima, IMA will create it after
    opening the file for writing, even if access is denied. Access to the file
    will be allowed afterwards.

    Avoid this issue by checking the appraisal status before updating
    security.ima.

    Signed-off-by: Roberto Sassu
    Signed-off-by: Mimi Zohar
    Signed-off-by: James Morris
    Signed-off-by: Greg Kroah-Hartman

    Roberto Sassu
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

06 Jul, 2017

1 commit

  • Pull security layer updates from James Morris:

    - a major update for AppArmor. From JJ:

    * several bug fixes and cleanups

    * the patch to add symlink support to securityfs that was floated
    on the list earlier and the apparmorfs changes that make use of
    securityfs symlinks

    * it introduces the domain labeling base code that Ubuntu has been
    carrying for several years, with several cleanups applied. And it
    converts the current mediation over to using the domain labeling
    base, which brings domain stacking support with it. This finally
    will bring the base upstream code in line with Ubuntu and provide
    a base to upstream the new feature work that Ubuntu carries.

    * This does _not_ contain any of the newer apparmor mediation
    features/controls (mount, signals, network, keys, ...) that
    Ubuntu is currently carrying, all of which will be RFC'd on top
    of this.

    - Notable also is the Infiniband work in SELinux, and the new file:map
    permission. From Paul:

    "While we're down to 21 patches for v4.13 (it was 31 for v4.12),
    the diffstat jumps up tremendously with over 2k of line changes.

    Almost all of these changes are the SELinux/IB work done by
    Daniel Jurgens; some other noteworthy changes include a NFS v4.2
    labeling fix, a new file:map permission, and reporting of policy
    capabilities on policy load"

    There's also now genfscon labeling support for tracefs, which was
    lost in v4.1 with the separation from debugfs.

    - Smack incorporates a safer socket check in file_receive, and adds a
    cap_capable call in privilege check.

    - TPM as usual has a bunch of fixes and enhancements.

    - Multiple calls to security_add_hooks() can now be made for the same
    LSM, to allow LSMs to have hook declarations across multiple files.

    - IMA now supports different "ima_appraise=" modes (eg. log, fix) from
    the boot command line.

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (126 commits)
    apparmor: put back designators in struct initialisers
    seccomp: Switch from atomic_t to recount_t
    seccomp: Adjust selftests to avoid double-join
    seccomp: Clean up core dump logic
    IMA: update IMA policy documentation to include pcr= option
    ima: Log the same audit cause whenever a file has no signature
    ima: Simplify policy_func_show.
    integrity: Small code improvements
    ima: fix get_binary_runtime_size()
    ima: use ima_parse_buf() to parse template data
    ima: use ima_parse_buf() to parse measurements headers
    ima: introduce ima_parse_buf()
    ima: Add cgroups2 to the defaults list
    ima: use memdup_user_nul
    ima: fix up #endif comments
    IMA: Correct Kconfig dependencies for hash selection
    ima: define is_ima_appraise_enabled()
    ima: define Kconfig IMA_APPRAISE_BOOTPARAM option
    ima: define a set of appraisal rules requiring file signatures
    ima: extend the "ima_policy" boot command line to support multiple policies
    ...

    Linus Torvalds
     

22 Jun, 2017

15 commits

  • If the file doesn't have an xattr, ima_appraise_measurement sets cause to
    "missing-hash" while if there's an xattr but it's a digest instead of a
    signature it sets cause to "IMA-signature-required".

    Fix it by setting cause to "IMA-signature-required" in both cases.

    Signed-off-by: Thiago Jung Bauermann
    Signed-off-by: Mimi Zohar

    Thiago Jung Bauermann
     
  • If the func_tokens array uses the same indices as enum ima_hooks,
    policy_func_show can be a lot simpler, and the func_* enum becomes
    unnecessary.

    Also, if we use the same macro trick used by kernel_read_file_id_str we can
    use one hooks list for both the enum and the string array, making sure they
    are always in sync (suggested by Mimi Zohar).

    Finally, by using the printf pattern for the function token directly
    instead of using the pt macro we can simplify policy_func_show even further
    and avoid needing a temporary buffer.

    Signed-off-by: Thiago Jung Bauermann
    Signed-off-by: Mimi Zohar

    Thiago Jung Bauermann
     
  • These changes are too small to warrant their own patches:

    The keyid and sig_size members of struct signature_v2_hdr are in BE format,
    so use a type that makes this assumption explicit. Also, use beXX_to_cpu
    instead of __beXX_to_cpu to read them.

    Change integrity_kernel_read to take a void * buffer instead of char *
    buffer, so that callers don't have to use a cast if they provide a buffer
    that isn't a char *.

    Add missing #endif comment in ima.h pointing out which macro it refers to.

    Add missing fall through comment in ima_appraise.c.

    Constify mask_tokens and func_tokens arrays.

    Signed-off-by: Thiago Jung Bauermann
    Signed-off-by: Mimi Zohar

    Thiago Jung Bauermann
     
  • Remove '+ 1' from 'size += strlen(entry->template_desc->name) + 1;',
    as the template name is sent to userspace without the '\0' character.

    Signed-off-by: Roberto Sassu
    Signed-off-by: Mimi Zohar

    Roberto Sassu
     
  • The binary_field_data structure definition has been removed from
    ima_restore_template_data(). The lengths and data pointers are directly
    stored into the template_data array of the ima_template_entry structure.
    For template data, both the number of fields and buffer end checks can
    be done, as these information are known (respectively from the template
    descriptor, and from the measurement header field).

    Signed-off-by: Roberto Sassu
    Signed-off-by: Mimi Zohar

    Roberto Sassu
     
  • The binary_hdr_v1 and binary_data_v1 structures defined in
    ima_restore_measurement_list() have been replaced with an array of four
    ima_field_data structures where pcr, digest, template name and
    template data lengths and pointers are stored.

    The length of pcr and digest in the ima_field_data array and the bits
    in the bitmap are set before ima_parse_buf() is called. The ENFORCE_FIELDS
    bit is set for all entries except the last one (there is still data to
    parse), and ENFORCE_BUFEND is set only for the last entry.

    Signed-off-by: Roberto Sassu
    Signed-off-by: Mimi Zohar

    Roberto Sassu
     
  • ima_parse_buf() takes as input the buffer start and end pointers, and
    stores the result in a static array of ima_field_data structures,
    where the len field contains the length parsed from the buffer, and
    the data field contains the address of the buffer just after the length.
    Optionally, the function returns the current value of the buffer pointer
    and the number of array elements written.

    A bitmap has been added as parameter of ima_parse_buf() to handle
    the cases where the length is not prepended to data. Each bit corresponds
    to an element of the ima_field_data array. If a bit is set, the length
    is not parsed from the buffer, but is read from the corresponding element
    of the array (the length must be set before calling the function).

    ima_parse_buf() can perform three checks upon request by callers,
    depending on the enforce mask passed to it:

    - ENFORCE_FIELDS: matching of number of fields (length-data combination)
    - there must be enough data in the buffer to parse the number of fields
    requested (output: current value of buffer pointer)
    - ENFORCE_BUFEND: matching of buffer end
    - the ima_field_data array must be large enough to contain lengths and
    data pointers for the amount of data requested (output: number
    of fields written)
    - ENFORCE_FIELDS | ENFORCE_BUFEND: matching of both

    Use cases

    - measurement entry header: ENFORCE_FIELDS | ENFORCE_BUFEND
    - four fields must be parsed: pcr, digest, template name, template data
    - ENFORCE_BUFEND is enforced only for the last measurement entry
    - template digest (Crypto Agile): ENFORCE_BUFEND
    - since only the total template digest length is known, the function
    parses length-data combinations until the buffer end is reached
    - template data: ENFORCE_FIELDS | ENFORCE_BUFEND
    - since the number of fields and the total template data length
    are known, the function can perform both checks

    Signed-off-by: Roberto Sassu
    Signed-off-by: Mimi Zohar

    Roberto Sassu
     
  • cgroups2 is beginning to show up in wider usage. Add it to the default
    nomeasure/noappraise list like other filesystems.

    Signed-off-by: Laura Abbott
    Signed-off-by: Mimi Zohar

    Laura Abbott
     
  • Use memdup_user_nul() helper instead of open-coding to simplify the
    code.

    Signed-off-by: Geliang Tang
    Signed-off-by: Mimi Zohar

    Geliang Tang
     
  • While reading the code, I noticed that these #endif comments don't match
    how they're actually nested. This patch fixes that.

    Signed-off-by: Tycho Andersen
    Signed-off-by: Mimi Zohar

    Tycho Andersen
     
  • IMA uses the hash algorithm too early to be able to use a module.
    Require the selected hash algorithm to be built-in.

    Signed-off-by: Ben Hutchings
    Signed-off-by: Mimi Zohar

    Ben Hutchings
     
  • Only return enabled if in enforcing mode, not fix or log modes.

    Signed-off-by: Mimi Zohar

    Changes:
    - Define is_ima_appraise_enabled() as a bool (Thiago Bauermann)

    Mimi Zohar
     
  • Permit enabling the different "ima_appraise=" modes (eg. log, fix)
    from the boot command line.

    Signed-off-by: Mimi Zohar

    Mimi Zohar
     
  • The builtin "ima_appraise_tcb" policy should require file signatures for
    at least a few of the hooks (eg. kernel modules, firmware, and the kexec
    kernel image), but changing it would break the existing userspace/kernel
    ABI.

    This patch defines a new builtin policy named "secure_boot", which
    can be specified on the "ima_policy=" boot command line, independently
    or in conjunction with the "ima_appraise_tcb" policy, by specifing
    ima_policy="appraise_tcb | secure_boot". The new appraisal rules
    requiring file signatures will be added prior to the "ima_appraise_tcb"
    rules.

    Signed-off-by: Mimi Zohar

    Changelog:
    - Reference secure boot in the new builtin policy name. (Thiago Bauermann)

    Mimi Zohar
     
  • Add support for providing multiple builtin policies on the "ima_policy="
    boot command line. Use "|" as the delimitor separating the policy names.

    Signed-off-by: Mimi Zohar

    Mimi Zohar
     

05 Jun, 2017

3 commits


19 Apr, 2017

1 commit


05 Apr, 2017

1 commit

  • Replace struct key's restrict_link function pointer with a pointer to
    the new struct key_restriction. The structure contains pointers to the
    restriction function as well as relevant data for evaluating the
    restriction.

    The garbage collector checks restrict_link->keytype when key types are
    unregistered. Restrictions involving a removed key type are converted
    to use restrict_link_reject so that restrictions cannot be removed by
    unregistering key types.

    Signed-off-by: Mat Martineau

    Mat Martineau
     

13 Mar, 2017

1 commit

  • For now we have only "=" operator for fowner/uid/euid rules. This
    patch provide two more operators - ">" and "999
    Appraise all files owned by users with UID 1000-1010:
    dont_appraise fowner>1010
    appraise fowner>999

    Changelog v3:
    - Removed code duplication in ima_parse_rule().
    - Fix ima_policy_show() - (Mimi)

    Changelog v2:
    - Fixed default policy rules.

    Signed-off-by: Mikhail Kurinnoi
    Signed-off-by: Mimi Zohar

    security/integrity/ima/ima_policy.c | 115 +++++++++++++++++++++++++++---------
    1 file changed, 87 insertions(+), 28 deletions(-)

    Mikhail Kurinnoi
     

07 Mar, 2017

2 commits

  • Modifying the attributes of a file makes ima_inode_post_setattr reset
    the IMA cache flags. So if the file, which has just been created,
    is opened a second time before the first file descriptor is closed,
    verification fails since the security.ima xattr has not been written
    yet. We therefore have to look at the IMA_NEW_FILE even if the file
    already existed.

    With this patch there should no longer be an error when cat tries to
    open testfile:

    $ rm -f testfile
    $ ( echo test >&3 ; touch testfile ; cat testfile ) 3>testfile

    A file being new is no reason to accept that it is missing a digital
    signature demanded by the policy.

    Signed-off-by: Daniel Glöckner
    Cc: stable@vger.kernel.org
    Signed-off-by: Mimi Zohar

    Daniel Glöckner
     
  • The default IMA rules are loaded during init and then do not
    change, so mark them as __ro_after_init.

    Signed-off-by: James Morris
    Signed-off-by: Mimi Zohar

    James Morris
     

02 Mar, 2017

1 commit


28 Jan, 2017

2 commits

  • Otherwise some mask and inmask tokens with MAY_APPEND flag may not work
    as expected.

    Signed-off-by: Lans Zhang
    Signed-off-by: Mimi Zohar

    Lans Zhang
     
  • On failure to return a pathname from ima_d_path(), a pointer to
    dname is returned, which is subsequently used in the IMA measurement
    list, the IMA audit records, and other audit logging. Saving the
    pointer to dname for later use has the potential to race with rename.

    Intead of returning a pointer to dname on failure, this patch returns
    a pointer to a copy of the filename.

    Reported-by: Al Viro
    Signed-off-by: Mimi Zohar
    Cc: stable@vger.kernel.org

    Mimi Zohar
     

21 Dec, 2016

3 commits

  • For remote attestion it is important for the ima measurement values to
    be platform-independent. Therefore integer fields to be hashed must be
    converted to canonical format.

    Link: http://lkml.kernel.org/r/1480554346-29071-11-git-send-email-zohar@linux.vnet.ibm.com
    Signed-off-by: Andreas Steffen
    Signed-off-by: Mimi Zohar
    Cc: Thiago Jung Bauermann
    Cc: "Eric W. Biederman"
    Cc: Dmitry Kasatkin
    Cc: Josh Sklar
    Cc: Dave Young
    Cc: Vivek Goyal
    Cc: Baoquan He
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Stewart Smith
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andreas Steffen
     
  • The IMA binary_runtime_measurements list is currently in platform native
    format.

    To allow restoring a measurement list carried across kexec with a
    different endianness than the targeted kernel, this patch defines
    little-endian as the canonical format. For big endian systems wanting
    to save/restore the measurement list from a system with a different
    endianness, a new boot command line parameter named "ima_canonical_fmt"
    is defined.

    Considerations: use of the "ima_canonical_fmt" boot command line option
    will break existing userspace applications on big endian systems
    expecting the binary_runtime_measurements list to be in platform native
    format.

    Link: http://lkml.kernel.org/r/1480554346-29071-10-git-send-email-zohar@linux.vnet.ibm.com
    Signed-off-by: Mimi Zohar
    Acked-by: Dmitry Kasatkin
    Cc: Thiago Jung Bauermann
    Cc: "Eric W. Biederman"
    Cc: Andreas Steffen
    Cc: Josh Sklar
    Cc: Dave Young
    Cc: Vivek Goyal
    Cc: Baoquan He
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Stewart Smith
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mimi Zohar
     
  • The configured IMA measurement list template format can be replaced at
    runtime on the boot command line, including a custom template format.
    This patch adds support for restoring a measuremement list containing
    multiple builtin/custom template formats.

    Link: http://lkml.kernel.org/r/1480554346-29071-9-git-send-email-zohar@linux.vnet.ibm.com
    Signed-off-by: Mimi Zohar
    Acked-by: Dmitry Kasatkin
    Cc: Thiago Jung Bauermann
    Cc: "Eric W. Biederman"
    Cc: Andreas Steffen
    Cc: Josh Sklar
    Cc: Dave Young
    Cc: Vivek Goyal
    Cc: Baoquan He
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Stewart Smith
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mimi Zohar