From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 5B4F23A9DB4 for ; Thu, 8 Jan 2026 11:29:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767871789; cv=none; b=MsjfepLQqKywncOK/FgP12vPLzl3ZTdNikMdXS6V4t3q8eZSUJ54QTP62sbq8AM4ckttHuz7SxF1Ta0I8+O321d/2jGLg1nEaIOFnFpK//g+cCHGPtSXeSojdGFcrOq2bPk4XwLpNCm2+p1YEhmdjFgWY3lZDdg3T4nEtigOhSk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767871789; c=relaxed/simple; bh=DgkWQnj485Cdlj0s6OaAmvJGF615eW9UFZIJZgLGdOs=; h=From:In-Reply-To:References:To:Cc:Subject:MIME-Version: Content-Type:Date:Message-ID; b=fvApJHcAFsw2lS6/CuWh231ZE7W4IN1knS2wm8fQd26Nmpbs8Ni1z1xQakyW6TzkG6sop1vOtp/qi2DIQaNJkjX4lR9mYtul8DYi29J1KkS1JWUcdKnpPnMCcPASBjT1RnPtTE4yy5UoJa0+rBsfKtsN8VEgVHLLvEprTTY7BLA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=SGoR8NfB; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SGoR8NfB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767871785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BY4QFtk8w05Z2iDasTM1yxyFxo3qpga8FzQxbaR04dE=; b=SGoR8NfBTTPN9lA/mWTCD3RryO4PEV/AXLcyHJpXtG5UF+cMdbrnas7ZRxmPAnG5T0/D8c RaEdAqPtp+INPfA3t9JcmNhEYSgnvDDD+Awyzs3Sk3ctAEW6Gsq7b13eHE5XskfGlw43Pd WEdL5Jhgk1iMc75vP8Tinn8bMBC/tfM= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-322-0DGUIbRDOL2xf5vLaO_vQg-1; Thu, 08 Jan 2026 06:29:39 -0500 X-MC-Unique: 0DGUIbRDOL2xf5vLaO_vQg-1 X-Mimecast-MFC-AGG-ID: 0DGUIbRDOL2xf5vLaO_vQg_1767871777 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8FF5318005B6; Thu, 8 Jan 2026 11:29:36 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.4]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7598430002D1; Thu, 8 Jan 2026 11:29:31 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20260105152145.1801972-1-dhowells@redhat.com> <20260105152145.1801972-7-dhowells@redhat.com> To: Ignat Korchagin Cc: dhowells@redhat.com, Lukas Wunner , Jarkko Sakkinen , Herbert Xu , Eric Biggers , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , "Jason A . Donenfeld" , Ard Biesheuvel , Stephan Mueller , linux-crypto@vger.kernel.org, keyrings@vger.kernel.org, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, Tadeusz Struk , "David S. Miller" Subject: Re: [PATCH v11 6/8] crypto: Add RSASSA-PSS support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2708429.1767871770.1@warthog.procyon.org.uk> Date: Thu, 08 Jan 2026 11:29:30 +0000 Message-ID: <2708430.1767871770@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Ignat Korchagin wrote: > A lot of pointers and arithmetic here. Wouldn't it be easier to do > something like in [1]? Fair point. > > +DEFINE_FREE(crypto_free_shash, struct crypto_shash*, > > + if (!IS_ERR_OR_NULL(_T)) { crypto_free_shash(_T); }); > > Is this useful enough to go into some commonly used header for shash? Maybe - I guess there's no actual cost to doing so as it generates an inline function. > > + struct crypto_shash *hash_tfm __free(crypto_free_shash) = NULL; > > + struct shash_desc *Hash __free(kfree) = NULL; > > So even though x509/pkcs7 code now has a counterexample (partially due > to my fault) seems the consensus [2] is to declare and initialise the > variable with the __free attribute at the same time meaning it is OK > to declare the variables later and not follow the "declaration at the > top" rule. Ok, I'll move the decls. David