Re: Security: information leaks in /proc enable keystroke recovery

2009-08-17 Thread Robert Watson


On Sun, 16 Aug 2009, David Wagner wrote:

I accept your argument that there is no point trying to defend against 
deliberate communication of information between two cooperating processes 
via some sneaky channel; there is no hope of stopping that in 
general-purpose commodity OS's.  If process X and Y are both colluding to 
send information from X to Y, they will succeed, no matter how hard we try. 
We have no hope of closing all such channels, for general-purpose commodity 
OS's (like FreeBSD or Linux).


Moving beyind EIP/ESP, which are clearly a bad idea:

The OS community has not engaged well with the concerns raised by past 
cache-based crypto side channels, in part because it seemed the least complex 
solution was hardening crypto against having key-driven footprints in the 
cache.  However, the problem they represent (avoiding the use of shared 
resources between mutually untrusting processes, and then mitigating efects 
that remain) definitely sounds like the covert channel problem, with very 
similar concerns extensively discussed in the documents I referred to.


In an interactive system, the scheduling of threads in a process reflect the 
completion of various events: user I/O, network I/O, disk I/O, or perhaps the 
expiration of a timer associated with application-internal events (animations, 
statistics, etc).  Monitoring these from another process is intentionally easy 
on commodity OS's -- there are a variety of monitoring statistics, from the 
already mentioned process/thread execution time, to context switch counters, 
wait channels/addresses, lock states, timestamps on special devices, etc, not 
to mention having CPU sink processes that nice themselves appropriately and 
hang around monitoring execution of other processes/threads/the kernel through 
gaps in its own scheduling.  Some of the intentional mechanisms are specific 
to processes, and easy to block by policy.  Others are global, and begin the 
sliding down the slope of making the system and applications a lot harder to 
analyze and debug, something that sites frequently hosting large numbers of 
mutually untrusting users (web farms) may not be willing to deal do.


Into the area of techniques that annoy people: my guess is that you may also 
be able to measure the context switching of processes on other CPUs through 
very careful timing of events in the kernel on your local CPU.  For example, 
it's a reasonable bet that using the TSC and carefully selected system 
calls/arguments, you can measure cache line behavior associated with kernel 
scheduler/statistic lines that will be pulled to another CPU when a context 
switch takes place.  For example, consider per-CPU run queue locks or context 
switch statistics, which may in edge cases be pulled to another CPU, such as 
when monitoring takes place.  If they are already local to the attacking CPU, 
no context switch has taken place on the other CPU since you last checked; if 
they're non-local, a context switch has taken place.


Following Colin Percival's paper on cache side channels for RSA, there was a 
lot of discussion about how the OS could help mitigate these problems: do you 
provide security critical sections around cryptography which introduce 
temporary but performance-degrading mutual exclusion of caches based on 
knowledge of the CPU topology, for example.  Identifying and offering similar 
trade-offs between performance and security, avoiding excess complexity, and 
in particular, limiting the scope of those performance losses to only critical 
moments will be key if the security community wants to engage the OS community 
here.  Otherwise I suspect these concerns will pass by, unaddressed, again.


Robert N M Watson
Computer Laboratory
University of Cambridge
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Howto setup multiboot with GPT?

2009-08-17 Thread John Baldwin
On Friday 14 August 2009 5:07:49 pm Andrey V. Elsukov wrote:
 Hi,
 
 I have installed 8.0-BETA2 amd64 on ZFS root with GPT. I made addition 
 partition and
 made new ZFS pool, builded and installed i386 world and kernel to this pool. 
 So, is there some way to select from which partition i want to boot?

Not currently unless you hardcode a specific partition in /boot.config.  (You
may need a patch from jhay@ to fix the parsing of that file though.)  I
believe someone (can't recall who) has some changes in a p4 branch to extend
gptboot to support a fancier interface with a menu of possible partitions,
etc.

-- 
John Baldwin
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Howto setup multiboot with GPT?

2009-08-17 Thread Artis Caune
2009/8/15 Andrey V. Elsukov bu7c...@yandex.ru:
 Hi,

 I have installed 8.0-BETA2 amd64 on ZFS root with GPT. I made addition 
 partition and
 made new ZFS pool, builded and installed i386 world and kernel to this pool.
 So, is there some way to select from which partition i want to boot?

 My configuration:
 gpart show ad10
 =        34  1250263661  ad10  GPT  (596G)
          34         256     1  freebsd-boot  (128K)
         290     8388608     2  freebsd-swap  (4.0G)
     8388898   209715200     3  freebsd-zfs  (100G)
   218104098   209715200     4  freebsd-zfs  (100G)
   427819298   822444397        - free -  (392G)

 zpool list
 NAME    SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
 amd64  99,5G  10,5G  89,0G    10%  ONLINE  -
 x86    99,5G   346M  99,2G     0%  ONLINE  /mnt

 cat /boot/loader.conf
 zfs_load=YES
 vfs.root.mountfrom=zfs:amd64


You can try using one freebsd-zfs partition, one pool and just change
bootfs zpool property:

# zpool create rpool ad10p3
# zfs create rpool/ROOT/amd64
# zfs create rpool/ROOT/x86
# zpool set bootfs=rpool/amd64 rpool

echo 'vfs.root.mountfrom=zfs:rpool/amd64'  /ROOT/amd64/boot/loader.conf
echo 'vfs.root.mountfrom=zfs:rpool/x86'  /ROOT/x86/boot/loader.conf


and then change bootfs on the fly:

amd64# zpool set bootfs=rpool/x86 rpool
amd64# reboot

x86# zpool set bootfs=rpool/amd64 rpool
x86# reboot





-- 
Artis Caune

Everything should be made as simple as possible, but not simpler.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Howto setup multiboot with GPT?

2009-08-17 Thread John Hay
On Mon, Aug 17, 2009 at 09:32:54AM -0400, John Baldwin wrote:
 On Friday 14 August 2009 5:07:49 pm Andrey V. Elsukov wrote:
  Hi,
  
  I have installed 8.0-BETA2 amd64 on ZFS root with GPT. I made addition 
  partition and
  made new ZFS pool, builded and installed i386 world and kernel to this 
  pool. 
  So, is there some way to select from which partition i want to boot?
 
 Not currently unless you hardcode a specific partition in /boot.config.  (You
 may need a patch from jhay@ to fix the parsing of that file though.)  I
 believe someone (can't recall who) has some changes in a p4 branch to extend
 gptboot to support a fancier interface with a menu of possible partitions,
 etc.

My patch is only for gptboot (ufs partitions). From what I looked at
gptzfsboot, it only looks at the first pool. You can boot from different
filesystems inside a pool though. You can set that with
zpool set bootfs=pool/dataset

John
-- 
John Hay -- j...@meraka.csir.co.za / j...@freebsd.org
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org