LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] dm-init: fix 2 incorrect use of kstrndup()
@ 2019-05-29  1:33 Gen Zhang
  2019-05-29 12:23 ` [dm-devel] " Bart Van Assche
  0 siblings, 1 reply; 7+ messages in thread
From: Gen Zhang @ 2019-05-29  1:33 UTC (permalink / raw)
  To: agk, snitzer, dm-devel; +Cc: linux-kernel

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>
---
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;
 
---

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dm-devel] [PATCH] dm-init: fix 2 incorrect use of kstrndup()
  2019-05-29  1:33 [PATCH] dm-init: fix 2 incorrect use of kstrndup() Gen Zhang
@ 2019-05-29 12:23 ` Bart Van Assche
  2019-05-29 15:24   ` Gen Zhang
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Van Assche @ 2019-05-29 12:23 UTC (permalink / raw)
  To: Gen Zhang, agk, snitzer, dm-devel; +Cc: linux-kernel

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dm-devel] [PATCH] dm-init: fix 2 incorrect use of kstrndup()
  2019-05-29 12:23 ` [dm-devel] " Bart Van Assche
@ 2019-05-29 15:24   ` Gen Zhang
  2019-05-30 16:11     ` Mike Snitzer
  0 siblings, 1 reply; 7+ messages in thread
From: Gen Zhang @ 2019-05-29 15:24 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: agk, snitzer, dm-devel, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: dm-init: fix 2 incorrect use of kstrndup()
  2019-05-29 15:24   ` Gen Zhang
@ 2019-05-30 16:11     ` Mike Snitzer
  2019-05-31  0:44       ` Gen Zhang
  2019-06-06  9:27       ` Gen Zhang
  0 siblings, 2 replies; 7+ messages in thread
From: Mike Snitzer @ 2019-05-30 16:11 UTC (permalink / raw)
  To: Gen Zhang; +Cc: Bart Van Assche, dm-devel, agk, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: dm-init: fix 2 incorrect use of kstrndup()
  2019-05-30 16:11     ` Mike Snitzer
@ 2019-05-31  0:44       ` Gen Zhang
  2019-06-06  9:27       ` Gen Zhang
  1 sibling, 0 replies; 7+ messages in thread
From: Gen Zhang @ 2019-05-31  0:44 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: Bart Van Assche, dm-devel, agk, linux-kernel

> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: dm-init: fix 2 incorrect use of kstrndup()
  2019-05-30 16:11     ` Mike Snitzer
  2019-05-31  0:44       ` Gen Zhang
@ 2019-06-06  9:27       ` Gen Zhang
  2019-06-17  9:27         ` Gen Zhang
  1 sibling, 1 reply; 7+ messages in thread
From: Gen Zhang @ 2019-06-06  9:27 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: Bart Van Assche, dm-devel, agk, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: dm-init: fix 2 incorrect use of kstrndup()
  2019-06-06  9:27       ` Gen Zhang
@ 2019-06-17  9:27         ` Gen Zhang
  0 siblings, 0 replies; 7+ messages in thread
From: Gen Zhang @ 2019-06-17  9:27 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: Bart Van Assche, dm-devel, agk, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-06-17  9:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29  1:33 [PATCH] dm-init: fix 2 incorrect use of kstrndup() Gen Zhang
2019-05-29 12:23 ` [dm-devel] " Bart Van Assche
2019-05-29 15:24   ` Gen Zhang
2019-05-30 16:11     ` Mike Snitzer
2019-05-31  0:44       ` Gen Zhang
2019-06-06  9:27       ` Gen Zhang
2019-06-17  9:27         ` Gen Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).