From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765642AbYDQNKy (ORCPT ); Thu, 17 Apr 2008 09:10:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759467AbYDQNKm (ORCPT ); Thu, 17 Apr 2008 09:10:42 -0400 Received: from stinky.trash.net ([213.144.137.162]:63121 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750879AbYDQNKm (ORCPT ); Thu, 17 Apr 2008 09:10:42 -0400 Message-ID: <48074C4E.6060400@trash.net> Date: Thu, 17 Apr 2008 15:10:38 +0200 From: Patrick McHardy User-Agent: Mozilla-Thunderbird 2.0.0.12 (X11/20080405) MIME-Version: 1.0 To: hadi@cyberus.ca CC: David Miller , 12o3l@tiscali.nl, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] NET: catch signed nla_len() retval in tcf_simp_init() References: <4806C501.20300@tiscali.nl> <20080416.213712.78410382.davem@davemloft.net> <4806D847.2030806@trash.net> <1208437113.4420.34.camel@localhost> In-Reply-To: <1208437113.4420.34.camel@localhost> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org jamal wrote: > On Thu, 2008-17-04 at 06:55 +0200, Patrick McHardy wrote: > >> The change is also unnecessary because the attribute was >> already validated and the length can not be less than zero. > > Since act_simple is an academic example: > I think that a better solution is to add TCA_DEF_DATA (which is a > string) to the nla_policy. nla_policy is defined but at the moment it is > not used in the call to nla_parse_nested() - might as well use it. Basic validity checks are always performed. But I agree, better to provide a good example.