Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755201AbbL3VjT (ORCPT ); Wed, 30 Dec 2015 16:39:19 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:39685 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750940AbbL3VjR (ORCPT ); Wed, 30 Dec 2015 16:39:17 -0500 Date: Wed, 30 Dec 2015 16:39:15 -0500 (EST) Message-Id: <20151230.163915.990334768673899184.davem@davemloft.net> To: nicstange@gmail.com Cc: edumazet@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] net, socket, socket_wq: fix missing initialization of flags From: David Miller In-Reply-To: <87ziwtphdo.fsf_-_@gmail.com> References: <87ege73bma.fsf@gmail.com> <1451323186.8255.5.camel@edumazet-glaptop2.roam.corp.google.com> <87ziwtphdo.fsf_-_@gmail.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]); Wed, 30 Dec 2015 13:39:16 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1891 Lines: 39 From: Nicolai Stange Date: Tue, 29 Dec 2015 13:29:55 +0100 > Fixes: ceb5d58b2170 ("net: fix sock_wake_async() rcu protection") > > Commit ceb5d58b2170 ("net: fix sock_wake_async() rcu protection") from > the current 4.4 release cycle introduced a new flags member in > struct socket_wq and moved SOCKWQ_ASYNC_NOSPACE and SOCKWQ_ASYNC_WAITDATA > from struct socket's flags member into that new place. > > Unfortunately, the new flags field is never initialized properly, at least > not for the struct socket_wq instance created in sock_alloc_inode(). > > One particular issue I encountered because of this is that my GNU Emacs > failed to draw anything on my desktop -- i.e. what I got is a transparent > window, including the title bar. Bisection lead to the commit mentioned > above and further investigation by means of strace told me that Emacs > is indeed speaking to my Xorg through an O_ASYNC AF_UNIX socket. This is > reproducible 100% of times and the fact that properly initializing the > struct socket_wq ->flags fixes the issue leads me to the conclusion that > somehow SOCKWQ_ASYNC_WAITDATA got set in the uninitialized ->flags, > preventing my Emacs from receiving any SIGIO's due to data becoming > available and it got stuck. > > Make sock_alloc_inode() set the newly created struct socket_wq's ->flags > member to zero. > > Signed-off-by: Nicolai Stange Applied, but please in the future please put the Fixes: tag right above the first signoff/ack, like this: Fixes: ceb5d58b2170 ("net: fix sock_wake_async() rcu protection") Signed-off-by: Nicolai Stange -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/