Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF2D3C6FD19 for ; Thu, 16 Mar 2023 18:58:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229849AbjCPS6x (ORCPT ); Thu, 16 Mar 2023 14:58:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbjCPS6v (ORCPT ); Thu, 16 Mar 2023 14:58:51 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39B2310251 for ; Thu, 16 Mar 2023 11:58:49 -0700 (PDT) Received: by mail-io1-xd33.google.com with SMTP id bf15so1241657iob.7 for ; Thu, 16 Mar 2023 11:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; t=1678993128; x=1681585128; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=beuZlOYlsGzrMlG2T+NH12KmnMkS0LRayDtZbfmxOCM=; b=YHNcLeTN/TdKtnITj02u1Dj0NXIHsb7iM4JVFgpxlSmdKIrLsTn/lf1H4q17titWS5 0jLJhX+RJKAh+ybCHy7TR71/RwA6C5OUzPsWBkAUUQLD+akdJZy7IvRhHbd9l35Rps8Y A2o0FtExI/rvjWzIliySutETJRfmXcntUfVWf4oQNMhpAMXjNYsiZcA0dWRdcKjaVsCN 5fhHiQTaz7g6HreC/6DboYmGcJHzjvBTKSmxbBzFe452qH4Rzan6fG7cdAsXXgem5ImN FbcjdQd6cFGVwhhsgSjDqjo9PhjsiaU+OvnB8qV6QKWHQIR7Jz57Tp8F4zrcsp7XpwcM DGYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678993128; x=1681585128; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=beuZlOYlsGzrMlG2T+NH12KmnMkS0LRayDtZbfmxOCM=; b=ozlI9Ot2evomZaytbvlHRZszoAUYO9g8Scyxt2Dzd41VE3fSe68UxrwxIQC1b2yXNh CQTDLGQZb48ECoLo2CGWgrz1g68Mjsjmpm8Vyp61C2NKmHSQsSu4UCTPAENFIsQC1HOP udAXpxd+2/Y4FRSs9xg0JvERaQiGrEzw+rtGtQZyV5AxS90WohOPpXvXpN0Aa/cjTSEo mZSW5q0AD7j8+lBQCUFxBrLEuRykeHiyWcZ7VXG4T5C5vDiVPcYdYLWUnp+Ivae8OLm3 r3l/xRTlz7x70Rbp527Pw9446BLjoQfnUqbEehaIuc/+u0SULH74zO+scRIa+TBIpFIk JwjQ== X-Gm-Message-State: AO0yUKUsBmXQOnxovopacJeLQrEc5NFSFNeHGlBq3eYP0YFOidYQBofm pEkeDdBSQ/6TRvuC0WeS8+JsdQ== X-Google-Smtp-Source: AK7set/HbVF/sI5C5fpqS0RJ/ZYcJLU41RZTQBCp5bQc0lst6zGd3Kd6qtUMUKfyxVuu57wrWVOsdg== X-Received: by 2002:a6b:c38f:0:b0:752:f9b6:386b with SMTP id t137-20020a6bc38f000000b00752f9b6386bmr2123784iof.0.1678993128361; Thu, 16 Mar 2023 11:58:48 -0700 (PDT) Received: from [192.168.1.94] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id ck16-20020a0566383f1000b003cfd7393382sm12225jab.93.2023.03.16.11.58.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Mar 2023 11:58:47 -0700 (PDT) Message-ID: <23aa947b-43b6-d1d3-f8b4-4518cf4dcabb@kernel.dk> Date: Thu, 16 Mar 2023 12:58:46 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH 5.10/5.15] io_uring: avoid null-ptr-deref in io_arm_poll_handler Content-Language: en-US To: Fedor Pchelkin , Greg Kroah-Hartman , stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org References: <20230316185616.271024-1-pchelkin@ispras.ru> From: Jens Axboe In-Reply-To: <20230316185616.271024-1-pchelkin@ispras.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/16/23 12:56 PM, Fedor Pchelkin wrote: > No upstream commit exists for this commit. > > The issue was introduced with backporting upstream commit c16bda37594f > ("io_uring/poll: allow some retries for poll triggering spuriously"). > > Memory allocation can possibly fail causing invalid pointer be > dereferenced just before comparing it to NULL value. > > Move the pointer check in proper place (upstream has the similar location > of the check). In case the request has REQ_F_POLLED flag up, apoll can't > be NULL so no need to check there. > > Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Ah thanks, yes that's a mistake. Looks good to me! -- Jens Axboe