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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110128013552.GB8019@noexit>
Date:	Thu, 27 Jan 2011 17:35:53 -0800
From:	Joel Becker <jlbec@...lplan.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	dsterba@...e.cz, mfasheh@...e.com, linux-kernel@...r.kernel.org,
	ocfs2-devel@....oracle.com
Subject: Re: [Ocfs2-devel] fs/ocfs2/dlm: Use GFP_ATOMIC under spin_lock

On Thu, Jan 27, 2011 at 05:09:48PM -0800, Andrew Morton wrote:
> > -       local = kmalloc(sizeof(qr->qr_regions), GFP_KERNEL);
> > +       local = kmalloc(sizeof(qr->qr_regions), GFP_ATOMIC);
> >         if (!local) {
> >                 status = -ENOMEM;
> >                 goto bail;
> > 
> 
> Switching to GFP_ATOMIC is the worst of all possible ways of "fixing"
> this bug.  GFP_ATOMIC is *unreliable*.  We don't want to introduce
> unreliability deep down inside our filesytems.  And fs maintainers who
> don't want to make their filesystems less reliable shouldn't blindly
> apply patches that do so :(

	Fair enough.

> A reliable way of fixing this bug is below.  As an added bonus, it
> makes the fs faster.
> 
> --- a/fs/ocfs2/dlm/dlmdomain.c~a
> +++ a/fs/ocfs2/dlm/dlmdomain.c
> @@ -926,9 +926,9 @@ static int dlm_assert_joined_handler(str
>  }
>  
>  static int dlm_match_regions(struct dlm_ctxt *dlm,
> -			     struct dlm_query_region *qr)
> +			     struct dlm_query_region *qr, u8 *local)
>  {
> -	char *local = NULL, *remote = qr->qr_regions;
> +	char *remote = qr->qr_regions;

	Won't the stack-depth busybodies hate us for this?  I realize we
don't go much deeper from here, but it still is 1K of stack.

Joel

-- 

"When arrows don't penetrate, see...
 Cupid grabs the pistol."

			http://www.jlbec.org/
			jlbec@...lplan.org
--
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