04 May, 2022

2 commits

  • Update documentation for trusted key use with the Cryptographic
    Acceleration and Assurance Module (CAAM), an IP on NXP SoCs.

    Signed-off-by: Ahmad Fatoum

    Ahmad Fatoum
     
  • The two existing trusted key sources don't make use of the kernel RNG, but instead let the hardware doing the sealing/unsealing also generate the random key material. However, both users and future backends may want to place less trust into the quality of the trust source's random number generator and instead reuse the kernel entropy pool, which can be seeded from multiple entropy sources.

    Make this possible by adding a new trusted.rng parameter, that will force use of the kernel RNG. In its absence, it's up to the trust source to decide, which random numbers to use, maintaining the existing behavior.

    Suggested-by: Jarkko Sakkinen
    Acked-by: Sumit Garg
    Acked-by: Pankaj Gupta
    Reviewed-by: David Gstir
    Reviewed-by: Pankaj Gupta
    Reviewed-by: Jarkko Sakkinen
    Signed-off-by: Ahmad Fatoum

    Ahmad Fatoum
     

02 Nov, 2021

1 commit

  • Secure keys are derieved using CAAM crypto block.

    Secure keys derieved are the random number symmetric keys from CAAM.
    Blobs corresponding to the key are formed using CAAM. User space
    will only be able to view the blob of the key.

    Signed-off-by: Udit Agarwal

    Reviewed-by: Sahil Malhotra
    [ Aisheng: fix minior conflicts due to
    47f9c2796891 ("KEYS: trusted: Create trusted keys subsystem") ]
    Sign-off-by: Dong Aisheng

    Udit Agarwal
     

29 Jun, 2021

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "This was a reasonably active cycle for documentation; this includes:

    - Some kernel-doc cleanups. That script is still regex onslaught from
    hell, but it has gotten a little better.

    - Improvements to the checkpatch docs, which are also used by the
    tool itself.

    - A major update to the pathname lookup documentation.

    - Elimination of :doc: markup, since our automarkup magic can create
    references from filenames without all the extra noise.

    - The flurry of Chinese translation activity continues.

    Plus, of course, the usual collection of updates, typo fixes, and
    warning fixes"

    * tag 'docs-5.14' of git://git.lwn.net/linux: (115 commits)
    docs: path-lookup: use bare function() rather than literals
    docs: path-lookup: update symlink description
    docs: path-lookup: update get_link() ->follow_link description
    docs: path-lookup: update WALK_GET, WALK_PUT desc
    docs: path-lookup: no get_link()
    docs: path-lookup: update i_op->put_link and cookie description
    docs: path-lookup: i_op->follow_link replaced with i_op->get_link
    docs: path-lookup: Add macro name to symlink limit description
    docs: path-lookup: remove filename_mountpoint
    docs: path-lookup: update do_last() part
    docs: path-lookup: update path_mountpoint() part
    docs: path-lookup: update path_to_nameidata() part
    docs: path-lookup: update follow_managed() part
    docs: Makefile: Use CONFIG_SHELL not SHELL
    docs: Take a little noise out of the build process
    docs: x86: avoid using ReST :doc:`foo` markup
    docs: virt: kvm: s390-pv-boot.rst: avoid using ReST :doc:`foo` markup
    docs: userspace-api: landlock.rst: avoid using ReST :doc:`foo` markup
    docs: trace: ftrace.rst: avoid using ReST :doc:`foo` markup
    docs: trace: coresight: coresight.rst: avoid using ReST :doc:`foo` markup
    ...

    Linus Torvalds
     

18 Jun, 2021

1 commit


09 Jun, 2021

1 commit


03 Jun, 2021

2 commits

  • With the recent introduction of the evmsig template field, remote verifiers
    can obtain the EVM portable signature instead of the IMA signature, to
    verify file metadata.

    After introducing the new fields to include file metadata in the
    measurement list, this patch finally defines the evm-sig template, whose
    format is:

    d-ng|n-ng|evmsig|xattrnames|xattrlengths|xattrvalues|iuid|igid|imode

    xattrnames, xattrlengths and xattrvalues are populated only from defined
    EVM protected xattrs, i.e. the ones that EVM considers to verify the
    portable signature. xattrnames and xattrlengths are populated only if the
    xattr is present.

    xattrnames and xattrlengths are not necessary for verifying the EVM
    portable signature, but they are included for completeness of information,
    if a remote verifier wants to infer more from file metadata.

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

    Roberto Sassu
     
  • This patch defines the new template fields xattrnames, xattrlengths and
    xattrvalues, which contain respectively a list of xattr names (strings,
    separated by |), lengths (u32, hex) and values (hex). If an xattr is not
    present, the name and length are not displayed in the measurement list.

    Reported-by: kernel test robot (Missing prototype def)
    Signed-off-by: Roberto Sassu
    Signed-off-by: Mimi Zohar

    Roberto Sassu
     

