linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: darrick.wong@oracle.com
Cc: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-btrfs@vger.kernel.org,
	clm@fb.com, jbacik@fb.com, dsterba@suse.com, matorola@gmail.com,
	sandeen@sandeen.net, linux-xfs@vger.kernel.org,
	linux-ext4@vger.kernel.org
Subject: Re: crypto: Work around deallocated stack frame reference gcc bug on sparc.
Date: Fri, 02 Jun 2017 15:55:29 -0400 (EDT)	[thread overview]
Message-ID: <20170602.155529.599501370529389401.davem@davemloft.net> (raw)
In-Reply-To: <20170602.143906.818489457650113258.davem@davemloft.net>

From: David Miller <davem@davemloft.net>
Date: Fri, 02 Jun 2017 14:39:06 -0400 (EDT)

> From: "Darrick J. Wong" <darrick.wong@oracle.com>
> Date: Fri, 2 Jun 2017 11:08:08 -0700
> 
>> ext4/jbd2's crc32c implementations will also need a fix like this for
>> {ext4,jbd2}_chksum.  Note that both of these modules call the crypto api
>> directly to avoid a static dependence on libcrc32c; this was done to
>> reduce kernel footprint for applications that don't need it.  (ext2,
>> ext3, and ext4 before the metadata_csum feature existed).
> 
> Good catch.  I even looked at that code the other day so should
> have spotted it as well.
> 
> I'll integrate fixes for those into my patch when I get a chance,
> thanks!

Actually, ext4 doesn't trigger the problem because the on-stack object
used in ext4 is a fixed size at compile time.  Which is technically an
ill-advised assumption to make.  Even the generic libcrc32c.c doesn't
assume that the context area is 4 bytes for crc32c.

Anyways, back to the main point, the gcc bug only triggers when
alloca() like constructs are used.

That's why I scanned for SHASH_DESC_ON_STACK() to see exactly where
the workaround is necessary.

  reply	other threads:[~2017-06-02 19:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02 15:28 crypto: Work around deallocated stack frame reference gcc bug on sparc David Miller
2017-06-02 18:08 ` Darrick J. Wong
2017-06-02 18:39   ` David Miller
2017-06-02 19:55     ` David Miller [this message]
2017-06-06 19:04 ` David Miller
2017-06-07  3: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=20170602.155529.599501370529389401.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=clm@fb.com \
    --cc=darrick.wong@oracle.com \
    --cc=dsterba@suse.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jbacik@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=matorola@gmail.com \
    --cc=sandeen@sandeen.net \
    --cc=sparclinux@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;
as well as URLs for NNTP newsgroup(s).