Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1097337rwd; Thu, 15 Jun 2023 06:23:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72YCB3ycxP4a004Gbb1MhlgQqUJYmNA9yMwGChDctCxD3ztJzh+8yMDhV6BOPWGPZfzp3g X-Received: by 2002:a92:d483:0:b0:338:d170:6e32 with SMTP id p3-20020a92d483000000b00338d1706e32mr17185693ilg.7.1686835408573; Thu, 15 Jun 2023 06:23:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686835408; cv=none; d=google.com; s=arc-20160816; b=S+Gtl9ItZSYXKtBbvIwIv8m8gRgVV0FCSitW1rXoCuZVcge7TBFwM6JWmqCy5z61on SgWUqIgHNFlclPBvi6q3yd7d+LdbPC6SYu9AeIZqapT6G3G1+nJzGVnjA8yTTR+vMHzl WjT6VdtHKWuUtGzNKj5VEh7ops9c9raIbZIQv614DWxuXElpiSO0wjLVYvUh9aTnPigM WxmL3ir6NyQIBI5QK8FwvGwGoHXKMnwN34bw9tuH62PTNNzSINYMlUIHfyDGGQRA1VCR 2sq47Dsx8dXTIOJk7SzEgWF7m7KLdWypY5GPtkGOKUhPjNZELX0v+rfdVHj90PluciAp LcYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=g1B1o/FLv9G0pUm1w2hOwI7VRYkKM2WCDqp7dFZZlHs=; b=IVervd5ziOQEYukbne0s0Pq0ROEDoSBxQFqNVoaeBYZvDiouuXo6u08cHvBRWWmQpV YVpkfOC1LN6shJbSmtfZ1YKeaqVKeIqaNpgVombErXrL3l27apfp6iGt775eCjRYpUj1 Ib/uTjfhD3yoFxhC5pxhYRPnv1jdTMGw++w2vkjB8GzRUc484rYYNE6pvEWyTb9wgnuw jL+k8jcbA1rL369axmp0LHSwcyY5Z5TldjDJYv6HavEZRnzqRNd+99d2d1dnB5oZnwfh /M8wV5PComUAiIEVnKNNFKu1MxoiD3MEipbNvAKMEYrCeBFzGXJXARjRt/OmOQXEw45C NX7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=NxuAR8Kw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x19-20020a63b213000000b005346b8dae84si9442877pge.787.2023.06.15.06.23.15; Thu, 15 Jun 2023 06:23:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=NxuAR8Kw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343875AbjFONOH (ORCPT + 99 others); Thu, 15 Jun 2023 09:14:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343710AbjFONNu (ORCPT ); Thu, 15 Jun 2023 09:13:50 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA221294D for ; Thu, 15 Jun 2023 06:13:33 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-657c4bcad0bso2025890b3a.1 for ; Thu, 15 Jun 2023 06:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20221208.gappssmtp.com; s=20221208; t=1686834813; x=1689426813; 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=g1B1o/FLv9G0pUm1w2hOwI7VRYkKM2WCDqp7dFZZlHs=; b=NxuAR8Kwlaeh/EmM1YCgCVqYyw6uo92KBbxLVItzxTFf/kOvv92ue2AYLsEwBT9uJb UwLIbo4RYn5vetNgHJS1efdFP5hetZzoQ0RJ1xTF1jqSumRQ7LFHxWMvRcGX71raeM2w 5F7GToKM2tzpJl6DIm7fz0ROqrC8k18jzvopqmfB7aFf91epmPNpL+4BR6BsranQ4QXm L4AFcQuMep4XB4CN4eBft6LJ0aTGFUB8kq6L44upxPCWlLOlZsP0Q3BPhuErKOR16kXM f723VBQCousEB8mvomyvAOvsUNbUF7FURhWHCnoWA6bK9lZui2bBDM9kmgDn5o1/6rDd xUzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686834813; x=1689426813; 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=g1B1o/FLv9G0pUm1w2hOwI7VRYkKM2WCDqp7dFZZlHs=; b=brLzV5JJrOjtRns/hM5BalmH78Sm+yAg8F2HIE9TR1IV0GntbzsXq2BVoV484aC2QC DhwwF3eJT5oS7h+Qq9/z4SFnK7ZFAtex5nc0KI3QH/AedMsVRqKEJbG7FpUGlDPobl9D Fu0hNvZsQDc2XN6JrZ6fej4veZxPTA+NKe+VR+eChoFQp8vkO7QAYsX0+Ye9zlJm0GRG Gb7Ri8u4iHzk1qq0Ii2b9UVqRDbPEOLVLBxk1fH4aMoCaJ77ZDFIreWHPCvKnTsA9gIe DIFq+baFEMgrAO6HgUp0eUeiMSNnYNgqLiCz+2a5rfsPGLCS7Ea6R4YztF/MdrER8nmY iNwg== X-Gm-Message-State: AC+VfDw4uAKlAfMXqQJV9RVJJXmtwdXR6Q3G8gbRnwrMMotDJEpIw729 31kivDfbuqarEXNUPVIUbF3Djw== X-Received: by 2002:a17:90b:3852:b0:25b:e83b:593f with SMTP id nl18-20020a17090b385200b0025be83b593fmr13345455pjb.4.1686834813160; Thu, 15 Jun 2023 06:13:33 -0700 (PDT) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id ga12-20020a17090b038c00b002564dc3cb60sm1881320pjb.9.2023.06.15.06.13.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Jun 2023 06:13:32 -0700 (PDT) Message-ID: Date: Thu, 15 Jun 2023 07:13:31 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] tools/io_uring: Fix missing check for return value of malloc() Content-Language: en-US To: Ammar Faizi , Chenyuan Mi Cc: Pavel Begunkov , io-uring Mailing List , Linux Kernel Mailing List References: <20230615125045.125172-1-cymi20@fudan.edu.cn> <34898926-681e-1790-4303-e2b54e793a62@gnuweeb.org> From: Jens Axboe In-Reply-To: <34898926-681e-1790-4303-e2b54e793a62@gnuweeb.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/15/23 7:00?AM, Ammar Faizi wrote: > On 6/15/23 7:50 PM, Chenyuan Mi wrote: >> The malloc() function may return NULL when it fails, >> which may cause null pointer deference in kmalloc(), > > It's a userspace app, there is no kmalloc(). Also, I don't think it's > worth to fix a missing ENOMEM handling for that old test program. But > anyway, let's wait for maintainers' comment on this. Definitely not worth it, and I find it odd how the author would target just one of multiple allocations in that file. I'm guessing it's because this checker only checks for malloc(), and no thought has otherwise gone into a) if the patch makes any sense at all, and b) if it does make sense, are there potentially other cases to consider? -- Jens Axboe