lkml.org 
[lkml]   [2009]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Change ZERO_SIZE_PTR to point at unmapped space
On Sat, 30 May 2009, Larry H. wrote:

> Let me provide you with a realistic scenario:
>
> 1. foo.c network protocol implementation takes a sockopt which
> sets some ACME_OPTLEN value taken from userland.
>
> 2. the length is not validated properly: it can be zero or an
> integer overflow / signedness issue allows it to wrap to zero.
>
> 3. kmalloc(0) ensues, and data is copied to the pointer
> returned. if this is the default ZERO_SIZE_PTR*, a malicious user
> can mmap a page at NULL, and read data leaked from kernel memory
> everytime that setsockopt is issued.
> (*: kmalloc of zero returns ZERO_SIZE_PTR)

Cannot happen. The page at 0L is not mapped. This will cause a fault.

You are assuming the system has already been breached. Then of course all
bets are off.

> The performance impact, if any, is completely negligible. The security
> benefits of this utterly simple change well surpass the downsides.

Dont see any security benefit. If there is a way to breach security
of the kernel via mmap then please tell us and then lets fix
the problem and not engage in dealing with secondary issues.

Semantics of mmap(NULL, ...) is that the kernel selects a valid address
for you. How are you mapping something at 0L?



\
 
 \ /
  Last update: 2009-06-02 17:41    [W:0.500 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site