Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3804214ybi; Mon, 29 Jul 2019 12:58:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjnfuodSZRsCVwCkFwPudk2i6T1UUcta3ir3VajpySZJ5PWbxkFnXIiarVE9b1tR7gh9f2 X-Received: by 2002:a17:902:ab8f:: with SMTP id f15mr17736580plr.159.1564430310869; Mon, 29 Jul 2019 12:58:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564430310; cv=none; d=google.com; s=arc-20160816; b=TWrMscn30KJkQK5nizSoWXd/TJIBTIjRW//8qMMJedZncQu+htN1KNgfHvmm8ooYQ7 GjVs/sIRPrFujyR8tML8gcUyB7NXGd7tAREJgi//JBRfxb84y0n+GHxjLgIMNkO8+NTW rqvELDkR2smhNxV2JA2jymD23bQRQU+SKw54fV8YqYe6lcT8zK3CztneizmaEIv6xNe+ vhwqt626jXjohP35KdM6h7Uy8AeiXmFIXVu9yA0m2KtVDcc8qHQcvyJHnAr5Y+7UqvKi tOpQQvUMNDxlZS4xkXpy5S4s71F5mHoDAGx1LWfAbp6kOZBiN6nJk54CpS8MkT48toI5 hsrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/l9BmDML9UohdNutlCqe+K0df9pelMN7/xTVwk28KmI=; b=KGEs+5+1dHiGS0Z1mWuPC6DNqS4HYwSF6JcZ+3HKrhZJIl69irgOwtd/5KAdFM9nWs 0VeK9PYdQsTcDOliw4GABXmACxqvvunywVAjsL3YHDCm7CElO2HHbBHUXCpR9c24046e lUntu2+VJh52n/LkLZ1JRJ9e23LNBSZlFkonLXWKQVi/Bi0ZAgDKbOD2U80b8hTPL9ET D5EUTUhNB96bOjZVSRDz1I2jqUCQqsw+AzyN/MgELVTuPfmSmsgDNlr5k5L213HAvvAn xDFErGixpR5Jtv0nJwuxSw8ER0eF9MzXtMAGI4SXwC8j+CuuFREtG2jciNyAQ3ZwyhMe h/MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oRdSGXb0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y82si26839881pfb.58.2019.07.29.12.58.16; Mon, 29 Jul 2019 12:58:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oRdSGXb0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404268AbfG2Tz5 (ORCPT + 99 others); Mon, 29 Jul 2019 15:55:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:48694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404251AbfG2Tzu (ORCPT ); Mon, 29 Jul 2019 15:55:50 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C726921655; Mon, 29 Jul 2019 19:55:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564430150; bh=+/rm5CDoZsI6YgQXhHNsuleyRNVQTh7kw9Su+PBQ8xA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oRdSGXb0vuQme68/BcsC9XCaGMNFNpw40XeP0c8SLGVKmFeohDLuDnLJ4B829hccx eQY3Ge4ix5ledr6KeJFVYJwVujUIZTylfO2RiMYJs+ijL7Nyc9tUmOLXDFgvIhD9m5 UgI5QNy9/fOA7K0ZwMELomJKqkx1kUIoyryHLBmY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Kozak , Jens Axboe Subject: [PATCH 5.2 213/215] io_uring: ensure ->list is initialized for poll commands Date: Mon, 29 Jul 2019 21:23:29 +0200 Message-Id: <20190729190816.805465347@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jens Axboe commit 36703247d5f52a679df9da51192b6950fe81689f upstream. Daniel reports that when testing an http server that uses io_uring to poll for incoming connections, sometimes it hard crashes. This is due to an uninitialized list member for the io_uring request. Normally this doesn't trigger and none of the test cases caught it. Reported-by: Daniel Kozak Tested-by: Daniel Kozak Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -1489,6 +1489,8 @@ static int io_poll_add(struct io_kiocb * INIT_LIST_HEAD(&poll->wait.entry); init_waitqueue_func_entry(&poll->wait, io_poll_wake); + INIT_LIST_HEAD(&req->list); + mask = vfs_poll(poll->file, &ipt.pt) & poll->events; spin_lock_irq(&ctx->completion_lock);