Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1541184iog; Thu, 16 Jun 2022 08:26:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vF0iBUpIEit5/CUd/fTQI+Ui6gsKS5FhIASd2HtuD8Iv56bIt8hoeWYsv3aLOixTp+puoM X-Received: by 2002:a17:90a:e2d3:b0:1e8:ab66:c0be with SMTP id fr19-20020a17090ae2d300b001e8ab66c0bemr5716205pjb.12.1655393189986; Thu, 16 Jun 2022 08:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655393189; cv=none; d=google.com; s=arc-20160816; b=AfwUTj43OVJXtbgo1CUW09ubk7isBo9w36GqizBvHGhfnGsjS3fL7qgAo2NspoCTSW wqU7rb5TknkgGRz81jaE2sZydyPGbZsZ4oPRS6PVZTcI+b7QL5i20QG4E0KmnVo6RmZp ihQI0HyR2oL62nClLprKOVksgQcP9Ozh/d/aKBsPEzJYJWbb8vGjTYqYtvjBnzU6G1qn GJVglAoK04eOASWwgoJpmmqbQJaBF4mzl5gexIUAjNSu2OTW9sesC9bHF3n43FOFXRf+ zsG05IxfU4n2TZ4Oz5Ccqzg6csuZIPstmq33YOXKkr/XdSQszn0cGxxaLg5djIvEaZv5 Zeag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=mZRF6hJ3UGdutY4x1XFgjt/qO9jlqhvxRlKhleqTfz4=; b=zjG03+U39BbapvOGncqKbtL+d1Rcv3Dz9nd1/gU8B/f2CfrY5HtnB6eosYCQ5RI1kj 2A1G7+/vAmJWNquxghH3lauZVcsePOiAdXknpqnxky+Blxrx+wkdM+Fl74TR/gak6FK3 qUZ7r8mzSLKC2hiqqwx5QC6kGhrJ86ASaDmd1dnQrmNa/c+E//rLDu2RGVGwHDXZkc6d WtZRlmTV46yYf4tUbwXSmIhxc+twb+Dxvdt4cWM5UN+aM9BI5G2DvLdVQFt2c54mQjRX rL8wPb1DlPEZ5Tt4q8N1XA+/fSWh7+M0HPUocvkJ1amtr2SD49j0UPo6D/t5LvjR05Wd 0phQ== 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: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 s30-20020a63215e000000b00401b6bca5f2si2600458pgm.301.2022.06.16.08.26.17; Thu, 16 Jun 2022 08:26:29 -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; 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 S1377593AbiFPPQO (ORCPT + 99 others); Thu, 16 Jun 2022 11:16:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233390AbiFPPQN (ORCPT ); Thu, 16 Jun 2022 11:16:13 -0400 Received: from hi1smtp01.de.adit-jv.com (smtp1.de.adit-jv.com [93.241.18.167]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF334340F6; Thu, 16 Jun 2022 08:16:11 -0700 (PDT) Received: from hi2exch02.adit-jv.com (hi2exch02.adit-jv.com [10.72.92.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hi1smtp01.de.adit-jv.com (Postfix) with ESMTPS id 71C21520290; Thu, 16 Jun 2022 17:16:10 +0200 (CEST) Received: from lxhi-065 (10.72.94.4) by hi2exch02.adit-jv.com (10.72.92.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 16 Jun 2022 17:16:09 +0200 Date: Thu, 16 Jun 2022 17:16:03 +0200 From: Eugeniu Rosca To: Roberto Sassu CC: , , , , , , , , , , , , , , , , , , Eugeniu Rosca , Eugeniu Rosca Subject: Re: [PATCH v4 3/3] gen_init_cpio: add support for file metadata Message-ID: <20220616151603.GA4400@lxhi-065> References: <20190523121803.21638-1-roberto.sassu@huawei.com> <20190523121803.21638-4-roberto.sassu@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190523121803.21638-4-roberto.sassu@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.72.94.4] X-ClientProxiedBy: hi2exch02.adit-jv.com (10.72.92.28) To hi2exch02.adit-jv.com (10.72.92.28) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE,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 Hello Roberto, On Do, Mai 23, 2019 at 02:18:03 +0200, Roberto Sassu wrote: > This patch adds support for file metadata (only TYPE_XATTR metadata type). > gen_init_cpio has been modified to read xattrs from files that will be > added to the image and to include file metadata as separate files with the > special name 'METADATA!!!'. > > This behavior can be selected by setting the desired file metadata type as > value for CONFIG_INITRAMFS_FILE_METADATA. > > Signed-off-by: Roberto Sassu > --- > usr/Kconfig | 8 +++ > usr/Makefile | 4 +- > usr/gen_init_cpio.c | 137 ++++++++++++++++++++++++++++++++++++-- > usr/gen_initramfs_list.sh | 10 ++- > 4 files changed, 150 insertions(+), 9 deletions(-) > > diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c [..] > +static int write_xattrs(const char *path) > +{ [..] > + while (list_ptr < xattr_list + list_len) { > + name_len = strlen(list_ptr); PVS-Studio 7.19 reports at this line: => usr/gen_init_cpio.c 84 warn V769 => The 'xattr_list' pointer in the 'xattr_list + list_len' expression could be nullptr. => In such case, resulting value will be senseless and it should not be used. Check lines: 84, 69. I guess the finding is valid and it's due to the fact that the malloc return value is not being checked/sanitized? BR, Eugeniu.