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]
Message-Id: <20080818224643.865da7a3.akpm@linux-foundation.org>
Date:	Mon, 18 Aug 2008 22:46:43 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Huang Ying <ying.huang@...el.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATH -mm] Fix a race condtion of oops_in_progress

On Tue, 19 Aug 2008 13:38:00 +0800 Huang Ying <ying.huang@...el.com> wrote:

> On Mon, 2008-08-18 at 21:06 -0700, Andrew Morton wrote:
> > On Mon, 18 Aug 2008 10:03:27 +0800 Huang Ying <ying.huang@...el.com> wrote:
> > 
> > > This patch fix a race condition of oops_in_progress. Which may be
> > > changed on multiple CPU simultaneously, but it is changed via
> > > non-atomic operation ++/--. This patch changes the definition of
> > > oops_in_process from int to atomic_t, and accessing method to atomic
> > > operations.
> > 
> > 
> > > extern atomic_t oops_in_progress;
> > 
> > In file included from include/asm/system.h:10,
> >                  from include/asm/processor.h:17,
> >                  from include/asm/atomic_32.h:5,
> >                  from include/asm/atomic.h:2,
> >                  from include/linux/crypto.h:20,
> >                  from arch/x86/kernel/asm-offsets_32.c:7,
> >                  from arch/x86/kernel/asm-offsets.c:2:
> > include/linux/kernel.h:236: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'oops_in_progress'
> > make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1
> > make: *** [prepare0] Error 2
> > 
> > we can't inlude asm/atomic.h from linux/kernel.h because asm/atomic.h
> > includes linux/kernel.h via the above route.
> > 
> > And we cannot forward-declare atomic_t by hand because it's a typedef.
> > 
> > Not sure what to do, really.  Find a different header file in which to
> > declare oops_in_progress?
> 
> It seems that asm/atomic.h is used for both atomic_t declaration and
> implementation, how about separate them? That it, add a new file
> asm/atomic_def.h, put typedef there, and include asm/atomic_def.h in
> kernel.h?

yup, that sounds sensible.

Of course, it may be the case that we no longer need to include
kernel.h from within asm-x86/system.h.  But that's the sort of thing
which once done is awfully hard to undo.

--
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