Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1953441rdb; Tue, 5 Sep 2023 09:42:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGkDVNm4bpCo99e6LsmmbN1QujF1UjJbV/EtC0O5q2vo7tTx0xneQD9ZSq+5j8gaBD29bb X-Received: by 2002:a17:906:768d:b0:9a5:d48f:c906 with SMTP id o13-20020a170906768d00b009a5d48fc906mr333697ejm.15.1693932156340; Tue, 05 Sep 2023 09:42:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693932156; cv=none; d=google.com; s=arc-20160816; b=njSDC2pqDJBJ9/ChPzXciTbCNloWhH2JnizDsb8Bwkk2oTI5jV5SMhsZj2hLyNpACJ FLnUe1vi0xVU7uyWWf2GbaoB7Olw5zcP+Nle+3lGcx1vK+TPL0vsXtTQ1htYNu85IOeH xwKoh1C/ofgYj0sA3xMM9KwncZl7FVdJqtqFgpWHgDXdVsmubymODmRoYd+XQkBKSNb9 TL6RDmRwMGfeiYSCHj56FveEKgzbDaNy8q9w+Z65jT0C5tCI353oZK1DmQP5XW5C9XzF taEmbeF5Zch1/rYHf9LYemzONRIzzDAhDGTIFQJC1q6/Fy79GW3fWMBzMOV8DAJ7iufy elgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=wUAGW9h1OX/2Y/iGRE83p0/xHOfZ/RDAjfa98pqTsUU=; fh=Ax7kIbtZqBmtPc5SXxAF+lRgkSweMeHUyQFK9JaJfB4=; b=tmYYGkKbUrUEhFwW0iKxfeHQvun+JkTTRn2kj5Y8lHeiKtxUDOkA58YarQ98fhP9Eu m1oQW61TXr+AlrDJ/Ml2qi8e9QMcCOuIJ0tdbCiwZBjSzHISwCDaHV1gdJJfzOJSYkwb us3FjyTG7JLOtU5IOrDO/eSxGQfA2FD111GduQHl5Sq83NgKmOGdG09opV1axca225LE xsq4or/B0rABHolm78fbJ1y+XG4phZav65yxds3EvEWEyFOYk4xX4X7cpNbLKwjGNdB2 jNk4GAF8epvj54HcDXlNrBLaRpEd7gwfepuCMilv6ZaSq9Q8yWaiTK8KNz/Oyjop/5O9 Mw+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 kf4-20020a17090776c400b00993a68a3af6si7918460ejc.511.2023.09.05.09.42.12; Tue, 05 Sep 2023 09:42:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245214AbjIEQUd (ORCPT + 99 others); Tue, 5 Sep 2023 12:20:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353795AbjIEISF (ORCPT ); Tue, 5 Sep 2023 04:18:05 -0400 Received: from 167-179-156-38.a7b39c.syd.nbn.aussiebb.net (167-179-156-38.a7b39c.syd.nbn.aussiebb.net [167.179.156.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0C3E1AE; Tue, 5 Sep 2023 01:17:59 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1qdRFi-00AtI6-RA; Tue, 05 Sep 2023 16:17:39 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Tue, 05 Sep 2023 16:17:40 +0800 Date: Tue, 5 Sep 2023 16:17:40 +0800 From: Herbert Xu To: Marion & Christophe JAILLET Cc: Longfang Liu , "David S. Miller" , Zaibo Xu , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-crypto@vger.kernel.org Subject: Re: [PATCH] crypto: hisilicon/hpre - Fix a erroneous check after snprintf() Message-ID: References: <73534cb1713f58228d54ea53a8a137f4ef939bad.1693858632.git.christophe.jaillet@wanadoo.fr> <00bdcfec-6cc1-e521-ceaa-d16d6341ca16@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00bdcfec-6cc1-e521-ceaa-d16d6341ca16@wanadoo.fr> X-Spam-Status: No, score=2.7 required=5.0 tests=BAYES_00,HELO_DYNAMIC_IPADDR2, RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS,TVD_RCVD_IP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Sep 05, 2023 at 07:27:47AM +0200, Marion & Christophe JAILLET wrote: > > Some debugfs dir of file way be left around. Is it what your are talking > about? Yes all allocated resources should be freed on the error path. > > The other snprintf in the same file also looks suspect. > > It looks correct to me. > > And HPRE_DBGFS_VAL_MAX_LEN being 20, it doesn't really matter. The string > can't be truncated with just a "%u\n". Well if you're going to go with that line of reasoning then this case ("cluster%d") can't overflow either, no? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt