All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Li Zhijian <lizhijian@cn.fujitsu.com>,
	qemu-devel@nongnu.org, mst@redhat.com, peter.maydell@linaro.org
Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	philip.li@intel.com, zhijianx.li@intel.com,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH for-4.0 v3 1/4] unify len and addr type for memory/address APIs
Date: Mon, 3 Dec 2018 10:42:42 -0600	[thread overview]
Message-ID: <db93993f-a034-a22a-56b1-9a44e7c67a35@linaro.org> (raw)
In-Reply-To: <1543848532-12604-2-git-send-email-lizhijian@cn.fujitsu.com>

On 12/3/18 8:48 AM, Li Zhijian wrote:
> Some address/memory APIs have different type between
> 'hwaddr/target_ulong addr' and 'int len'. It is very unsafety, espcially
> some APIs will be passed a non-int len by caller which might cause
> overflow quietly.
> Below is an potential overflow case:
>     dma_memory_read(uint32_t len)
>       -> dma_memory_rw(uint32_t len)
>         -> dma_memory_rw_relaxed(uint32_t len)
>           -> address_space_rw(int len) # len overflow
> 
> CC: Paolo Bonzini <pbonzini@redhat.com>
> CC: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> CC: Richard Henderson <rth@twiddle.net>
> CC: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> 
> ---
> V3: use the same type between len and addr(Peter Maydell)
>     rebase code basing on https://patchew.org/QEMU/20181122133507.30950-1-peter.maydell@linaro.org/
> ---
>  exec.c                    | 47 +++++++++++++++++++++++------------------------
>  include/exec/cpu-all.h    |  2 +-
>  include/exec/cpu-common.h |  8 ++++----
>  include/exec/memory.h     | 22 +++++++++++-----------
>  4 files changed, 39 insertions(+), 40 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~

  parent reply	other threads:[~2018-12-03 16:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 14:48 [Qemu-devel] [PATCH for-4.0 v3 0/4] allow to load initrd below 4G for recent kernel Li Zhijian
2018-12-03 14:48 ` [Qemu-devel] [PATCH for-4.0 v3 1/4] unify len and addr type for memory/address APIs Li Zhijian
2018-12-03 14:42   ` Peter Maydell
2018-12-03 16:42   ` Richard Henderson [this message]
2018-12-04 17:40   ` Philippe Mathieu-Daudé
2018-12-06  2:09     ` Li Zhijian
2018-12-03 14:48 ` [Qemu-devel] [PATCH for-4.0 v3 2/4] refactor load_image_size Li Zhijian
2018-12-03 16:43   ` Richard Henderson
2018-12-03 14:48 ` [Qemu-devel] [PATCH for-4.0 v3 3/4] i386: import bootparam.h Li Zhijian
2018-12-03 16:44   ` Richard Henderson
2018-12-04  1:06   ` Michael S. Tsirkin
2018-12-04  8:09     ` Li Zhijian
2018-12-05 10:28       ` Li Zhijian
2018-12-05 15:33         ` Michael S. Tsirkin
2018-12-06  2:13           ` Li Zhijian
2018-12-03 14:48 ` [Qemu-devel] [PATCH for-4.0 v3 4/4] i386: allow to load initrd below 4G for recent linux Li Zhijian

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=db93993f-a034-a22a-56b1-9a44e7c67a35@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=crosthwaite.peter@gmail.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philip.li@intel.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=zhijianx.li@intel.com \
    /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.