Linux cryptographic layer development
 help / color / mirror / Atom feed
From: "PaX Team" <pageexec@freemail.hu>
To: "Jan-Simon Möller" <dl9pf@gmx.de>,
	"Herbert Xu" <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org, behanw@converseincode.com
Subject: Re: [RFC] [PATCH]  Fix for a warning - crypto/fcrypt,c
Date: Wed, 21 Aug 2013 17:39:36 +0200	[thread overview]
Message-ID: <5214DF38.17262.204C9B7D@pageexec.freemail.hu> (raw)
In-Reply-To: <20130821104715.GA22975@gondor.apana.org.au>

On 21 Aug 2013 at 20:47, Herbert Xu wrote:

> On Thu, Aug 15, 2013 at 02:01:50PM +0200, Jan-Simon Möller wrote:
> > Solution - make sure we don't exceed the 32 bit range by adding (x & ~(1U << 
> > 27))  
> > =  & (0xF7FFFFFF)_16 or & (1111 0111 1111 1111 1111 1111 1111 1111)_2
> 
> Your fix makes no sense.  To achieve what you want you'd need to lop
> off the first 5 bits, not the fifth bit.

oops, the bitmask expression wanted to be (1U << 27) - 1) instead.
another approach would be to simply cast the macro argument to __be32.

> However, which compiler is this? This warning seems to be rather
> pointless.

it's clang and this warning is about an undefined behaviour because
the hexadecimal constants passed to this macro are treated as signed
ints and for some of the constants the result of the shift cannot be
represented as a signed int.

  reply	other threads:[~2013-08-21 16:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15 12:01 [RFC] [PATCH] Fix for a warning - crypto/fcrypt,c Jan-Simon Möller
2013-08-21 10:47 ` Herbert Xu
2013-08-21 15:39   ` PaX Team [this message]
2013-08-21 20:42 ` Jan-Simon Möller
2013-08-26  6:04   ` Herbert Xu

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=5214DF38.17262.204C9B7D@pageexec.freemail.hu \
    --to=pageexec@freemail.hu \
    --cc=behanw@converseincode.com \
    --cc=davem@davemloft.net \
    --cc=dl9pf@gmx.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox