netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jeffrey.t.kirsher@intel.com
Cc: jeff@garzik.org, netdev@vger.kernel.org,
	alexander.h.duyck@intel.com, tgraf@suug.ch
Subject: Re: [PATCH 2/3] netlink: nal_parse_nested_compat was not parsing nested attributes
Date: Fri, 22 Aug 2008 03:18:23 -0700 (PDT)	[thread overview]
Message-ID: <20080822.031823.223140487.davem@davemloft.net> (raw)
In-Reply-To: <20080822005126.4697.16602.stgit@jtkirshe-mobile.jf.intel.com>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 21 Aug 2008 17:51:26 -0700

Please at least CC: the author of the patch you are reverting so
that they can provide feedback and have a look at this.

Thomas Graf CC:'d.

> From: Alexander Duyck <alexander.h.duyck@intel.com>
> 
> This patch reverts previous commit: b9a2f2e450b0f770bb4347ae8d48eb2dea701e24
> netlink: Fix nla_parse_nested_compat() to call nla_parse() directly
> 
> The purpose of nla_parse_nested_compat is to parse attributes which contain a
> struct followed by a container attribute with a stream of nested attributes.
> This patch reverts the previous patch which assumed that there was no container
> attribute due to a malformed string of attributes being generated by
> netem_parse_opts
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
> 
>  include/net/netlink.h |   11 +++++------
>  1 files changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/include/net/netlink.h b/include/net/netlink.h
> index 18024b8..b295cd1 100644
> --- a/include/net/netlink.h
> +++ b/include/net/netlink.h
> @@ -770,13 +770,12 @@ static inline int __nla_parse_nested_compat(struct nlattr *tb[], int maxtype,
>  					    const struct nla_policy *policy,
>  					    int len)
>  {
> -	int nested_len = nla_len(nla) - NLA_ALIGN(len);
> -
> -	if (nested_len < 0)
> +	if (nla_len(nla) < len)
>  		return -EINVAL;
> -	if (nested_len >= nla_attr_size(0))
> -		return nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len),
> -				 nested_len, policy);
> +	if (nla_len(nla) >= NLA_ALIGN(len) + sizeof(struct nlattr))
> +		return nla_parse_nested(tb, maxtype,
> +					nla_data(nla) + NLA_ALIGN(len),
> +					policy);
>  	memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));
>  	return 0;
>  }
> 

  reply	other threads:[~2008-08-22 10:18 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-22  0:51 [PATCH 1/3] LRO: fix return code propogation Jeff Kirsher
2008-08-22  0:51 ` [PATCH 2/3] netlink: nal_parse_nested_compat was not parsing nested attributes Jeff Kirsher
2008-08-22 10:18   ` David Miller [this message]
2008-08-22 17:40     ` [PATCH 2/3] netlink: nla_parse_nested_compat " Duyck, Alexander H
2008-08-27 14:52       ` Thomas Graf
2008-08-27 18:09         ` Duyck, Alexander H
2008-08-22  0:51 ` [PATCH 3/3] pkt_sched: restore multiqueue prio scheduler Jeff Kirsher
2008-08-22 10:16   ` David Miller
2008-08-22 14:30     ` jamal
2008-08-22 22:19       ` Jarek Poplawski
2008-08-23  0:01         ` Alexander Duyck
2008-08-23  0:40           ` David Miller
2008-08-23  1:37             ` Alexander Duyck
2008-08-23  5:12               ` Herbert Xu
2008-08-23  6:35                 ` Alexander Duyck
2008-08-23  7:07                   ` Herbert Xu
2008-08-23  8:23                   ` David Miller
2008-08-23  8:15               ` David Miller
2008-08-23  0:33         ` David Miller
2008-08-23  8:47           ` Jarek Poplawski
2008-08-23 16:31             ` Alexander Duyck
2008-08-23 16:49               ` jamal
2008-08-23 19:09                 ` Alexander Duyck
2008-08-24  7:53                   ` Jarek Poplawski
2008-08-24 13:39                     ` jamal
2008-08-24 19:19                       ` Jarek Poplawski
2008-08-24 19:27                         ` Jarek Poplawski
2008-08-24 19:59                           ` Jarek Poplawski
2008-08-24 20:18                             ` Jarek Poplawski
2008-08-25  0:50                           ` David Miller
2008-08-25  3:03                             ` Alexander Duyck
2008-08-25  6:16                               ` Jarek Poplawski
2008-08-25  9:36                                 ` Jarek Poplawski
2008-08-25  0:49                         ` David Miller
2008-08-25  6:06                           ` Jarek Poplawski
2008-08-25  7:48                             ` David Miller
2008-08-25  7:57                               ` Jarek Poplawski
2008-08-25  8:02                                 ` David Miller
2008-08-25  8:25                                   ` Jarek Poplawski
2008-08-25  8:35                                     ` Jarek Poplawski
2008-08-22 10:20 ` [PATCH 1/3] LRO: fix return code propogation David Miller

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=20080822.031823.223140487.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=alexander.h.duyck@intel.com \
    --cc=jeff@garzik.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /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).