02 Jun, 2021

3 commits

  • This patch defines the new template field imode, which includes the
    inode mode. It can be used by a remote verifier to verify the EVM portable
    signature, if it was included with the template fields sig or evmsig.

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

    Roberto Sassu
     
  • This patch defines the new template fields iuid and igid, which include
    respectively the inode UID and GID. For idmapped mounts, still the original
    UID and GID are provided.

    These fields can be used to verify the EVM portable signature, if it was
    included with the template fields sig or evmsig.

    Signed-off-by: Roberto Sassu
    Acked-by: Christian Brauner
    Signed-off-by: Mimi Zohar

    Roberto Sassu
     
  • With the patch to accept EVM portable signatures when the
    appraise_type=imasig requirement is specified in the policy, appraisal can
    be successfully done even if the file does not have an IMA signature.

    However, remote attestation would not see that a different signature type
    was used, as only IMA signatures can be included in the measurement list.
    This patch solves the issue by introducing the new template field 'evmsig'
    to show EVM portable signatures and by including its value in the existing
    field 'sig' if the IMA signature is not found.

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

    Roberto Sassu
     

11 May, 2021

1 commit

  • A few of the Documentation .rst files begin with a Unicode
    byte order mark (BOM). The BOM may signify endianess for
    16-bit or 32-bit encodings or indicate that the text stream
    is indeed Unicode. We don't need it for either of those uses.
    It may also interfere with (confuse) some software.

    Since we don't need it and its use is optional, just delete
    the uses of it in Documentation/.

    https://en.wikipedia.org/wiki/Byte_order_mark

    Signed-off-by: Randy Dunlap
    Reviewed-by: Matthew Wilcox (Oracle)
    Reviewed-by: Greg Kroah-Hartman
    Cc: Mauro Carvalho Chehab
    Link: https://lore.kernel.org/r/20210506231907.14359-1-rdunlap@infradead.org
    Signed-off-by: Jonathan Corbet

    Randy Dunlap
     

02 May, 2021

1 commit

  • Pull Landlock LSM from James Morris:
    "Add Landlock, a new LSM from Mickaël Salaün.

    Briefly, Landlock provides for unprivileged application sandboxing.

    From Mickaël's cover letter:
    "The goal of Landlock is to enable to restrict ambient rights (e.g.
    global filesystem access) for a set of processes. Because Landlock
    is a stackable LSM [1], it makes possible to create safe security
    sandboxes as new security layers in addition to the existing
    system-wide access-controls. This kind of sandbox is expected to
    help mitigate the security impact of bugs or unexpected/malicious
    behaviors in user-space applications. Landlock empowers any
    process, including unprivileged ones, to securely restrict
    themselves.

    Landlock is inspired by seccomp-bpf but instead of filtering
    syscalls and their raw arguments, a Landlock rule can restrict the
    use of kernel objects like file hierarchies, according to the
    kernel semantic. Landlock also takes inspiration from other OS
    sandbox mechanisms: XNU Sandbox, FreeBSD Capsicum or OpenBSD
    Pledge/Unveil.

    In this current form, Landlock misses some access-control features.
    This enables to minimize this patch series and ease review. This
    series still addresses multiple use cases, especially with the
    combined use of seccomp-bpf: applications with built-in sandboxing,
    init systems, security sandbox tools and security-oriented APIs [2]"

    The cover letter and v34 posting is here:

    https://lore.kernel.org/linux-security-module/20210422154123.13086-1-mic@digikod.net/

    See also:

    https://landlock.io/

    This code has had extensive design discussion and review over several
    years"

    Link: https://lore.kernel.org/lkml/50db058a-7dde-441b-a7f9-f6837fe8b69f@schaufler-ca.com/ [1]
    Link: https://lore.kernel.org/lkml/f646e1c7-33cf-333f-070c-0a40ad0468cd@digikod.net/ [2]

    * tag 'landlock_v34' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
    landlock: Enable user space to infer supported features
    landlock: Add user and kernel documentation
    samples/landlock: Add a sandbox manager example
    selftests/landlock: Add user space tests
    landlock: Add syscall implementations
    arch: Wire up Landlock syscalls
    fs,security: Add sb_delete hook
    landlock: Support filesystem access-control
    LSM: Infrastructure management of the superblock
    landlock: Add ptrace restrictions
    landlock: Set up the security framework and manage credentials
    landlock: Add ruleset and domain management
    landlock: Add object management

    Linus Torvalds
     

