All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-kernel@vger.kernel.org,
	George Zhang <georgezhang@vmware.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] VMCI: integer overflow in vmci_datagram_dispatch()
Date: Fri, 29 Aug 2014 11:13:47 +0000	[thread overview]
Message-ID: <5400606B.8010905@bfs.de> (raw)
In-Reply-To: <20140829084256.GA14780@mwanda>



Am 29.08.2014 10:42, schrieb Dan Carpenter:
> This is untrusted user data from vmci_host_do_send_datagram() so the
> VMCI_DG_SIZE() macro can have an integer overflow.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/misc/vmw_vmci/vmci_datagram.c b/drivers/misc/vmw_vmci/vmci_datagram.c
> index f3cdd90..8226652 100644
> --- a/drivers/misc/vmw_vmci/vmci_datagram.c
> +++ b/drivers/misc/vmw_vmci/vmci_datagram.c
> @@ -328,7 +328,8 @@ int vmci_datagram_dispatch(u32 context_id,
>  
>  	BUILD_BUG_ON(sizeof(struct vmci_datagram) != 24);
>  
> -	if (VMCI_DG_SIZE(dg) > VMCI_MAX_DG_SIZE) {
> +	if (dg->payload_size > VMCI_MAX_DG_SIZE ||
> +	    VMCI_DG_SIZE(dg) > VMCI_MAX_DG_SIZE) {
>  		pr_devel("Payload (size=%llu bytes) too big to send\n",
>  			 (unsigned long long)dg->payload_size);
>  		return VMCI_ERROR_INVALID_ARGS;

Are your sure about that ">" ? maybe ">=" was intended ?

re,
 wh

> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

WARNING: multiple messages have this Message-ID (diff)
From: walter harms <wharms@bfs.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-kernel@vger.kernel.org,
	George Zhang <georgezhang@vmware.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] VMCI: integer overflow in vmci_datagram_dispatch()
Date: Fri, 29 Aug 2014 13:13:47 +0200	[thread overview]
Message-ID: <5400606B.8010905@bfs.de> (raw)
In-Reply-To: <20140829084256.GA14780@mwanda>



Am 29.08.2014 10:42, schrieb Dan Carpenter:
> This is untrusted user data from vmci_host_do_send_datagram() so the
> VMCI_DG_SIZE() macro can have an integer overflow.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/misc/vmw_vmci/vmci_datagram.c b/drivers/misc/vmw_vmci/vmci_datagram.c
> index f3cdd90..8226652 100644
> --- a/drivers/misc/vmw_vmci/vmci_datagram.c
> +++ b/drivers/misc/vmw_vmci/vmci_datagram.c
> @@ -328,7 +328,8 @@ int vmci_datagram_dispatch(u32 context_id,
>  
>  	BUILD_BUG_ON(sizeof(struct vmci_datagram) != 24);
>  
> -	if (VMCI_DG_SIZE(dg) > VMCI_MAX_DG_SIZE) {
> +	if (dg->payload_size > VMCI_MAX_DG_SIZE ||
> +	    VMCI_DG_SIZE(dg) > VMCI_MAX_DG_SIZE) {
>  		pr_devel("Payload (size=%llu bytes) too big to send\n",
>  			 (unsigned long long)dg->payload_size);
>  		return VMCI_ERROR_INVALID_ARGS;

Are your sure about that ">" ? maybe ">=" was intended ?

re,
 wh

> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2014-08-29 11:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29  8:42 [patch] VMCI: integer overflow in vmci_datagram_dispatch() Dan Carpenter
2014-08-29  8:42 ` Dan Carpenter
2014-08-29 11:13 ` walter harms [this message]
2014-08-29 11:13   ` walter harms
2014-08-29 11:21   ` Dan Carpenter
2014-08-29 11:21     ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5400606B.8010905@bfs.de \
    --to=wharms@bfs.de \
    --cc=dan.carpenter@oracle.com \
    --cc=georgezhang@vmware.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.