linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ARM] selftests, arm64: fix uninitialized symbol in tags_test.c
@ 2019-08-19 13:14 Andrey Konovalov
  2019-08-19 13:16 ` Andrey Konovalov
  2019-08-19 15:03 ` Will Deacon
  0 siblings, 2 replies; 6+ messages in thread
From: Andrey Konovalov @ 2019-08-19 13:14 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mm, linux-kernel, amd-gfx, dri-devel,
	linux-rdma, linux-media, kvm, linux-kselftest, Will Deacon
  Cc: Mark Rutland, Szabolcs Nagy, Catalin Marinas, Kostya Serebryany,
	Khalid Aziz, Felix Kuehling, Vincenzo Frascino, Jacob Bramley,
	Leon Romanovsky, Christoph Hellwig, Jason Gunthorpe, Dave Martin,
	Evgeniy Stepanov, Kevin Brodsky, Kees Cook, Ruben Ayrapetyan,
	Andrey Konovalov, Ramana Radhakrishnan, Alex Williamson,
	Mauro Carvalho Chehab, Dmitry Vyukov, Greg Kroah-Hartman,
	Yishai Hadas, Jens Wiklander, Dan Carpenter, Lee Smith,
	Alexander Deucher, Andrew Morton, enh, Robin Murphy,
	Christian Koenig, Luc Van Oostenryck

Fix tagged_ptr not being initialized when TBI is not enabled.

Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
---
 tools/testing/selftests/arm64/tags_test.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/arm64/tags_test.c b/tools/testing/selftests/arm64/tags_test.c
index 22a1b266e373..5701163460ef 100644
--- a/tools/testing/selftests/arm64/tags_test.c
+++ b/tools/testing/selftests/arm64/tags_test.c
@@ -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;
-- 
2.23.0.rc1.153.gdeed80330f-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH ARM] selftests, arm64: fix uninitialized symbol in tags_test.c
  2019-08-19 13:14 [PATCH ARM] selftests, arm64: fix uninitialized symbol in tags_test.c Andrey Konovalov
@ 2019-08-19 13:16 ` Andrey Konovalov
  2019-08-19 15:03 ` Will Deacon
  1 sibling, 0 replies; 6+ messages in thread
From: Andrey Konovalov @ 2019-08-19 13:16 UTC (permalink / raw)
  To: Will Deacon
  Cc: Mark Rutland, kvm, Szabolcs Nagy, Catalin Marinas, dri-devel,
	Kostya Serebryany, Khalid Aziz,
	open list:KERNEL SELFTEST FRAMEWORK, Felix Kuehling,
	Vincenzo Frascino, Jacob Bramley, Leon Romanovsky, linux-rdma,
	amd-gfx, Christoph Hellwig, Jason Gunthorpe, Linux ARM,
	Dave Martin, Evgeniy Stepanov, linux-media, Kevin Brodsky,
	Kees Cook, Ruben Ayrapetyan, Ramana Radhakrishnan,
	Alex Williamson, Mauro Carvalho Chehab, Dmitry Vyukov,
	Linux Memory Management List, Greg Kroah-Hartman, Yishai Hadas,
	LKML, Jens Wiklander, Dan Carpenter, Lee Smith,
	Alexander Deucher, Andrew Morton, enh, Robin Murphy,
	Christian Koenig, Luc Van Oostenryck

On Mon, Aug 19, 2019 at 3:14 PM Andrey Konovalov <andreyknvl@google.com> wrote:
>
> Fix tagged_ptr not being initialized when TBI is not enabled.
>
> Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---
>  tools/testing/selftests/arm64/tags_test.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/arm64/tags_test.c b/tools/testing/selftests/arm64/tags_test.c
> index 22a1b266e373..5701163460ef 100644
> --- a/tools/testing/selftests/arm64/tags_test.c
> +++ b/tools/testing/selftests/arm64/tags_test.c
> @@ -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;
> --
> 2.23.0.rc1.153.gdeed80330f-goog
>

Hi Will,

This is supposed to go on top of the TBI related patches that you have
added to the arm tree.

