All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/01] staging: gasket: Fix incongruency in handling of sysfs entries creation
@ 2020-03-29 21:59 Luís Mendes
  2020-04-02 10:42 ` Dan Carpenter
  0 siblings, 1 reply; 6+ messages in thread
From: Luís Mendes @ 2020-03-29 21:59 UTC (permalink / raw)
  To: Rob Springer, Todd Poynor, Ben Chan, Greg Kroah-Hartman, devel

Fix incongruency in handling of sysfs entries creation.
This issue could cause invalid memory accesses, by not properly
detecting the end of the sysfs attributes array.

Signed-off-by: Luis Mendes <luis.p.mendes@gmail.com>
---

 gasket_sysfs.c |    3 +--
 gasket_sysfs.h |    4 ----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff -uprN -X linux-5.6-rc7-vanilla/Documentation/dontdiff
linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.c
linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.c
--- linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.c
2020-03-23 01:31:56.000000000 +0000
+++ linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.c    2020-03-29
18:52:39.399925886 +0100
@@ -228,8 +228,7 @@ int gasket_sysfs_create_entries(struct d
     }

     mutex_lock(&mapping->mutex);
-    for (i = 0; strcmp(attrs[i].attr.attr.name, GASKET_ARRAY_END_MARKER);
-        i++) {
+    for (i = 0; attrs[i].attr.attr.name != NULL; i++) {
         if (mapping->attribute_count == GASKET_SYSFS_MAX_NODES) {
             dev_err(device,
                 "Maximum number of sysfs nodes reached for device\n");
diff -uprN -X linux-5.6-rc7-vanilla/Documentation/dontdiff
linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.h
linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.h
--- linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.h
2020-03-23 01:31:56.000000000 +0000
+++ linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.h    2020-03-29
18:52:56.487839090 +0100
@@ -30,10 +30,6 @@
  */
 #define GASKET_SYSFS_MAX_NODES 196

-/* End markers for sysfs struct arrays. */
-#define GASKET_ARRAY_END_TOKEN GASKET_RESERVED_ARRAY_END
-#define GASKET_ARRAY_END_MARKER __stringify(GASKET_ARRAY_END_TOKEN)
-
 /*
  * Terminator struct for a gasket_sysfs_attr array. Must be at the end of
  * all gasket_sysfs_attribute arrays.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 01/01] staging: gasket: Fix incongruency in handling of sysfs entries creation
  2020-03-29 21:59 [PATCH 01/01] staging: gasket: Fix incongruency in handling of sysfs entries creation Luís Mendes
@ 2020-04-02 10:42 ` Dan Carpenter
  2020-04-02 14:22   ` Luís Mendes
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2020-04-02 10:42 UTC (permalink / raw)
  To: Luís Mendes, Wentao Cai
  Cc: devel, Greg Kroah-Hartman, Todd Poynor, Rob Springer

On Sun, Mar 29, 2020 at 10:59:21PM +0100, Luís Mendes wrote:
> Fix incongruency in handling of sysfs entries creation.
> This issue could cause invalid memory accesses, by not properly
> detecting the end of the sysfs attributes array.
>

Please add a Fixes tag.

Fixes: 84c45d5f3bf1 ("staging: gasket: Replace macro __ATTR with __ATTR_NULL")

That patch was never sent to the proper mailing list for review.

Anyway, Luis, you will need to resend because your patch doesn't apply.
Please read the first paragraphs of Documentation/process/email-clients.rst

regards,
dan carpenter


_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 01/01] staging: gasket: Fix incongruency in handling of sysfs entries creation
  2020-04-02 10:42 ` Dan Carpenter
@ 2020-04-02 14:22   ` Luís Mendes
  2020-04-03  9:06     ` Dan Carpenter
  0 siblings, 1 reply; 6+ messages in thread
From: Luís Mendes @ 2020-04-02 14:22 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: devel, Greg Kroah-Hartman, Wentao Cai, Rob Springer, Todd Poynor

Hi Dan,

Ah sorry, ok, I will re-send the patch using git.
Can you please tell me which is the correct mailing list to where this
patch should be submitted?

Thanks,
Luís

On Thu, Apr 2, 2020 at 11:42 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> On Sun, Mar 29, 2020 at 10:59:21PM +0100, Luís Mendes wrote:
> > Fix incongruency in handling of sysfs entries creation.
> > This issue could cause invalid memory accesses, by not properly
> > detecting the end of the sysfs attributes array.
> >
>
> Please add a Fixes tag.
>
> Fixes: 84c45d5f3bf1 ("staging: gasket: Replace macro __ATTR with __ATTR_NULL")
>
> That patch was never sent to the proper mailing list for review.
>
> Anyway, Luis, you will need to resend because your patch doesn't apply.
> Please read the first paragraphs of Documentation/process/email-clients.rst
>
> regards,
> dan carpenter
>
>
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 01/01] staging: gasket: Fix incongruency in handling of sysfs entries creation
  2020-04-02 14:22   ` Luís Mendes
@ 2020-04-03  9:06     ` Dan Carpenter
  2020-04-03 15:15       ` Luis Mendes
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2020-04-03  9:06 UTC (permalink / raw)
  To: Luís Mendes
  Cc: devel, Greg Kroah-Hartman, Todd Poynor, Wentao Cai, Rob Springer

On Thu, Apr 02, 2020 at 03:22:33PM +0100, Luís Mendes wrote:
> Hi Dan,
> 
> Ah sorry, ok, I will re-send the patch using git.
> Can you please tell me which is the correct mailing list to where this
> patch should be submitted?
> 

You had the CC correct, but always CC the person responsible for
original patch which introduced the problem so that they can review it.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 01/01] staging: gasket: Fix incongruency in handling of sysfs entries creation
  2020-04-03  9:06     ` Dan Carpenter
