Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1331595 > unrolled thread
| Started by | Steve French <smfrench@gmail.com> |
|---|---|
| First post | 2016-02-11 01:20 +0100 |
| Last post | 2016-02-11 01:20 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] cifs: fix potential overflow in cifs_compose_mount_options Steve French <smfrench@gmail.com> - 2016-02-11 01:20 +0100
| From | Steve French <smfrench@gmail.com> |
|---|---|
| Date | 2016-02-11 01:20 +0100 |
| Subject | Re: [PATCH] cifs: fix potential overflow in cifs_compose_mount_options |
| Message-ID | <r0N9f-13L-1@gated-at.bofh.it> |
On Mon, Feb 1, 2016 at 10:34 AM, Insu Yun <wuninsu@gmail.com> wrote:
> In worst case, "ip=" + sb_mountdata + ipv6 can be copied into mountdata.
> Therefore, for safe, it is better to add more size when allocating memory.
>
> Signed-off-by: Insu Yun <wuninsu@gmail.com>
> ---
> fs/cifs/cifs_dfs_ref.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
> index 7dc886c..e956cba 100644
> --- a/fs/cifs/cifs_dfs_ref.c
> +++ b/fs/cifs/cifs_dfs_ref.c
> @@ -175,7 +175,7 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
> * string to the length of the original string to allow for worst case.
> */
> md_len = strlen(sb_mountdata) + INET6_ADDRSTRLEN;
> - mountdata = kzalloc(md_len + 1, GFP_KERNEL);
> + mountdata = kzalloc(md_len + sizeof("ip=") + 1, GFP_KERNEL);
> if (mountdata == NULL) {
> rc = -ENOMEM;
> goto compose_mount_options_err;
Not likely to be reproducible in practice (since ip= is already in the
sb_mountdata) but in case mount.cifs was missing and ip= was missing from
the original mount string, might as well add it.
Merged into cifs-2.6.git
--
Thanks,
Steve
Back to top | Article view | linux.kernel
csiph-web