From mboxrd@z Thu Jan 1 00:00:00 1970 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 058C0C25B4E for ; Fri, 20 Jan 2023 15:39:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230403AbjATPjZ (ORCPT ); Fri, 20 Jan 2023 10:39:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230143AbjATPjW (ORCPT ); Fri, 20 Jan 2023 10:39:22 -0500 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D49A280BB0 for ; Fri, 20 Jan 2023 07:39:00 -0800 (PST) Received: by mail-io1-xd32.google.com with SMTP id i70so2589295ioa.12 for ; Fri, 20 Jan 2023 07:39:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; 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=gHZ4zxBKFj/78J0fghwgqaCjE6ht7Gwjai/lQVrZMf8=; b=gzg/QqiLfqNSaqONNPcY97/OcjrVcsvcFTexWk9phcHskdpA/awPSAPK+qKlGdaMWL tMmDAxtDSo4MhCTU9yCIXclGWEEsEii8lZmmogEkgXGIhh0RGjTxC7ILBVdtHC9MvCcI +3BoP0vdvEvHIS+VNFDhzZoK/UyAdx2WaY1mBZ9u94Vf34ZZk6HW+t5z+xprtptdDOMi njaXyLqgFCOPwbexbVkcX2SgD0SwDkT/doNPxWzFiIzG2OIR+t/M50uI4bh+RSKZLMnH O4+/pnWilxTCpHgCgRhrfCFpSpAfVX5A1kZtR4CfkkTFFT2U9JMYPBDoQqZsP1I8UkZS vvTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=gHZ4zxBKFj/78J0fghwgqaCjE6ht7Gwjai/lQVrZMf8=; b=jU9Xl4Rw2vMolR26EJvF6BHGIMaXiABPKhBfa20cwdreQC61I7loPCu0fCdNsuhprG qQRCxfsw6xQi021b+ztprR5Z77xkoDHoLKBFL7OdKY2zHftF7IOHNd48jrl30NuU5Muc qXDpt+pqB8IJ4kDKgg5dP8OH6sIcs+HfbRxV0q+t82NXUMOUB6mTYxtzVetqU46g0Zyn HLUJgz0L6tupJWkSGveg+uuYZ7KZxo54m/jQj/NblJMnSL86/ZWDiGf3IAf6VjQRcfKL oL6X7SZlfjaw+yk/U94LALfiFCiNvis7LES6simAURn/oN2WPLTK2SLSr3M0GmrZnhjh xpPA== X-Gm-Message-State: AFqh2kr6wbJNz8eipqEqmfmA8dOEFxYJH7KNUXmmSQ+NS8bwBjHuLMyY X2wjirkMqgJ8EgcIGWxRtYGcAg== X-Google-Smtp-Source: AMrXdXsYSPJPn7W3Ubt8NCyYzB8UwottVFJpCvJnHsWEcCNVGQcrk9dR2AQCl75CacxgnfxJV4FO9w== X-Received: by 2002:a5d:9e4d:0:b0:707:6808:45c0 with SMTP id i13-20020a5d9e4d000000b00707680845c0mr1239435ioi.1.1674229135632; Fri, 20 Jan 2023 07:38:55 -0800 (PST) Received: from [192.168.1.94] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id t19-20020a056602141300b006e01740c3b6sm13476398iov.2.2023.01.20.07.38.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Jan 2023 07:38:55 -0800 (PST) Message-ID: Date: Fri, 20 Jan 2023 08:38:54 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH] io_uring: Enable KASAN for request cache Content-Language: en-US To: Pavel Begunkov , Breno Leitao , io-uring@vger.kernel.org Cc: kasan-dev@googlegroups.com, leit@fb.com, linux-kernel@vger.kernel.org References: <20230118155630.2762921-1-leitao@debian.org> From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/20/23 8:09 AM, Pavel Begunkov wrote: > On 1/18/23 15:56, Breno Leitao wrote: >> Every io_uring request is represented by struct io_kiocb, which is >> cached locally by io_uring (not SLAB/SLUB) in the list called >> submit_state.freelist. This patch simply enabled KASAN for this free >> list. >> >> This list is initially created by KMEM_CACHE, but later, managed by >> io_uring. This patch basically poisons the objects that are not used >> (i.e., they are the free list), and unpoisons it when the object is >> allocated/removed from the list. >> >> Touching these poisoned objects while in the freelist will cause a KASAN >> warning. > > Doesn't apply cleanly to for-6.3/io_uring, but otherwise looks good > > Reviewed-by: Pavel Begunkov I ran testing on this yesterday and noticed the same thing, just a trivial fuzz reject. I can fix it up while applying. Thanks for reviewing! -- Jens Axboe