Skip to content

RFC: Public key encryption of dmesg by the kernel

Dan Aloni kernel-hardening lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 7 repliesIn review
  2. v15 patches 10 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7crypto: fix memory leak in rsa-kcs1pad encryptioncrypto/rsa-pkcs1pad.c+0 -90 replies
2/7Move net/ceph/armor to lib/ and add docsinclude/linux/base64-armor.h lib/Kconfig lib/Makefile +5 more+85 -110 replies
3/7base64-armor: add bounds checkinginclude/linux/base64-armor.h lib/base64-armor.c net/ceph/crypto.c+30 -90 replies
4/7certs: allow in-kernel access of trusted keyscerts/system_keyring.c include/keys/system_keyring.h+58 -11 reply
5/7printk: allow kmsg to be encrypted using public key encryptionDocumentation/ioctl/ioctl-number.txt include/uapi/linux/kmsg.h init/Kconfig +1 more+480 -06 replies
6/7tools: add dmesg decryption programtools/Makefile tools/kmsg/.gitignore tools/kmsg/Makefile +1 more+377 -10 replies
7/7docs: add dmesg encryption docDocumentation/admin-guide/dmesg-encryption.rst Documentation/admin-guide/index.rst+119 -00 replies

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by.

PatchRandy Dunlap
1/7
2/7
3/7
4/7
5/7
6/7
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCHv2 0/7] RFC: Public key encryption of dmesg by the kernel

Changes from v1 [1]:

- Made suggested fixes following a review from Randy Dunlap
- Modified the ASCII encoding of cipher text to base64 instead of hex, with newlines replaced by '~' ; updated dmesg-decipher for it too
- Moved base64 code from fs/ceph to lib, and improved it a bit
- Improved checks that we are not overflowing the user buffer when using copy_to_user to in the added code
- Added some prints when errors in dmesg-decipher
- Fixes to Makefile at tools/ for building 'kmsg' (should it build by default in target 'all'? There is an openssl depdendency.)
- checkpatch.pl linting

[1] https://lwn.net/Articles/742412/

Dan Aloni (7):
crypto: fix memory leak in rsa-kcs1pad encryption Move net/ceph/armor to lib/ and add docs
base64-armor: add bounds checking
certs: allow in-kernel access of trusted keys
printk: allow kmsg to be encrypted using public key encryption
tools: add dmesg decryption program
docs: add dmesg encryption doc

 Documentation/admin-guide/dmesg-encryption.rst | 116 +++++++
 Documentation/admin-guide/index.rst            |   1 +
 Documentation/ioctl/ioctl-number.txt           |   1 +
 certs/system_keyring.c                         |  56 ++-
 crypto/rsa-pkcs1pad.c                          |   9 -
 include/keys/system_keyring.h                  |   3 +
 include/linux/base64-armor.h                   |  70 ++++
 include/uapi/linux/kmsg.h                      |  18 +
 init/Kconfig                                   |  11 +
 kernel/printk/printk.c                         | 451 +++++++++++++++++++++++++
 lib/Kconfig                                    |   7 +
 lib/Makefile                                   |   1 +
 net/ceph/armor.c => lib/base64-armor.c         |  29 +-
 net/ceph/Kconfig                               |   1 +
 net/ceph/Makefile                              |   2 +-
 net/ceph/crypto.c                              |   3 +-
 net/ceph/crypto.h                              |   4 -
 tools/Makefile                                 |   9 +-
 tools/kmsg/.gitignore                          |   1 +
 tools/kmsg/Makefile                            |  14 +
 tools/kmsg/dmesg-decipher.c                    | 354 +++++++++++++++++++
 21 files changed, 1139 insertions(+), 22 deletions(-)
 create mode 100644 Documentation/admin-guide/dmesg-encryption.rst
 create mode 100644 include/linux/base64-armor.h
 create mode 100644 include/uapi/linux/kmsg.h
 rename net/ceph/armor.c => lib/base64-armor.c (75%)
 create mode 100644 tools/kmsg/.gitignore
 create mode 100644 tools/kmsg/Makefile
 create mode 100644 tools/kmsg/dmesg-decipher.c
Signature · 1 line
2.14.3