lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 31 Aug 2012 12:00:26 +0400
From:	Pavel Shilovsky <piastryyy@...il.com>
To:	Nick Pasich <Nick@...kandbarb.net>
Cc:	Jeff Layton <jlayton@...hat.com>, linux-cifs@...r.kernel.org,
	linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: WARNING: at fs/inode.c:280 drop_nlink+0x31/0x33()

2012/8/31 Nick Pasich <Nick@...kandbarb.net>:
> Jeff,
>
> I applied this patch to Kernel 3.5.3 from Pavel and the
> the warning is gone with no problems.
>
> Thanks,
>
> --( Nick Pasich
>
> ##########################################################
>
> From df2d6b1fbf2401c5ee04f2ac143ea0954e3a87a6 Mon Sep 17 00:00:00 2001
> From: Pavel Shilovsky <pshilovsky@...ba.org>
> Date: Fri, 13 Jul 2012 11:59:45 +0400
> Subject: [PATCH] CIFS: Protect i_nlink from being negative
>
> that can cause warning messages.
>
> Signed-off-by: Pavel Shilovsky <pshilovsky@...ba.org>
> ---
>  fs/cifs/inode.c |   13 +++++++++++--
>  1 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> index 7354877..88afb1a 100644
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -1110,6 +1110,15 @@ undo_setattr:
>                 goto out_close;
>  }
>
> +/* copied from fs/nfs/dir.c with small changes */
> +static void
> +cifs_drop_nlink(struct inode *inode)
> +{
> +       spin_lock(&inode->i_lock);
> +       if (inode->i_nlink > 0)
> +               drop_nlink(inode);
> +       spin_unlock(&inode->i_lock);
> +}
>
>  /*
>   * If dentry->d_inode is null (usually meaning the cached dentry
> @@ -1166,13 +1175,13 @@ retry_std_delete:
>  psx_del_no_retry:
>                 if (!rc) {
>                                 if (inode)
> -                       drop_nlink(inode);
> +                       cifs_drop_nlink(inode);
>                 } else if (rc == -ENOENT) {
>                                 d_drop(dentry);
>                 } else if (rc == -ETXTBSY) {
>                                 rc = cifs_rename_pending_delete(full_path, dentry, xid);
>                                 if (rc == 0)
> -                       drop_nlink(inode);
> +                       cifs_drop_nlink(inode);
>                 } else if ((rc == -EACCES) && (dosattr == 0) && inode) {
>                                 attrs = kzalloc(sizeof(*attrs), GFP_KERNEL);
>                                 if (attrs == NULL) {
> --
> 1.7.3.3
>
> ##########################################################
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

This one fixes only a part of the problem. Now we have another patch
for this problem:

https://git.samba.org/sfrench/?p=sfrench/cifs-2.6.git;a=commitdiff;h=b7ca69289680cf631fb20b7d436467c4ec1153cd;hp=6dab7ede9390d4d937cb89feca932e4fd575d2da

-- 
Best regards,
Pavel Shilovsky.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