23 Apr, 2021

1 commit

  • Add a first document describing userspace API: how to define and enforce
    a Landlock security policy. This is explained with a simple example.
    The Landlock system calls are described with their expected behavior and
    current limitations.

    Another document is dedicated to kernel developers, describing guiding
    principles and some important kernel structures.

    This documentation can be built with the Sphinx framework.

    Cc: James Morris
    Cc: Jann Horn
    Cc: Serge E. Hallyn
    Signed-off-by: Mickaël Salaün
    Reviewed-by: Vincent Dagonneau
    Reviewed-by: Kees Cook
    Link: https://lore.kernel.org/r/20210422154123.13086-13-mic@digikod.net
    Signed-off-by: James Morris

    Mickaël Salaün
     

14 Apr, 2021

2 commits

  • Update documentation for Trusted and Encrypted Keys with TEE as a new
    trust source. Following is brief description of updates:

    - Add a section to demonstrate a list of supported devices along with
    their security properties/guarantees.
    - Add a key generation section.
    - Updates for usage section including differences specific to a trust
    source.

    Co-developed-by: Elaine Palmer
    Signed-off-by: Elaine Palmer
    Signed-off-by: Sumit Garg
    Signed-off-by: Jarkko Sakkinen

    Sumit Garg
     
  • Modify the TPM2 key format blob output to export and import in the
    ASN.1 form for TPM2 sealed object keys. For compatibility with prior
    trusted keys, the importer will also accept two TPM2B quantities
    representing the public and private parts of the key. However, the
    export via keyctl pipe will only output the ASN.1 format.

    The benefit of the ASN.1 format is that it's a standard and thus the
    exported key can be used by userspace tools (openssl_tpm2_engine,
    openconnect and tpm2-tss-engine). The format includes policy
    specifications, thus it gets us out of having to construct policy
    handles in userspace and the format includes the parent meaning you
    don't have to keep passing it in each time.

    This patch only implements basic handling for the ASN.1 format, so
    keys with passwords but no policy.

    Signed-off-by: James Bottomley
    Tested-by: Jarkko Sakkinen
    Signed-off-by: Jarkko Sakkinen

    James Bottomley
     

24 Feb, 2021

1 commit

  • Pull keyring updates from David Howells:
    "Here's a set of minor keyrings fixes/cleanups that I've collected from
    various people for the upcoming merge window.

    A couple of them might, in theory, be visible to userspace:

    - Make blacklist_vet_description() reject uppercase letters as they
    don't match the all-lowercase hex string generated for a blacklist
    search.

    This may want reconsideration in the future, but, currently, you
    can't add to the blacklist keyring from userspace and the only
    source of blacklist keys generates lowercase descriptions.

    - Fix blacklist_init() to use a new KEY_ALLOC_* flag to indicate that
    it wants KEY_FLAG_KEEP to be set rather than passing KEY_FLAG_KEEP
    into keyring_alloc() as KEY_FLAG_KEEP isn't a valid alloc flag.

    This isn't currently a problem as the blacklist keyring isn't
    currently writable by userspace.

    The rest of the patches are cleanups and I don't think they should
    have any visible effect"

    * tag 'keys-misc-20210126' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
    watch_queue: rectify kernel-doc for init_watch()
    certs: Replace K{U,G}IDT_INIT() with GLOBAL_ROOT_{U,G}ID
    certs: Fix blacklist flag type confusion
    PKCS#7: Fix missing include
    certs: Fix blacklisted hexadecimal hash string check
    certs/blacklist: fix kernel doc interface issue
    crypto: public_key: Remove redundant header file from public_key.h
    keys: remove trailing semicolon in macro definition
    crypto: pkcs7: Use match_string() helper to simplify the code
    PKCS#7: drop function from kernel-doc pkcs7_validate_trust_one
    encrypted-keys: Replace HTTP links with HTTPS ones
    crypto: asymmetric_keys: fix some comments in pkcs7_parser.h
    KEYS: remove redundant memset
    security: keys: delete repeated words in comments
    KEYS: asymmetric: Fix kerneldoc
    security/keys: use kvfree_sensitive()
    watch_queue: Drop references to /dev/watch_queue
    keys: Remove outdated __user annotations
    security: keys: Fix fall-through warnings for Clang

    Linus Torvalds
     

22 Jan, 2021

1 commit


12 Jan, 2021

