All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: "Luís Henriques" <lhenriques@suse.de>
Cc: Xiubo Li <xiubli@redhat.com>, Ilya Dryomov <idryomov@gmail.com>,
	ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] ceph: minor fixes and encrypted snapshot names
Date: Fri, 04 Mar 2022 13:30:50 -0500	[thread overview]
Message-ID: <e7f91d0be0f41320e5a4f38ded1bde166626a17f.camel@kernel.org> (raw)
In-Reply-To: <87fsnx4rb3.fsf@brahms.olymp>

On Fri, 2022-03-04 at 16:26 +0000, Luís Henriques wrote:
> Luís Henriques <lhenriques@suse.de> writes:
> 
> > Hi!
> > 
> > I'm sending another iteration of the encrypted snapshot names patch.  This
> > patch assumes PR#45224 [1] to be merged as it adds support for the
> > alternate names.
> > 
> > Two notes:
> > 
> > 1. Patch 0001 is just a small fix from another fscrypt patch.  It's
> >    probably better to simply squash it.
> > 
> > 2. I'm not sure how easy it is to hit the UAF fixed by patch 0002.  I can
> >    reproduce it easily by commenting the code that adds the
> >    DCACHE_NOKEY_NAME flag in patch 0003.
> 
> Obviously, immediately after sending this patchset I realized I failed to
> mention a very (*VERY*) important note:
> 
> Snapshot names can not start with a '_'.  I think the reason is related
> with the 'long snapshot names', but I can't really remember the details
> anymore.  The point is that an encrypted snapshot name base64-encoded
> *may* end-up starting with an '_' as we're using the base64-url variant.
> 
> I really don't know if it's possible to fix that.  I guess that in that
> case the user will get an error and fail to create the snapshot but he'll
> be clueless because the reason.  Probably a warning can be added to the
> kernel logs, but maybe there are other ideas.
> 


Ouch. Is that imposed by the MDS? It'd be best if we could remove that
limitation from it altogether if we can.

If we can't, then we might be able to get away with prepending all the
encrypted names with some legal characte. Then when we go to decrypt it
we just strip that off.

We could also consider changing the base64 routine to use something else
in lieu of '_' but that's more of a hassle.
-- 
Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2022-03-04 18:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04 16:14 [PATCH 0/3] ceph: minor fixes and encrypted snapshot names Luís Henriques
2022-03-04 16:14 ` [PATCH 1/3] ceph: fix error path in ceph_readdir() Luís Henriques
2022-03-04 18:17   ` Jeff Layton
2022-03-05 14:30     ` Luís Henriques
2022-03-04 16:14 ` [PATCH 2/3] ceph: fix use-after-free in ceph_readdir Luís Henriques
2022-03-04 18:20   ` Jeff Layton
2022-03-05 12:43     ` Xiubo Li
2022-03-05 14:32       ` Luís Henriques
2022-03-04 16:14 ` [PATCH 3/3] ceph: add support for encrypted snapshot names Luís Henriques
2022-03-04 18:25   ` Jeff Layton
2022-03-05 14:34     ` Luís Henriques
2022-03-05 12:43   ` Xiubo Li
2022-03-04 16:26 ` [PATCH 0/3] ceph: minor fixes and " Luís Henriques
2022-03-04 18:30   ` Jeff Layton [this message]
2022-03-05 14:56     ` Luís Henriques
2022-03-07  0:49       ` Xiubo Li
2022-03-07 14:20         ` Luís Henriques

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=e7f91d0be0f41320e5a4f38ded1bde166626a17f.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=lhenriques@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiubli@redhat.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.