diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-15 11:06:43 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-15 11:06:43 +0100 |
commit | 4a11ea0818f9d84b7b29693f27adaa5d020ffe25 (patch) | |
tree | 790e0cfa51205da212bd6606c125c057d62b8273 | |
parent | 4ca24c3b9f9a828d7c951844ceec88e8699550ad (diff) | |
download | patches-4a11ea0818f9d84b7b29693f27adaa5d020ffe25.tar.gz |
add and remove a patch and refresh some
-rw-r--r-- | 0001-crypto-asym_tpm-correct-zero-out-potential-secrets.patch | 28 | ||||
-rw-r--r-- | 0001-driver-core-aux-test-code.patch | 188 | ||||
-rw-r--r-- | 0002-arch-wire-up-the-readfile-syscall.patch | 2 | ||||
-rw-r--r-- | series | 2 |
4 files changed, 190 insertions, 30 deletions
diff --git a/0001-crypto-asym_tpm-correct-zero-out-potential-secrets.patch b/0001-crypto-asym_tpm-correct-zero-out-potential-secrets.patch deleted file mode 100644 index 922cc3233f9768..00000000000000 --- a/0001-crypto-asym_tpm-correct-zero-out-potential-secrets.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 5c228ea4d119be44cf78cb9e36590f2b3fdc4f1e Mon Sep 17 00:00:00 2001 -From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -Date: Fri, 4 Dec 2020 08:57:41 +0100 -Subject: [PATCH] crypto: asym_tpm: correct zero out potential secrets - -The function derive_pub_key() should be calling memzero_explicit() -instead of memset() in case the complier decides to optimize away the -call to memset() because it "knows" no one is going to touch the memory -anymore. - -Reported-by: Ilil Blum Shem-Tov <ilil.blum.shem-tov@intel.com> -Tested-by: Ilil Blum Shem-Tov <ilil.blum.shem-tov@intel.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - crypto/asymmetric_keys/asym_tpm.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/crypto/asymmetric_keys/asym_tpm.c -+++ b/crypto/asymmetric_keys/asym_tpm.c -@@ -354,7 +354,7 @@ static uint32_t derive_pub_key(const voi - memcpy(cur, e, sizeof(e)); - cur += sizeof(e); - /* Zero parameters to satisfy set_pub_key ABI. */ -- memset(cur, 0, SETKEY_PARAMS_SIZE); -+ memzero_explicit(cur, SETKEY_PARAMS_SIZE); - - return cur - buf; - } diff --git a/0001-driver-core-aux-test-code.patch b/0001-driver-core-aux-test-code.patch new file mode 100644 index 00000000000000..cda132cdcfb352 --- /dev/null +++ b/0001-driver-core-aux-test-code.patch @@ -0,0 +1,188 @@ +From fd830d0ff53aa70488a69e4eaf3fb0de9205c39f Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Date: Fri, 4 Dec 2020 09:46:22 +0100 +Subject: [PATCH] driver core: aux test code + +try to test out the aux bus code +--- + drivers/base/Kconfig | 2 + drivers/base/Makefile | 1 + drivers/base/aux_test.c | 140 +++++++++++++++++++++++++++++++++++++++++++++++ + drivers/base/auxiliary.c | 1 + 4 files changed, 143 insertions(+), 1 deletion(-) + create mode 100644 drivers/base/aux_test.c + +--- a/drivers/base/Kconfig ++++ b/drivers/base/Kconfig +@@ -2,7 +2,7 @@ + menu "Generic Driver Options" + + config AUXILIARY_BUS +- bool ++ tristate "aux bus" + + config UEVENT_HELPER + bool "Support for uevent helper" +--- a/drivers/base/Makefile ++++ b/drivers/base/Makefile +@@ -8,6 +8,7 @@ obj-y := component.o core.o bus.o dd.o + topology.o container.o property.o cacheinfo.o \ + swnode.o + obj-$(CONFIG_AUXILIARY_BUS) += auxiliary.o ++obj-$(CONFIG_AUXILIARY_BUS) += aux_test.o + obj-$(CONFIG_DEVTMPFS) += devtmpfs.o + obj-y += power/ + obj-$(CONFIG_ISA_BUS_API) += isa.o +--- /dev/null ++++ b/drivers/base/aux_test.c +@@ -0,0 +1,140 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++ ++ ++#include <linux/init.h> ++#include <linux/device.h> ++#include <linux/module.h> ++#include <linux/slab.h> ++#include <linux/auxiliary_bus.h> ++#include <linux/platform_device.h> ++ ++ ++struct aux_test_device { ++ struct auxiliary_device auxdev; ++ int foo; ++ void *data; ++}; ++ ++#define aux_dev_to_test_device(auxdev) \ ++ container_of(auxdev, struct aux_test_device, auxdev) ++ ++static void aux_test_dev_release(struct device *dev) ++{ ++ struct auxiliary_device *auxdev = to_auxiliary_dev(dev); ++ struct aux_test_device *test_dev = aux_dev_to_test_device(auxdev); ++ ++ kfree(test_dev); ++} ++ ++static struct aux_test_device *test_device_alloc(struct device *parent, ++ const char *name, u32 id) ++{ ++ struct aux_test_device *test_dev; ++ struct auxiliary_device *auxdev; ++ int retval; ++ ++ test_dev = kzalloc(sizeof(*test_dev), GFP_KERNEL); ++ if (!test_dev) ++ return NULL; ++ ++ auxdev= &test_dev->auxdev; ++ auxdev->name = name; ++ auxdev->dev.parent = parent; ++ auxdev->dev.release = aux_test_dev_release; ++ auxdev->id = id; ++ ++ retval = auxiliary_device_init(auxdev); ++ if (retval) { ++ dev_err(parent, "aux device failed to init\n"); ++ kfree(test_dev); ++ return NULL; ++ } ++ ++ return test_dev; ++} ++ ++static struct aux_test_device *test_device_create(struct device *parent, ++ const char *name, u32 id) ++{ ++ struct aux_test_device *test_dev; ++ int retval; ++ ++ test_dev = test_device_alloc(parent, name, id); ++ if (!test_dev) { ++ dev_err(parent, "aux device %s failed to be created\n", name); ++ return NULL; ++ } ++ ++ retval = auxiliary_device_add(&test_dev->auxdev); ++ if (retval) { ++ dev_err(parent, "aux device %s failed to be added, error %d\n", ++ name, retval); ++ auxiliary_device_uninit(&test_dev->auxdev); ++ return NULL; ++ } ++ ++ return test_dev; ++} ++ ++static void test_dev_del(struct aux_test_device *test_dev) ++{ ++ if (!test_dev) ++ return; ++ ++ auxiliary_device_delete(&test_dev->auxdev); ++ auxiliary_device_uninit(&test_dev->auxdev); ++} ++ ++ ++static struct aux_test_device *tdev1, *tdev2, *tdev3; ++ ++/* Make a random device to be the "parent" of our tests */ ++static struct platform_device *root_device; ++ ++static void root_device_release(struct device *dev) ++{ ++ struct platform_device *pdev = to_platform_device(dev); ++ kfree(pdev); ++} ++ ++static int __init aux_test_init(void) ++{ ++ int retval; ++ ++ root_device = kzalloc(sizeof(*root_device), GFP_KERNEL); ++ if (!root_device) ++ return -ENOMEM; ++ ++ root_device->name = "aux_test_root"; ++ root_device->dev.release = root_device_release; ++ ++ retval = platform_device_register(root_device); ++ if (retval) { ++ kfree(root_device); ++ return retval; ++ } ++ ++ /* Allocate 3 test devices as a child of this parent */ ++ tdev1 = test_device_create(&root_device->dev, "test_dev_1", 21); ++ tdev2 = test_device_create(&root_device->dev, "test_dev_2", 32); ++ tdev3 = test_device_create(&root_device->dev, "test_dev_3", 43); ++ ++ return 0; ++} ++ ++static void __exit aux_test_exit(void) ++{ ++ test_dev_del(tdev1); ++ test_dev_del(tdev2); ++ test_dev_del(tdev3); ++ platform_device_unregister(root_device); ++ ++} ++ ++ ++ ++module_init(aux_test_init); ++module_exit(aux_test_exit); ++ ++ ++MODULE_LICENSE("GPL v2"); +--- a/drivers/base/auxiliary.c ++++ b/drivers/base/auxiliary.c +@@ -11,6 +11,7 @@ + #include <linux/init.h> + #include <linux/slab.h> + #include <linux/module.h> ++#include <linux/slab.h> + #include <linux/pm_domain.h> + #include <linux/pm_runtime.h> + #include <linux/string.h> diff --git a/0002-arch-wire-up-the-readfile-syscall.patch b/0002-arch-wire-up-the-readfile-syscall.patch index 489a85ce3b4c68..687aad72dbc606 100644 --- a/0002-arch-wire-up-the-readfile-syscall.patch +++ b/0002-arch-wire-up-the-readfile-syscall.patch @@ -156,7 +156,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +442 common readfile sys_readfile --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h -@@ -1013,6 +1013,8 @@ asmlinkage long sys_pidfd_send_signal(in +@@ -1037,6 +1037,8 @@ asmlinkage long sys_pidfd_send_signal(in siginfo_t __user *info, unsigned int flags); asmlinkage long sys_pidfd_getfd(int pidfd, int fd, unsigned int flags); @@ -1,6 +1,6 @@ # +0001-driver-core-aux-test-code.patch copying.patch -0001-crypto-asym_tpm-correct-zero-out-potential-secrets.patch 0001-readfile-implement-readfile-syscall.patch 0002-arch-wire-up-the-readfile-syscall.patch 0003-selftests-add-readfile-2-selftests.patch |