Message ID | 20190529013320.GA3307@zhanggen-UX430UQ (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Mike Snitzer |
Headers | show |
Series | dm-init: fix 2 incorrect use of kstrndup() | expand |
On 5/28/19 6:33 PM, Gen Zhang wrote: > In drivers/md/dm-init.c, kstrndup() is incorrectly used twice. > > It should be: char *kstrndup(const char *s, size_t max, gfp_t gfp); Should the following be added to this patch? Fixes: 6bbc923dfcf5 ("dm: add support to directly boot to a mapped device") # v5.1. Cc: stable Thanks, Bart. -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
On Wed, May 29, 2019 at 05:23:53AM -0700, Bart Van Assche wrote: > On 5/28/19 6:33 PM, Gen Zhang wrote: > > In drivers/md/dm-init.c, kstrndup() is incorrectly used twice. > > > > It should be: char *kstrndup(const char *s, size_t max, gfp_t gfp); > > Should the following be added to this patch? > > Fixes: 6bbc923dfcf5 ("dm: add support to directly boot to a mapped > device") # v5.1. > Cc: stable > > Thanks, > > Bart. Personally, I am not quite sure about this question, because I am not the maintainer of this part. Thanks Gen -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
On Wed, May 29 2019 at 11:24am -0400, Gen Zhang <blackgod016574@gmail.com> wrote: > On Wed, May 29, 2019 at 05:23:53AM -0700, Bart Van Assche wrote: > > On 5/28/19 6:33 PM, Gen Zhang wrote: > > > In drivers/md/dm-init.c, kstrndup() is incorrectly used twice. > > > > > > It should be: char *kstrndup(const char *s, size_t max, gfp_t gfp); > > > > Should the following be added to this patch? > > > > Fixes: 6bbc923dfcf5 ("dm: add support to directly boot to a mapped > > device") # v5.1. > > Cc: stable > > > > Thanks, > > > > Bart. > Personally, I am not quite sure about this question, because I am not > the maintainer of this part. Yes, it should have the tags Bart suggested. I'll take care it. Thanks, Mike -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
> Yes, it should have the tags Bart suggested. > > I'll take care it. > > Thanks, > Mike Thanks for your reply, and please keep me informed if it is applied. Thanks Gen -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
On Thu, May 30, 2019 at 12:11:03PM -0400, Mike Snitzer wrote: > On Wed, May 29 2019 at 11:24am -0400, > Gen Zhang <blackgod016574@gmail.com> wrote: > > > On Wed, May 29, 2019 at 05:23:53AM -0700, Bart Van Assche wrote: > > > On 5/28/19 6:33 PM, Gen Zhang wrote: > > > > In drivers/md/dm-init.c, kstrndup() is incorrectly used twice. > > > > > > > > It should be: char *kstrndup(const char *s, size_t max, gfp_t gfp); > > > > > > Should the following be added to this patch? > > > > > > Fixes: 6bbc923dfcf5 ("dm: add support to directly boot to a mapped > > > device") # v5.1. > > > Cc: stable > > > > > > Thanks, > > > > > > Bart. > > Personally, I am not quite sure about this question, because I am not > > the maintainer of this part. > > Yes, it should have the tags Bart suggested. > > I'll take care it. > > Thanks, > Mike Hi, Is there any updates about this patch? I want to check if it is apllied beacause I have to write it down in my paper and the deadline is close. Thanks Gen -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
On Thu, Jun 06, 2019 at 05:27:25PM +0800, Gen Zhang wrote: > On Thu, May 30, 2019 at 12:11:03PM -0400, Mike Snitzer wrote: > > On Wed, May 29 2019 at 11:24am -0400, > > Gen Zhang <blackgod016574@gmail.com> wrote: > > > > > On Wed, May 29, 2019 at 05:23:53AM -0700, Bart Van Assche wrote: > > > > On 5/28/19 6:33 PM, Gen Zhang wrote: > > > > > In drivers/md/dm-init.c, kstrndup() is incorrectly used twice. > > > > > > > > > > It should be: char *kstrndup(const char *s, size_t max, gfp_t gfp); > > > > > > > > Should the following be added to this patch? > > > > > > > > Fixes: 6bbc923dfcf5 ("dm: add support to directly boot to a mapped > > > > device") # v5.1. > > > > Cc: stable > > > > > > > > Thanks, > > > > > > > > Bart. > > > Personally, I am not quite sure about this question, because I am not > > > the maintainer of this part. > > > > Yes, it should have the tags Bart suggested. > > > > I'll take care it. > > > > Thanks, > > Mike > Hi, > Is there any updates about this patch? I want to check if it is apllied > beacause I have to write it down in my paper and the deadline is close. > > Thanks > Gen Could anyone look into this patch? It's not updated for about 20 days. And I am really on a deadline to get this patch applied. Thanks Gen -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
diff --git a/drivers/md/dm-init.c b/drivers/md/dm-init.c index 352e803..526e261 100644 --- a/drivers/md/dm-init.c +++ b/drivers/md/dm-init.c @@ -140,8 +140,8 @@ static char __init *dm_parse_table_entry(struct dm_device *dev, char *str) return ERR_PTR(-EINVAL); } /* target_args */ - dev->target_args_array[n] = kstrndup(field[3], GFP_KERNEL, - DM_MAX_STR_SIZE); + dev->target_args_array[n] = kstrndup(field[3], DM_MAX_STR_SIZE, + GFP_KERNEL); if (!dev->target_args_array[n]) return ERR_PTR(-ENOMEM); @@ -275,7 +275,7 @@ static int __init dm_init_init(void) DMERR("Argument is too big. Limit is %d\n", DM_MAX_STR_SIZE); return -EINVAL; } - str = kstrndup(create, GFP_KERNEL, DM_MAX_STR_SIZE); + str = kstrndup(create, DM_MAX_STR_SIZE, GFP_KERNEL); if (!str) return -ENOMEM;
In drivers/md/dm-init.c, kstrndup() is incorrectly used twice. It should be: char *kstrndup(const char *s, size_t max, gfp_t gfp); Signed-off-by: Gen Zhang <blackgod016574@gmail.com> --- --- -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel