From: Benjamin Marzinski <bmarzins@redhat.com>
To: mwilck@suse.com
Cc: dm-devel@redhat.com, David Bond <dbond@suse.com>
Subject: Re: [PATCH 4/4] libmpathpersist: ABI change: limit data-in/out size to 8192 bytes
Date: Sat, 14 Mar 2020 19:19:35 -0500 [thread overview]
Message-ID: <20200315001935.GU30153@octiron.msp.redhat.com> (raw)
In-Reply-To: <20200306230605.3473-5-mwilck@suse.com>
On Sat, Mar 07, 2020 at 12:06:05AM +0100, mwilck@suse.com wrote:
> From: Martin Wilck <mwilck@suse.com>
>
> Make sure that data structures used for PERSISTENT RESERVE IN/OUT
> fit into 8k buffers.
>
> This patch breaks the libmpathpersist ABI.
>
I'm not super worried about this. I don't really see a way for users to
hurt themselves because of this change, without making some pretty odd
assumptions. Am I missing something?
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
> libmpathpersist/mpath_persist.h | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/libmpathpersist/mpath_persist.h b/libmpathpersist/mpath_persist.h
> index 7cf4faf9..bdf4069d 100644
> --- a/libmpathpersist/mpath_persist.h
> +++ b/libmpathpersist/mpath_persist.h
> @@ -92,7 +92,7 @@ struct prin_readdescr
> uint32_t prgeneration;
> uint32_t additional_length; /* The value should be either 0 or divisible by 8.
> 0 indicates no registered reservation key. */
> - uint8_t key_list[MPATH_MAX_PARAM_LEN];
> + uint8_t key_list[MPATH_MAX_PARAM_LEN - 2 * sizeof(uint32_t)];
> };
>
> struct prin_resvdescr
> @@ -141,7 +141,9 @@ struct print_fulldescr_list
> {
> uint32_t prgeneration;
> uint32_t number_of_descriptor;
> - uint8_t private_buffer[MPATH_MAX_PARAM_LEN]; /*Private buffer for list storage*/
> + /* Data-in; Private buffer for list storage */
> + uint8_t private_buffer[MPATH_MAX_PARAM_LEN - 2 * sizeof(uint32_t)];
> + /* array of pointers into private_buffer */
> struct prin_fulldescr *descriptors[];
> };
>
> @@ -163,8 +165,13 @@ struct prout_param_descriptor { /* PROUT parameter descriptor */
> uint8_t sa_flags;
> uint8_t _reserved;
> uint16_t _obsolete1;
> - uint8_t private_buffer[MPATH_MAX_PARAM_LEN]; /*private buffer for list storage*/
> - uint32_t num_transportid; /* Number of Transport ID listed in trnptid_list[]*/
> + /*private buffer for list storage; data-out */
> + /* 24: offsetof (struct prout_param_descriptor, private_buffer) */
> + uint8_t private_buffer[MPATH_MAX_PARAM_LEN - 24];
> + /* Internal use below here */
> + /* Number of Transport ID listed in trnptid_list[] */
> + uint32_t num_transportid;
> + /* pointers into private_buffer */
> struct transportid *trnptid_list[];
> };
>
> --
> 2.25.1
next prev parent reply other threads:[~2020-03-15 0:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 23:06 [PATCH 0/4] libmpathpersist allocation size fixes mwilck
2020-03-06 23:06 ` [PATCH 1/4] libmpathpersist: limit PRIN allocation length to 8192 bytes mwilck
2020-03-14 23:14 ` Benjamin Marzinski
2020-03-06 23:06 ` [PATCH 2/4] libmpathpersist: format_transportids(): avoid PROUT overflow mwilck
2020-03-14 23:15 ` Benjamin Marzinski
2020-03-15 0:14 ` Martin Wilck
2020-03-06 23:06 ` [PATCH 3/4] libmpathpersist: mpath_format_readfullstatus(): use real buffer size mwilck
2020-03-14 23:16 ` Benjamin Marzinski
2020-03-06 23:06 ` [PATCH 4/4] libmpathpersist: ABI change: limit data-in/out size to 8192 bytes mwilck
2020-03-15 0:19 ` Benjamin Marzinski [this message]
2020-03-15 0:27 ` Martin Wilck
2020-03-15 20:45 ` Martin Wilck
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=20200315001935.GU30153@octiron.msp.redhat.com \
--to=bmarzins@redhat.com \
--cc=dbond@suse.com \
--cc=dm-devel@redhat.com \
--cc=mwilck@suse.com \
/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.