Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Benes <mbenes@suse.cz>2018-12-31 13:31:45 +0100
committerMiroslav Benes <mbenes@suse.cz>2018-12-31 13:31:45 +0100
commit4750a48b8af0f8700c57c951cd89147871a4a9a0 (patch)
treeea6460204d8abe28b0e8a092f87df1960aca356d
parenta2aab7bce17bb150d93945c2245b81bafdc860a5 (diff)
parent76fa1a42d05db3cb21e3fbc0b5ccece8dee12f7e (diff)
Merge branch 'master-livepatch' into master-livepatch-sle12
-rw-r--r--uname_patch/livepatch_uname.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/uname_patch/livepatch_uname.c b/uname_patch/livepatch_uname.c
index fdd11cc..4ca603a 100644
--- a/uname_patch/livepatch_uname.c
+++ b/uname_patch/livepatch_uname.c
@@ -108,23 +108,23 @@ out:
asmlinkage long klp_sys_newuname(struct new_utsname __user *name)
{
- int errno = 0;
+ struct new_utsname tmp;
char klp_version[65] = { 0 };
down_read(klp_uts_sem);
- if (copy_to_user(name, utsname(), sizeof *name))
- errno = -EFAULT;
+ memcpy(&tmp, utsname(), sizeof(tmp));
memcpy(klp_version, utsname()->version, sizeof(utsname()->version));
up_read(klp_uts_sem);
+ if (copy_to_user(name, &tmp, sizeof(tmp)))
+ return -EFAULT;
- if (!errno && override_release(name->release, sizeof(name->release)))
- errno = -EFAULT;
- if (!errno && override_architecture(name))
- errno = -EFAULT;
- if (!errno && override_version(name->version, sizeof(name->version),
- klp_version))
- errno = -EFAULT;
- return errno;
+ if (override_release(name->release, sizeof(name->release)))
+ return -EFAULT;
+ if (override_architecture(name))
+ return -EFAULT;
+ if (override_version(name->version, sizeof(name->version), klp_version))
+ return -EFAULT;
+ return 0;
}
int klp_patch_uname_init(void)