All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ross Lagerwall <ross.lagerwall@cloud.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org,
	 Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH] livepatch-build-tools: allow patch file name sizes up to 128 characters
Date: Tue, 27 Feb 2024 13:32:05 +0000	[thread overview]
Message-ID: <CAG7k0EqfMecUGQJSqMLxmR7vOjushAYQuG-r+3eAhs4a-UhuTw@mail.gmail.com> (raw)
In-Reply-To: <20240131165816.58762-1-roger.pau@citrix.com>

On Wed, Jan 31, 2024 at 4:58 PM Roger Pau Monne <roger.pau@citrix.com> wrote:
>
> XenServer uses quite long Xen version names, and encode such in the livepatch
> filename, and it's currently running out of space in the file name.
>
> Bump max filename size to 128, so it also matches the patch name length in the
> hypervisor interface.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
>  livepatch-build | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/livepatch-build b/livepatch-build
> index cdb852cc7fea..78dd2d801048 100755
> --- a/livepatch-build
> +++ b/livepatch-build
> @@ -72,8 +72,8 @@ function make_patch_name()
>      fi
>
>      # Only allow alphanumerics and '_' and '-' in the patch name.  Everything
> -    # else is replaced with '-'.  Truncate to 48 chars.
> -    echo ${PATCHNAME//[^a-zA-Z0-9_-]/-} |cut -c 1-48
> +    # else is replaced with '-'.  Truncate to 128 chars.
> +    echo ${PATCHNAME//[^a-zA-Z0-9_-]/-} |cut -c -128
>  }

I think it should be XEN_LIVEPATCH_NAME_SIZE - 1 to match the hypervisor
since AFAICT the hypervisor expects the last character to be NUL.

In get_name(), it checks:

    if ( !name->size || name->size > XEN_LIVEPATCH_NAME_SIZE )
        return -EINVAL;

... and:

    if ( n[name->size - 1] )
        return -EINVAL;

Do you agree with that?

Ross


  reply	other threads:[~2024-02-27 13:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 16:58 [PATCH] livepatch-build-tools: allow patch file name sizes up to 128 characters Roger Pau Monne
2024-02-27 13:32 ` Ross Lagerwall [this message]
2024-02-27 16:32   ` Roger Pau Monné

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=CAG7k0EqfMecUGQJSqMLxmR7vOjushAYQuG-r+3eAhs4a-UhuTw@mail.gmail.com \
    --to=ross.lagerwall@cloud.com \
    --cc=konrad.wilk@oracle.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.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.