public inbox for kernel-tls-handshake@lists.linux.dev
 help / color / mirror / Atom feed
From: Ken Milmore <ken.milmore@gmail.com>
To: Chuck Lever <chuck.lever@oracle.com>,
	kernel-tls-handshake@lists.linux.dev
Subject: Re: [PATCH 1/7] tlshd_handshake_parms: Dispense with unnecessary dynamic storage for peerids.
Date: Sun, 8 Jun 2025 20:08:40 +0100	[thread overview]
Message-ID: <004e428f-0f19-4afa-b286-c62ff3492a71@gmail.com> (raw)
In-Reply-To: <9f57e091-8e21-4ab3-981d-962a3d738e10@oracle.com>



On 08/06/2025 19:03, Chuck Lever wrote:
> On 6/8/25 1:42 PM, Ken Milmore wrote:
> 
> Needs a patch description. Why is this change necessary?
> 

I find the varied allocation policies used for members of tlshd_handshake_parms a bit sloppy:

- Some of the members are pointers to static singleton buffers outside the struct (peername, peeraddr).
- Then we have remote_peerid, which is an in-struct array of of key_serial_t, size 10.
- Then we have peerids, which is a dynamically-allocated array of key_serial_t, maximum runtime length 1!

This inconsistency has no obvious rationale, is very confusing to newcomers (me!) and is a banana skin for anyone 
attempting to audit the code. This seemed like a bit of low-hanging fruit to tidy up.


  reply	other threads:[~2025-06-08 19:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-08 17:42 [PATCH 1/7] tlshd_handshake_parms: Dispense with unnecessary dynamic storage for peerids Ken Milmore
2025-06-08 18:03 ` Chuck Lever
2025-06-08 19:08   ` Ken Milmore [this message]
2025-06-09 16:08     ` Chuck Lever
2025-06-13 21:42 ` Chuck Lever
2025-06-13 23:09   ` Ken Milmore
2025-06-14  0:40     ` Chuck Lever
2025-06-14  2:03       ` Ken Milmore
2025-06-18 13:42   ` Chuck Lever
2025-06-18 15:03     ` Ken Milmore
2025-06-18 16:00       ` Chuck Lever

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=004e428f-0f19-4afa-b286-c62ff3492a71@gmail.com \
    --to=ken.milmore@gmail.com \
    --cc=chuck.lever@oracle.com \
    --cc=kernel-tls-handshake@lists.linux.dev \
    /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