Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764804AbZLQOXV (ORCPT ); Thu, 17 Dec 2009 09:23:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1764772AbZLQOXU (ORCPT ); Thu, 17 Dec 2009 09:23:20 -0500 Received: from mail-pz0-f171.google.com ([209.85.222.171]:48418 "EHLO mail-pz0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762715AbZLQOXS (ORCPT ); Thu, 17 Dec 2009 09:23:18 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; b=GoKznm0PpwB/y7ciZMSfLSANJOSalz+z0pwZM2MMoxMsLywLhrEkcs/C5MQmLimE0j Tv4/pQGz0D2JQejIJ2VF9jxMfdlDZAtC2u2Djf/QL4AXqSBZsE22Cz9cL8RSAZzli4tJ Q9e65OAptlEs/qxeLRpL5XGsXU27741UxN5EY= Date: Thu, 17 Dec 2009 22:26:57 +0800 From: "Liuweni" To: "linux-fsdevel" , "linux-kernel" , "viro" Cc: "Liu Hui" , "Xiao Guangrong" , "strongzgy" , "qingshenlwy" Subject: [PATCH 3/3]posix acl:Add an acl check Message-ID: <200912172226552340782@gmail.com> X-mailer: Foxmail 6, 15, 201, 22 [cn] Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1050 Lines: 35 In this function, the parameter of acl will be called by FOREACH_ACL_ENTRY(macro) without null point check. I add a Null point check to it. --- Signed-off-by: Liuwenyi Cc: Alexander Viro Cc: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 39df95a..6d81a13 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -213,6 +213,9 @@ posix_acl_permission(struct inode *inode, const struct posix_acl *acl, int want) const struct posix_acl_entry *pa, *pe, *mask_obj; int found = 0; + if (!acl) + return -EINVAL; + FOREACH_ACL_ENTRY(pa, acl, pe) { switch(pa->e_tag) { case ACL_USER_OBJ: -------------- Best Regards, Liuweni 2009-12-17 -- 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/