All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namjae Jeon <linkinjeon@kernel.org>
To: Hyunchul Lee <hyc.lee@gmail.com>
Cc: linux-cifs@vger.kernel.org,
	Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	Ralph Boehme <slow@samba.org>, Steve French <smfrench@gmail.com>
Subject: Re: [PATCH v4] ksmbd: use LOOKUP_BENEATH to prevent the out of share access
Date: Sat, 25 Sep 2021 09:43:39 +0900	[thread overview]
Message-ID: <CAKYAXd-XqKdgYSsQKJmDDjUyzqQcGfSjd5uJth3mnsRkAWjOjw@mail.gmail.com> (raw)
In-Reply-To: <20210924150616.926503-1-hyc.lee@gmail.com>

2021-09-25 0:06 GMT+09:00, Hyunchul Lee <hyc.lee@gmail.com>:
> instead of removing '..' in a given path, call
> kern_path with LOOKUP_BENEATH flag to prevent
> the out of share access.
>
> ran various test on this:
> smb2-cat-async smb://127.0.0.1/homes/../out_of_share
> smb2-cat-async smb://127.0.0.1/homes/foo/../../out_of_share
> smbclient //127.0.0.1/homes -c "mkdir ../foo2"
> smbclient //127.0.0.1/homes -c "rename bar ../bar"
>
> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
> Cc: Ralph Boehme <slow@samba.org>
> Cc: Steve French <smfrench@gmail.com>
> Cc: Namjae Jeon <linkinjeon@kernel.org>
> Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Looks good to me!
Acked-by: Namjae Jeon <linkinjeon@kernel.org>

Thanks!

  parent reply	other threads:[~2021-09-25  0:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24 15:06 [PATCH v4] ksmbd: use LOOKUP_BENEATH to prevent the out of share access Hyunchul Lee
2021-09-24 17:20 ` Jeremy Allison
2021-09-25  0:08   ` Namjae Jeon
2021-09-25  0:21     ` Namjae Jeon
2021-09-25  0:43 ` Namjae Jeon [this message]
2021-09-25 17:45   ` Steve French
2021-09-28 15:18 ` Tom Talpey
2021-09-29 12:40   ` Namjae Jeon
2021-09-29 15:01     ` Tom Talpey
2021-09-29 23:52       ` Namjae Jeon
2021-09-30  0:01   ` Hyunchul Lee

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=CAKYAXd-XqKdgYSsQKJmDDjUyzqQcGfSjd5uJth3mnsRkAWjOjw@mail.gmail.com \
    --to=linkinjeon@kernel.org \
    --cc=hyc.lee@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=slow@samba.org \
    --cc=smfrench@gmail.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.