Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp952706pxp; Wed, 16 Mar 2022 22:27:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfmNW3GgZ0KCtWZApj5fATzwb1il9W2nY9+OS3th7AaxjEUJVB9X6ZV1mP0J1HfY8vWXKZ X-Received: by 2002:a05:6a00:14c9:b0:4f7:763b:2efd with SMTP id w9-20020a056a0014c900b004f7763b2efdmr3261242pfu.55.1647494873030; Wed, 16 Mar 2022 22:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647494873; cv=none; d=google.com; s=arc-20160816; b=T6p8t3yPmztFNIu/gZJX+ZCl1wqRrKDuEwRVLkanQJ84W3cj9OX6gnQUB0fgoW6aqI 9PTVnd7i99AAs3Xx7C0TtfAH2lhOwqvpvYw4YUE+Of7grcBSNjWmUGCmJiLmCoevKkLz Dd+gbjspW2z9ny5RYT305tCEUcSSBuNi+HpsgHkKkWktTCogesODeOfl32vN+zN0ETjR tEf0ZI7EZgsdp8AFBwBWr7ruPDN4rEnNnyd+A7DcfsPa7yEl64OGQiOcCl5cnRPU7wvF HA9KA7eR26c8tZHxy3EfHNQWEoxwaxErXPmtDfs9/pjfF/UlSBqzTfUo8v2osw3fooMZ BSBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=AzfOyTOdyO0VQuEeVnPB1zokWJjb1zuJI4aFs5RCWko=; b=n5p5VxLa9S4VL249ju8N1Be1U4SJbpSrDv5xS/oZBqMwKMk8vrQwwqsogLzt8KvWco nj382sZ+HkwUUIv0VyzubKzKXJBD8893Y/KceZd+QA3a4eQOXrIhHxP2s7RfPQpcCR3z j2c5s12hXTrL5KVI4Eahv/lBcFAihcbRFCVTQVnsCiiQSyVDYwYnvY7Lr4gYgprZqK5i uOZ2itGhe1jvYwt+dYsLnmkNNFOYtv+iqJW6cEzFI7txTDQYiQFqVEBnH9MUKKH0zmPu giq2/+5TNsEXZaGip1OUK22oXLT9ksOC/FucSIVblb4SiMnrz6gsWVvnP7nPP238ZbuM qpHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o9-20020a170902e28900b00153f30d55ebsi399267plc.280.2022.03.16.22.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:27:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5B66421DF2B; Wed, 16 Mar 2022 21:28:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236845AbiCNIgg (ORCPT + 99 others); Mon, 14 Mar 2022 04:36:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231548AbiCNIga (ORCPT ); Mon, 14 Mar 2022 04:36:30 -0400 Received: from cstnet.cn (smtp21.cstnet.cn [159.226.251.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8E4A531340; Mon, 14 Mar 2022 01:35:20 -0700 (PDT) Received: from localhost.localdomain (unknown [124.16.138.126]) by APP-01 (Coremail) with SMTP id qwCowACnrfk1_i5ixhxyAw--.16154S2; Mon, 14 Mar 2022 16:35:02 +0800 (CST) From: Jiasheng Jiang To: gregkh@linuxfoundation.org Cc: stephen@networkplumber.org, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, davem@davemloft.net, kuba@kernel.org, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, kpsingh@kernel.org, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Jiasheng Jiang Subject: Re: [PATCH] hv_netvsc: Add check for kvmalloc_array Date: Mon, 14 Mar 2022 16:35:00 +0800 Message-Id: <20220314083500.2501146-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: qwCowACnrfk1_i5ixhxyAw--.16154S2 X-Coremail-Antispam: 1UD129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUYq7AC8VAFwI0_Xr0_Wr1l1xkIjI8I6I8E 6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28Cjx kF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8I cVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87 Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE 6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72 CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7 M4IIrI8v6xkF7I0E8cxan2IY04v7MxkIecxEwVAFwVW8ZwCF04k20xvY0x0EwIxGrwCFx2 IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v2 6r106r1rMI8E67AF67kF1VAFwI0_GFv_WrylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67 AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IY s7xG6rWUJVWrZr1UMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI 0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyTuYvjfUeYLvDUUUU X-Originating-IP: [124.16.138.126] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, Mar 14, 2022 at 04:13:59PM +0800, Greg KH wrote: >> The failure of allocation is not included in the tests. >> And as far as I know, there is not any tool that has the >> ability to fail the allocation. > > There are tools that do this. > Thanks, could you please tell me the tools? Jiang >> But I think that for safety, the cost of redundant and harmless >> check is acceptable. >> Also, checking after allocation is a good program pattern. > > That's fine, it's how you clean up that is the problem that not everyone > gets correct, which is why it is good to verify that you do not > introduce problems.