Re: [Qemu-devel] [PULL 04/05] seccomp: add setuid, setgid, chroot and setgroups to whitelist

2015-11-18 Thread Namsun Ch'o
I have no idea why the lines didn't wrap in my last post... Sorry about that.

[Qemu-devel] [PATCH v3] Add seccomp argument filters for madvise, shmget, and shmctl

2015-11-18 Thread Namsun Ch'o
Signed-off-by: Namsun Ch'o --- Changes so far: v1 - Created argument filters for the madvise, shmget, and shmctl syscalls. v1 -> v2 - Added 5 new madvise flags which were present in the source code but not in the strace which I generated. - Added IP_CREAT|0600 to shmget, whic

Re: [Qemu-devel] [PULL 04/05] seccomp: add setuid, setgid, chroot and setgroups to whitelist

2015-11-18 Thread Namsun Ch'o
I think this patch should not be applied, because it completely defeats the purpose of the sandbox. With these syscalls whitelisted, -runas and -chroot have absolutely no effect against an attacker, even with -sandbox on. Paolo Adding chroot() and set*id() doesn't break the purpose of the sa

Re: [Qemu-devel] [PULL 00/04] seccomp branch queue

2015-11-18 Thread Namsun Ch'o
I guess this is addressed to Namsun's patches. Namsun, can you rewrite the commit messages according to Peter's suggestions and resend? Sure. I used a longer commit message, and put the chatty stuff below the ---. I posted it as a new top-level thread as a v3 patch.

Re: [Qemu-devel] [PATCH] Add syscalls for -runas and -chroot tothe seccomp sandbox

2015-10-05 Thread Namsun Ch'o
> Drawback: complexity. If we decide to limit ourselves to the original > threat model (rogue guest), and enter the sandbox only after setup, we > can keep things simpler. We could do both without much complexity. This looks simple enough to me: rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_

Re: [Qemu-devel] [PATCH] Add syscalls for -runas and -chroot tothe seccomp sandbox

2015-10-03 Thread Namsun Ch'o
> Our intention since the beginning was to protect the host from the > illegal guest operations. But you do have an interesting point about > flaws on qemu itself. Perhaps this might be something I could work on to > improve (start a bigger whitelist and get it tighter before guest > launches). Th

Re: [Qemu-devel] [PATCH v3] Add argument filters to the seccomp sandbox

2015-10-03 Thread Namsun Ch'o
> The pull request will be delayed a little bit due to some new patches > incoming. Let's just set an agreement on how to approach regarding the > "-runas and -chroot" patch and will prepare just a single batch for pull > reuqest to Peter. I also noticed that I had made that patch over the chroot

Re: [Qemu-devel] [PATCH] Add syscalls for -runas and -chroot tothe seccomp sandbox

2015-10-03 Thread Namsun Ch'o
> If we intend seccomp to protect against flaws during QEMU setup, then having > it earlier is neccessary. eg QEMU opening a corrupt qcow2 image which might > exploit QEMU before the guest CPUs start. > If the latter is the case, then we could start with a relaxed seccomp > sandbox which included

[Qemu-devel] [PATCH] Add syscalls for -runas and -chroot to the seccomp sandbox

2015-10-01 Thread Namsun Ch'o
-runas and -chroot cause QEMU to be killed with -sandbox on. This patch adds those syscalls. Signed-off-by: Namsun Ch'o --- diff --git a/qemu-seccomp.c b/qemu-seccomp.c index f9de0d3..5cb1809 100644 --- a/qemu-seccomp.c +++ b/qemu-seccomp.c @@ -237,7 +237,11 @@ static const struct Qem

Re: [Qemu-devel] [PATCH v3] Add argument filters to the seccomp sandbox

2015-09-30 Thread Namsun Ch'o
> This looks good now. > Thanks for your contribution. > Acked-by: Eduardo Otubo > ps.: I'll create a pull request with all changes made so far on Friday. I was told on IRC to submit patches in smaller chunks, with a few new filters at a time. Should I wait until it is merged, or should I go ah

