Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp1351853rwl; Fri, 4 Nov 2022 12:54:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6uFEH0H7fZhLbvibR81XVODLICE5ivaV+5NRY/2FqScs/zrP8Es7tRtOD1IeQ1EWom0bK1 X-Received: by 2002:a17:903:50e:b0:182:631b:df6f with SMTP id jn14-20020a170903050e00b00182631bdf6fmr36958218plb.66.1667591651263; Fri, 04 Nov 2022 12:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667591651; cv=none; d=google.com; s=arc-20160816; b=D/Ka6bTZJftQYjL8h5+0OnoMbxHFpSazPj6SCnGi/IQOjNR6XvkT9XF+Sxlc/REuAz vuvPeVc9ziPczu286LWPT7HpqXpg29sZ48z1/nXM9BLrah9kKgxI+N1HCwkCyt/McrV0 jQ775vqyfcNbu6G8EAqcAXRNUfVCBBFnkwlPdMfxrpgehZXrWUcN3crku2W9ZsyzJ4br 6RfoH8akLgaQrvhq9S8RN1LzFc7dQmyMEc+GeEi+4MioeHmJ5TAUf+h24cmC88OmtsL5 rdOdDp9l/tGuwqrK0eqPaN1Ng2TIj5kUfI2pNxl5KP3HuWqTW4EF4aajA5pzQNdDL7Vg m4pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:date:from:dkim-signature; bh=GJx5Vo13L9gX9apUbugbGq7p+vwBn4IOzk+4YVYJbZo=; b=BTm3lhln39QcCI0Oid/Jcznp4VlwvkfZotLYAZjDe1WJk1rqgAOxqVaKjN2U/Mg1yx S1unIr6pd4LChjgvTeqO5j+eSzPuNShkD0Su6YoEC4p1j4ZKhA4Rh4kY5qDY5Oj3E5MM 2IEyx7XE08ffxd1naNGNVrjLF/zYR3sNXmDkD4KH9V3Cb0vBQTBpumgbBR0N/S0ZBm9/ gMzqgQGGNbtHl0ni35AAhL0JU1aoZ++JIO88GRRC0NlQV2ETk2hJw2Z1++fcIN97VFg2 oTWFUf5XSe1u4YI5RkU8qp/DP9iTSTBHQBjDn77QjiTVxEqrCcBZvpRZEUoKf6vPK6/E 5dSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PWyXmK+b; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e28-20020a631e1c000000b0046b0e168af0si397996pge.597.2022.11.04.12.53.59; Fri, 04 Nov 2022 12:54:11 -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=@chromium.org header.s=google header.b=PWyXmK+b; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229670AbiKDTcs (ORCPT + 97 others); Fri, 4 Nov 2022 15:32:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229581AbiKDTcl (ORCPT ); Fri, 4 Nov 2022 15:32:41 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CECC345082 for ; Fri, 4 Nov 2022 12:32:40 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id y13so5346421pfp.7 for ; Fri, 04 Nov 2022 12:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :from:to:cc:subject:date:message-id:reply-to; bh=GJx5Vo13L9gX9apUbugbGq7p+vwBn4IOzk+4YVYJbZo=; b=PWyXmK+bN4YM6UWblyRMVutXuc2f46M8K5kj7AsPvSQYau24NgfA3c14hTpOkY/lXh TgZknkLqE8+M15xi09X/3zFxiyUz3OD4glTMJZRgR90wrf2JsTPhor8EbFM0YrK/rKoG YgSETYSHttYklZcLjRGnOLHKMpA0xM6Z8PDlw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GJx5Vo13L9gX9apUbugbGq7p+vwBn4IOzk+4YVYJbZo=; b=R9Wi7Hs5oXaradb8e0m6RD21LKVq8o01hKZigcN8SxB52Bdo4NATCjMZAvf66AK03X Kk6eUaq1QI1oEPwwATiDkQhWeIfT+bhzl3NVDhzRFkbL9ATuN0ZxDrylbTTU1EE+rXT+ 4leB9cpMrJlm4stYLpxd4E3roLMZI4JPLv/4X2sCILkfx3FQ8gvzFH5lq7QKG5/RV7U5 IV0Zx8cWDIYWH3Whv8D5ATofEIE/dGY6vjGuSxmIS3dtFcz5o8QF+lKxJx2h5xkdsKe3 FVb89sZno/IKVmG0PlSqKfIfnQRqhZmTl1UhnR6oRoav5XJWYW0vMKzuzZHwzGo//zsF bZ2A== X-Gm-Message-State: ACrzQf3JU1An1EU4DtHe57J1eru4PzioVhTW19tpf3yKkOinusnllsUr 3BzJrToOdFippg5hhT/kS0+6VA== X-Received: by 2002:a05:6a00:a8c:b0:558:991a:6691 with SMTP id b12-20020a056a000a8c00b00558991a6691mr37351768pfl.53.1667590360362; Fri, 04 Nov 2022 12:32:40 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id e4-20020a17090a684400b00212daa6f41dsm95856pjm.28.2022.11.04.12.32.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 12:32:39 -0700 (PDT) From: coverity-bot X-Google-Original-From: coverity-bot Date: Fri, 4 Nov 2022 12:32:38 -0700 To: Peter Zijlstra Cc: Thomas Gleixner , Peter Zijlstra , Miroslav Benes , linux-kernel@vger.kernel.org, Mikulas Patocka , Josh Poimboeuf , Borislav Petkov , Yujie Liu , "Gustavo A. R. Silva" , linux-next@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Coverity: elf_create_prefix_symbol(): Resource leaks Message-ID: <202211041232.6071ACE@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Hello! This is an experimental semi-automated report about issues detected by Coverity from a scan of next-20221104 as part of the linux-next scan project: https://scan.coverity.com/projects/linux-next-weekly-scan You're getting this email because you were associated with the identified lines of code (noted below) that were touched by commits: Tue Nov 1 13:44:09 2022 +0100 9f2899fe36a6 ("objtool: Add option to generate prefix symbols") Coverity reported the following: *** CID 1527141: Resource leaks (RESOURCE_LEAK) tools/objtool/elf.c:833 in elf_create_prefix_symbol() 827 struct symbol *sym = calloc(1, sizeof(*sym)); 828 size_t namelen = strlen(orig->name) + sizeof("__pfx_"); 829 char *name = malloc(namelen); 830 831 if (!sym || !name) { 832 perror("malloc"); vvv CID 1527141: Resource leaks (RESOURCE_LEAK) vvv Variable "sym" going out of scope leaks the storage it points to. 833 return NULL; 834 } 835 836 snprintf(name, namelen, "__pfx_%s", orig->name); 837 838 sym->name = name; If this is a false positive, please let us know so we can mark it as such, or teach the Coverity rules to be smarter. If not, please make sure fixes get into linux-next. :) For patches fixing this, please include these lines (but double-check the "Fixes" first): Reported-by: coverity-bot Addresses-Coverity-ID: 1527141 ("Resource leaks") Fixes: 9f2899fe36a6 ("objtool: Add option to generate prefix symbols") Thanks for your attention! -- Coverity-bot