From: Dan Carpenter <error27@gmail.com>
To: Patrick McHardy <kaber@trash.net>
Cc: ebtables-devel@lists.sourceforge.net, netfilter-devel@vger.kernel.org
Subject: Re: [rfc] netfilter: copy less data to the user
Date: Thu, 15 Jul 2010 12:16:45 +0200 [thread overview]
Message-ID: <20100715101645.GB17585@bicker> (raw)
In-Reply-To: <4C3ED959.4080007@trash.net>
On Thu, Jul 15, 2010 at 11:48:09AM +0200, Patrick McHardy wrote:
> Am 14.07.2010 23:04, schrieb Dan Carpenter:
> > Smatch complains that we copy too much data to the user in ebtables.
> > We copied EBT_FUNCTION_MAXNAMELEN (32) characters to the user here, but
> > "m->u.match->name" has XT_EXTENSION_MAXNAMELEN (29) characters.
> >
> > I'm not sure if this is a bug where someone got confused with m->u.name
> > which has 32 characters or if this is done for backwards compatability.
>
> Looking at ebtables.h, ebt_entry_match->name uses
> EBT_FUNCTION_MAXNAMELEN, which is 32 bytes. Where did you get
> XT_EXTENSION_MAXNAMELEN from?
>
Exactly. ebt_entry_match->u.name uses EBT_FUNCTION_MAXNAMELEN but this is
from ebt_entry_match->u.match->name which is type struct xt_match.
But it looks like we're exporting struct ebt_match which also uses
EBT_FUNCTION_MAXNAMELEN. So maybe the fix is to copy ->u.name instead
of ->u.match->name.
regards,
dan carpenter
next prev parent reply other threads:[~2010-07-15 10:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-14 21:04 [rfc] netfilter: copy less data to the user Dan Carpenter
2010-07-15 9:48 ` Patrick McHardy
2010-07-15 10:16 ` Dan Carpenter [this message]
2010-07-15 15:29 ` Patrick McHardy
2010-07-25 16:36 ` Jan Engelhardt
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=20100715101645.GB17585@bicker \
--to=error27@gmail.com \
--cc=ebtables-devel@lists.sourceforge.net \
--cc=kaber@trash.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).