mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
UPSTREAM: selftests, arm64: fix uninitialized symbol in tags_test.c
(Upstream commit 74585fcb7b).
Fix tagged_ptr not being initialized when TBI is not enabled.
Link: https://www.spinics.net/lists/linux-kselftest/msg09446.html
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Bug: 135692346
Change-Id: Ibfe3dfddb76ae56d51201d9e5db750c8f119323a
This commit is contained in:
committed by
Alistair Delva
parent
86794180e2
commit
58f10ec3d3
@@ -14,15 +14,17 @@
|
||||
int main(void)
|
||||
{
|
||||
static int tbi_enabled = 0;
|
||||
struct utsname *ptr, *tagged_ptr;
|
||||
unsigned long tag = 0;
|
||||
struct utsname *ptr;
|
||||
int err;
|
||||
|
||||
if (prctl(PR_SET_TAGGED_ADDR_CTRL, PR_TAGGED_ADDR_ENABLE, 0, 0, 0) == 0)
|
||||
tbi_enabled = 1;
|
||||
ptr = (struct utsname *)malloc(sizeof(*ptr));
|
||||
if (tbi_enabled)
|
||||
tagged_ptr = (struct utsname *)SET_TAG(ptr, 0x42);
|
||||
err = uname(tagged_ptr);
|
||||
tag = 0x42;
|
||||
ptr = (struct utsname *)SET_TAG(ptr, tag);
|
||||
err = uname(ptr);
|
||||
free(ptr);
|
||||
|
||||
return err;
|
||||
|
||||
Reference in New Issue
Block a user