From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2993802AbcBTEvP (ORCPT ); Fri, 19 Feb 2016 23:51:15 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:42655 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2993761AbcBTEvJ (ORCPT ); Fri, 19 Feb 2016 23:51:09 -0500 Date: Fri, 19 Feb 2016 23:51:07 -0500 (EST) Message-Id: <20160219.235107.1810934052787203460.davem@davemloft.net> To: rweikusat@mobileactivedefense.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, hannes@stressinduktion.org, joseph.salisbury@canonical.com, edumazet@google.com Subject: Re: [PATCH net] af_unix: Don't use continue to re-execute unix_stream_read_generic loop From: David Miller In-Reply-To: <877fi2gpkd.fsf@doppelsaurus.mobileactivedefense.com> References: <877fi2gpkd.fsf@doppelsaurus.mobileactivedefense.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 19 Feb 2016 20:51:09 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rainer Weikusat Date: Thu, 18 Feb 2016 12:39:46 +0000 > The unix_stream_read_generic function tries to use a continue statement > to restart the receive loop after waiting for a message. This may not > work as intended as the caller might use a recvmsg call to peek at > control messages without specifying a message buffer. If this was the > case, the continue will cause the function to return without an error > and without the credential information if the function had to wait for a > message while it had returned with the credentials otherwise. Change to > using goto to restart the loop without checking the condition first in > this case so that credentials are returned either way. > > Signed-off-by: Rainer Weikusat > Acked-by: Hannes Frederic Sowa Applied, thanks.