diff mbox

[Xen-devel,v3] xen/arm: map_dev_mmio_region: printk should be ratelimited

Message ID 1460010494-3100-1-git-send-email-zhaoshenglong@huawei.com
State New
Headers show

Commit Message

Shannon Zhao April 7, 2016, 6:28 a.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>

The function map_dev_mmio_region is used in a hypercall. Therefore all
printks should be ratelimited to avoid a malicious guest flooding the
console.

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
v3: update commit message
---
 xen/arch/arm/p2m.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Julien Grall April 7, 2016, 9:48 a.m. UTC | #1
Hi Shannon,

On 07/04/16 07:28, Shannon Zhao wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
>
> The function map_dev_mmio_region is used in a hypercall. Therefore all
> printks should be ratelimited to avoid a malicious guest flooding the
> console.
>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Acked-by: Julien Grall <julien.grall@arm.com>

Regards,

> ---
> v3: update commit message
> ---
>   xen/arch/arm/p2m.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index 0011708..db21433 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -1284,7 +1284,7 @@ int map_dev_mmio_region(struct domain *d,
>       res = map_mmio_regions(d, start_gfn, nr, mfn);
>       if ( res < 0 )
>       {
> -        printk(XENLOG_ERR "Unable to map [%#lx - %#lx] in Dom%d\n",
> +        printk(XENLOG_G_ERR "Unable to map [%#lx - %#lx] in Dom%d\n",
>                  start_gfn, start_gfn + nr - 1, d->domain_id);
>           return res;
>       }
>
diff mbox

Patch

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 0011708..db21433 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -1284,7 +1284,7 @@  int map_dev_mmio_region(struct domain *d,
     res = map_mmio_regions(d, start_gfn, nr, mfn);
     if ( res < 0 )
     {
-        printk(XENLOG_ERR "Unable to map [%#lx - %#lx] in Dom%d\n",
+        printk(XENLOG_G_ERR "Unable to map [%#lx - %#lx] in Dom%d\n",
                start_gfn, start_gfn + nr - 1, d->domain_id);
         return res;
     }