From: Jiri Pirko <jiri@resnulli.us>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: netdev@vger.kernel.org, jiri@nvidia.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com
Subject: Re: [PATCH net] net: devlink: fix UAF in devlink_compat_running_version()
Date: Mon, 28 Nov 2022 11:01:45 +0100 [thread overview]
Message-ID: <Y4SHCVw80UyB5irX@nanopsycho> (raw)
In-Reply-To: <20221122121048.776643-1-yangyingliang@huawei.com>
Tue, Nov 22, 2022 at 01:10:48PM CET, yangyingliang@huawei.com wrote:
[...]
>
>Fixes: a62fdbbe9403 ("netdevsim: implement ndo_get_devlink_port")
>Reported-by: Zhengchao Shao <shaozhengchao@huawei.com>
>Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>---
> net/core/devlink.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/net/core/devlink.c b/net/core/devlink.c
>index 89baa7c0938b..6453ac0558fb 100644
>--- a/net/core/devlink.c
>+++ b/net/core/devlink.c
>@@ -250,6 +250,9 @@ void devlink_put(struct devlink *devlink)
>
> struct devlink *__must_check devlink_try_get(struct devlink *devlink)
> {
>+ if (!xa_get_mark(&devlinks, devlink->index, DEVLINK_REGISTERED))
^
You have an extra space here. Checkpatch would warn you.
>+ return NULL;
>+
> if (refcount_inc_not_zero(&devlink->refcount))
> return devlink;
> return NULL;
>--
>2.25.1
>
prev parent reply other threads:[~2022-11-28 10:02 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 12:10 [PATCH net] net: devlink: fix UAF in devlink_compat_running_version() Yang Yingliang
2022-11-22 14:32 ` Leon Romanovsky
2022-11-22 15:25 ` Yang Yingliang
2022-11-22 19:04 ` Leon Romanovsky
2022-11-22 20:27 ` Jakub Kicinski
2022-11-23 1:50 ` Yang Yingliang
2022-11-23 6:40 ` Yang Yingliang
2022-11-23 7:41 ` Leon Romanovsky
2022-11-23 8:34 ` Yang Yingliang
2022-11-23 9:33 ` Leon Romanovsky
2022-11-23 19:18 ` Ido Schimmel
2022-11-24 2:18 ` Jakub Kicinski
2022-11-24 5:56 ` Leon Romanovsky
2022-11-28 9:20 ` Ido Schimmel
2022-11-28 9:58 ` Jiri Pirko
2022-11-28 11:50 ` Leon Romanovsky
2022-11-28 13:52 ` Jiri Pirko
2022-11-29 8:44 ` Leon Romanovsky
2022-11-29 9:05 ` Jiri Pirko
2022-11-29 11:20 ` Leon Romanovsky
2022-11-29 11:44 ` Jiri Pirko
2022-11-28 18:20 ` Jakub Kicinski
2022-11-29 8:31 ` Jiri Pirko
2022-11-30 2:18 ` Jakub Kicinski
2022-11-30 8:54 ` Leon Romanovsky
2022-11-30 11:32 ` Jiri Pirko
2022-11-30 16:36 ` Jakub Kicinski
2022-11-30 11:42 ` Jiri Pirko
2022-11-30 16:46 ` Jakub Kicinski
2022-11-30 17:00 ` Jiri Pirko
2022-11-30 17:20 ` Jakub Kicinski
2022-11-30 19:20 ` Leon Romanovsky
2022-12-01 8:40 ` Jiri Pirko
2022-12-01 10:05 ` Leon Romanovsky
2022-12-01 12:20 ` Jiri Pirko
2022-12-01 8:39 ` Jiri Pirko
2022-11-30 22:25 ` Jacob Keller
2022-11-24 2:20 ` Jakub Kicinski
2022-11-24 2:47 ` Jakub Kicinski
2022-11-24 7:28 ` Yang Yingliang
2022-11-28 10:01 ` Jiri Pirko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y4SHCVw80UyB5irX@nanopsycho \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=yangyingliang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.