From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Berg Subject: Re: [PATCH net] genetlink: fix genlmsg_nlhdr() Date: Wed, 15 Nov 2017 13:20:10 +0100 Message-ID: <1510748410.2030.31.camel@sipsolutions.net> References: <20171115120932.A6A87A0CA8@unicorn.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: Michal Kubecek , "David S. Miller" Return-path: Received: from s3.sipsolutions.net ([144.76.63.242]:54682 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757788AbdKOMUQ (ORCPT ); Wed, 15 Nov 2017 07:20:16 -0500 In-Reply-To: <20171115120932.A6A87A0CA8@unicorn.suse.cz> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 2017-11-15 at 13:09 +0100, Michal Kubecek wrote: > According to the description, first argument of genlmsg_nlhdr() points to > what genlmsg_put() returns, i.e. beginning of user header. Therefore we > should only subtract size of genetlink header and netlink message header, > not user header. > > This also means we don't need to pass the pointer to genetlink family and > the same is true for genl_dump_check_consistent() which is the only caller > of genlmsg_nlhdr(). (Note that at the moment, these functions are only > used for families which do not have user header so that they are not > affected.) > > Fixes: 670dc2833d14 ("netlink: advertise incomplete dumps") > Signed-off-by: Michal Kubecek Looks sensible, though I don't think it's really needed in net since it really has no effect - as you note, family->hdrsize is 0 for all the families calling this right now. Reviewed-by: Johannes Berg johannes