1 commit

  • Replace the lkml.org links with lore to better use a single source
    that's more likely to stay available long-term.

    Done by bash script:

    cvt_lkml_to_lore ()
    {
    tmpfile=$(mktemp ./.cvt_links.XXXXXXX)

    header=$(echo $1 | sed 's@/lkml/@/lkml/headers/@')

    wget -qO - $header > $tmpfile
    if [[ $? == 0 ]] ; then
    link=$(grep -i '^Message-Id:' $tmpfile | head -1 | \
    sed -r -e 's/^\s*Message-Id:\s*\s*$//' -e 's@^@https://lore.kernel.org/r/@')
    # echo "testlink: $link"
    if [ -n "$link" ] ; then
    wget -qO - $link > /dev/null
    if [[ $? == 0 ]] ; then
    echo $link
    fi
    fi
    fi

    rm -f $tmpfile
    }

    git grep -P -o "\bhttps?://(?:www.)?lkml.org/lkml[\/\w]+" $@ |
    while read line ; do
    echo $line
    file=$(echo $line | cut -f1 -d':')
    link=$(echo $line | cut -f2- -d':')
    newlink=$(cvt_lkml_to_lore $link)
    if [[ -n "$newlink" ]] ; then
    sed -i -e "s#\b$link\b#$newlink#" $file
    fi
    done

    Link: https://lore.kernel.org/patchwork/patch/1265849/#1462688
    Signed-off-by: Joe Perches
    Link: https://lore.kernel.org/r/77cdb7f32cfb087955bfc3600b86c40bed5d4104.camel@perches.com
    Signed-off-by: Jonathan Corbet

    Joe Perches
     

10 Sep, 2020

2 commits

  • Commit 15322a0d90b6 ("lsm: remove current_security()") removed
    current_security() from the sources.

    Signed-off-by: Denis Efremov
    Link: https://lore.kernel.org/r/20200830142509.5738-1-efremov@linux.com
    Signed-off-by: Jonathan Corbet

    Denis Efremov
     
  • The parameters in command examples for tpm2_createprimary and
    tpm2_evictcontrol are outdated, people (like me) are not able to create
    trusted key by these command examples.

    This patch updates the parameters of command example tpm2_createprimary
    and tpm2_evictcontrol in trusted-encrypted.rst. With Linux kernel v5.8
    and tpm2-tools-4.1, people can create a trusted key by following the
    examples in this document.

    Signed-off-by: Coly Li
    Reviewed-by: Jarkko Sakkinen
    Reviewed-by: Stefan Berger
    Cc: Dan Williams
    Cc: James Bottomley
    Cc: Jason Gunthorpe
    Cc: Mimi Zohar
    Cc: Peter Huewe
    Link: https://lore.kernel.org/r/20200821135356.15737-1-colyli@suse.de
    Signed-off-by: Jonathan Corbet

    Coly Li
     

13 Jul, 2020

1 commit

  • Drop the doubled word "in".

    Signed-off-by: Randy Dunlap
    Acked-by: Jarkko Sakkinen
    Cc: Jonathan Corbet
    Cc: linux-doc@vger.kernel.org
    Cc: James Bottomley
    Cc: Jarkko Sakkinen
    Cc: Mimi Zohar
    Cc: linux-integrity@vger.kernel.org
    Cc: keyrings@vger.kernel.org
    Link: https://lore.kernel.org/r/20200707180414.10467-19-rdunlap@infradead.org
    Signed-off-by: Jonathan Corbet

    Randy Dunlap
     

07 Jul, 2020

1 commit


06 Jul, 2020

1 commit

  • When making access control choices from a file-based context, f_cred
    must be used instead of current_cred() to avoid confused deputy attacks
    where an open file may get passed to a more privileged process. Add a
    short paragraph to explicitly state the rationale.

    Cc: Jonathan Corbet
    Cc: linux-doc@vger.kernel.org
    Signed-off-by: Kees Cook
    Link: https://lore.kernel.org/r/202007031038.8833A35DE4@keescook
    Signed-off-by: Jonathan Corbet

    Kees Cook
     

20 Jun, 2020

1 commit

  • This file is almost compatible with ReST. Just minor changes
    were needed:

    - Adjust document and titles markups;
    - Adjust numbered list markups;
    - Add a comments markup for the Contents section;
    - Add markups for literal blocks.

    Acked-by: Jarkko Sakkinen
    Signed-off-by: Mauro Carvalho Chehab
    Link: https://lore.kernel.org/r/c2275ea94e0507a01b020ab66dfa824d8b1c2545.1592203650.git.mchehab+huawei@kernel.org
    Signed-off-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

14 Jun, 2020