Re: [Qemu-devel] [PATCH v2] Add argument filters to the seccomp sandbox

2015-09-30 Thread Namsun Ch'o
> (I'm not sure what happens to your emails that all of them does not > relate to the same thread/Message-ID, making a pain to follow through > out the volume of email on the list, please pay attention to that) I just click Reply All, I'm not sure how else I would do it. Are they somehow being pos

Re: [Qemu-devel] [PATCH v2] Add argument filters to the seccomp sandbox

2015-09-28 Thread Namsun Ch'o
> My understanding of the config file you proposed is that it would allow the > configuration of a whitelist, so changes to the config very could result in > *less* strict of a filter, not always more. No. Any time an administrator wants a syscall that is not enabled in the sandbox, they either do

Re: [Qemu-devel] [PATCH v2] Add argument filters to the seccomp sandbox

2015-09-28 Thread Namsun Ch'o
> To be clear, I'm not suggesting "--enable-syscalls=foo,bar,...", what I'm > suggesting is a decomposition of the current filter list into blocks of > syscalls that are needed to enable specific functionality. For example, if > you enable audio support at runtime a set of syscalls will be adde

Re: [Qemu-devel] [PATCH] ui/cocoa.m: Add real CDROM menu item

2015-09-26 Thread Namsun Ch'o
> Actually on Mac OS X, /dev/cdrom always points to the optical drive. > It is how QEMU is programmed. Is this only for Mac? I must have missed that.

Re: [Qemu-devel] [PATCH] ui/cocoa.m: Add real CDROM menu item

2015-09-25 Thread Namsun Ch'o
> Add a menu item to the Machine menu called "Use Real CDROM". It gives the > user the ability to use a real CDROM with QEMU by simply selecting a menu > item. > NSASCIIStringEncoding]; > +qmp_change_blockdev(device, "/dev/cdrom", "raw", &err); > +handleAnyDeviceErrors(err); Not all syste

Re: [Qemu-devel] [PATCH v2] Add argument filters to the seccomp sandbox

2015-09-25 Thread Namsun Ch'o
> I've suggested this in the past but to my knowledge no has done any work in > this direction, including myself. Despite the lack of progress, I still > think this is a very worthwhile idea. Which is exactly why I think a configuration file would be the best option instead of --enable-syscalls=fo

Re: [Qemu-devel] [PATCH v2] Add argument filters to the seccomp sandbox

2015-09-24 Thread Namsun Ch'o
>Can you point out which exact use case breaks if you don't whitelist the >below mentioned system calls' flags? It happens whenever I do -runas with the sandbox enabled, or chroot with the sandbox enabled. sh# qemu-system-x86_64 -m 2048 -enable-kvm -chroot /var/empty -sandbox on \ > -cdrom /tmp/d

[Qemu-devel] [PATCH v3] Add argument filters to the seccomp sandbox

2015-09-24 Thread Namsun Ch'o
he comma on the last entry of the madvise_flags array. - Removed one madvise flag (MADV_INVALID) which doesn't exist, apparently. Signed-off-by: Namsun Ch'o --- diff --git a/qemu-seccomp.c b/qemu-seccomp.c index f9de0d3..a353ef9 100644 --- a/qemu-seccomp.c +++ b/qemu-sec

Re: [Qemu-devel] [PATCH] Add a few argument filters to the seccomp sandbox

2015-09-11 Thread Namsun Ch'o
> On Thursday, September 10, 2015 03:48:52 PM Daniel P. Berrange wrote: > > On Wed, Sep 09, 2015 at 09:55:33PM -0400, namn...@safe-mail.net wrote: > > > + > > > +/* shmget */ > > > +rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(shmget), 2, > > > +SCMP_A0(SCMP_CMP_EQ, IPC_PRIVA