LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] net: core: devlink.c: Hold devlink->lock from the beginning of devlink_dpipe_table_register()
@ 2020-02-21 18:09 madhuparnabhowmik10
2020-02-22 6:26 ` Jiri Pirko
0 siblings, 1 reply; 10+ messages in thread
From: madhuparnabhowmik10 @ 2020-02-21 18:09 UTC (permalink / raw)
To: jiri, davem
Cc: netdev, linux-kernel, joel, frextrite, linux-kernel-mentees,
paulmck, Madhuparna Bhowmik
From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
devlink_dpipe_table_find() should be called under either
rcu_read_lock() or devlink->lock. devlink_dpipe_table_register()
calls devlink_dpipe_table_find() without holding the lock
and acquires it later. Therefore hold the devlink->lock
from the beginning of devlink_dpipe_table_register().
Suggested-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
---
net/core/devlink.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 3e8c94155d93..d54e1f156b6f 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -6840,6 +6840,8 @@ int devlink_dpipe_table_register(struct devlink *devlink,
{
struct devlink_dpipe_table *table;
+ mutex_lock(&devlink->lock);
+
if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name))
return -EEXIST;
@@ -6855,7 +6857,6 @@ int devlink_dpipe_table_register(struct devlink *devlink,
table->priv = priv;
table->counter_control_extern = counter_control_extern;
- mutex_lock(&devlink->lock);
list_add_tail_rcu(&table->list, &devlink->dpipe_table_list);
mutex_unlock(&devlink->lock);
return 0;
--
2.17.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] net: core: devlink.c: Hold devlink->lock from the beginning of devlink_dpipe_table_register()
2020-02-21 18:09 [PATCH] net: core: devlink.c: Hold devlink->lock from the beginning of devlink_dpipe_table_register() madhuparnabhowmik10
@ 2020-02-22 6:26 ` Jiri Pirko
2020-02-22 6:55 ` Madhuparna Bhowmik
0 siblings, 1 reply; 10+ messages in thread
From: Jiri Pirko @ 2020-02-22 6:26 UTC (permalink / raw)
To: madhuparnabhowmik10
Cc: jiri, davem, netdev, linux-kernel, joel, frextrite,
linux-kernel-mentees, paulmck
Fri, Feb 21, 2020 at 07:09:43PM CET, madhuparnabhowmik10@gmail.com wrote:
>From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>
>devlink_dpipe_table_find() should be called under either
>rcu_read_lock() or devlink->lock. devlink_dpipe_table_register()
>calls devlink_dpipe_table_find() without holding the lock
>and acquires it later. Therefore hold the devlink->lock
>from the beginning of devlink_dpipe_table_register().
>
>Suggested-by: Jiri Pirko <jiri@mellanox.com>
>Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>---
> net/core/devlink.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/net/core/devlink.c b/net/core/devlink.c
>index 3e8c94155d93..d54e1f156b6f 100644
>--- a/net/core/devlink.c
>+++ b/net/core/devlink.c
>@@ -6840,6 +6840,8 @@ int devlink_dpipe_table_register(struct devlink *devlink,
> {
> struct devlink_dpipe_table *table;
>
>+ mutex_lock(&devlink->lock);
>+
> if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name))
> return -EEXIST;
You have to handle the error path.
>
>@@ -6855,7 +6857,6 @@ int devlink_dpipe_table_register(struct devlink *devlink,
> table->priv = priv;
> table->counter_control_extern = counter_control_extern;
>
>- mutex_lock(&devlink->lock);
> list_add_tail_rcu(&table->list, &devlink->dpipe_table_list);
> mutex_unlock(&devlink->lock);
> return 0;
>--
>2.17.1
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] net: core: devlink.c: Hold devlink->lock from the beginning of devlink_dpipe_table_register()
2020-02-22 6:26 ` Jiri Pirko
@ 2020-02-22 6:55 ` Madhuparna Bhowmik
0 siblings, 0 replies; 10+ messages in thread
From: Madhuparna Bhowmik @ 2020-02-22 6:55 UTC (permalink / raw)
To: Jiri Pirko
Cc: madhuparnabhowmik10, jiri, davem, netdev, linux-kernel, joel,
frextrite, linux-kernel-mentees, paulmck
On Sat, Feb 22, 2020 at 07:26:40AM +0100, Jiri Pirko wrote:
> Fri, Feb 21, 2020 at 07:09:43PM CET, madhuparnabhowmik10@gmail.com wrote:
> >From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> >
> >devlink_dpipe_table_find() should be called under either
> >rcu_read_lock() or devlink->lock. devlink_dpipe_table_register()
> >calls devlink_dpipe_table_find() without holding the lock
> >and acquires it later. Therefore hold the devlink->lock
> >from the beginning of devlink_dpipe_table_register().
> >
> >Suggested-by: Jiri Pirko <jiri@mellanox.com>
> >Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> >---
> > net/core/devlink.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> >diff --git a/net/core/devlink.c b/net/core/devlink.c
> >index 3e8c94155d93..d54e1f156b6f 100644
> >--- a/net/core/devlink.c
> >+++ b/net/core/devlink.c
> >@@ -6840,6 +6840,8 @@ int devlink_dpipe_table_register(struct devlink *devlink,
> > {
> > struct devlink_dpipe_table *table;
> >
> >+ mutex_lock(&devlink->lock);
> >+
> > if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name))
> > return -EEXIST;
>
> You have to handle the error path.
>
Sure, I have sent the updated patch.
Thank you,
Madhuparna
>
> >
> >@@ -6855,7 +6857,6 @@ int devlink_dpipe_table_register(struct devlink *devlink,
> > table->priv = priv;
> > table->counter_control_extern = counter_control_extern;
> >
> >- mutex_lock(&devlink->lock);
> > list_add_tail_rcu(&table->list, &devlink->dpipe_table_list);
> > mutex_unlock(&devlink->lock);
> > return 0;
> >--
> >2.17.1
> >
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] net: core: devlink.c: Hold devlink->lock from the beginning of devlink_dpipe_table_register()
@ 2020-02-22 6:52 madhuparnabhowmik10
2020-02-23 6:43 ` Jiri Pirko
0 siblings, 1 reply; 10+ messages in thread
From: madhuparnabhowmik10 @ 2020-02-22 6:52 UTC (permalink / raw)
To: jiri, davem
Cc: netdev, linux-kernel, joel, frextrite, linux-kernel-mentees,
paulmck, Madhuparna Bhowmik
From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
devlink_dpipe_table_find() should be called under either
rcu_read_lock() or devlink->lock. devlink_dpipe_table_register()
calls devlink_dpipe_table_find() without holding the lock
and acquires it later. Therefore hold the devlink->lock
from the beginning of devlink_dpipe_table_register().
Suggested-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
---
net/core/devlink.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 3e8c94155d93..ba9dd8cb98c3 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -6840,22 +6840,29 @@ int devlink_dpipe_table_register(struct devlink *devlink,
{
struct devlink_dpipe_table *table;
- if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name))
+ mutex_lock(&devlink->lock);
+
+ if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name)) {
+ mutex_unlock(&devlink->lock);
return -EEXIST;
+ }
- if (WARN_ON(!table_ops->size_get))
+ if (WARN_ON(!table_ops->size_get)) {
+ mutex_unlock(&devlink->lock);
return -EINVAL;
+ }
table = kzalloc(sizeof(*table), GFP_KERNEL);
- if (!table)
+ if (!table) {
+ mutex_unlock(&devlink->lock);
return -ENOMEM;
+ }
table->name = table_name;
table->table_ops = table_ops;
table->priv = priv;
table->counter_control_extern = counter_control_extern;
- mutex_lock(&devlink->lock);
list_add_tail_rcu(&table->list, &devlink->dpipe_table_list);
mutex_unlock(&devlink->lock);
return 0;
--
2.17.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] net: core: devlink.c: Hold devlink->lock from the beginning of devlink_dpipe_table_register()
2020-02-22 6:52 madhuparnabhowmik10
@ 2020-02-23 6:43 ` Jiri Pirko
2020-02-23 10:56 ` Madhuparna Bhowmik
0 siblings, 1 reply; 10+ messages in thread
From: Jiri Pirko @ 2020-02-23 6:43 UTC (permalink / raw)
To: madhuparnabhowmik10
Cc: jiri, davem, netdev, linux-kernel, joel, frextrite,
linux-kernel-mentees, paulmck
Sat, Feb 22, 2020 at 07:52:34AM CET, madhuparnabhowmik10@gmail.com wrote:
>From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>
>devlink_dpipe_table_find() should be called under either
>rcu_read_lock() or devlink->lock. devlink_dpipe_table_register()
>calls devlink_dpipe_table_find() without holding the lock
>and acquires it later. Therefore hold the devlink->lock
>from the beginning of devlink_dpipe_table_register().
>
>Suggested-by: Jiri Pirko <jiri@mellanox.com>
>Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>---
> net/core/devlink.c | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
>diff --git a/net/core/devlink.c b/net/core/devlink.c
>index 3e8c94155d93..ba9dd8cb98c3 100644
>--- a/net/core/devlink.c
>+++ b/net/core/devlink.c
>@@ -6840,22 +6840,29 @@ int devlink_dpipe_table_register(struct devlink *devlink,
> {
> struct devlink_dpipe_table *table;
>
>- if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name))
>+ mutex_lock(&devlink->lock);
>+
>+ if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name)) {
>+ mutex_unlock(&devlink->lock);
> return -EEXIST;
>+ }
>
>- if (WARN_ON(!table_ops->size_get))
>+ if (WARN_ON(!table_ops->size_get)) {
>+ mutex_unlock(&devlink->lock);
> return -EINVAL;
>+ }
>
> table = kzalloc(sizeof(*table), GFP_KERNEL);
>- if (!table)
>+ if (!table) {
>+ mutex_unlock(&devlink->lock);
Please use "goto unlock" instead of unlocking on multiple places.
> return -ENOMEM;
>+ }
>
> table->name = table_name;
> table->table_ops = table_ops;
> table->priv = priv;
> table->counter_control_extern = counter_control_extern;
>
>- mutex_lock(&devlink->lock);
> list_add_tail_rcu(&table->list, &devlink->dpipe_table_list);
> mutex_unlock(&devlink->lock);
> return 0;
>--
>2.17.1
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] net: core: devlink.c: Hold devlink->lock from the beginning of devlink_dpipe_table_register()
2020-02-23 6:43 ` Jiri Pirko
@ 2020-02-23 10:56 ` Madhuparna Bhowmik
0 siblings, 0 replies; 10+ messages in thread
From: Madhuparna Bhowmik @ 2020-02-23 10:56 UTC (permalink / raw)
To: Jiri Pirko
Cc: madhuparnabhowmik10, jiri, davem, netdev, linux-kernel, joel,
frextrite, linux-kernel-mentees, paulmck
On Sun, Feb 23, 2020 at 07:43:29AM +0100, Jiri Pirko wrote:
> Sat, Feb 22, 2020 at 07:52:34AM CET, madhuparnabhowmik10@gmail.com wrote:
> >From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> >
> >devlink_dpipe_table_find() should be called under either
> >rcu_read_lock() or devlink->lock. devlink_dpipe_table_register()
> >calls devlink_dpipe_table_find() without holding the lock
> >and acquires it later. Therefore hold the devlink->lock
> >from the beginning of devlink_dpipe_table_register().
> >
> >Suggested-by: Jiri Pirko <jiri@mellanox.com>
> >Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> >---
> > net/core/devlink.c | 15 +++++++++++----
> > 1 file changed, 11 insertions(+), 4 deletions(-)
> >
> >diff --git a/net/core/devlink.c b/net/core/devlink.c
> >index 3e8c94155d93..ba9dd8cb98c3 100644
> >--- a/net/core/devlink.c
> >+++ b/net/core/devlink.c
> >@@ -6840,22 +6840,29 @@ int devlink_dpipe_table_register(struct devlink *devlink,
> > {
> > struct devlink_dpipe_table *table;
> >
> >- if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name))
> >+ mutex_lock(&devlink->lock);
> >+
> >+ if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name)) {
> >+ mutex_unlock(&devlink->lock);
> > return -EEXIST;
> >+ }
> >
> >- if (WARN_ON(!table_ops->size_get))
> >+ if (WARN_ON(!table_ops->size_get)) {
> >+ mutex_unlock(&devlink->lock);
> > return -EINVAL;
> >+ }
> >
> > table = kzalloc(sizeof(*table), GFP_KERNEL);
> >- if (!table)
> >+ if (!table) {
> >+ mutex_unlock(&devlink->lock);
>
> Please use "goto unlock" instead of unlocking on multiple places.
>
Sure, I have sent a new patch.
Thank you,
Madhuparna
>
>
> > return -ENOMEM;
> >+ }
> >
> > table->name = table_name;
> > table->table_ops = table_ops;
> > table->priv = priv;
> > table->counter_control_extern = counter_control_extern;
> >
> >- mutex_lock(&devlink->lock);
> > list_add_tail_rcu(&table->list, &devlink->dpipe_table_list);
> > mutex_unlock(&devlink->lock);
> > return 0;
> >--
> >2.17.1
> >
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] net: core: devlink.c: Hold devlink->lock from the beginning of devlink_dpipe_table_register()
@ 2020-02-23 10:52 madhuparnabhowmik10
2020-02-23 11:01 ` Jiri Pirko
0 siblings, 1 reply; 10+ messages in thread
From: madhuparnabhowmik10 @ 2020-02-23 10:52 UTC (permalink / raw)
To: jiri, davem
Cc: netdev, linux-kernel, joel, linux-kernel-mentees, paulmck,
Madhuparna Bhowmik
From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
devlink_dpipe_table_find() should be called under either
rcu_read_lock() or devlink->lock. devlink_dpipe_table_register()
calls devlink_dpipe_table_find() without holding the lock
and acquires it later. Therefore hold the devlink->lock
from the beginning of devlink_dpipe_table_register().
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
---
net/core/devlink.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 4c63c9a4c09e..61a350f59741 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -6838,26 +6838,35 @@ int devlink_dpipe_table_register(struct devlink *devlink,
void *priv, bool counter_control_extern)
{
struct devlink_dpipe_table *table;
+ int err = 0;
- if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name))
- return -EEXIST;
+ mutex_lock(&devlink->lock);
- if (WARN_ON(!table_ops->size_get))
- return -EINVAL;
+ if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name)) {
+ err = -EEXIST;
+ goto unlock;
+ }
+
+ if (WARN_ON(!table_ops->size_get)) {
+ err = -EINVAL;
+ goto unlock;
+ }
table = kzalloc(sizeof(*table), GFP_KERNEL);
- if (!table)
- return -ENOMEM;
+ if (!table) {
+ err = -ENOMEM;
+ goto unlock;
+ }
table->name = table_name;
table->table_ops = table_ops;
table->priv = priv;
table->counter_control_extern = counter_control_extern;
- mutex_lock(&devlink->lock);
list_add_tail_rcu(&table->list, &devlink->dpipe_table_list);
+unlock:
mutex_unlock(&devlink->lock);
- return 0;
+ return err;
}
EXPORT_SYMBOL_GPL(devlink_dpipe_table_register);
--
2.17.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] net: core: devlink.c: Hold devlink->lock from the beginning of devlink_dpipe_table_register()
2020-02-23 10:52 madhuparnabhowmik10
@ 2020-02-23 11:01 ` Jiri Pirko
0 siblings, 0 replies; 10+ messages in thread
From: Jiri Pirko @ 2020-02-23 11:01 UTC (permalink / raw)
To: madhuparnabhowmik10
Cc: jiri, davem, netdev, linux-kernel, joel, linux-kernel-mentees, paulmck
Sun, Feb 23, 2020 at 11:52:53AM CET, madhuparnabhowmik10@gmail.com wrote:
>From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>
>devlink_dpipe_table_find() should be called under either
>rcu_read_lock() or devlink->lock. devlink_dpipe_table_register()
>calls devlink_dpipe_table_find() without holding the lock
>and acquires it later. Therefore hold the devlink->lock
>from the beginning of devlink_dpipe_table_register().
>
>Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>---
> net/core/devlink.c | 25 +++++++++++++++++--------
> 1 file changed, 17 insertions(+), 8 deletions(-)
>
>diff --git a/net/core/devlink.c b/net/core/devlink.c
>index 4c63c9a4c09e..61a350f59741 100644
>--- a/net/core/devlink.c
>+++ b/net/core/devlink.c
>@@ -6838,26 +6838,35 @@ int devlink_dpipe_table_register(struct devlink *devlink,
> void *priv, bool counter_control_extern)
> {
> struct devlink_dpipe_table *table;
>+ int err = 0;
>
>- if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name))
>- return -EEXIST;
>+ mutex_lock(&devlink->lock);
>
>- if (WARN_ON(!table_ops->size_get))
>- return -EINVAL;
>+ if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name)) {
>+ err = -EEXIST;
>+ goto unlock;
>+ }
>+
>+ if (WARN_ON(!table_ops->size_get)) {
>+ err = -EINVAL;
>+ goto unlock;
>+ }
Put this check out of the lock please.
>
> table = kzalloc(sizeof(*table), GFP_KERNEL);
>- if (!table)
>- return -ENOMEM;
>+ if (!table) {
>+ err = -ENOMEM;
>+ goto unlock;
>+ }
>
> table->name = table_name;
> table->table_ops = table_ops;
> table->priv = priv;
> table->counter_control_extern = counter_control_extern;
>
>- mutex_lock(&devlink->lock);
> list_add_tail_rcu(&table->list, &devlink->dpipe_table_list);
>+unlock:
> mutex_unlock(&devlink->lock);
>- return 0;
>+ return err;
> }
> EXPORT_SYMBOL_GPL(devlink_dpipe_table_register);
>
>--
>2.17.1
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] net: core: devlink.c: Hold devlink->lock from the beginning of devlink_dpipe_table_register()
@ 2020-02-23 11:22 madhuparnabhowmik10
2020-02-23 18:17 ` Jiri Pirko
0 siblings, 1 reply; 10+ messages in thread
From: madhuparnabhowmik10 @ 2020-02-23 11:22 UTC (permalink / raw)
To: jiri, davem
Cc: netdev, linux-kernel, joel, linux-kernel-mentees, paulmck,
Madhuparna Bhowmik
From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
devlink_dpipe_table_find() should be called under either
rcu_read_lock() or devlink->lock. devlink_dpipe_table_register()
calls devlink_dpipe_table_find() without holding the lock
and acquires it later. Therefore hold the devlink->lock
from the beginning of devlink_dpipe_table_register().
Suggested-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
---
net/core/devlink.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 4c63c9a4c09e..e82750bdc496 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -6838,26 +6838,33 @@ int devlink_dpipe_table_register(struct devlink *devlink,
void *priv, bool counter_control_extern)
{
struct devlink_dpipe_table *table;
-
- if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name))
- return -EEXIST;
+ int err = 0;
if (WARN_ON(!table_ops->size_get))
return -EINVAL;
+ mutex_lock(&devlink->lock);
+
+ if (devlink_dpipe_table_find(&devlink->dpipe_table_list, table_name)) {
+ err = -EEXIST;
+ goto unlock;
+ }
+
table = kzalloc(sizeof(*table), GFP_KERNEL);
- if (!table)
- return -ENOMEM;
+ if (!table) {
+ err = -ENOMEM;
+ goto unlock;
+ }
table->name = table_name;
table->table_ops = table_ops;
table->priv = priv;
table->counter_control_extern = counter_control_extern;
- mutex_lock(&devlink->lock);
list_add_tail_rcu(&table->list, &devlink->dpipe_table_list);
+unlock:
mutex_unlock(&devlink->lock);
- return 0;
+ return err;
}
EXPORT_SYMBOL_GPL(devlink_dpipe_table_register);
--
2.17.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] net: core: devlink.c: Hold devlink->lock from the beginning of devlink_dpipe_table_register()
2020-02-23 11:22 madhuparnabhowmik10
@ 2020-02-23 18:17 ` Jiri Pirko
0 siblings, 0 replies; 10+ messages in thread
From: Jiri Pirko @ 2020-02-23 18:17 UTC (permalink / raw)
To: madhuparnabhowmik10
Cc: jiri, davem, netdev, linux-kernel, joel, linux-kernel-mentees, paulmck
Sun, Feb 23, 2020 at 12:22:33PM CET, madhuparnabhowmik10@gmail.com wrote:
>From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>
>devlink_dpipe_table_find() should be called under either
>rcu_read_lock() or devlink->lock. devlink_dpipe_table_register()
>calls devlink_dpipe_table_find() without holding the lock
>and acquires it later. Therefore hold the devlink->lock
>from the beginning of devlink_dpipe_table_register().
>
>Suggested-by: Jiri Pirko <jiri@mellanox.com>
>Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2020-02-23 18:17 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-21 18:09 [PATCH] net: core: devlink.c: Hold devlink->lock from the beginning of devlink_dpipe_table_register() madhuparnabhowmik10
2020-02-22 6:26 ` Jiri Pirko
2020-02-22 6:55 ` Madhuparna Bhowmik
2020-02-22 6:52 madhuparnabhowmik10
2020-02-23 6:43 ` Jiri Pirko
2020-02-23 10:56 ` Madhuparna Bhowmik
2020-02-23 10:52 madhuparnabhowmik10
2020-02-23 11:01 ` Jiri Pirko
2020-02-23 11:22 madhuparnabhowmik10
2020-02-23 18:17 ` Jiri Pirko
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).