search for: lguest_address_ok

Displaying 20 results from an estimated 24 matches for "lguest_address_ok".

2007 Apr 18
1
[PATCH] Lguest32 print hex on bad reads and writes
...rs/lguest/core.c =================================================================== --- linux-2.6.21-rc5-mm2.orig/drivers/lguest/core.c +++ linux-2.6.21-rc5-mm2/drivers/lguest/core.c @@ -220,7 +220,7 @@ u8 lgread_u8(struct lguest *lg, u32 addr /* Don't let them access lguest binary */ if (!lguest_address_ok(lg, addr) || get_user(val, (u32 __user *)addr) != 0) - kill_guest(lg, "bad read address %u", addr); + kill_guest(lg, "bad read address %x", addr); return val; } @@ -231,7 +231,7 @@ u16 lgread_u16(struct lguest *lg, u32 ad /* Don't let them access lguest binary...
2007 Apr 18
1
[PATCH] Lguest32 print hex on bad reads and writes
...rs/lguest/core.c =================================================================== --- linux-2.6.21-rc5-mm2.orig/drivers/lguest/core.c +++ linux-2.6.21-rc5-mm2/drivers/lguest/core.c @@ -220,7 +220,7 @@ u8 lgread_u8(struct lguest *lg, u32 addr /* Don't let them access lguest binary */ if (!lguest_address_ok(lg, addr) || get_user(val, (u32 __user *)addr) != 0) - kill_guest(lg, "bad read address %u", addr); + kill_guest(lg, "bad read address %x", addr); return val; } @@ -231,7 +231,7 @@ u16 lgread_u16(struct lguest *lg, u32 ad /* Don't let them access lguest binary...
2007 May 14
5
[PATCH 1/6] lguest: host code tidyups
...ivers/lguest/segments.c | 6 ++--- include/linux/lguest_launcher.h | 2 - 9 files changed, 56 insertions(+), 56 deletions(-) =================================================================== --- a/drivers/lguest/core.c +++ b/drivers/lguest/core.c @@ -212,39 +212,40 @@ int lguest_address_ok(const struct lgues } /* Just like get_user, but don't let guest access lguest binary. */ -u32 lgread_u32(struct lguest *lg, u32 addr) +u32 lgread_u32(struct lguest *lg, unsigned long addr) { u32 val = 0; /* Don't let them access lguest binary */ if (!lguest_address_ok(lg, addr,...
2007 May 14
5
[PATCH 1/6] lguest: host code tidyups
...ivers/lguest/segments.c | 6 ++--- include/linux/lguest_launcher.h | 2 - 9 files changed, 56 insertions(+), 56 deletions(-) =================================================================== --- a/drivers/lguest/core.c +++ b/drivers/lguest/core.c @@ -212,39 +212,40 @@ int lguest_address_ok(const struct lgues } /* Just like get_user, but don't let guest access lguest binary. */ -u32 lgread_u32(struct lguest *lg, u32 addr) +u32 lgread_u32(struct lguest *lg, unsigned long addr) { u32 val = 0; /* Don't let them access lguest binary */ if (!lguest_address_ok(lg, addr,...
2007 May 10
4
[PATCH 0/5] lguest feedback tidyups
Hi all, Gratefully-received recent feedback from CC'd was applied to excellent effect (and the advice from Matt Mackall about my personal appearance is best unrequited). The patch is split in 5 parts to correspond with the 9 parts Andrew sent out before, but here's the summary: 1) Sparse (thanks Christoph Hellwig): - lguest_const can be static now - lguest.c should include
2007 May 10
4
[PATCH 0/5] lguest feedback tidyups
Hi all, Gratefully-received recent feedback from CC'd was applied to excellent effect (and the advice from Matt Mackall about my personal appearance is best unrequited). The patch is split in 5 parts to correspond with the 9 parts Andrew sent out before, but here's the summary: 1) Sparse (thanks Christoph Hellwig): - lguest_const can be static now - lguest.c should include
2007 Sep 10
1
[PATCH] Add macros for acessing lguest fields
...files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/lguest/io.c b/drivers/lguest/io.c index ea68613..70bab38 100644 --- a/drivers/lguest/io.c +++ b/drivers/lguest/io.c @@ -247,7 +247,7 @@ static int lgread_other(struct lguest *lg, void *buf, u32 addr, unsigned bytes) { if (!lguest_address_ok(lg, addr, bytes) - || access_process_vm(lg->tsk, addr, buf, bytes, 0) != bytes) { + || access_process_vm(lguest_task(lg), addr, buf, bytes, 0) != bytes) { memset(buf, 0, bytes); kill_guest(lg, "bad address in registered DMA struct"); return 0; @@ -261,7 +261,7 @@ stati...
2007 Sep 10
1
[PATCH] Add macros for acessing lguest fields
...files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/lguest/io.c b/drivers/lguest/io.c index ea68613..70bab38 100644 --- a/drivers/lguest/io.c +++ b/drivers/lguest/io.c @@ -247,7 +247,7 @@ static int lgread_other(struct lguest *lg, void *buf, u32 addr, unsigned bytes) { if (!lguest_address_ok(lg, addr, bytes) - || access_process_vm(lg->tsk, addr, buf, bytes, 0) != bytes) { + || access_process_vm(lguest_task(lg), addr, buf, bytes, 0) != bytes) { memset(buf, 0, bytes); kill_guest(lg, "bad address in registered DMA struct"); return 0; @@ -261,7 +261,7 @@ stati...
2007 May 09
1
[patch 3/9] lguest: the host code
...+ break; + default: + return 0; + } + + if (in) { + /* Lower bit tells is whether it's a 16 or 32 bit access */ + if (insn & 0x1) + lg->regs->eax = 0xFFFFFFFF; + else + lg->regs->eax |= (0xFFFF << shift); + } + lg->regs->eip += insnlen; + return 1; +} + +int lguest_address_ok(const struct lguest *lg, + unsigned long addr, unsigned long len) +{ + return (addr+len) / PAGE_SIZE < lg->pfn_limit && (addr+len >= addr); +} + +/* Just like get_user, but don't let guest access lguest binary. */ +u32 lgread_u32(struct lguest *lg, u32 addr) +{ + u32 val...
2007 May 09
1
[patch 3/9] lguest: the host code
...+ break; + default: + return 0; + } + + if (in) { + /* Lower bit tells is whether it's a 16 or 32 bit access */ + if (insn & 0x1) + lg->regs->eax = 0xFFFFFFFF; + else + lg->regs->eax |= (0xFFFF << shift); + } + lg->regs->eip += insnlen; + return 1; +} + +int lguest_address_ok(const struct lguest *lg, + unsigned long addr, unsigned long len) +{ + return (addr+len) / PAGE_SIZE < lg->pfn_limit && (addr+len >= addr); +} + +/* Just like get_user, but don't let guest access lguest binary. */ +u32 lgread_u32(struct lguest *lg, u32 addr) +{ + u32 val...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 09/13] lguest64 devices
...+ +static struct list_head dma_hash[64]; + +/* FIXME: allow multi-page lengths. */ +static int check_dma_list(struct lguest_guest_info *linfo, + const struct lguest_dma *dma) +{ + unsigned int i; + + for (i = 0; i < LGUEST_MAX_DMA_SECTIONS; i++) { + if (!dma->len[i]) + return 1; + if (!lguest_address_ok(linfo, dma->addr[i])) + goto kill; + if (dma->len[i] > PAGE_SIZE) + goto kill; + /* We could do over a page, but is it worth it? */ + if ((dma->addr[i] % PAGE_SIZE) + dma->len[i] > PAGE_SIZE) + goto kill; + } + return 1; + +kill: + kill_guest(linfo, "bad DMA entry: %...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 09/13] lguest64 devices
...+ +static struct list_head dma_hash[64]; + +/* FIXME: allow multi-page lengths. */ +static int check_dma_list(struct lguest_guest_info *linfo, + const struct lguest_dma *dma) +{ + unsigned int i; + + for (i = 0; i < LGUEST_MAX_DMA_SECTIONS; i++) { + if (!dma->len[i]) + return 1; + if (!lguest_address_ok(linfo, dma->addr[i])) + goto kill; + if (dma->len[i] > PAGE_SIZE) + goto kill; + /* We could do over a page, but is it worth it? */ + if ((dma->addr[i] % PAGE_SIZE) + dma->len[i] > PAGE_SIZE) + goto kill; + } + return 1; + +kill: + kill_guest(linfo, "bad DMA entry: %...
2007 Apr 18
1
[PATCH] lguest32 kallsyms backtrace of guest.
...segments.o io.o lguest_user.o hypervisor.o lguest_debug.o Index: linux-2.6.21-rc5-mm2/drivers/lguest/core.c =================================================================== --- linux-2.6.21-rc5-mm2.orig/drivers/lguest/core.c +++ linux-2.6.21-rc5-mm2/drivers/lguest/core.c @@ -210,6 +210,28 @@ int lguest_address_ok(const struct lgues } /* Just like get_user, but don't let guest access lguest binary. */ +u8 lgread_u8(struct lguest *lg, u32 addr) +{ + u8 val = 0; + + /* Don't let them access lguest binary */ + if (!lguest_address_ok(lg, addr) + || get_user(val, (u32 __user *)addr) != 0) + kill_...
2007 Apr 18
1
[PATCH] lguest32 kallsyms backtrace of guest.
...segments.o io.o lguest_user.o hypervisor.o lguest_debug.o Index: linux-2.6.21-rc5-mm2/drivers/lguest/core.c =================================================================== --- linux-2.6.21-rc5-mm2.orig/drivers/lguest/core.c +++ linux-2.6.21-rc5-mm2/drivers/lguest/core.c @@ -210,6 +210,28 @@ int lguest_address_ok(const struct lgues } /* Just like get_user, but don't let guest access lguest binary. */ +u8 lgread_u8(struct lguest *lg, u32 addr) +{ + u8 val = 0; + + /* Don't let them access lguest binary */ + if (!lguest_address_ok(lg, addr) + || get_user(val, (u32 __user *)addr) != 0) + kill_...
2007 Apr 18
1
[RFC/PATCH LGUEST X86_64 03/13] lguest64 core
...e <asm/i387.h> +#include "lguest.h" + +#define HV_OFFSET(x) (typeof(x))((unsigned long)(x)+lguest_hv_offset) + +unsigned long lguest_hv_addr; +unsigned long lguest_hv_offset; +int lguest_hv_pages; + +int lguest_vcpu_pages; +int lguest_vcpu_order; + +DEFINE_MUTEX(lguest_lock); + +int lguest_address_ok(const struct lguest_guest_info *linfo, u64 addr) +{ + return addr / PAGE_SIZE < linfo->pfn_limit; +} + +u8 lhread_u8(struct lguest_vcpu *vcpu, u64 addr) +{ + u8 val = 0; + + if (!lguest_address_ok(vcpu->guest, addr) + || get_user(val, (u8 __user *)addr) != 0) + kill_guest_dump(vcpu,...
2007 Apr 18
1
[RFC/PATCH LGUEST X86_64 03/13] lguest64 core
...e <asm/i387.h> +#include "lguest.h" + +#define HV_OFFSET(x) (typeof(x))((unsigned long)(x)+lguest_hv_offset) + +unsigned long lguest_hv_addr; +unsigned long lguest_hv_offset; +int lguest_hv_pages; + +int lguest_vcpu_pages; +int lguest_vcpu_order; + +DEFINE_MUTEX(lguest_lock); + +int lguest_address_ok(const struct lguest_guest_info *linfo, u64 addr) +{ + return addr / PAGE_SIZE < linfo->pfn_limit; +} + +u8 lhread_u8(struct lguest_vcpu *vcpu, u64 addr) +{ + u8 val = 0; + + if (!lguest_address_ok(vcpu->guest, addr) + || get_user(val, (u8 __user *)addr) != 0) + kill_guest_dump(vcpu,...
2007 Aug 08
13
[PATCH 0/7] Modify lguest32 to make room for lguest64
Hi all, I've been working on lguest64 and in order to do this, I had to move a lot of the i386 specific out of the way. Well, the lguest64 port is still not ready to display, but before Rusty makes too many changes I would like this in upstream so I don't have to keep repeating my changes :-) So this patch series moves lguest32 out of the way for other archs. -- Steve
2007 Aug 08
13
[PATCH 0/7] Modify lguest32 to make room for lguest64
Hi all, I've been working on lguest64 and in order to do this, I had to move a lot of the i386 specific out of the way. Well, the lguest64 port is still not ready to display, but before Rusty makes too many changes I would like this in upstream so I don't have to keep repeating my changes :-) So this patch series moves lguest32 out of the way for other archs. -- Steve
2007 Aug 08
7
[PATCH 0/5 -v2] Modify lguest32 to make room for lguest64 (version 2)
[ Changes since last version. - Move lg.h to include/asm instead (suggested by Rusty Russel) - All steps of the series compiles (suggested by Stephen Rothwell) - Better ifdef header naming (suggested by Stephen Rothwell) - Added Andi Kleen to CC (forgot to on V1) ] Hi all, I've been working on lguest64 and in order to do this, I had to move a lot of the i386 specific out of the
2007 Aug 08
7
[PATCH 0/5 -v2] Modify lguest32 to make room for lguest64 (version 2)
[ Changes since last version. - Move lg.h to include/asm instead (suggested by Rusty Russel) - All steps of the series compiles (suggested by Stephen Rothwell) - Better ifdef header naming (suggested by Stephen Rothwell) - Added Andi Kleen to CC (forgot to on V1) ] Hi all, I've been working on lguest64 and in order to do this, I had to move a lot of the i386 specific out of the