From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH v2 net] strparser: Fix sign of err codes Date: Tue, 27 Mar 2018 13:29:34 -0400 (EDT) Message-ID: <20180327.132934.1073739597914168404.davem@davemloft.net> References: <20180327152352.GA35552@davejwatson-mba.local> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: tom@quantonium.net, netdev@vger.kernel.org To: davejwatson@fb.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:43902 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753238AbeC0R3f (ORCPT ); Tue, 27 Mar 2018 13:29:35 -0400 In-Reply-To: <20180327152352.GA35552@davejwatson-mba.local> Sender: netdev-owner@vger.kernel.org List-ID: From: Dave Watson Date: Tue, 27 Mar 2018 08:23:52 -0700 > strp_parser_err is called with a negative code everywhere, which then > calls abort_parser with a negative code. strp_msg_timeout calls > abort_parser directly with a positive code. Negate ETIMEDOUT > to match signed-ness of other calls. > > The default abort_parser callback, strp_abort_strp, sets > sk->sk_err to err. Also negate the error here so sk_err always > holds a positive value, as the rest of the net code expects. Currently > a negative sk_err can result in endless loops, or user code that > thinks it actually sent/received err bytes. > > Found while testing net/tls_sw recv path. > > Fixes: 43a0c6751a322847 ("strparser: Stream parser for messages") > Signed-off-by: Dave Watson Your v1 patch was already applied to my net tree, so you'll have to send any further changes as a relative patch.