From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757874AbdKOMcR (ORCPT ); Wed, 15 Nov 2017 07:32:17 -0500 Received: from mx2.suse.de ([195.135.220.15]:47547 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752279AbdKOMcJ (ORCPT ); Wed, 15 Nov 2017 07:32:09 -0500 Date: Wed, 15 Nov 2017 13:32:07 +0100 From: Michal Kubecek To: Johannes Berg Cc: "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] genetlink: fix genlmsg_nlhdr() Message-ID: <20171115123207.cebxtmhtjtsu66xd@unicorn.suse.cz> References: <20171115120932.A6A87A0CA8@unicorn.suse.cz> <1510748410.2030.31.camel@sipsolutions.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1510748410.2030.31.camel@sipsolutions.net> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 15, 2017 at 01:20:10PM +0100, Johannes Berg wrote: > 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 Well, I'm currently working on one with hdrsize > 0 which is how I found this. :-) But it will still need some time before it can get even into net-next. Michal Kubecek