mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Trivial fix for out of bounds array access in xfrm4_policy_check
@ 2004-09-07 10:35 Catalin(ux aka Dino) BOIE
  2004-09-07 12:46 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Catalin(ux aka Dino) BOIE @ 2004-09-07 10:35 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 620 bytes --]

Hello!

Coverity found a bug in accessing xfrm4_policy_check using XFRM_POLICY_FWD 
(=2) as index in sk->sk_policy.

sk->sk_policy[] is defined in sock.h as:

struct xfrm_policy *sk_policy[2];

Attached is the fix.

http://linuxbugs.coverity.com/external/editbugparent.php?viewbugid=2138&checkers%5B%5D=all&status%5B%5D=BUG&status%5B%5D=UNINSPECTED&status%5B%5D=UNKNOWN&status%5B%5D=DON%27T%20CARE&status%5B%5D=PENDING&product%5B%5D=all&component%5B%5D=all&file=&fn=&sortby=reverse_rank&before=&after=&curpage=2&bugid=-1&comment=&reason=

---
Catalin(ux aka Dino) BOIE
catab at deuroconsult.ro
http://kernel.umbrella.ro/

[-- Attachment #2: Type: TEXT/PLAIN, Size: 433 bytes --]

--- linux/include/net/sock.h	2004-09-07 13:13:31.000000000 +0300
+++ mylinux/include/net/sock.h	2004-09-07 13:14:36.000000000 +0300
@@ -201,7 +201,7 @@ struct sock {
 	wait_queue_head_t	*sk_sleep;
 	struct dst_entry	*sk_dst_cache;
 	rwlock_t		sk_dst_lock;
-	struct xfrm_policy	*sk_policy[2];
+	struct xfrm_policy	*sk_policy[3];
 	atomic_t		sk_rmem_alloc;
 	struct sk_buff_head	sk_receive_queue;
 	atomic_t		sk_wmem_alloc;

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

* Re: [PATCH] Trivial fix for out of bounds array access in xfrm4_policy_check
  2004-09-07 10:35 [PATCH] Trivial fix for out of bounds array access in xfrm4_policy_check Catalin(ux aka Dino) BOIE
@ 2004-09-07 12:46 ` Herbert Xu
  2004-09-07 21:02   ` David S. Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2004-09-07 12:46 UTC (permalink / raw)
  To: Catalinux aka Dino BOIE; +Cc: netdev, linux-kernel

Catalinux aka Dino BOIE <util@deuroconsult.ro> wrote:
> 
> Coverity found a bug in accessing xfrm4_policy_check using XFRM_POLICY_FWD 
> (=2) as index in sk->sk_policy.
> 
> sk->sk_policy[] is defined in sock.h as:
> 
> struct xfrm_policy *sk_policy[2];
> 
> Attached is the fix.

This is bogus as if the packet is forwarded then sk == NULL.
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH] Trivial fix for out of bounds array access in xfrm4_policy_check
  2004-09-07 12:46 ` Herbert Xu
@ 2004-09-07 21:02   ` David S. Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David S. Miller @ 2004-09-07 21:02 UTC (permalink / raw)
  To: Herbert Xu; +Cc: util, netdev, linux-kernel

On Tue, 07 Sep 2004 22:46:22 +1000
Herbert Xu <herbert@gondor.apana.org.au> wrote:

> Catalinux aka Dino BOIE <util@deuroconsult.ro> wrote:
> > 
> > Coverity found a bug in accessing xfrm4_policy_check using XFRM_POLICY_FWD 
> > (=2) as index in sk->sk_policy.
> > 
> > sk->sk_policy[] is defined in sock.h as:
> > 
> > struct xfrm_policy *sk_policy[2];
> > 
> > Attached is the fix.
> 
> This is bogus as if the packet is forwarded then sk == NULL.

Agreed.

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

end of thread, other threads:[~2004-09-07 21:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-07 10:35 [PATCH] Trivial fix for out of bounds array access in xfrm4_policy_check Catalin(ux aka Dino) BOIE
2004-09-07 12:46 ` Herbert Xu
2004-09-07 21:02   ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®