* [bug report] selftests, arm64: add a selftest for passing tagged pointers to kernel
@ 2019-08-15 8:18 Dan Carpenter
2019-08-19 13:22 ` Andrey Konovalov
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-08-15 8:18 UTC (permalink / raw)
To: andreyknvl; +Cc: linux-kselftest
Hello Andrey Konovalov,
The patch 9ce1263033cd: "selftests, arm64: add a selftest for passing
tagged pointers to kernel" from Jul 23, 2019, leads to the following
static checker warning:
./tools/testing/selftests/arm64/tags_test.c:25 main()
error: uninitialized symbol 'tagged_ptr'.
tools/testing/selftests/arm64/tags_test.c
14 int main(void)
15 {
16 static int tbi_enabled = 0;
17 struct utsname *ptr, *tagged_ptr;
^^^^^^^^^^
18 int err;
19
20 if (prctl(PR_SET_TAGGED_ADDR_CTRL, PR_TAGGED_ADDR_ENABLE, 0, 0, 0) == 0)
21 tbi_enabled = 1;
22 ptr = (struct utsname *)malloc(sizeof(*ptr));
23 if (tbi_enabled)
24 tagged_ptr = (struct utsname *)SET_TAG(ptr, 0x42);
^^^^^^^^^^^^^^^
No else path.
25 err = uname(tagged_ptr);
26 free(ptr);
27
28 return err;
29 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [bug report] selftests, arm64: add a selftest for passing tagged pointers to kernel
2019-08-15 8:18 [bug report] selftests, arm64: add a selftest for passing tagged pointers to kernel Dan Carpenter
@ 2019-08-19 13:22 ` Andrey Konovalov
0 siblings, 0 replies; 2+ messages in thread
From: Andrey Konovalov @ 2019-08-19 13:22 UTC (permalink / raw)
To: Dan Carpenter; +Cc: open list:KERNEL SELFTEST FRAMEWORK
On Thu, Aug 15, 2019 at 10:18 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> Hello Andrey Konovalov,
>
> The patch 9ce1263033cd: "selftests, arm64: add a selftest for passing
> tagged pointers to kernel" from Jul 23, 2019, leads to the following
> static checker warning:
>
> ./tools/testing/selftests/arm64/tags_test.c:25 main()
> error: uninitialized symbol 'tagged_ptr'.
>
> tools/testing/selftests/arm64/tags_test.c
> 14 int main(void)
> 15 {
> 16 static int tbi_enabled = 0;
> 17 struct utsname *ptr, *tagged_ptr;
> ^^^^^^^^^^
>
> 18 int err;
> 19
> 20 if (prctl(PR_SET_TAGGED_ADDR_CTRL, PR_TAGGED_ADDR_ENABLE, 0, 0, 0) == 0)
> 21 tbi_enabled = 1;
> 22 ptr = (struct utsname *)malloc(sizeof(*ptr));
> 23 if (tbi_enabled)
> 24 tagged_ptr = (struct utsname *)SET_TAG(ptr, 0x42);
> ^^^^^^^^^^^^^^^
> No else path.
>
> 25 err = uname(tagged_ptr);
> 26 free(ptr);
> 27
> 28 return err;
> 29 }
>
> regards,
> dan carpenter
Hi Dan,
Just sent a patch with a fix.
Thanks for the report!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-19 13:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-15 8:18 [bug report] selftests, arm64: add a selftest for passing tagged pointers to kernel Dan Carpenter
2019-08-19 13:22 ` Andrey Konovalov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).