1 commit

  • …git/dhowells/linux-fs

    Pull notification queue from David Howells:
    "This adds a general notification queue concept and adds an event
    source for keys/keyrings, such as linking and unlinking keys and
    changing their attributes.

    Thanks to Debarshi Ray, we do have a pull request to use this to fix a
    problem with gnome-online-accounts - as mentioned last time:

    https://gitlab.gnome.org/GNOME/gnome-online-accounts/merge_requests/47

    Without this, g-o-a has to constantly poll a keyring-based kerberos
    cache to find out if kinit has changed anything.

    [ There are other notification pending: mount/sb fsinfo notifications
    for libmount that Karel Zak and Ian Kent have been working on, and
    Christian Brauner would like to use them in lxc, but let's see how
    this one works first ]

    LSM hooks are included:

    - A set of hooks are provided that allow an LSM to rule on whether or
    not a watch may be set. Each of these hooks takes a different
    "watched object" parameter, so they're not really shareable. The
    LSM should use current's credentials. [Wanted by SELinux & Smack]

    - A hook is provided to allow an LSM to rule on whether or not a
    particular message may be posted to a particular queue. This is
    given the credentials from the event generator (which may be the
    system) and the watch setter. [Wanted by Smack]

    I've provided SELinux and Smack with implementations of some of these
    hooks.

    WHY
    ===

    Key/keyring notifications are desirable because if you have your
    kerberos tickets in a file/directory, your Gnome desktop will monitor
    that using something like fanotify and tell you if your credentials
    cache changes.

    However, we also have the ability to cache your kerberos tickets in
    the session, user or persistent keyring so that it isn't left around
    on disk across a reboot or logout. Keyrings, however, cannot currently
    be monitored asynchronously, so the desktop has to poll for it - not
    so good on a laptop. This facility will allow the desktop to avoid the
    need to poll.

    DESIGN DECISIONS
    ================

    - The notification queue is built on top of a standard pipe. Messages
    are effectively spliced in. The pipe is opened with a special flag:

    pipe2(fds, O_NOTIFICATION_PIPE);

    The special flag has the same value as O_EXCL (which doesn't seem
    like it will ever be applicable in this context)[?]. It is given up
    front to make it a lot easier to prohibit splice&co from accessing
    the pipe.

    [?] Should this be done some other way? I'd rather not use up a new
    O_* flag if I can avoid it - should I add a pipe3() system call
    instead?

    The pipe is then configured::

    ioctl(fds[1], IOC_WATCH_QUEUE_SET_SIZE, queue_depth);
    ioctl(fds[1], IOC_WATCH_QUEUE_SET_FILTER, &filter);

    Messages are then read out of the pipe using read().

    - It should be possible to allow write() to insert data into the
    notification pipes too, but this is currently disabled as the
    kernel has to be able to insert messages into the pipe *without*
    holding pipe->mutex and the code to make this work needs careful
    auditing.

    - sendfile(), splice() and vmsplice() are disabled on notification
    pipes because of the pipe->mutex issue and also because they
    sometimes want to revert what they just did - but one or more
    notification messages might've been interleaved in the ring.

    - The kernel inserts messages with the wait queue spinlock held. This
    means that pipe_read() and pipe_write() have to take the spinlock
    to update the queue pointers.

    - Records in the buffer are binary, typed and have a length so that
    they can be of varying size.

    This allows multiple heterogeneous sources to share a common
    buffer; there are 16 million types available, of which I've used
    just a few, so there is scope for others to be used. Tags may be
    specified when a watchpoint is created to help distinguish the
    sources.

    - Records are filterable as types have up to 256 subtypes that can be
    individually filtered. Other filtration is also available.

    - Notification pipes don't interfere with each other; each may be
    bound to a different set of watches. Any particular notification
    will be copied to all the queues that are currently watching for it
    - and only those that are watching for it.

    - When recording a notification, the kernel will not sleep, but will
    rather mark a queue as having lost a message if there's
    insufficient space. read() will fabricate a loss notification
    message at an appropriate point later.

    - The notification pipe is created and then watchpoints are attached
    to it, using one of:

    keyctl_watch_key(KEY_SPEC_SESSION_KEYRING, fds[1], 0x01);
    watch_mount(AT_FDCWD, "/", 0, fd, 0x02);
    watch_sb(AT_FDCWD, "/mnt", 0, fd, 0x03);

    where in both cases, fd indicates the queue and the number after is
    a tag between 0 and 255.

    - Watches are removed if either the notification pipe is destroyed or
    the watched object is destroyed. In the latter case, a message will
    be generated indicating the enforced watch removal.

    Things I want to avoid:

    - Introducing features that make the core VFS dependent on the
    network stack or networking namespaces (ie. usage of netlink).

    - Dumping all this stuff into dmesg and having a daemon that sits
    there parsing the output and distributing it as this then puts the
    responsibility for security into userspace and makes handling
    namespaces tricky. Further, dmesg might not exist or might be
    inaccessible inside a container.

    - Letting users see events they shouldn't be able to see.

    TESTING AND MANPAGES
    ====================

    - The keyutils tree has a pipe-watch branch that has keyctl commands
    for making use of notifications. Proposed manual pages can also be
    found on this branch, though a couple of them really need to go to
    the main manpages repository instead.

    If the kernel supports the watching of keys, then running "make
    test" on that branch will cause the testing infrastructure to spawn
    a monitoring process on the side that monitors a notifications pipe
    for all the key/keyring changes induced by the tests and they'll
    all be checked off to make sure they happened.

    https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git/log/?h=pipe-watch

    - A test program is provided (samples/watch_queue/watch_test) that
    can be used to monitor for keyrings, mount and superblock events.
    Information on the notifications is simply logged to stdout"

    * tag 'notifications-20200601' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
    smack: Implement the watch_key and post_notification hooks
    selinux: Implement the watch_key security hook
    keys: Make the KEY_NEED_* perms an enum rather than a mask
    pipe: Add notification lossage handling
    pipe: Allow buffers to be marked read-whole-or-error for notifications
    Add sample notification program
    watch_queue: Add a key/keyring notification facility
    security: Add hooks to rule on setting a watch
    pipe: Add general notification queue support
    pipe: Add O_NOTIFICATION_PIPE
    security: Add a hook for the point of notification insertion
    uapi: General notification queue definitions

    Linus Torvalds
     