Thanks!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH ARM] selftests, arm64: fix uninitialized symbol in tags_test.c
  2019-08-19 13:14 [PATCH ARM] selftests, arm64: fix uninitialized symbol in tags_test.c Andrey Konovalov
  2019-08-19 13:16 ` Andrey Konovalov
@ 2019-08-19 15:03 ` Will Deacon
  2019-08-19 15:16   ` Andrey Konovalov
  1 sibling, 1 reply; 6+ messages in thread
From: Will Deacon @ 2019-08-19 15:03 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Mark Rutland, kvm, Christian Koenig, Szabolcs Nagy,
	Catalin Marinas, Will Deacon, dri-devel, Kostya Serebryany,
	Khalid Aziz, Lee Smith, linux-kselftest, Vincenzo Frascino,
	Jacob Bramley, Leon Romanovsky, linux-rdma, amd-gfx,
	Christoph Hellwig, Jason Gunthorpe, Dmitry Vyukov, Dave Martin,
	Evgeniy Stepanov, linux-media, Kees Cook, Ruben Ayrapetyan,
	Kevin Brodsky, Alex Williamson, Mauro Carvalho Chehab,
	linux-arm-kernel, linux-mm, Greg Kroah-Hartman, Felix Kuehling,
	linux-kernel, Jens Wiklander, Dan Carpenter,
	Ramana Radhakrishnan, Alexander Deucher, Andrew Morton, enh,
	Robin Murphy, Yishai Hadas, Luc Van Oostenryck

On Mon, Aug 19, 2019 at 03:14:42PM +0200, Andrey Konovalov wrote:
> Fix tagged_ptr not being initialized when TBI is not enabled.
> 
> Dan Carpenter <dan.carpenter@oracle.com>

Guessing this was Reported-by, or has Dan introduced his own tag now? ;)

Got a link to the report?

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH ARM] selftests, arm64: fix uninitialized symbol in tags_test.c
  2019-08-19 15:03 ` Will Deacon
@ 2019-08-19 15:16   ` Andrey Konovalov
  2019-08-19 15:38     ` Will Deacon
  0 siblings, 1 reply; 6+ messages in thread
From: Andrey Konovalov @ 2019-08-19 15:16 UTC (permalink / raw)
  To: Will Deacon
  Cc: Mark Rutland, kvm, Christian Koenig, Szabolcs Nagy,
	Catalin Marinas, Will Deacon, dri-devel, Kostya Serebryany,
	Khalid Aziz, Lee Smith, open list:KERNEL SELFTEST FRAMEWORK,
	Vincenzo Frascino, Jacob Bramley, Leon Romanovsky, linux-rdma,
	amd-gfx, Christoph Hellwig, Jason Gunthorpe, Dmitry Vyukov,
	Dave Martin, Evgeniy Stepanov, linux-media, Kees Cook,
	Ruben Ayrapetyan, Kevin Brodsky, Alex Williamson,
	Mauro Carvalho Chehab, Linux ARM, Linux Memory Management List,
	Greg Kroah-Hartman, Felix Kuehling, LKML, Jens Wiklander,
	Dan Carpenter, Ramana Radhakrishnan, Alexander Deucher,
	Andrew Morton, enh, Robin Murphy, Yishai Hadas,
	Luc Van Oostenryck

On Mon, Aug 19, 2019 at 5:03 PM Will Deacon <will@kernel.org> wrote:
>
> On Mon, Aug 19, 2019 at 03:14:42PM +0200, Andrey Konovalov wrote:
> > Fix tagged_ptr not being initialized when TBI is not enabled.
> >
> > Dan Carpenter <dan.carpenter@oracle.com>
>
> Guessing this was Reported-by, or has Dan introduced his own tag now? ;)

Oops, yes, Reported-by :)

>
> Got a link to the report?

https://www.spinics.net/lists/linux-kselftest/msg09446.html

