All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
To: "dsterba@suse.cz" <dsterba@suse.cz>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH v2] btrfs: assert sizes of ioctl structures
Date: Tue, 14 Jul 2020 14:49:31 +0000	[thread overview]
Message-ID: <SN4PR0401MB35986997606AF4136D0218439B610@SN4PR0401MB3598.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20200714123234.GP3703@twin.jikos.cz

On 14/07/2020 14:33, David Sterba wrote:
> On Tue, Jul 14, 2020 at 06:32:36PM +0900, Johannes Thumshirn wrote:
>> When expanding ioctl interfaces we want to make sure we're not changing
>> the size of the structures, otherwise it can lead to incorrect transfers
>> between kernel and user-space.
>>
>> Build time assert the size of each structure so we're not running into any
>> incompatibilities.
>>
>> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> 
> I've tried 32bit build and the assertion fails for many structures, but
> I was expecting only the send one because it contains the pointer.

I wonder if we should have two different asserts for 32 and 64bit for 
these structures or remove the asserts from them.

Having a 32 and 64bit assert will add some ifdeffery, let me see how 
ugly this will get.


  reply	other threads:[~2020-07-14 14:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14  9:32 [PATCH v2] btrfs: assert sizes of ioctl structures Johannes Thumshirn
2020-07-14 12:32 ` David Sterba
2020-07-14 14:49   ` Johannes Thumshirn [this message]
2020-07-14 14:55     ` David Sterba
2020-07-15  7:12       ` Johannes Thumshirn
2020-07-15  7:56         ` David Sterba

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=SN4PR0401MB35986997606AF4136D0218439B610@SN4PR0401MB3598.namprd04.prod.outlook.com \
    --to=johannes.thumshirn@wdc.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@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 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.