Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758695AbZDWHnd (ORCPT ); Thu, 23 Apr 2009 03:43:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756389AbZDWHax (ORCPT ); Thu, 23 Apr 2009 03:30:53 -0400 Received: from sous-sol.org ([216.99.217.87]:50518 "EHLO x200.localdomain" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756256AbZDWHaw (ORCPT ); Thu, 23 Apr 2009 03:30:52 -0400 Message-Id: <20090423072645.830562637@sous-sol.org> User-Agent: quilt/0.47-1 Date: Thu, 23 Apr 2009 00:21:15 -0700 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, "Serge E. Hallyn" , David Howells , James Morris Subject: [patch 055/100] cap_prctl: dont set error to 0 at no_change References: <20090423072020.428683652@sous-sol.org> Content-Disposition: inline; filename=cap_prctl-don-t-set-error-to-0-at-no_change.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1309 Lines: 42 -stable review patch. If anyone has any objections, please let us know. --------------------- From: Serge E. Hallyn upstream commit: 5bf37ec3e0f5eb79f23e024a7fbc8f3557c087f0 One-liner: capsh --print is broken without this patch. In certain cases, cap_prctl returns error > 0 for success. However, the 'no_change' label was always setting error to 0. As a result, for example, 'prctl(CAP_BSET_READ, N)' would always return 0. It should return 1 if a process has N in its bounding set (as by default it does). I'm keeping the no_change label even though it's now functionally the same as 'error'. Signed-off-by: Serge Hallyn Acked-by: David Howells Signed-off-by: James Morris Signed-off-by: Chris Wright --- security/commoncap.c | 1 - 1 file changed, 1 deletion(-) --- a/security/commoncap.c +++ b/security/commoncap.c @@ -916,7 +916,6 @@ changed: return commit_creds(new); no_change: - error = 0; error: abort_creds(new); return error; -- 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/