All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: David Miller <davem@davemloft.net>
Cc: kronos.it@gmail.com, netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org
Subject: Re: [2.6.24][BUG] Compact code broken?
Date: Thu, 15 Nov 2007 14:48:12 +0100	[thread overview]
Message-ID: <473C4E1C.2040301@trash.net> (raw)
In-Reply-To: <20071114.154247.130153717.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 756 bytes --]

David Miller wrote:
> From: "Luca Tettamanti" <kronos.it@gmail.com>
> Date: Thu, 15 Nov 2007 00:39:11 +0100
> 
>> On Nov 15, 2007 12:00 AM, David Miller <davem@davemloft.net> wrote:
>>> From: Luca Tettamanti <kronos.it@gmail.com>
>>> Date: Wed, 14 Nov 2007 22:28:55 +0100
>>>
>>>> Hello,
>>>> I'm testing a 64bit kernel on my machine and I've found an issue with
>>>> iptables (32 bit). Kernel is git current (9418d5dc).
>>> What platform?  x86?  powerpc?  sparc64?
>> x86
> 
> Ok, the userland pointer you provided seemed to be sign extended
> to 64-bit, so there might be a pointer arithmetic bug in the
> netfilter compat code somewhere.


It took me a few passes over the code, but it turns out to be
a simple typo :)

Luca, does this fix it for you?


[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1264 bytes --]

[NETFILTER]: fix compat_nf_sockopt typo

It should pass opt to the ->get/->set functions, not ops.

Fixes compat fault reported by Luca Tettamanti <kronos.it@gmail.com>

Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit ac55193be35872211189096ec600f94614a0179b
tree a6633e33307b5ec1e11fedc2d0e125ed6e2bd081
parent 99fee6d7e5748d96884667a4628118f7fc130ea0
author Patrick McHardy <kaber@trash.net> Thu, 15 Nov 2007 14:46:43 +0100
committer Patrick McHardy <kaber@trash.net> Thu, 15 Nov 2007 14:46:43 +0100

 net/netfilter/nf_sockopt.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/netfilter/nf_sockopt.c b/net/netfilter/nf_sockopt.c
index 87bc144..3dd4b3c 100644
--- a/net/netfilter/nf_sockopt.c
+++ b/net/netfilter/nf_sockopt.c
@@ -143,12 +143,12 @@ static int compat_nf_sockopt(struct sock *sk, int pf, int val,
 		if (ops->compat_get)
 			ret = ops->compat_get(sk, val, opt, len);
 		else
-			ret = ops->get(sk, val, ops, len);
+			ret = ops->get(sk, val, opt, len);
 	} else {
 		if (ops->compat_set)
-			ret = ops->compat_set(sk, val, ops, *len);
+			ret = ops->compat_set(sk, val, opt, *len);
 		else
-			ret = ops->set(sk, val, ops, *len);
+			ret = ops->set(sk, val, opt, *len);
 	}
 
 	module_put(ops->owner);

  reply	other threads:[~2007-11-15 13:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-14 21:28 [2.6.24][BUG] Compact code broken? Luca Tettamanti
2007-11-14 23:00 ` David Miller
2007-11-14 23:39   ` Luca Tettamanti
2007-11-14 23:42     ` David Miller
2007-11-15 13:48       ` Patrick McHardy [this message]
2007-11-15 20:14         ` Luca Tettamanti

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=473C4E1C.2040301@trash.net \
    --to=kaber@trash.net \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=kronos.it@gmail.com \
    --cc=netfilter-devel@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.