All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxl: Don't derefence null new_name pointer in libxl_domain_rename()
@ 2014-12-01 14:27 Euan Harris
  2014-12-01 14:50 ` Ian Campbell
  0 siblings, 1 reply; 4+ messages in thread
From: Euan Harris @ 2014-12-01 14:27 UTC (permalink / raw)
  To: xen-devel; +Cc: Euan Harris, Ian.Jackson

libxl__domain_rename() unconditionally dereferences its new_name
parameter, to check whether it is an empty string.   Add a check to
avoid a segfault if new_name is null.

Signed-off-by: Euan Harris <euan.harris@citrix.com>
---
 tools/libxl/libxl.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index f84f7c2..6e84b5d 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -385,6 +385,13 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
         }
     }
 
+    if (!new_name) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                        "new domain name not specified");
+        rc = ERROR_INVAL;
+        goto x_rc;
+    }
+
     if (new_name[0]) {
         /* nonempty names must be unique */
         uint32_t domid_e;
-- 
1.7.1

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

* Re: [PATCH] libxl: Don't derefence null new_name pointer in libxl_domain_rename()
  2014-12-01 14:27 [PATCH] libxl: Don't derefence null new_name pointer in libxl_domain_rename() Euan Harris
@ 2014-12-01 14:50 ` Ian Campbell
  2014-12-01 22:02   ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2014-12-01 14:50 UTC (permalink / raw)
  To: Euan Harris, Konrad Rzeszutek Wilk; +Cc: Ian.Jackson, xen-devel

On Mon, 2014-12-01 at 14:27 +0000, Euan Harris wrote:
> libxl__domain_rename() unconditionally dereferences its new_name
> parameter, to check whether it is an empty string.   Add a check to
> avoid a segfault if new_name is null.
> 
> Signed-off-by: Euan Harris <euan.harris@citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

I think this is a good fix to have for 4.5, Konrad CCd.

> ---
>  tools/libxl/libxl.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index f84f7c2..6e84b5d 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -385,6 +385,13 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
>          }
>      }
>  
> +    if (!new_name) {
> +        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
> +                        "new domain name not specified");
> +        rc = ERROR_INVAL;
> +        goto x_rc;
> +    }
> +
>      if (new_name[0]) {
>          /* nonempty names must be unique */
>          uint32_t domid_e;

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

* Re: [PATCH] libxl: Don't derefence null new_name pointer in libxl_domain_rename()
  2014-12-01 14:50 ` Ian Campbell
@ 2014-12-01 22:02   ` Konrad Rzeszutek Wilk
  2014-12-02 15:35     ` Ian Campbell
  0 siblings, 1 reply; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-12-01 22:02 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Ian.Jackson, Euan Harris, xen-devel

On Mon, Dec 01, 2014 at 02:50:56PM +0000, Ian Campbell wrote:
> On Mon, 2014-12-01 at 14:27 +0000, Euan Harris wrote:
> > libxl__domain_rename() unconditionally dereferences its new_name
> > parameter, to check whether it is an empty string.   Add a check to
> > avoid a segfault if new_name is null.
> > 
> > Signed-off-by: Euan Harris <euan.harris@citrix.com>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> I think this is a good fix to have for 4.5, Konrad CCd.

Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> > ---
> >  tools/libxl/libxl.c |    7 +++++++
> >  1 files changed, 7 insertions(+), 0 deletions(-)
> > 
> > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> > index f84f7c2..6e84b5d 100644
> > --- a/tools/libxl/libxl.c
> > +++ b/tools/libxl/libxl.c
> > @@ -385,6 +385,13 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
> >          }
> >      }
> >  
> > +    if (!new_name) {
> > +        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
> > +                        "new domain name not specified");
> > +        rc = ERROR_INVAL;
> > +        goto x_rc;
> > +    }
> > +
> >      if (new_name[0]) {
> >          /* nonempty names must be unique */
> >          uint32_t domid_e;
> 
> 

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

* Re: [PATCH] libxl: Don't derefence null new_name pointer in libxl_domain_rename()
  2014-12-01 22:02   ` Konrad Rzeszutek Wilk
@ 2014-12-02 15:35     ` Ian Campbell
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Campbell @ 2014-12-02 15:35 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: Ian.Jackson, Euan Harris, xen-devel

On Mon, 2014-12-01 at 17:02 -0500, Konrad Rzeszutek Wilk wrote:
> On Mon, Dec 01, 2014 at 02:50:56PM +0000, Ian Campbell wrote:
> > On Mon, 2014-12-01 at 14:27 +0000, Euan Harris wrote:
> > > libxl__domain_rename() unconditionally dereferences its new_name
> > > parameter, to check whether it is an empty string.   Add a check to
> > > avoid a segfault if new_name is null.
> > > 
> > > Signed-off-by: Euan Harris <euan.harris@citrix.com>
> > 
> > Acked-by: Ian Campbell <ian.campbell@citrix.com>
> > 
> > I think this is a good fix to have for 4.5, Konrad CCd.
> 
> Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Applied, fixing the typo in the subject as I went.

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

end of thread, other threads:[~2014-12-02 15:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-01 14:27 [PATCH] libxl: Don't derefence null new_name pointer in libxl_domain_rename() Euan Harris
2014-12-01 14:50 ` Ian Campbell
2014-12-01 22:02   ` Konrad Rzeszutek Wilk
2014-12-02 15:35     ` Ian Campbell

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.