From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Westphal Subject: Re: [PATCH v4 2/3] Do error handling if __build_packet_message fails Date: Tue, 4 Nov 2014 20:11:20 +0100 Message-ID: <20141104191120.GC6874@breakpoint.cc> References: <7be00bf663b212d4984414346da216cf17d3443d.1414586968.git.mleitner@redhat.com> <8dcee609af0015c15d2a99ab6d076a65d6ec01a8.1414586968.git.mleitner@redhat.com> <20141104164757.GA15508@salvia> <54591492.5090205@redhat.com> <20141104182609.GA26344@salvia> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Ricardo Leitner , netfilter-devel@vger.kernel.org To: Pablo Neira Ayuso Return-path: Received: from Chamillionaire.breakpoint.cc ([80.244.247.6]:48777 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751305AbaKDTLY (ORCPT ); Tue, 4 Nov 2014 14:11:24 -0500 Content-Disposition: inline In-Reply-To: <20141104182609.GA26344@salvia> Sender: netfilter-devel-owner@vger.kernel.org List-ID: Pablo Neira Ayuso wrote: > BTW, we should also signal the userspace when we fail to build the > message via: > > nfnetlink_set_err(net, 0, group, -ENOBUFS); > > so it knows that we're losing log messages for whatever reason. > Basically, userspace hits -ENOBUFS when calling recv(), which means > netlink is losing messages. I don't think we really need the > statistics. Not sure if this is a good idea. a) __build_packet_message must never fail. If it does, the kernel has a size accoutning bug somewhere. b) I see no meaningful way for userspace to handle this error; there is nothing it can do about it. c) If it happens, it might be that some userspace logging daemon suddently dies because it sees an unexpected 'fatal' error. > It seems this code needs some care. Agreed...