From: "Jan Beulich" Subject: [PATCH] linux-2.6.18/xenbus: fix overflow check in xenbus_dev_write() Date: Tue, 16 Oct 2012 13:18:52 +0100 Message-ID: <507D6CCC02000078000A1B07@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartA99889BC.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartA99889BC.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Reported-by: Dan Carpenter Signed-off-by: Jan Beulich --- a/drivers/xen/xenbus/xenbus_dev.c +++ b/drivers/xen/xenbus/xenbus_dev.c @@ -239,7 +239,7 @@ static ssize_t xenbus_dev_write(struct f if (!is_xenstored_ready()) return -ENODEV; =20 - if ((len + u->len) > sizeof(u->u.buffer)) { + if (len > sizeof(u->u.buffer) - u->len) { rc =3D -EINVAL; goto out; } --=__PartA99889BC.0__= Content-Type: text/plain; name="xen-xenbus-dev-write-buflen.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="xen-xenbus-dev-write-buflen.patch" xenbus: fix overflow check in xenbus_dev_write()=0A=0AReported-by: Dan = Carpenter =0ASigned-off-by: Jan Beulich = =0A=0A--- a/drivers/xen/xenbus/xenbus_dev.c=0A+++ = b/drivers/xen/xenbus/xenbus_dev.c=0A@@ -239,7 +239,7 @@ static ssize_t = xenbus_dev_write(struct f=0A if (!is_xenstored_ready())=0A = return -ENODEV;=0A =0A- if ((len + u->len) > sizeof(u->u.buffer)) {=0A+ if = (len > sizeof(u->u.buffer) - u->len) {=0A rc =3D -EINVAL;=0A = goto out;=0A }=0A --=__PartA99889BC.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartA99889BC.0__=--