11 Jun, 2020

1 commit

  • Pull more documentation updates from Jonathan Corbet:
    "A handful of late-arriving docs fixes, along with a patch changing a
    lot of HTTP links to HTTPS that had to be yanked and redone before the
    first pull"

    * tag 'docs-5.8-2' of git://git.lwn.net/linux:
    docs/memory-barriers.txt/kokr: smp_mb__{before,after}_atomic(): update Documentation
    Documentation: devres: add missing entry for devm_platform_get_and_ioremap_resource()
    Replace HTTP links with HTTPS ones: documentation
    docs: it_IT: address invalid reference warnings
    doc: zh_CN: use doc reference to resolve undefined label warning
    docs: Update the location of the LF NDA program
    docs: dev-tools: coccinelle: underlines

    Linus Torvalds
     

08 Jun, 2020

1 commit

  • Rationale:
    Reduces attack surface on kernel devs opening the links for MITM
    as HTTPS traffic is much harder to manipulate.

    Deterministic algorithm:
    For each file:
    For each line:
    If doesn't contain `\bxmlns\b`:
    For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
    If both the HTTP and HTTPS versions
    return 200 OK and serve the same content:
    Replace HTTP with HTTPS.

    Signed-off-by: Alexander A. Klimov
    Link: https://lore.kernel.org/r/20200526060544.25127-1-grandmaster@al2klimov.de
    Signed-off-by: Jonathan Corbet

    Alexander A. Klimov
     

05 Jun, 2020

1 commit

  • Pull keyring updates from David Howells:

    - Fix a documentation warning.

    - Replace a zero-length array with a flexible one

    - Make the big_key key type use ChaCha20Poly1305 and use the crypto
    algorithm directly rather than going through the crypto layer.

    - Implement the update op for the big_key type.

    * tag 'keys-next-20200602' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
    keys: Implement update for the big_key type
    security/keys: rewrite big_key crypto to use library interface
    KEYS: Replace zero-length array with flexible-array
    Documentation: security: core.rst: add missing argument

    Linus Torvalds
     

03 Jun, 2020

1 commit


