Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4672106pxy; Tue, 27 Apr 2021 10:01:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFS6x46JGcuodrR2y3A2n1lWkygXKxs6wz21eOzs7f3lwM3UlFFUk+r8TCSapQELYDqQyx X-Received: by 2002:a17:902:e88e:b029:ec:8ebe:9ff with SMTP id w14-20020a170902e88eb02900ec8ebe09ffmr24911242plg.26.1619542917487; Tue, 27 Apr 2021 10:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619542917; cv=none; d=google.com; s=arc-20160816; b=wmmNDGKnYwT/5tEccfKjCU72ox93we+lpeE9USeyd14arQxqoaDn73aG9SZUfwcwb6 fyXnuV3YM1cr38iwwfJPn9jKu9eXvHJTLAc/XuHde2ExXF5dE0e6MeE97/CdyGv5pIhb pOVb5YamFhsEOuJNoe/FXKyryVj3gYYdENgWIj02JkvbpwjbkjZUIZigjT+2SANhoAlH rb8pB/EGOiZX4fVvPYK1H2Cg/MlGc+1BSEE1h4oLLrKDvmg8YGra/bAEKLKOuLbiws6S ajvgogjp1vpor10OWb1aDPsL8po5K81OosVy2Ej2Cfc0QDsjXyNzfqjJZtyfYSyOzfuT 5Mag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=VQWN2MoFbn+ZbCk3aYL+k6MgSUCrIcFC3HaPv/js1xI=; b=wDTHykbdIQq5ZXKOzSrUvHP55DkqskYErAZr2Sr4MmuLMhCbvvDIU1NiXjTlVO8FYS wfSjse3ueL0Z2VXmhcZbW/3H8xsTQ4jQ13hK5gGnoxLqpbOaRkcA71Xph6Mv/d+c195i fM6K5YUmBRH/uigVrN7NzRs0vY9YhynCfI/3nKitnRB2AbvXFj6GPuJfCqHGlVhNWiZ7 aScgwCMvyUrZYgCybmTM4ErfUQBt4jhjYJTArQtYiLFriMzsoqnbP7AtUDMvmPLKP8Um tOtK7tQ6V7FG+8xI7u8a/fX8ZEkE6ZLqHnM/jCBts66hDjhdrUKUhA3YwinWGLsPrNv2 /DMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=OaOMNgPx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i7si521306pla.31.2021.04.27.10.01.44; Tue, 27 Apr 2021 10:01:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=OaOMNgPx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237403AbhD0RBu (ORCPT + 99 others); Tue, 27 Apr 2021 13:01:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236502AbhD0RBq (ORCPT ); Tue, 27 Apr 2021 13:01:46 -0400 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87637C061756 for ; Tue, 27 Apr 2021 10:01:00 -0700 (PDT) Received: by mail-io1-xd2a.google.com with SMTP id a11so7915653ioo.0 for ; Tue, 27 Apr 2021 10:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=VQWN2MoFbn+ZbCk3aYL+k6MgSUCrIcFC3HaPv/js1xI=; b=OaOMNgPxt/xHeJgQVxLE6f72BpwsMmGEJih3XGIyAjUwveuQuWYqu3MUwp1RDIDDYu j18lhg451O/piqwlezSI4e4g7ypGmhg8lB9h6Yrbce47IQ1EJyjjCDsUgBf3A4O8vHVD 5AB/qq/lKfpd0xUkoF23qnpHg7tB6gRt8w7Hg/kiMCNl3bncwew6mS7Ma5/kMSlQiU50 2cGgPmp770CSqthj01CndSCdD7LQEErsmYgTK0gZ24POEzU2Aua4ftJIJl0T0CFonMdh lPnCIJd77o7djc/Db4PEjZqLGj+ujNQe1IYvgLjX7Sjt8xrTZ5Dx6yZW2HOLgYhLvljK N0mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VQWN2MoFbn+ZbCk3aYL+k6MgSUCrIcFC3HaPv/js1xI=; b=g4ATLEf+fOgL7IhQtw48lxjN++3Ti8gd/hjnjWohW+/ugOV4bsAhZOa2TbocowMUNu YzBZQBAkk9ig6X6OfxZ77JujuCCBAZkPPiV/tFOi9ViRAZS3s0kDsTdR/rbOREtslYcv HXxHLUefYRgHBT4IOdsLPMZdSiiOuKsj/755cqzn6tuXcyWaCumZ0nQiD79gSNYIm6VS E1UYA2Ap3aA/22VsaT/syrxn+1WkJc+1t7D9qUIh+fBWXlhsvBQmdPvHN4san5VAxPJx 23mhSsUOtv3Cu0x01pl1FpKOhp0ThR0k0V8HifXqkhXJOJ6Hj+DM4AVgIjH9jH8mp4wK 8rlw== X-Gm-Message-State: AOAM5321Tgug6lLb1egYhwjjjis5y3m5WJXs+j076iMRerGpSvdo/LHH mrpVbDR4ZkOpjDjWU6u8owDTmw== X-Received: by 2002:a5e:880c:: with SMTP id l12mr20315619ioj.195.1619542859956; Tue, 27 Apr 2021 10:00:59 -0700 (PDT) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id l8sm198227ioq.35.2021.04.27.10.00.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Apr 2021 10:00:59 -0700 (PDT) Subject: Re: [PATCH 5.13] io_uring: Check current->io_uring in io_uring_cancel_sqpoll To: Pavel Begunkov , Palash Oswal Cc: dvyukov@google.com, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, oswalpalash@gmail.com, syzbot+be51ca5a4d97f017cd50@syzkaller.appspotmail.com, syzkaller-bugs@googlegroups.com, stable@vger.kernel.org References: <20210427125148.21816-1-hello@oswalpalash.com> <8204f859-7249-580e-9cb1-7e255dbcb982@gmail.com> From: Jens Axboe Message-ID: Date: Tue, 27 Apr 2021 11:00:59 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <8204f859-7249-580e-9cb1-7e255dbcb982@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/27/21 11:00 AM, Pavel Begunkov wrote: > On 4/27/21 2:37 PM, Jens Axboe wrote: >> On 4/27/21 6:51 AM, Palash Oswal wrote: >>> syzkaller identified KASAN: null-ptr-deref Write in >>> io_uring_cancel_sqpoll on v5.12 >>> >>> io_uring_cancel_sqpoll is called by io_sq_thread before calling >>> io_uring_alloc_task_context. This leads to current->io_uring being >>> NULL. io_uring_cancel_sqpoll should not have to deal with threads >>> where current->io_uring is NULL. >>> >>> In order to cast a wider safety net, perform input sanitisation >>> directly in io_uring_cancel_sqpoll and return for NULL value of >>> current->io_uring. >> >> Thanks applied - I augmented the commit message a bit. > > btw, does it fixes the replied before syz report? Should > syz fix or tag it if so. > Reported-by: syzbot+be51ca5a4d97f017cd50@syzkaller.appspotmail.com That tag was already there. -- Jens Axboe