Merge pull request #30675 from idryomov/wip-set-kernel-secret

common/secret.c: don't pass uninitialized stack data to the kernel

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Ilya Dryomov 2019-10-02 16:16:45 +02:00 committed by GitHub
commit 32fc260eba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,7 @@ int set_kernel_secret(const char *secret, const char *key_name)
return ret;
}
serial = add_key("ceph", key_name, payload, sizeof(payload), KEY_SPEC_PROCESS_KEYRING);
serial = add_key("ceph", key_name, payload, ret, KEY_SPEC_PROCESS_KEYRING);
if (serial == -1) {
ret = -errno;
}