02 Jun, 2020

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "A fair amount of stuff this time around, dominated by yet another
    massive set from Mauro toward the completion of the RST conversion. I
    *really* hope we are getting close to the end of this. Meanwhile,
    those patches reach pretty far afield to update document references
    around the tree; there should be no actual code changes there. There
    will be, alas, more of the usual trivial merge conflicts.

    Beyond that we have more translations, improvements to the sphinx
    scripting, a number of additions to the sysctl documentation, and lots
    of fixes"

    * tag 'docs-5.8' of git://git.lwn.net/linux: (130 commits)
    Documentation: fixes to the maintainer-entry-profile template
    zswap: docs/vm: Fix typo accept_threshold_percent in zswap.rst
    tracing: Fix events.rst section numbering
    docs: acpi: fix old http link and improve document format
    docs: filesystems: add info about efivars content
    Documentation: LSM: Correct the basic LSM description
    mailmap: change email for Ricardo Ribalda
    docs: sysctl/kernel: document unaligned controls
    Documentation: admin-guide: update bug-hunting.rst
    docs: sysctl/kernel: document ngroups_max
    nvdimm: fixes to maintainter-entry-profile
    Documentation/features: Correct RISC-V kprobes support entry
    Documentation/features: Refresh the arch support status files
    Revert "docs: sysctl/kernel: document ngroups_max"
    docs: move locking-specific documents to locking/
    docs: move digsig docs to the security book
    docs: move the kref doc into the core-api book
    docs: add IRQ documentation at the core-api book
    docs: debugging-via-ohci1394.txt: add it to the core-api book
    docs: fix references for ipmi.rst file
    ...

    Linus Torvalds
     

26 May, 2020

1 commit

  • This is a first pass at updating the basic documentation on
    Linux Security Modules (LSM), which is frighteningly out of date.
    Remove untrue statements about the LSM framework. Replace them
    with true statements where it is convenient to do so. This is
    the beginnig of a larger effort to bring the LSM documentation
    up to date.

    Signed-off-by: Casey Schaufler
    Link: https://lore.kernel.org/r/4c053d72-2d58-612f-6d6b-f04226d0181e@schaufler-ca.com
    Signed-off-by: Jonathan Corbet

    Casey Schaufler
     

19 May, 2020

1 commit

  • Add a key/keyring change notification facility whereby notifications about
    changes in key and keyring content and attributes can be received.

    Firstly, an event queue needs to be created:

    pipe2(fds, O_NOTIFICATION_PIPE);
    ioctl(fds[1], IOC_WATCH_QUEUE_SET_SIZE, 256);

    then a notification can be set up to report notifications via that queue:

    struct watch_notification_filter filter = {
    .nr_filters = 1,
    .filters = {
    [0] = {
    .type = WATCH_TYPE_KEY_NOTIFY,
    .subtype_filter[0] = UINT_MAX,
    },
    },
    };
    ioctl(fds[1], IOC_WATCH_QUEUE_SET_FILTER, &filter);
    keyctl_watch_key(KEY_SPEC_SESSION_KEYRING, fds[1], 0x01);

    After that, records will be placed into the queue when events occur in
    which keys are changed in some way. Records are of the following format:

    struct key_notification {
    struct watch_notification watch;
    __u32 key_id;
    __u32 aux;
    } *n;

    Where:

    n->watch.type will be WATCH_TYPE_KEY_NOTIFY.

    n->watch.subtype will indicate the type of event, such as
    NOTIFY_KEY_REVOKED.

    n->watch.info & WATCH_INFO_LENGTH will indicate the length of the
    record.

    n->watch.info & WATCH_INFO_ID will be the second argument to
    keyctl_watch_key(), shifted.

    n->key will be the ID of the affected key.

    n->aux will hold subtype-dependent information, such as the key
    being linked into the keyring specified by n->key in the case of
    NOTIFY_KEY_LINKED.

    Note that it is permissible for event records to be of variable length -
    or, at least, the length may be dependent on the subtype. Note also that
    the queue can be shared between multiple notifications of various types.

    Signed-off-by: David Howells
    Reviewed-by: James Morris

    David Howells
     

16 May, 2020

1 commit


08 May, 2020

1 commit

  • The library implementation of the SHA-1 compression function is
    confusingly called just "sha_transform()". Alongside it are some "SHA_"
    constants and "sha_init()". Presumably these are left over from a time
    when SHA just meant SHA-1. But now there are also SHA-2 and SHA-3, and
    moreover SHA-1 is now considered insecure and thus shouldn't be used.

    Therefore, rename these functions and constants to make it very clear
    that they are for SHA-1. Also add a comment to make it clear that these
    shouldn't be used.

    For the extra-misleadingly named "SHA_MESSAGE_BYTES", rename it to
    SHA1_BLOCK_SIZE and define it to just '64' rather than '(512/8)' so that
    it matches the same definition in . This prepares for
    merging into .

    Signed-off-by: Eric Biggers
    Signed-off-by: Herbert Xu

    Eric Biggers
     

21 Mar, 2020

