From patchwork Thu Nov 19 21:05:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shirish Pargaonkar X-Patchwork-Id: 38873 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by ozlabs.org (Postfix) with ESMTP id 03E49B6F0E for ; Fri, 20 Nov 2009 08:05:52 +1100 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 4B965AD22B; Thu, 19 Nov 2009 14:03:18 -0700 (MST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.8 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from mail-px0-f200.google.com (mail-px0-f200.google.com [209.85.216.200]) by lists.samba.org (Postfix) with ESMTP id A5C6DAD15C for ; Thu, 19 Nov 2009 14:03:12 -0700 (MST) Received: by pxi38 with SMTP id 38so1804489pxi.10 for ; Thu, 19 Nov 2009 13:05:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=RXdj7PwrJo5yo4lDuhCvi0+/DXPgxfqkQup70IsTLII=; b=yH0cpgt74nBJcdD7gt/HHl2YBmqt5rPa0WNpRrsNX3X67LAeZPOe4CMRsDDUDXmYwV XSPvGUEAj3PzXRw+syCjz7Kl3tbqA0Qcnyx3GxXSMk9QROx6kvrUrUSrBZZDGlKIT0h9 TJA2FW3usP1yvh724pDYfR2apqiZVcvVaNHzU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Ya0dwCC6mhTlj9qmtTT8Z2J4JLNA/38qjlCZM8Gi0EG0hPZCOq8L0NF9Tfd0+kO4bP k5oSmN1NQ9gLaqoG+70Tq4rNaIelw4zfLNZzTnHDy+R3m59e8wkNEhjvaNzgm8tdAEnB Qagbo59jg4MhpYoCD9k/7PPRJ2zxLhXRoUbHM= MIME-Version: 1.0 Received: by 10.114.18.37 with SMTP id 37mr505638war.143.1258664745050; Thu, 19 Nov 2009 13:05:45 -0800 (PST) Date: Thu, 19 Nov 2009 15:05:45 -0600 Message-ID: <4a4634330911191305q69e98671qfa4089592cdd71cf@mail.gmail.com> From: Shirish Pargaonkar To: linux-cifs-client@lists.samba.org Subject: [linux-cifs-client] [PATCH] add check for nameidata before accessing it X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org This should prevent oops reported in kernel bugzilla 14641 From 240f75430dbe4965f79d903309488ebabd3d3625 Mon Sep 17 00:00:00 2001 From: Shirish Pargaonkar Date: Thu, 19 Nov 2009 14:38:59 -0600 Subject: [PATCH] add check for nameidata before accessing it Cc: Stable Acked-by: Jeff Layton --- fs/cifs/dir.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) } @@ -675,7 +675,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, * reduction in network traffic in the other paths. */ if (pTcon->unix_ext) { - if (!(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY)) && + if (nd && !(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY)) && (nd->flags & LOOKUP_OPEN) && !pTcon->broken_posix_open && (nd->intent.open.flags & O_CREAT)) { rc = cifs_posix_open(full_path, &newInode, nd->path.mnt, -- 1.6.0.2 diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 627a60a..32771f5 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -643,7 +643,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, * O_EXCL: optimize away the lookup, but don't hash the dentry. Let * the VFS handle the create. */ - if (nd->flags & LOOKUP_EXCL) { + if (nd && (nd->flags & LOOKUP_EXCL)) { d_instantiate(direntry, NULL); return 0;