All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][net-next] esp6: fix incorrect null pointer check on xo
@ 2017-04-18 14:06 ` Colin King
  0 siblings, 0 replies; 6+ messages in thread
From: Colin King @ 2017-04-18 14:06 UTC (permalink / raw)
  To: David S . Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The check for xo being null is incorrect, currently it is checking
for non-null, it should be checking for null.

Detected with CoverityScan, CID#1429349 ("Dereference after null check")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/ipv6/esp6_offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
index 1cceeee7cc33..95f10728abaa 100644
--- a/net/ipv6/esp6_offload.c
+++ b/net/ipv6/esp6_offload.c
@@ -120,7 +120,7 @@ static struct sk_buff *esp6_gso_segment(struct sk_buff *skb,
 	netdev_features_t esp_features = features;
 	struct xfrm_offload *xo = xfrm_offload(skb);
 
-	if (xo)
+	if (!xo)
 		goto out;
 
 	seq = xo->seq.low;
-- 
2.11.0

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

* [PATCH][net-next] esp6: fix incorrect null pointer check on xo
@ 2017-04-18 14:06 ` Colin King
  0 siblings, 0 replies; 6+ messages in thread
From: Colin King @ 2017-04-18 14:06 UTC (permalink / raw)
  To: David S . Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The check for xo being null is incorrect, currently it is checking
for non-null, it should be checking for null.

Detected with CoverityScan, CID#1429349 ("Dereference after null check")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/ipv6/esp6_offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
index 1cceeee7cc33..95f10728abaa 100644
--- a/net/ipv6/esp6_offload.c
+++ b/net/ipv6/esp6_offload.c
@@ -120,7 +120,7 @@ static struct sk_buff *esp6_gso_segment(struct sk_buff *skb,
 	netdev_features_t esp_features = features;
 	struct xfrm_offload *xo = xfrm_offload(skb);
 
-	if (xo)
+	if (!xo)
 		goto out;
 
 	seq = xo->seq.low;
-- 
2.11.0


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

* Re: [PATCH][net-next] esp6: fix incorrect null pointer check on xo
  2017-04-18 14:06 ` Colin King
  (?)
@ 2017-04-18 17:12 ` David Miller
  2017-04-19  5:20   ` Steffen Klassert
  -1 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2017-04-18 17:12 UTC (permalink / raw)
  To: colin.king; +Cc: netdev, steffen.klassert

From: Colin King <colin.king@canonical.com>
Date: Tue, 18 Apr 2017 15:06:53 +0100

Trimming the CC: list down to something that actually makes
sense.

> From: Colin Ian King <colin.king@canonical.com>
> 
> The check for xo being null is incorrect, currently it is checking
> for non-null, it should be checking for null.
> 
> Detected with CoverityScan, CID#1429349 ("Dereference after null check")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

At a minimum you should work to check that you are CC:'ing the person
who added the code you are fixing.  You can use "git blame" for this.

Also, Steffen, you need to add the new IPSEC offload files to the
MAINTAINERS entry for iPSEC.

Thank you.

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

* Re: [PATCH][net-next] esp6: fix incorrect null pointer check on xo
  2017-04-18 14:06 ` Colin King
@ 2017-04-18 20:11   ` Dan Carpenter
  -1 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2017-04-18 20:11 UTC (permalink / raw)
  To: Colin King
  Cc: David S . Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, netdev, kernel-janitors,
	linux-kernel

It's in Steffen's tree, not the networking tree and he's not CC'd.  You
should really be adding Fixes tags because it helps to ensure you CC the
guilty parties.

regards,
dan carpenter

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

* Re: [PATCH][net-next] esp6: fix incorrect null pointer check on xo
@ 2017-04-18 20:11   ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2017-04-18 20:11 UTC (permalink / raw)
  To: Colin King
  Cc: David S . Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, netdev, kernel-janitors,
	linux-kernel

It's in Steffen's tree, not the networking tree and he's not CC'd.  You
should really be adding Fixes tags because it helps to ensure you CC the
guilty parties.

regards,
dan carpenter


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

* Re: [PATCH][net-next] esp6: fix incorrect null pointer check on xo
  2017-04-18 17:12 ` David Miller
@ 2017-04-19  5:20   ` Steffen Klassert
  0 siblings, 0 replies; 6+ messages in thread
From: Steffen Klassert @ 2017-04-19  5:20 UTC (permalink / raw)
  To: David Miller; +Cc: colin.king, netdev

On Tue, Apr 18, 2017 at 01:12:53PM -0400, David Miller wrote:
> From: Colin King <colin.king@canonical.com>
> Date: Tue, 18 Apr 2017 15:06:53 +0100
> 
> Trimming the CC: list down to something that actually makes
> sense.
> 
> > From: Colin Ian King <colin.king@canonical.com>
> > 
> > The check for xo being null is incorrect, currently it is checking
> > for non-null, it should be checking for null.
> > 
> > Detected with CoverityScan, CID#1429349 ("Dereference after null check")
> > 
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>

I've added

Fixes: 7862b4058b9f ("esp: Add gso handlers for esp4 and esp6")

and applied it to ipsec-next, thanks!

> 
> At a minimum you should work to check that you are CC:'ing the person
> who added the code you are fixing.  You can use "git blame" for this.
> 
> Also, Steffen, you need to add the new IPSEC offload files to the
> MAINTAINERS entry for iPSEC.

Yes, will do a patch.

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

end of thread, other threads:[~2017-04-19  5:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-18 14:06 [PATCH][net-next] esp6: fix incorrect null pointer check on xo Colin King
2017-04-18 14:06 ` Colin King
2017-04-18 17:12 ` David Miller
2017-04-19  5:20   ` Steffen Klassert
2017-04-18 20:11 ` Dan Carpenter
2017-04-18 20:11   ` Dan Carpenter

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.