1 commit

  • Changeset 58ad30cf91f0 ("docs: fix reference to core-api/namespaces.rst")
    enabled a new feature at Sphinx: it will now generate index for each
    document title, plus to each chapter inside it.

    There's a drawback, though: one document cannot have two sections
    with the same name anymore.

    A followup patch will change the logic of autosectionlabel to
    avoid most creating references for every single section title,
    but still we need to be able to reference the chapters inside
    a document.

    There are a few places where there are two chapters with the
    same name. This patch renames one of the chapters, in order to
    avoid symbol conflict within the same document.

    PS.: as I don't speach Chinese, I had some help from a friend
    (Wen Liu) at the Chinese translation for "publishing patches"
    for this document:

    Documentation/translations/zh_CN/process/5.Posting.rst

    Fixes: 58ad30cf91f0 ("docs: fix reference to core-api/namespaces.rst")
    Signed-off-by: Mauro Carvalho Chehab
    Link: https://lore.kernel.org/r/2bffb91e4a63d41bf5fae1c23e1e8b3bba0b8806.1584716446.git.mchehab+huawei@kernel.org
    Signed-off-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

23 Nov, 2019

1 commit


01 Oct, 2019

1 commit


28 Sep, 2019

1 commit

  • Pull integrity updates from Mimi Zohar:
    "The major feature in this time is IMA support for measuring and
    appraising appended file signatures. In addition are a couple of bug
    fixes and code cleanup to use struct_size().

    In addition to the PE/COFF and IMA xattr signatures, the kexec kernel
    image may be signed with an appended signature, using the same
    scripts/sign-file tool that is used to sign kernel modules.

    Similarly, the initramfs may contain an appended signature.

    This contained a lot of refactoring of the existing appended signature
    verification code, so that IMA could retain the existing framework of
    calculating the file hash once, storing it in the IMA measurement list
    and extending the TPM, verifying the file's integrity based on a file
    hash or signature (eg. xattrs), and adding an audit record containing
    the file hash, all based on policy. (The IMA support for appended
    signatures patch set was posted and reviewed 11 times.)

    The support for appended signature paves the way for adding other
    signature verification methods, such as fs-verity, based on a single
    system-wide policy. The file hash used for verifying the signature and
    the signature, itself, can be included in the IMA measurement list"

    * 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity:
    ima: ima_api: Use struct_size() in kzalloc()
    ima: use struct_size() in kzalloc()
    sefltest/ima: support appended signatures (modsig)
    ima: Fix use after free in ima_read_modsig()
    MODSIGN: make new include file self contained
    ima: fix freeing ongoing ahash_request
    ima: always return negative code for error
    ima: Store the measurement again when appraising a modsig
    ima: Define ima-modsig template
    ima: Collect modsig
    ima: Implement support for module-style appended signatures
    ima: Factor xattr_verify() out of ima_appraise_measurement()
    ima: Add modsig appraise_type option for module-style appended signatures
    integrity: Select CONFIG_KEYS instead of depending on it
    PKCS#7: Introduce pkcs7_get_digest()
    PKCS#7: Refactor verify_pkcs7_signature()
    MODSIGN: Export module signature definitions
    ima: initialize the "template" field with the default template

    Linus Torvalds
     

18 Sep, 2019

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "It's a somewhat calmer cycle for docs this time, as the churn of the
    mass RST conversion is happily mostly behind us.

    - A new document on reproducible builds.

    - We finally got around to zapping the documentation for hardware
    support that was removed in 2004; one doesn't want to rush these
    things.

    - The usual assortment of fixes, typo corrections, etc"

    * tag 'docs-5.4' of git://git.lwn.net/linux: (67 commits)
    Documentation: kbuild: Add document about reproducible builds
    docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]
    Documentation: Add "earlycon=sbi" to the admin guide
    doc:lock: remove reference to clever use of read-write lock
    devices.txt: improve entry for comedi (char major 98)
    docs: mtd: Update spi nor reference driver
    doc: arm64: fix grammar dtb placed in no attributes region
    Documentation: sysrq: don't recommend 'S' 'U' before 'B'
    mailmap: Update email address for Quentin Perret
    docs: ftrace: clarify when tracing is disabled by the trace file
    docs: process: fix broken link
    Documentation/arm/samsung-s3c24xx: Remove stray U+FEFF character to fix title
    Documentation/arm/sa1100/assabet: Fix 'make assabet_defconfig' command
    Documentation/arm/sa1100: Remove some obsolete documentation
    docs/zh_CN: update Chinese howto.rst for latexdocs making
    Documentation: virt: Fix broken reference to virt tree's index
    docs: Fix typo on pull requests guide
    kernel-doc: Allow anonymous enum
    Documentation: sphinx: Don't parse socket() as identifier reference
    Documentation: sphinx: Add missing comma to list of strings
    ...

    Linus Torvalds