@ 2020-04-03 15:15       ` Luis Mendes
  0 siblings, 0 replies; 6+ messages in thread
From: Luis Mendes @ 2020-04-03 15:15 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: devel, Luis Mendes, Greg Kroah-Hartman, Wentao Cai, Rob Springer,
	Todd Poynor

Fix incongruency in handling of sysfs entries creation.
This issue could cause invalid memory accesses, by not properly
detecting the end of the sysfs attributes array. 

Fixes: 84c45d5f3bf1 ("staging: gasket: Replace macro __ATTR with __ATTR_NULL")

Signed-off-by: Luis Mendes <luis.p.mendes@gmail.com>
---

 gasket_sysfs.c |    3 +--
 gasket_sysfs.h |    4 ----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff -uprN -X linux-5.6-rc7-vanilla/Documentation/dontdiff linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.c linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.c
--- linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.c	2020-03-23 01:31:56.000000000 +0000
+++ linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.c	2020-03-29 18:52:39.399925886 +0100
@@ -228,8 +228,7 @@ int gasket_sysfs_create_entries(struct d
 	}
 
 	mutex_lock(&mapping->mutex);
-	for (i = 0; strcmp(attrs[i].attr.attr.name, GASKET_ARRAY_END_MARKER);
-		i++) {
+	for (i = 0; attrs[i].attr.attr.name != NULL; i++) {
 		if (mapping->attribute_count == GASKET_SYSFS_MAX_NODES) {
 			dev_err(device,
 				"Maximum number of sysfs nodes reached for device\n");
diff -uprN -X linux-5.6-rc7-vanilla/Documentation/dontdiff linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.h linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.h
--- linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.h	2020-03-23 01:31:56.000000000 +0000
+++ linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.h	2020-03-29 18:52:56.487839090 +0100
@@ -30,10 +30,6 @@
  */
 #define GASKET_SYSFS_MAX_NODES 196
 
-/* End markers for sysfs struct arrays. */
-#define GASKET_ARRAY_END_TOKEN GASKET_RESERVED_ARRAY_END
-#define GASKET_ARRAY_END_MARKER __stringify(GASKET_ARRAY_END_TOKEN)
-
 /*
  * Terminator struct for a gasket_sysfs_attr array. Must be at the end of
  * all gasket_sysfs_attribute arrays.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 01/01] staging: gasket: Fix incongruency in handling of sysfs entries creation
       [not found] <[PATCH 01/01] staging: gasket: Fix incongruency in handling of sysfs entries creation>
@ 2020-04-03 15:00 ` Luis Mendes
  0 siblings, 0 replies; 6+ messages in thread
From: Luis Mendes @ 2020-04-03 15:00 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: devel, Luis Mendes, Greg Kroah-Hartman, Wentao Cai, Rob Springer,
	Todd Poynor

Fix incongruency in handling of sysfs entries creation.
This issue could cause invalid memory accesses, by not properly
detecting the end of the sysfs attributes array. 

Fixes: 84c45d5f3bf1 ("staging: gasket: Replace macro __ATTR with __ATTR_NULL")

Signed-off-by: Luis Mendes <luis.p.mendes@gmail.com>
---

 gasket_sysfs.c |    3 +--
 gasket_sysfs.h |    4 ----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff -uprN -X linux-5.6-rc7-vanilla/Documentation/dontdiff linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.c linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.c
--- linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.c	2020-03-23 01:31:56.000000000 +0000
+++ linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.c	2020-03-29 18:52:39.399925886 +0100
@@ -228,8 +228,7 @@ int gasket_sysfs_create_entries(struct d
 	}
 
 	mutex_lock(&mapping->mutex);
-	for (i = 0; strcmp(attrs[i].attr.attr.name, GASKET_ARRAY_END_MARKER);
-		i++) {
+	for (i = 0; attrs[i].attr.attr.name != NULL; i++) {
 		if (mapping->attribute_count == GASKET_SYSFS_MAX_NODES) {
 			dev_err(device,
 				"Maximum number of sysfs nodes reached for device\n");
diff -uprN -X linux-5.6-rc7-vanilla/Documentation/dontdiff linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.h linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.h
--- linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.h	2020-03-23 01:31:56.000000000 +0000
+++ linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.h	2020-03-29 18:52:56.487839090 +0100
@@ -30,10 +30,6 @@
  */
 #define GASKET_SYSFS_MAX_NODES 196
 
-/* End markers for sysfs struct arrays. */
-#define GASKET_ARRAY_END_TOKEN GASKET_RESERVED_ARRAY_END
-#define GASKET_ARRAY_END_MARKER __stringify(GASKET_ARRAY_END_TOKEN)
-
 /*
  * Terminator struct for a gasket_sysfs_attr array. Must be at the end of
  * all gasket_sysfs_attribute arrays.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2020-04-03 15:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-29 21:59 [PATCH 01/01] staging: gasket: Fix incongruency in handling of sysfs entries creation Luís Mendes
2020-04-02 10:42 ` Dan Carpenter
2020-04-02 14:22   ` Luís Mendes
2020-04-03  9:06     ` Dan Carpenter
2020-04-03 15:15       ` Luis Mendes
     [not found] <[PATCH 01/01] staging: gasket: Fix incongruency in handling of sysfs entries creation>
2020-04-03 15:00 ` Luis Mendes

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.