Re: [PATCH v3 1/2] init/do_mounts.c: ignore final \n inname_to_dev_t

From: Andrew Morton
Date: Thu Oct 03 2013 - 17:15:30 EST


On Thu, 3 Oct 2013 14:10:37 -0700 Sebastian Capella <sebastian.capella@xxxxxxxxxx> wrote:

> Enhance name_to_dev_t to handle trailing newline characters
> on device paths. Some inputs to name_to_dev_t may come from
> userspace where oftentimes a '\n' is appended to the path.
> Added const to the name buffer in both the function
> declaration and the prototype to reflect input buffer
> handling.
>
> By handling trailing newlines in name_to_dev_t, userspace
> buffers may be directly passed to name_to_dev_t without
> modification.

We have lib/string.c:strim() - perhaps this patch would be
neater if it were to use it?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/