Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Cc: David Sterba <dsterba@suse.cz>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 4/4] btrfs: assert sizes of ioctl structures
Date: Mon, 13 Jul 2020 16:58:09 +0200	[thread overview]
Message-ID: <20200713145809.GL3703@twin.jikos.cz> (raw)
In-Reply-To: <20200713122901.1773-5-johannes.thumshirn@wdc.com>

On Mon, Jul 13, 2020 at 09:29:01PM +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>

The structure size is ABI once it's part of the ioctl defintion, ie. in
any of the _IOWR/_IOR/_IOW macros. I don't see the assert added for
btrfs_ioctl_vol_args_v2 or btrfs_ioctl_quota_rescan_args and I haven't
checked all.

Can you please add the static asserts for all of them? The file ioctl.h
in progs should have that already so you can copy or cross-verify from
there.

I'll merge the patches 1-3 now.

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

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 12:28 [PATCH v2 0/4] Two furhter additions for fsinfo ioctl Johannes Thumshirn
2020-07-13 12:28 ` [PATCH v2 1/4] btrfs: pass checksum type via BTRFS_IOC_FS_INFO ioctl Johannes Thumshirn
2020-07-13 14:27   ` David Sterba
2020-07-13 14:28     ` Johannes Thumshirn
2020-07-13 14:50       ` David Sterba
2020-07-13 12:28 ` [PATCH v2 2/4] btrfs: add filesystem generation to fsinfo ioctl Johannes Thumshirn
2020-07-15  7:21   ` Nikolay Borisov
2020-07-13 12:29 ` [PATCH v2 3/4] btrfs: add metadata_uuid " Johannes Thumshirn
2020-07-15  7:22   ` Nikolay Borisov
2020-07-13 12:29 ` [PATCH v2 4/4] btrfs: assert sizes of ioctl structures Johannes Thumshirn
2020-07-13 14:58   ` David Sterba [this message]
2020-07-13 16:13     ` Johannes Thumshirn
2020-07-13 21:01   ` kernel test robot
2020-07-14 11:20     ` David Sterba
2020-07-14 11:23       ` 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=20200713145809.GL3703@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=johannes.thumshirn@wdc.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox