All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] s390/ipl: fix off-by-one in update_machine_ipl_properties()
@ 2020-03-20 14:31 Halil Pasic
  2020-03-20 17:25 ` Cornelia Huck
  2020-03-27  9:15 ` David Hildenbrand
  0 siblings, 2 replies; 4+ messages in thread
From: Halil Pasic @ 2020-03-20 14:31 UTC (permalink / raw)
  To: Cornelia Huck, Christian Borntraeger, qemu-s390x, qemu-devel
  Cc: Halil Pasic, Peter Maydell, Thomas Huth, David Hildenbrand,
	Richard Henderson

In update_machine_ipl_properties() the array ascii_loadparm needs to
hold the 8 char lodparm and a string terminating zero char.

Let's increase the size of ascii_loadparm accordingly.

Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Fixes: 0a01e082a4 ("s390/ipl: sync back loadparm")
Reported-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/s390x/ipl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index b81942e1e6..8c3e019571 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -546,7 +546,7 @@ static void update_machine_ipl_properties(IplParameterBlock *iplb)
     /* Sync loadparm */
     if (iplb->flags & DIAG308_FLAGS_LP_VALID) {
         uint8_t *ebcdic_loadparm = iplb->loadparm;
-        char ascii_loadparm[8];
+        char ascii_loadparm[9];
         int i;
 
         for (i = 0; i < 8 && ebcdic_loadparm[i]; i++) {

base-commit: 226cd20706e20264c176f8edbaf17d7c9b7ade4a
-- 
2.17.1



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

* Re: [PATCH 1/1] s390/ipl: fix off-by-one in update_machine_ipl_properties()
  2020-03-20 14:31 [PATCH 1/1] s390/ipl: fix off-by-one in update_machine_ipl_properties() Halil Pasic
@ 2020-03-20 17:25 ` Cornelia Huck
  2020-03-23 16:13   ` Halil Pasic
  2020-03-27  9:15 ` David Hildenbrand
  1 sibling, 1 reply; 4+ messages in thread
From: Cornelia Huck @ 2020-03-20 17:25 UTC (permalink / raw)
  To: Halil Pasic
  Cc: Peter Maydell, Thomas Huth, David Hildenbrand, qemu-devel,
	Christian Borntraeger, qemu-s390x, Richard Henderson

On Fri, 20 Mar 2020 15:31:01 +0100
Halil Pasic <pasic@linux.ibm.com> wrote:

> In update_machine_ipl_properties() the array ascii_loadparm needs to
> hold the 8 char lodparm and a string terminating zero char.

s/lodparm/loadparm/

> Let's increase the size of ascii_loadparm accordingly.
> 
> Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
> Fixes: 0a01e082a4 ("s390/ipl: sync back loadparm")

Fixes: Coverity CID 1421966

> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/s390x/ipl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> index b81942e1e6..8c3e019571 100644
> --- a/hw/s390x/ipl.c
> +++ b/hw/s390x/ipl.c
> @@ -546,7 +546,7 @@ static void update_machine_ipl_properties(IplParameterBlock *iplb)
>      /* Sync loadparm */
>      if (iplb->flags & DIAG308_FLAGS_LP_VALID) {
>          uint8_t *ebcdic_loadparm = iplb->loadparm;
> -        char ascii_loadparm[8];
> +        char ascii_loadparm[9];
>          int i;
>  
>          for (i = 0; i < 8 && ebcdic_loadparm[i]; i++) {
> 
> base-commit: 226cd20706e20264c176f8edbaf17d7c9b7ade4a

Thanks, queued to s390-fixes.



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

* Re: [PATCH 1/1] s390/ipl: fix off-by-one in update_machine_ipl_properties()
  2020-03-20 17:25 ` Cornelia Huck
@ 2020-03-23 16:13   ` Halil Pasic
  0 siblings, 0 replies; 4+ messages in thread
From: Halil Pasic @ 2020-03-23 16:13 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Peter Maydell, Thomas Huth, David Hildenbrand, qemu-devel,
	Christian Borntraeger, qemu-s390x, Richard Henderson

On Fri, 20 Mar 2020 18:25:18 +0100
Cornelia Huck <cohuck@redhat.com> wrote:

> On Fri, 20 Mar 2020 15:31:01 +0100
> Halil Pasic <pasic@linux.ibm.com> wrote:
> 
> > In update_machine_ipl_properties() the array ascii_loadparm needs to
> > hold the 8 char lodparm and a string terminating zero char.
> 
> s/lodparm/loadparm/
> 
> > Let's increase the size of ascii_loadparm accordingly.
> > 
> > Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
> > Fixes: 0a01e082a4 ("s390/ipl: sync back loadparm")
> 
> Fixes: Coverity CID 1421966
> 
> > Reported-by: Peter Maydell <peter.maydell@linaro.org>
> > ---
> >  hw/s390x/ipl.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> > index b81942e1e6..8c3e019571 100644
> > --- a/hw/s390x/ipl.c
> > +++ b/hw/s390x/ipl.c
> > @@ -546,7 +546,7 @@ static void update_machine_ipl_properties(IplParameterBlock *iplb)
> >      /* Sync loadparm */
> >      if (iplb->flags & DIAG308_FLAGS_LP_VALID) {
> >          uint8_t *ebcdic_loadparm = iplb->loadparm;
> > -        char ascii_loadparm[8];
> > +        char ascii_loadparm[9];
> >          int i;
> >  
> >          for (i = 0; i < 8 && ebcdic_loadparm[i]; i++) {
> > 
> > base-commit: 226cd20706e20264c176f8edbaf17d7c9b7ade4a
> 
> Thanks, queued to s390-fixes.
> 

Thank you!



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

* Re: [PATCH 1/1] s390/ipl: fix off-by-one in update_machine_ipl_properties()
  2020-03-20 14:31 [PATCH 1/1] s390/ipl: fix off-by-one in update_machine_ipl_properties() Halil Pasic
  2020-03-20 17:25 ` Cornelia Huck
@ 2020-03-27  9:15 ` David Hildenbrand
  1 sibling, 0 replies; 4+ messages in thread
From: David Hildenbrand @ 2020-03-27  9:15 UTC (permalink / raw)
  To: Halil Pasic, Cornelia Huck, Christian Borntraeger, qemu-s390x,
	qemu-devel
  Cc: Peter Maydell, Thomas Huth, Richard Henderson

On 20.03.20 15:31, Halil Pasic wrote:
> In update_machine_ipl_properties() the array ascii_loadparm needs to
> hold the 8 char lodparm and a string terminating zero char.
> 
> Let's increase the size of ascii_loadparm accordingly.
> 
> Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
> Fixes: 0a01e082a4 ("s390/ipl: sync back loadparm")
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/s390x/ipl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> index b81942e1e6..8c3e019571 100644
> --- a/hw/s390x/ipl.c
> +++ b/hw/s390x/ipl.c
> @@ -546,7 +546,7 @@ static void update_machine_ipl_properties(IplParameterBlock *iplb)
>      /* Sync loadparm */
>      if (iplb->flags & DIAG308_FLAGS_LP_VALID) {
>          uint8_t *ebcdic_loadparm = iplb->loadparm;
> -        char ascii_loadparm[8];
> +        char ascii_loadparm[9];
>          int i;
>  
>          for (i = 0; i < 8 && ebcdic_loadparm[i]; i++) {
> 
> base-commit: 226cd20706e20264c176f8edbaf17d7c9b7ade4a
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



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

end of thread, other threads:[~2020-03-27  9:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-20 14:31 [PATCH 1/1] s390/ipl: fix off-by-one in update_machine_ipl_properties() Halil Pasic
2020-03-20 17:25 ` Cornelia Huck
2020-03-23 16:13   ` Halil Pasic
2020-03-27  9:15 ` David Hildenbrand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.