Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp176267rbb; Fri, 23 Feb 2024 16:50:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXDJWfFdbIWt/e8nisxYP8Qv+fMxkePNkB8VxcGlvdCq36HeQ08Uu1B0gtn9r3hSPGaRRLuNXKh7gL+PNSS1lc/iZ48BLj9/+5owO5mmQ== X-Google-Smtp-Source: AGHT+IE/i9CWiLn1qQ9rFeaib4JwW0zxJ9EnNc1XxL5NrXR9N+qXcCUHEbwLepYSDSfAw405kXM/ X-Received: by 2002:a17:906:2496:b0:a3f:7138:f837 with SMTP id e22-20020a170906249600b00a3f7138f837mr861043ejb.12.1708735848087; Fri, 23 Feb 2024 16:50:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708735848; cv=pass; d=google.com; s=arc-20160816; b=Qmq2DFHrq0OGGCbZSM6U5oYHLK0V+97DJvisbvbr25n3F/o3RQzyLufk3h0LUiqP2k PI61zL71DQHROmP0PwzcwAdTrfqm/SY2g+NKjtUBVfjtxAOq63xvFC7o2tiOW+5yzhx4 ZB10pazyaabPG7ERzYzGR+P7aGAw6lRyQKwCy1yPlnbMSsMIjjHh4ABFGFBNI191mAUr wO4sS7wDPpQb8Ne0Gm6XfRqFMUbo2Up4aMlGvb73HXPrC0ofz3t/yz3w/RvBh6vnI0XM FcUkQUUqpec974d2VnEQy8U5/Y57tKRKAqOCr5CLiEDzgCMgfwsrtdksmf9LTilgzBSG g4Sg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=jke1e4FppY48gDW5Mlz81q3VJt7zYLGcvX58/UgiyCc=; fh=S2TJpLyU4f0UagcSnq10yoZ3WkxgQg6ofjuzJBMdiIo=; b=x+Qbg2VXLMtaMmzzEkjU+9VBkxYWvks6pPwl/87UJEQpWHTuXaurS5gj2mKk9nCXOu NPZx10ChTrcFzq7ZwYtipojwNM4GP2fHZQfqCGGEZobpamz51abhazQ6YSxUVPkV4NeI 3tWp3RlKq07i9M8WWVoXkuDV4yUxJGNy//TLIdWmn5LnB69d8CeVszDFnez0n7/3yuhl Y8lWJiQoefmVJnaZr41JQX1gDbB9VeNC+IPX/jQiItNE2yN7oS9XYqxXP7+97nWi6o/I s1eUFP2yctAVa2Ml6o3EMFMyC8DZoqX+7YTAxqTGbcPa9/8vHayyjHzAGsYofLcPQCI7 4EtQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gondor.apana.org.au dmarc=pass fromdomain=gondor.apana.org.au); spf=pass (google.com: domain of linux-crypto+bounces-2297-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2297-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=REJECT sp=QUARANTINE dis=NONE) header.from=apana.org.au Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d5-20020a170906174500b00a3e3a37b793si83568eje.419.2024.02.23.16.50.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 16:50:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2297-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gondor.apana.org.au dmarc=pass fromdomain=gondor.apana.org.au); spf=pass (google.com: domain of linux-crypto+bounces-2297-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2297-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=REJECT sp=QUARANTINE dis=NONE) header.from=apana.org.au Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D4C2A1F260FE for ; Sat, 24 Feb 2024 00:50:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 06A63184E; Sat, 24 Feb 2024 00:50:34 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CF6117C8; Sat, 24 Feb 2024 00:50:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=144.6.53.87 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708735833; cv=none; b=uNvH/ctve5HBzU6mS4aalwsfcgYXu8JP7BH7K+Q0rjejDw9/ZjYoUwvMJDXAVbm9tmEQowrCW1pQ3ipWQ10Mr+KbSAaAL9O40YRP4HRDeIojb3rmpvbHeYsLyyDlNQSriXsWgRgr7S2uIJV0BCjmdUe0IjpT+ynOshoE6S9j0Eg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708735833; c=relaxed/simple; bh=1Yx8JWtZT7NJ/ks9g6HxK/LqurKWFCidlnpb6hkrE10=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sZs44ZEmlGhapqM9+GRj0EzO0L449Qk62zfP0EzV089pqSVPWDdGDb7l7dMCKBoNXFlrsD71ssy3HqalPHA5uelUfwi75YBMxMB4CN2eHBgbjCGWRtC9lVDRxzzCFly0jPAOKWLKu3oXYw4XvHwWkZQR6YzUv0yeZ9iXHDTm3/w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gondor.apana.org.au; spf=pass smtp.mailfrom=gondor.apana.org.au; arc=none smtp.client-ip=144.6.53.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gondor.apana.org.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gondor.apana.org.au 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 1rdgF6-00HDvZ-OA; Sat, 24 Feb 2024 08:50:17 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Sat, 24 Feb 2024 08:50:31 +0800 Date: Sat, 24 Feb 2024 08:50:31 +0800 From: Herbert Xu To: Dan Carpenter Cc: Damian Muszynski , Giovanni Cabiddu , "David S. Miller" , Lucas Segarra Fernandez , Tero Kristo , Markas Rapoportas , qat-linux@intel.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] crypto: qat - uninitialized variable in adf_hb_error_inject_write() Message-ID: References: <193d36b0-961a-4b66-b945-37988f157ebe@moroto.mountain> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <193d36b0-961a-4b66-b945-37988f157ebe@moroto.mountain> On Tue, Feb 13, 2024 at 09:09:41PM +0300, Dan Carpenter wrote: > There are a few issues in this code. If *ppos is non-zero then the > first part of the buffer is not initialized. We never initialize the > last character of the buffer. The return is not checked so it's > possible that none of the buffer is initialized. > > This is debugfs code which is root only and the impact of these bugs is > very small. However, it's still worth fixing. To fix this: > 1) Check that *ppos is zero. > 2) Use copy_from_user() instead of simple_write_to_buffer(). > 3) Explicitly add a NUL terminator. > > Fixes: e2b67859ab6e ("crypto: qat - add heartbeat error simulator") > Signed-off-by: Dan Carpenter > --- > .../crypto/intel/qat/qat_common/adf_heartbeat_dbgfs.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt