All of lore.kernel.org
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: kernel-hardening@lists.openwall.com
Cc: Colin Vidal <colin@cvidal.org>,
	"keescook@chromium.org" <keescook@chromium.org>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"Anvin, H Peter" <h.peter.anvin@intel.com>,
	Hans Liljestrand <ishkamiel@gmail.com>,
	David Windsor <dwindsor@gmail.com>
Subject: Re: [kernel-hardening] [RFC v3 PATCH 01/13] Add architecture independent hardened atomic base
Date: Wed, 2 Nov 2016 15:55:08 +0900	[thread overview]
Message-ID: <20161102065505.GA381@linaro.org> (raw)
In-Reply-To: <2236FBA76BA1254E88B949DDB74E612B41BFAD4B@IRSMSX102.ger.corp.intel.com>

On Tue, Nov 01, 2016 at 12:15:25PM +0000, Reshetova, Elena wrote:
> >Hi (again :-)) Elena, Hans,
> 
> > diff --git a/include/linux/atomic.h b/include/linux/atomic.h
> <snip>
> > +#ifndef atomic_cmpxchg_wrap
> > +#define  atomic_cmpxchg_wrap(...)				\
> > +	__atomic_op_fence(atomic_cmpxchg_wrap, __VA_ARGS__) #endif
> >  #endif /* atomic_cmpxchg_relaxed */
> > 
> 
> >I have a problem here. With ARMv7 (without any of my patches), I have a
> >implicit declaration of atomic_cmpxchg_wrap. Perhaps something like
> 
> >    #ifndef atomic_cmpxchg_wrap_relaxed
> >    #define atomic_cmpxchg_wrap_relaxed atomic_cmpxchg_wrap
> 
> >is missing? I didn't follow the recent changes of that part, so I am
> >not quite sure...
> 
> >Thanks!
> 
> >Colin
> 
> >In file included from ./include/linux/spinlock.h:406:0,
>                  from ./include/linux/seqlock.h:35,
>                  from ./include/linux/time.h:5,
>                  from ./include/linux/stat.h:18,
>                  from ./include/linux/module.h:10,
>                  from net/ipv4/route.c:67:
> >net/ipv4/route.c: In function ‘ip_idents_reserve’:
> >./include/linux/atomic.h:459:20: error: implicit declaration of function ‘atomic_cmpxchg_wrap_relaxed’ [-Werror=implicit-function-declaration]
>   __atomic_op_fence(atomic_cmpxchg_wrap, __VA_ARGS__)
>                     ^
> >./include/linux/atomic.h:62:9: note: in definition of macro ‘__atomic_op_fence’
>  > typeof(op##_relaxed(args)) __ret;    \
>          ^~
> >net/ipv4/route.c:488:11: note: in expansion of macro ‘atomic_cmpxchg_wrap’
> >  } while (atomic_cmpxchg_wrap(p_id, old, new) != old);
> 
> Oh, I think this is because we don't have atomic_cmpxchg_wrap_relaxed defined neither atomic_xchg_wrap_relaxed. Wonder why this doesn't show up on x86, I did many builds without our x86 changes to verify. 
> Hans could you please handle this change today to unblock Colin? 
> 
> Actually this brings us to the fact that we tried to stay away from various relaxed/acquire/release functions (in providing default wrap implementations), but it seems that they are also needed...

This is just a reminder.
There is a potential inconsistency in naming:
    atomic_xx_wrap_relaxed vs. atomic_xx_relaxed_wrap
See:
http://www.openwall.com/lists/kernel-hardening/2016/10/25/7

-Takahiro AKASHI

> Sigh.. This grows bigger and bigger every day. I hope atomic doesn't plan to come with more functions in the nearest future :)
> 
> Kees, what is your opinion on relaxed/acquire/release coverage?
> 
> Best Regards,
> Elena. 

  parent reply	other threads:[~2016-11-02  6:55 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-31 11:43 [kernel-hardening] [RFC v3 PATCH 00/13] HARDENING_ATOMIC feature Elena Reshetova
2016-10-31 11:43 ` [kernel-hardening] [RFC v3 PATCH 01/13] Add architecture independent hardened atomic base Elena Reshetova
2016-11-01  9:44   ` Colin Vidal
2016-11-01 10:59     ` Reshetova, Elena
2016-11-01 11:35       ` Hans Liljestrand
2016-11-01 13:57         ` Kees Cook
2016-11-02  4:55           ` Reshetova, Elena
2016-11-02 21:23           ` Hans Liljestrand
2016-11-01 10:15   ` Colin Vidal
2016-11-01 10:55     ` Reshetova, Elena
2016-11-01 10:42   ` Colin Vidal
2016-11-01 11:02     ` Reshetova, Elena
2016-11-01 11:53   ` Colin Vidal
2016-11-01 12:15     ` Reshetova, Elena
2016-11-01 12:55       ` Hans Liljestrand
2016-11-01 17:21         ` Colin Vidal
2016-11-02  4:51           ` Reshetova, Elena
2016-11-02  6:55       ` AKASHI Takahiro [this message]
2016-11-04  7:04         ` Reshetova, Elena
2016-10-31 11:43 ` [kernel-hardening] [RFC v3 PATCH 02/13] percpu-refcount: leave atomic counter unprotected Elena Reshetova
2016-10-31 11:43 ` [kernel-hardening] [RFC v3 PATCH 03/13] kernel: identify wrapping atomic usage Elena Reshetova
2016-10-31 11:43 ` [kernel-hardening] [RFC v3 PATCH 04/13] mm: " Elena Reshetova
2016-10-31 11:43 ` [kernel-hardening] [RFC v3 PATCH 05/13] fs: " Elena Reshetova
2016-10-31 11:43 ` [kernel-hardening] [RFC v3 PATCH 06/13] net: " Elena Reshetova
2016-10-31 11:43 ` [kernel-hardening] [RFC v3 PATCH 07/13] net: atm: " Elena Reshetova
2016-10-31 11:43 ` [kernel-hardening] [RFC v3 PATCH 08/13] security: " Elena Reshetova
2016-10-31 11:43 ` [kernel-hardening] [RFC v3 PATCH 09/13] drivers: identify wrapping atomic usage (part 1/2) Elena Reshetova
2016-10-31 11:43 ` [kernel-hardening] [RFC v3 PATCH 10/13] drivers: identify wrapping atomic usage (part 2/2) Elena Reshetova
2016-10-31 11:43 ` [kernel-hardening] [RFC v3 PATCH 11/13] x86: identify wrapping atomic usage Elena Reshetova
2016-10-31 11:43 ` [kernel-hardening] [RFC v3 PATCH 12/13] x86: implementation for HARDENED_ATOMIC Elena Reshetova
2016-10-31 11:43 ` [kernel-hardening] [RFC v3 PATCH 13/13] lkdtm: add tests for atomic over-/underflow Elena Reshetova

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161102065505.GA381@linaro.org \
    --to=takahiro.akashi@linaro.org \
    --cc=arnd@arndb.de \
    --cc=colin@cvidal.org \
    --cc=dwindsor@gmail.com \
    --cc=h.peter.anvin@intel.com \
    --cc=ishkamiel@gmail.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.