Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Mar 24, 2022
  2. Mar 10, 2022
  3. Mar 08, 2022
  4. Mar 03, 2022
  5. Mar 02, 2022
    • Nicolai Stange's avatar
      crypto: dh - constify struct dh's pointer members · 215bebc8
      Nicolai Stange authored
      
      struct dh contains several pointer members corresponding to DH parameters:
      ->key, ->p and ->g. A subsequent commit will introduce "dh" wrapping
      templates of the form "ffdhe2048(dh)", "ffdhe3072(dh)" and so on in order
      to provide built-in support for the well-known safe-prime ffdhe group
      parameters specified in RFC 7919. These templates will need to set the
      group parameter related members of the (serialized) struct dh instance
      passed to the inner "dh" kpp_alg instance, i.e. ->p and ->g, to some
      constant, static storage arrays.
      
      Turn the struct dh pointer members' types into "pointer to const" in
      preparation for this.
      
      Signed-off-by: default avatarNicolai Stange <nstange@suse.de>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      215bebc8
    • Paul Moore's avatar
      selinux: shorten the policy capability enum names · cdbec3ed
      Paul Moore authored
      
      The SELinux policy capability enum names are rather long and follow
      the "POLICYDB_CAPABILITY_XXX format".  While the "POLICYDB_" prefix
      is helpful in tying the enums to other SELinux policy constants,
      macros, etc. there is no reason why we need to spell out
      "CAPABILITY" completely.  Shorten "CAPABILITY" to "CAP" in order to
      make things a bit shorter and cleaner.
      
      Moving forward, the SELinux policy capability enum names should
      follow the "POLICYDB_CAP_XXX" format.
      
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      cdbec3ed
  6. Mar 01, 2022
    • Roopa Prabhu's avatar
      rtnetlink: add new rtm tunnel api for tunnel id filtering · 7b8135f4
      Roopa Prabhu authored
      
      This patch adds new rtm tunnel msg and api for tunnel id
      filtering in dst_metadata devices. First dst_metadata
      device to use the api is vxlan driver with AF_BRIDGE
      family.
      
      This and later changes add ability in vxlan driver to do
      tunnel id filtering (or vni filtering) on dst_metadata
      devices. This is similar to vlan api in the vlan filtering bridge.
      
      this patch includes selinux nlmsg_route_perms support for RTM_*TUNNEL
      api from Benjamin Poirier.
      
      Signed-off-by: default avatarRoopa Prabhu <roopa@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b8135f4
  7. Feb 28, 2022
  8. Feb 25, 2022
  9. Feb 23, 2022
    • Randy Dunlap's avatar
      TOMOYO: fix __setup handlers return values · 39844b7e
      Randy Dunlap authored
      __setup() handlers should return 1 if the parameter is handled.
      Returning 0 causes the entire string to be added to init's
      environment strings (limited to 32 strings), unnecessarily polluting it.
      
      Using the documented strings "TOMOYO_loader=string1" and
      "TOMOYO_trigger=string2" causes an Unknown parameter message:
        Unknown kernel command line parameters
          "BOOT_IMAGE=/boot/bzImage-517rc5 TOMOYO_loader=string1 \
           TOMOYO_trigger=string2", will be passed to user space.
      
      and these strings are added to init's environment string space:
        Run /sbin/init as init process
          with arguments:
           /sbin/init
          with environment:
           HOME=/
           TERM=linux
           BOOT_IMAGE=/boot/bzImage-517rc5
           TOMOYO_loader=string1
           TOMOYO_trigger=string2
      
      With this change, these __setup handlers act as expected,
      and init's environment is not polluted with these strings.
      
      Fixes: 0e4ae0e0
      
       ("TOMOYO: Make several options configurable.")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reported-by: default avatarIgor Zhbanov <i.zhbanov@omprussia.ru>
      Link: https://lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
      
      
      Cc: James Morris <jmorris@namei.org>
      Cc: Kentaro Takeda <takedakn@nttdata.co.jp>
      Cc: tomoyo-dev-en@lists.osdn.me
      Cc: "Serge E. Hallyn" <serge@hallyn.com>
      Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      39844b7e
  10. Feb 22, 2022
    • Randy Dunlap's avatar
      EVM: fix the evm= __setup handler return value · f2544f5e
      Randy Dunlap authored
      __setup() handlers should return 1 if the parameter is handled.
      Returning 0 causes the entire string to be added to init's
      environment strings (limited to 32 strings), unnecessarily polluting it.
      
      Using the documented string "evm=fix" causes an Unknown parameter message:
        Unknown kernel command line parameters
        "BOOT_IMAGE=/boot/bzImage-517rc5 evm=fix", will be passed to user space.
      
      and that string is added to init's environment string space:
        Run /sbin/init as init process
          with arguments:
           /sbin/init
          with environment:
           HOME=/
           TERM=linux
           BOOT_IMAGE=/boot/bzImage-517rc5
           evm=fix
      
      With this change, using "evm=fix" acts as expected and an invalid
      option ("evm=evm") causes a warning to be printed:
        evm: invalid "evm" mode
      but init's environment is not polluted with this string, as expected.
      
      Fixes: 7102ebcd
      
       ("evm: permit only valid security.evm xattrs to be updated")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reported-by: default avatarIgor Zhbanov <i.zhbanov@omprussia.ru>
      Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
      Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      f2544f5e
    • Ondrej Mosnacek's avatar
      selinux: fix misuse of mutex_is_locked() · ce2fc710
      Ondrej Mosnacek authored
      mutex_is_locked() tests whether the mutex is locked *by any task*, while
      here we want to test if it is held *by the current task*. To avoid
      false/missed WARNINGs, use lockdep_assert_is_held() and
      lockdep_assert_is_not_held() instead, which do the right thing (though
      they are a no-op if CONFIG_LOCKDEP=n).
      
      Cc: stable@vger.kernel.org
      Fixes: 2554a48f
      
       ("selinux: measure state and policy capabilities")
      Signed-off-by: default avatarOndrej Mosnacek <omosnace@redhat.com>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      ce2fc710
  11. Feb 21, 2022
    • Yael Tzur's avatar
      KEYS: encrypted: Instantiate key with user-provided decrypted data · cd3bc044
      Yael Tzur authored
      
      For availability and performance reasons master keys often need to be
      released outside of a Key Management Service (KMS) to clients. It
      would be beneficial to provide a mechanism where the
      wrapping/unwrapping of data encryption keys (DEKs) is not dependent
      on a remote call at runtime yet security is not (or only minimally)
      compromised. Master keys could be securely stored in the Kernel and
      be used to wrap/unwrap keys from Userspace.
      
      The encrypted.c class supports instantiation of encrypted keys with
      either an already-encrypted key material, or by generating new key
      material based on random numbers. This patch defines a new datablob
      format: [<format>] <master-key name> <decrypted data length>
      <decrypted data> that allows to inject and encrypt user-provided
      decrypted data. The decrypted data must be hex-ascii encoded.
      
      Signed-off-by: default avatarYael Tzur <yaelt@google.com>
      Reviewed-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      Reviewed-by: default avatarSumit Garg <sumit.garg@linaro.org>
      Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      cd3bc044
  12. Feb 18, 2022
  13. Feb 16, 2022
  14. Feb 15, 2022
    • Ondrej Mosnacek's avatar
      security: implement sctp_assoc_established hook in selinux · 3eb8eaf2
      Ondrej Mosnacek authored
      Do this by extracting the peer labeling per-association logic from
      selinux_sctp_assoc_request() into a new helper
      selinux_sctp_process_new_assoc() and use this helper in both
      selinux_sctp_assoc_request() and selinux_sctp_assoc_established(). This
      ensures that the peer labeling behavior as documented in
      Documentation/security/SCTP.rst is applied both on the client and server
      side:
      """
      An SCTP socket will only have one peer label assigned to it. This will be
      assigned during the establishment of the first association. Any further
      associations on this socket will have their packet peer label compared to
      the sockets peer label, and only if they are different will the
      ``association`` permission be validated. This is validated by checking the
      socket peer sid against the received packets peer sid to determine whether
      the association should be allowed or denied.
      """
      
      At the same time, it also ensures that the peer label of the association
      is set to the correct value, such that if it is peeled off into a new
      socket, the socket's peer label  will then be set to the association's
      peer label, same as it already works on the server side.
      
      While selinux_inet_conn_established() (which we are replacing by
      selinux_sctp_assoc_established() for SCTP) only deals with assigning a
      peer label to the connection (socket), in case of SCTP we need to also
      copy the (local) socket label to the association, so that
      selinux_sctp_sk_clone() can then pick it up for the new socket in case
      of SCTP peeloff.
      
      Careful readers will notice that the selinux_sctp_process_new_assoc()
      helper also includes the "IPv4 packet received over an IPv6 socket"
      check, even though it hadn't been in selinux_sctp_assoc_request()
      before. While such check is not necessary in
      selinux_inet_conn_request() (because struct request_sock's family field
      is already set according to the skb's family), here it is needed, as we
      don't have request_sock and we take the initial family from the socket.
      In selinux_sctp_assoc_established() it is similarly needed as well (and
      also selinux_inet_conn_established() already has it).
      
      Fixes: 72e89f50
      
       ("security: Add support for SCTP security hooks")
      Reported-by: default avatarPrashanth Prahlad <pprahlad@redhat.com>
      Based-on-patch-by: default avatarXin Long <lucien.xin@gmail.com>
      Reviewed-by: default avatarXin Long <lucien.xin@gmail.com>
      Tested-by: default avatarRichard Haines <richard_c_haines@btinternet.com>
      Signed-off-by: default avatarOndrej Mosnacek <omosnace@redhat.com>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      3eb8eaf2
    • Ondrej Mosnacek's avatar
      security: add sctp_assoc_established hook · 5e50f5d4
      Ondrej Mosnacek authored
      security_sctp_assoc_established() is added to replace
      security_inet_conn_established() called in
      sctp_sf_do_5_1E_ca(), so that asoc can be accessed in security
      subsystem and save the peer secid to asoc->peer_secid.
      
      Fixes: 72e89f50
      
       ("security: Add support for SCTP security hooks")
      Reported-by: default avatarPrashanth Prahlad <pprahlad@redhat.com>
      Based-on-patch-by: default avatarXin Long <lucien.xin@gmail.com>
      Reviewed-by: default avatarXin Long <lucien.xin@gmail.com>
      Tested-by: default avatarRichard Haines <richard_c_haines@btinternet.com>
      Signed-off-by: default avatarOndrej Mosnacek <omosnace@redhat.com>
      Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
      5e50f5d4
    • Mimi Zohar's avatar
      ima: define ima_max_digest_data struct without a flexible array variable · 8c54135e
      Mimi Zohar authored
      
      To support larger hash digests in the 'iint' cache, instead of defining
      the 'digest' field as the maximum digest size, the 'digest' field was
      defined as a flexible array variable.  The "ima_digest_data" struct was
      wrapped inside a local structure with the maximum digest size.  But
      before adding the record to the iint cache, memory for the exact digest
      size was dynamically allocated.
      
      The original reason for defining the 'digest' field as a flexible array
      variable is still valid for the 'iint' cache use case.  Instead of
      wrapping the 'ima_digest_data' struct in a local structure define
      'ima_max_digest_data' struct.
      
      Reviewed-by: default avatarStefan Berger <stefanb@linux.ibm.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      8c54135e
    • Mimi Zohar's avatar
      ima: rename IMA_ACTION_FLAGS to IMA_NONACTION_FLAGS · aae6ccbd
      Mimi Zohar authored
      
      Simple policy rule options, such as fowner, uid, or euid, can be checked
      immediately, while other policy rule options, such as requiring a file
      signature, need to be deferred.
      
      The 'flags' field in the integrity_iint_cache struct contains the policy
      action', 'subaction', and non action/subaction.
      
      action: measure/measured, appraise/appraised, (collect)/collected,
              audit/audited
      subaction: appraise status for each hook (e.g. file, mmap, bprm, read,
              creds)
      non action/subaction: deferred policy rule options and state
      
      Rename the IMA_ACTION_FLAGS to IMA_NONACTION_FLAGS.
      
      Reviewed-by: default avatarStefan Berger <stefanb@linux.ibm.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      aae6ccbd
    • Stefan Berger's avatar
      ima: Return error code obtained from securityfs functions · e4e071ba
      Stefan Berger authored
      
      If an error occurs when creating a securityfs file, return the exact
      error code to the caller.
      
      Signed-off-by: default avatarStefan Berger <stefanb@linux.ibm.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      e4e071ba
    • Austin Kim's avatar
      ima: Fix trivial typos in the comments · 65603435
      Austin Kim authored
      
      There are a few minor typos in the comments. Fix these.
      
      Signed-off-by: default avatarAustin Kim <austindh.kim@gmail.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
      65603435
  15. Feb 13, 2022
  16. Feb 07, 2022
  17. Feb 06, 2022
  18. Feb 04, 2022
  19. Feb 02, 2022