>
> Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH ARM] selftests, arm64: fix uninitialized symbol in tags_test.c
  2019-08-19 15:16   ` Andrey Konovalov
@ 2019-08-19 15:38     ` Will Deacon
  2019-08-19 15:44       ` Andrey Konovalov
  0 siblings, 1 reply; 6+ messages in thread
From: Will Deacon @ 2019-08-19 15:38 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Mark Rutland, kvm, Christian Koenig, Szabolcs Nagy,
	Catalin Marinas, Will Deacon, dri-devel, Kostya Serebryany,
	Khalid Aziz, Lee Smith, open list:KERNEL SELFTEST FRAMEWORK,
	Vincenzo Frascino, Jacob Bramley, Leon Romanovsky, linux-rdma,
	amd-gfx, Christoph Hellwig, Jason Gunthorpe, Dmitry Vyukov,
	Dave Martin, Evgeniy Stepanov, linux-media, Kees Cook,
	Ruben Ayrapetyan, Kevin Brodsky, Alex Williamson,
	Mauro Carvalho Chehab, Linux ARM, Linux Memory Management List,
	Greg Kroah-Hartman, Felix Kuehling, LKML, Jens Wiklander,
	Dan Carpenter, Ramana Radhakrishnan, Alexander Deucher,
	Andrew Morton, enh, Robin Murphy, Yishai Hadas,
	Luc Van Oostenryck

On Mon, Aug 19, 2019 at 05:16:37PM +0200, Andrey Konovalov wrote:
> On Mon, Aug 19, 2019 at 5:03 PM Will Deacon <will@kernel.org> wrote:
> >
> > On Mon, Aug 19, 2019 at 03:14:42PM +0200, Andrey Konovalov wrote:
> > > Fix tagged_ptr not being initialized when TBI is not enabled.
> > >
> > > Dan Carpenter <dan.carpenter@oracle.com>
> >
> > Guessing this was Reported-by, or has Dan introduced his own tag now? ;)
> 
> Oops, yes, Reported-by :)
> 
> >
> > Got a link to the report?
> 
> https://www.spinics.net/lists/linux-kselftest/msg09446.html

Thanks, I'll fix up the commit message and push this out later on. If you
get a chance, would you be able to look at the pending changes from
Catalin[1], please?

Will

[1] https://lkml.kernel.org/r/20190815154403.16473-1-catalin.marinas@arm.com

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH ARM] selftests, arm64: fix uninitialized symbol in tags_test.c
  2019-08-19 15:38     ` Will Deacon
@ 2019-08-19 15:44       ` Andrey Konovalov
  0 siblings, 0 replies; 6+ messages in thread
From: Andrey Konovalov @ 2019-08-19 15:44 UTC (permalink / raw)
  To: Will Deacon
  Cc: Mark Rutland, kvm, Christian Koenig, Szabolcs Nagy,
	Catalin Marinas, Will Deacon, dri-devel, Kostya Serebryany,
	Khalid Aziz, Lee Smith, open list:KERNEL SELFTEST FRAMEWORK,
	Vincenzo Frascino, Jacob Bramley, Leon Romanovsky, linux-rdma,
	amd-gfx, Christoph Hellwig, Jason Gunthorpe, Dmitry Vyukov,
	Dave Martin, Evgeniy Stepanov, linux-media, Kees Cook,
	Ruben Ayrapetyan, Kevin Brodsky, Alex Williamson,
	Mauro Carvalho Chehab, Linux ARM, Linux Memory Management List,
	Greg Kroah-Hartman, Felix Kuehling, LKML, Jens Wiklander,
	Dan Carpenter, Ramana Radhakrishnan, Alexander Deucher,
	Andrew Morton, enh, Robin Murphy, Yishai Hadas,
	Luc Van Oostenryck

On Mon, Aug 19, 2019 at 5:39 PM Will Deacon <will@kernel.org> wrote:
>
> On Mon, Aug 19, 2019 at 05:16:37PM +0200, Andrey Konovalov wrote:
> > On Mon, Aug 19, 2019 at 5:03 PM Will Deacon <will@kernel.org> wrote:
> > >
> > > On Mon, Aug 19, 2019 at 03:14:42PM +0200, Andrey Konovalov wrote:
> > > > Fix tagged_ptr not being initialized when TBI is not enabled.
> > > >
> > > > Dan Carpenter <dan.carpenter@oracle.com>
> > >
> > > Guessing this was Reported-by, or has Dan introduced his own tag now? ;)
> >
> > Oops, yes, Reported-by :)
> >
> > >
> > > Got a link to the report?
> >
> > https://www.spinics.net/lists/linux-kselftest/msg09446.html
>
> Thanks, I'll fix up the commit message and push this out later on. If you
> get a chance, would you be able to look at the pending changes from
> Catalin[1], please?
>
> Will
>
> [1] https://lkml.kernel.org/r/20190815154403.16473-1-catalin.marinas@arm.com

Sure! I didn't realize some actioned is required from me on those.
I'll add my Acked-by's. Thanks!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-19 15:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-19 13:14 [PATCH ARM] selftests, arm64: fix uninitialized symbol in tags_test.c Andrey Konovalov
2019-08-19 13:16 ` Andrey Konovalov
2019-08-19 15:03 ` Will Deacon
2019-08-19 15:16   ` Andrey Konovalov
2019-08-19 15:38     ` Will Deacon
2019-08-19 15:44       ` 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).