Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2109235rdb; Thu, 7 Dec 2023 20:13:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHR5/iKJYClu7yAPT2x6xz5+HAdXxttJ/1nqvtPx1EWbNgGzKbj+LzpjLyLiuPueEa44UnE X-Received: by 2002:a17:903:41ce:b0:1d0:6ffd:611c with SMTP id u14-20020a17090341ce00b001d06ffd611cmr369596ple.62.1702008808857; Thu, 07 Dec 2023 20:13:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702008808; cv=none; d=google.com; s=arc-20160816; b=qNcG/5fjFwl4v7EZSKtcOs8fA44AvLICzef347TfEGBRxFelwhSMDIyKq0YYjggFaV ziZ6P2WerEMuMz6usndC8Qgm2cxFNM3HMC7GIb/LoS8Smcg4ynmcNiDrpbhWx6bnoJco 1S0Gt/icYH7NeVz6A2LnpIMn5sZ+u1QESCFFJBolbMpp0W4DnHlZx+TFFy4fwF0gksbi EWRYFbfMiXcq7kuMKd47t1VFc0AB33eA0upnDcbZJJ5dVnSIz2U+k3vPohHGJ1/4J6Za 7+yrT+LiKJTekFdfKylmN++yf4D7+BaUTtByuu92AgftWZVED8mK+Yl6YmHjNKOrbB7q MeHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:message-id:in-reply-to:date :mime-version; bh=d60eezRWfTN7z7k53kCNyN44qWasOR83dFsRUInfg5U=; fh=V9AeBafJgTW96HdC48wsxGAfd7Fe9P2uAL8tLCjpUN4=; b=n5E1LVQ8BR6GFIsYcl7zGORM/WGEEluCChOs4S0MpRyFdIoXkqGdzc4H2ByMo7QrkD MGi9Y2j5sHgfVLvRPaxoiwxuqsEfC7RNdJ1YfQx/LDJCwH+30e8XCZa7zhigkeaHBggn CxJdZMxAfoMsEt/yIbDCoM6YPKYUr4aXZjlFZm7Db2jNMAvXwsKvi8Oh7RQOiPmsvhPm Xhqll1FzcB6fAmDmq8GaB8BFmlSqPRjYy/lU9k0iNji9qYMkLK0XeDrxs2504qGI3GCV 86SnMLAjqwflDAL5LCoTM8eFWu75KxqVb7zHpzQOSoxKl9L0a03xjh6rX/3aYe/MD32r CX5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id v17-20020a1709028d9100b001cfd24c7b81si882128plo.216.2023.12.07.20.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 20:13:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 6BA6680789C2; Thu, 7 Dec 2023 20:13:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231892AbjLHENI (ORCPT + 99 others); Thu, 7 Dec 2023 23:13:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbjLHENH (ORCPT ); Thu, 7 Dec 2023 23:13:07 -0500 Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C43B91712 for ; Thu, 7 Dec 2023 20:13:13 -0800 (PST) Received: by mail-ot1-f72.google.com with SMTP id 46e09a7af769-6d88143b45bso2344893a34.0 for ; Thu, 07 Dec 2023 20:13:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702008793; x=1702613593; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=d60eezRWfTN7z7k53kCNyN44qWasOR83dFsRUInfg5U=; b=NngE9QzGzHroFYkdR8oQXpb/Jm7XRRynHeOSVXGZ2aZjz7R0FaDGBwjKtRbj4CzQAJ sfbV8pPFc2BbWBfOrPjpZ0kPKm9dGnNKBrDkKyGIpaIAo/NS3kwNgDOtHUFDE2IKOB3G 86BHR+003hzxDSZXVAwOnVYwG5Xnw5YW8yc8lhObE8n83SfApjbNqrNURCO1dGN/fDkk je1+LeGEPFkdax0sJLdPfQ5WdZmIUv0iFCXY7lqe0w3jjL8P5YD9hWSZDyGvU17abMD8 W71MNrh6tIouV9Cb1zAsDCdz6FyfExhLqw8UoNV6A5ETE4AEEYRH2xoohQ+xZMYjFMtX DBvA== X-Gm-Message-State: AOJu0YwwNMYTevdsZkJtfQ1egSQF/L0OOu47k2mdXa0huvIAW+leQ9oc NpD4Ru7ZDtDN19HtFx2x6Dv05DJ2GsSWmpmvqc5w6WqALHdkmRE= MIME-Version: 1.0 X-Received: by 2002:a05:6830:4581:b0:6d9:d4d1:1610 with SMTP id az1-20020a056830458100b006d9d4d11610mr1708781otb.2.1702008793251; Thu, 07 Dec 2023 20:13:13 -0800 (PST) Date: Thu, 07 Dec 2023 20:13:13 -0800 In-Reply-To: <000000000000bfba3a060bf4ffcf@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <00000000000086c592060bf7cd42@google.com> Subject: Re: [syzbot] [arm-msm?] [net?] memory leak in radix_tree_insert From: syzbot To: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=1.1 required=5.0 tests=FROM_LOCAL_HEX, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SORBS_WEB, SPF_HELO_NONE,SPF_PASS,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 agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 07 Dec 2023 20:13:26 -0800 (PST) X-Spam-Level: * For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org. *** Subject: [arm-msm?] [net?] memory leak in radix_tree_insert Author: lizhi.xu@windriver.com #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 33cc938e65a9 diff --git a/lib/radix-tree.c b/lib/radix-tree.c index 976b9bd02a1b..5c2f9d8f2c3e 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -714,8 +714,10 @@ int radix_tree_insert(struct radix_tree_root *root, unsigned long index, return error; error = insert_entries(node, slot, item); - if (error < 0) + if (error < 0) { + __radix_tree_delete(root, node, slot); return error; + } if (node) { unsigned offset = get_slot_offset(node, slot);