Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752029Ab2JHPrY (ORCPT ); Mon, 8 Oct 2012 11:47:24 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39703 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751208Ab2JHPrU (ORCPT ); Mon, 8 Oct 2012 11:47:20 -0400 Date: Mon, 8 Oct 2012 10:47:11 -0500 From: Serge Hallyn To: Kees Cook Cc: Andrew Vagin , linux-kernel@vger.kernel.org, "Andrew G. Morgan" , Pavel Emelyanov , Andrew Morton , KAMEZAWA Hiroyuki Subject: Re: [PATCH] proc: don't show nonexistent capabilities (v2) Message-ID: <20121008154711.GA16261@sergelap> References: <1349603814-1085468-1-git-send-email-avagin@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1781 Lines: 50 Quoting Kees Cook (keescook@chromium.org): > On Sun, Oct 7, 2012 at 2:56 AM, Andrew Vagin wrote: > > Without this patch it is really hard to interpret a bounding set, > > if CAP_LAST_CAP is unknown for a current kernel. > > > > Non-existant capabilities can not be deleted from a bounding set > > with help of prctl. > > > > E.g.: Here are two examples without/with this patch. > > CapBnd: ffffffe0fdecffff > > CapBnd: 00000000fdecffff > > > > I suggest to hide non-existent capabilities. Here is two reasons. > > * It's logically and easier for using. > > * It helps to checkpoint-restore capabilities of tasks, because tasks > > can be restored on another kernel, where CAP_LAST_CAP is bigger. > > > > v2: Non-existent capabilities can not be removed from creds, because > > in this case user cannot set all=eip. This patch cleans up non-existent > > capabilities from content of /proc/pid/status > > > > Cc: Andrew G. Morgan > > Cc: Serge Hallyn Basic capsh tests seem to have no problem with it. Thanks, Andrew. Reviewed-by: Serge E. Hallyn > > Cc: Pavel Emelyanov > > Cc: Andrew Morton > > Cc: Kees Cook > > Cc: KAMEZAWA Hiroyuki > > Signed-off-by: Andrew Vagin > > Seems sensible to me. > > Reviewed-by: Kees Cook > > -Kees > > -- > Kees Cook > Chrome OS Security -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/