From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753386Ab0IPFwB (ORCPT ); Thu, 16 Sep 2010 01:52:01 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:46399 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752318Ab0IPFv7 (ORCPT ); Thu, 16 Sep 2010 01:51:59 -0400 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 From: KOSAKI Motohiro To: Linus Torvalds Subject: Re: [PATCH 2/2] execve: check the VM has enough memory at first Cc: kosaki.motohiro@jp.fujitsu.com, Roland McGrath , Andrew Morton , linux-kernel@vger.kernel.org, oss-security@lists.openwall.com, Solar Designer , Kees Cook , Al Viro , Oleg Nesterov , Neil Horman , linux-fsdevel@vger.kernel.org, pageexec@freemail.hu, "Brad Spengler , Eugene Teo" , KAMEZAWA Hiroyuki In-Reply-To: <20100914105147.C996.A69D9226@jp.fujitsu.com> References: <20100914105147.C996.A69D9226@jp.fujitsu.com> Message-Id: <20100916111714.CA03.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.50.07 [ja] Date: Thu, 16 Sep 2010 14:51:55 +0900 (JST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > On Wed, Sep 8, 2010 at 10:04 PM, KOSAKI Motohiro > > wrote: > > > > > > After this patch, execve() expand stack at first and receive to > > > check vm_enough_memory() properly. then, too long argument of > > > execve() than the machine memory return EFAULT properly. > > > > This is horrible. We don't want to walk the arguments one more time > > just for this. Let's just improve the checks that we do as we go > > along. > > > > Linus > > Okey. I'll consider new way in this night. After while thinking, I decided to just drop this idea. because 1) If one pass check is must, we can't reuse vm-overcommit check. 2) Glibc has the duplicated hueristic, then we can't change it nor introduce new hard limit. (Sh*t) 3) This is not must fix, it only mitigate a pain when accidental large argv case. Only OOM fixes enough care intended attack case. 4) distro can change default of rlim_max of RLIMIT_STACK. It protect from RLIM_INFINITY smash. Briefly says, to introduce new limit has bad benefit/risk balance. Sadly.