All of lore.kernel.org
 help / color / mirror / Atom feed
From: Justin Iurman <justin.iurman@uliege.be>
To: dan.carpenter@oracle.com
Cc: kbuild@lists.01.org, justin.iurman@uliege.be,
	netdev@vger.kernel.org, lkp@intel.com, kbuild-all@lists.01.org,
	davem@davemloft.net
Subject: [PATCH net-next] Fix unchecked dereference
Date: Fri, 26 Jun 2020 10:54:35 +0200	[thread overview]
Message-ID: <20200626085435.6627-1-justin.iurman@uliege.be> (raw)
In-Reply-To: <20200625105237.GC2549@kadam>

If rhashtable_remove_fast returns an error, a rollback is applied. In
that case, an unchecked dereference has been fixed.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Justin Iurman <justin.iurman@uliege.be>
---
 net/ipv6/ioam6.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/ioam6.c b/net/ipv6/ioam6.c
index e414e915bf1e..f1347940245e 100644
--- a/net/ipv6/ioam6.c
+++ b/net/ipv6/ioam6.c
@@ -161,7 +161,8 @@ static int ioam6_genl_delns(struct sk_buff *skb, struct genl_info *info)
 	err = rhashtable_remove_fast(&nsdata->namespaces, &ns->head,
 				     rht_ns_params);
 	if (err) {
-		ns->schema->ns = ns;
+		if (ns->schema)
+			ns->schema->ns = ns;
 		goto out_unlock;
 	}
 
@@ -355,7 +356,8 @@ static int ioam6_genl_delsc(struct sk_buff *skb, struct genl_info *info)
 	err = rhashtable_remove_fast(&nsdata->schemas, &sc->head,
 				     rht_sc_params);
 	if (err) {
-		sc->ns->schema = sc;
+		if (sc->ns)
+			sc->ns->schema = sc;
 		goto out_unlock;
 	}
 
-- 
2.17.1


  reply	other threads:[~2020-06-26  8:55 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24 19:23 [PATCH net-next 0/5] Data plane support for IOAM Pre-allocated Trace with IPv6 Justin Iurman
2020-06-24 19:23 ` [PATCH net-next 1/5] ipv6: eh: Introduce removable TLVs Justin Iurman
2020-06-24 20:32   ` Tom Herbert
2020-06-25 17:47     ` Justin Iurman
2020-06-25 20:53       ` Tom Herbert
2020-06-26  8:22         ` Justin Iurman
2020-06-26 15:39           ` Tom Herbert
2020-06-26 17:14             ` Justin Iurman
2020-06-26 18:35               ` Tom Herbert
2020-06-24 19:23 ` [PATCH net-next 2/5] ipv6: IOAM tunnel decapsulation Justin Iurman
2020-06-25  2:32   ` Tom Herbert
2020-06-25 17:56     ` Justin Iurman
2020-06-26  0:48       ` Tom Herbert
2020-06-26  8:31         ` Justin Iurman
2020-06-26 15:52           ` Tom Herbert
2020-06-24 19:23 ` [PATCH net-next 3/5] ipv6: ioam: Data plane support for Pre-allocated Trace Justin Iurman
2020-06-24 21:37   ` kernel test robot
2020-06-24 21:37     ` kernel test robot
2020-06-24 23:11   ` kernel test robot
2020-06-24 23:11     ` kernel test robot
2020-06-24 23:11   ` [RFC PATCH] ipv6: ioam: ioam6_fill_trace_data_node() can be static kernel test robot
2020-06-24 23:11     ` kernel test robot
2020-06-25  2:42   ` [PATCH net-next 3/5] ipv6: ioam: Data plane support for Pre-allocated Trace Tom Herbert
2020-06-25 14:29   ` Tom Herbert
2020-06-25 18:23     ` Justin Iurman
2020-06-25 20:32       ` Tom Herbert
2020-06-26  8:13         ` Justin Iurman
2020-06-26 14:53           ` Tom Herbert
2020-06-24 19:23 ` [PATCH net-next 4/5] ipv6: ioam: Generic Netlink to configure IOAM Justin Iurman
2020-06-25 10:52   ` Dan Carpenter
2020-06-25 10:52     ` Dan Carpenter
2020-06-25 10:52     ` Dan Carpenter
2020-06-26  8:54     ` Justin Iurman [this message]
2020-06-26 16:01       ` [PATCH net-next] Fix unchecked dereference Jakub Kicinski
2020-06-26 16:01         ` Jakub Kicinski
2020-06-26 17:23         ` Justin Iurman
2020-06-27  4:04           ` Jakub Kicinski
2020-06-27  4:04             ` Jakub Kicinski
2020-06-24 19:23 ` [PATCH net-next 5/5] ipv6: ioam: Documentation for new IOAM sysctls Justin Iurman
2020-06-25  2:53   ` Tom Herbert
2020-06-25 18:00     ` Justin Iurman

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=20200626085435.6627-1-justin.iurman@uliege.be \
    --to=justin.iurman@uliege.be \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=lkp@intel.com \
    --cc=netdev@vger.kernel.org \
    /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.