[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrWBHJ52YjowqJ7S90bXvkw_B1VxbkSDKpyjwC1WYvGE3w@mail.gmail.com>
Date: Sat, 3 Jan 2015 15:06:27 -0800
From: Andy Lutomirski <luto@...capital.net>
To: Pavel Machek <pavel@....cz>
Cc: Richard Weinberger <richard@....at>, Jiri Kosina <jkosina@...e.cz>,
Kees Cook <keescook@...omium.org>,
LKML <linux-kernel@...r.kernel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
David Rientjes <rientjes@...gle.com>,
Aaron Tomlin <atomlin@...hat.com>,
DaeSeok Youn <daeseok.youn@...il.com>,
Thomas Gleixner <tglx@...utronix.de>, vdavydov@...allels.com,
Rik van Riel <riel@...hat.com>,
Oleg Nesterov <oleg@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Al Viro <viro@...iv.linux.org.uk>,
Brad Spengler <spender@...ecurity.net>
Subject: Re: [PATCH] [RFC] Deter exploit bruteforcing
On Sat, Jan 3, 2015 at 2:36 PM, Pavel Machek <pavel@....cz> wrote:
>
>> >> No. This is not what this patch does.
>> >>
>> >>> But changing glibc to do sleep(30); abort(); instead of abort(); to
>> >>> slow down bruteforcing of canaries makes some kind of sense... and
>> >>> should be ok by default.
>> >>
>> >> As I saidn only focusing one the specific stack canary case is not enough.
>> >
>> > Ok, so I am now saying "adding random delays to the kernel, hoping
>> > they slow attacker down" is bad idea. Feel free to add my NAK to the
>> > patch.
>>
>> The patch does not add random delays nor is hope involved.
>>
>> It has a very clear purpose, it makes brute force attacks to forking
>> services unattractive.
>> Exploits often use the fact that after fork() the child has the same memory
>> as the parent and therefore an attacker can start fruitful brute force attacks
>> to brute stack canaries, offsets, etc. as the new child will always have mostly
>> the same memory layout as before.
>>
>> But I'll happily add your NAK to this series.
>
> Please do.
>
>> > If really neccessary, "kill_me_slowly()" syscall would be acceptable,
>> > but it seems just sleep(); abort(); combination is enough.
>>
>> The goal of the patch is not to protect only against brute forcing the stack canary.
>> It should protect against all kind of brute forcing using forking services.
>>
>> > glibc should cover 99% cases where this matters, please just fix glibc,
>> > others will follow.
>>
>> There are a lot of systems out there without glibc.
>
> Only "interesting" systems that are without glibc are androids, and
> they usually run very old kernels.
>
> If you implement sleep() in glibc, distros will enable it and you'll
> protect all the desktop users.
As an attempt to help end this particular line of debate: putting the
sleep in glibc won't work. The point isn't to make the crashed
process crash more slowly; it's to limit the rate at which *new*
siblings can be forked and crashed as a canary or ASLR brute-force
probe. IOW, adding a sleep call to glibc slows down the wrong thing.
Also, trying to get libc to take action on a plain old segfault is a
giant mess, because it involves mucking with signal handling, which
glibc really has no business doing by default.
Also, this patch is missing a bit, I think. We really want to control
the total rate of crashes. This patch imposes a delay per crash, but
AFAICS it would still be possible for an attacker to coerce a forking
server to fork, say, 10k children, then probe all of them, then wait
30 seconds and repeat.
--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists