Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755911AbZKSU1n (ORCPT ); Thu, 19 Nov 2009 15:27:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753278AbZKSU1m (ORCPT ); Thu, 19 Nov 2009 15:27:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37643 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755799AbZKSU1k (ORCPT ); Thu, 19 Nov 2009 15:27:40 -0500 From: Steve Grubb Organization: Red Hat To: "Andrew G. Morgan" Subject: Re: drop SECURITY_FILE_CAPABILITIES? Date: Thu, 19 Nov 2009 15:26:15 -0500 User-Agent: KMail/1.12.2 (Linux/2.6.30.9-96.fc11.x86_64; KDE/4.3.2; x86_64; ; ) Cc: "Serge E. Hallyn" , lkml , linux-security-module@vger.kernel.org, Kees Cook , Andreas Gruenbacher , Michael Kerrisk , George Wilson , KaiGai Kohei References: <20091110140739.GA15534@us.ibm.com> <200911181433.30967.sgrubb@redhat.com> <551280e50911190735u210e2c60xc944c333b122d22d@mail.gmail.com> In-Reply-To: <551280e50911190735u210e2c60xc944c333b122d22d@mail.gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200911191526.15345.sgrubb@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1008 Lines: 30 On Thursday 19 November 2009 10:35:12 am Andrew G. Morgan wrote: > How about this change? > > @@ -169,8 +169,11 @@ SYSCALL_DEFINE2(capget, cap_user_header_ > kernel_cap_t pE, pI, pP; > > ret = cap_validate_magic(header, &tocopy); > - if (ret != 0) > + if ((ret != 0) || (dataptr == NULL)) { > + if ((ret == -EINVAL) && (dataptr == NULL)) > + return 0; > return ret; > + } > > if (get_user(pid, &header->pid)) > return -EFAULT; > > ? This is a slightly modified version of what you posted before. > Specifically, in the case that the user guessed a compatible version > this NULL call will succeed and not EFAULT. Sure. Looks good to me. Thanks, -Steve -- 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/