Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp191920lqg; Fri, 1 Mar 2024 02:11:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVY9Mqo6cP3uwgZ0X59fpZErRSLW4ZoMFilsuUD/3ZkO5azb7mknI6i4LynVAQB518rpUlubIWJ2Wf3QrZpU2MRm0o4xVaSioWPoKRoKA== X-Google-Smtp-Source: AGHT+IEPPqdfxvySMY7PdLp0frMcKco45DTBX9ha6zx7tDvMixsRYBAyQwAxL71Ok4gop2jDURgv X-Received: by 2002:a05:6808:3c8b:b0:3c0:2bf5:7c11 with SMTP id gs11-20020a0568083c8b00b003c02bf57c11mr1941542oib.17.1709287876306; Fri, 01 Mar 2024 02:11:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709287876; cv=pass; d=google.com; s=arc-20160816; b=EuQ7Cri93FDU13plL+I6lKeMae42tkJARgCPwj7PFn23/WP1hCwmlF1tdV+8W8F6Ue X61Iq0IiZKx3tlniPg/aYSFFECdtb9Bu22qNaZ2Rcy+KI1hghhGXBcNpRwcWfG92ZDdZ Xq/J9dnaUzjkKE0dKLPrRRXsk8QsCBKexjnpX8ETlDrStenTMXz4OjmCpvKYbssdUHfu KMdumY1+wd/uv6/RqHq+4l9PBuDBU+ljUPQo1lOIA8gbkElrOXC+MOTiD38MCwV/ushR CMbHoKDwgVb/P9GnixCC+gRDDxh+nmtqC1DYQiVcvr0zZ6VUpXph4gWd2XDtC4aRtzRR ls2w== 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=D+8+A4rAEb4xhKeutFjua3q8xf9A6KdrNIjoYsXETGo=; fh=YHrumqgMEu4RWLB5H+WnsfaxzrRtPe0O0ZPdC31Jmu4=; b=RNJyUQZrnLNCgcZEY7EyTZ3a4Qdzb8e2h9lrKahJM22RVj9RfqaV1qAfnrW7U6z3Tx 9IMmSj3GfDKl9IF67SG0sEW3w1XuDEu3JSs3krv7lWrEsV4WZOb6pwyuhXurtOGBmVPB J3KmI+lp4uJZ/tLESnDO3XzOKSbkDav9/UUSIt6KVbWzhpOmv8O+vURNlfw/01U/7Fzr /nXwnYNiUR7kd/ZLsZ0rznf9XX04xNHH7ce4NOHYADAw13FgmEROaTN3TWisR01d/QhU WjqHw3+LNjuUEhuR9jm9ZTv+FbY1Y72yMdSB2USAJNmUtwR/qGkyiJR4yXfr2YXiybeU quHw==; 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-2419-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2419-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 sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k123-20020a632481000000b005e468d36711si3329567pgk.652.2024.03.01.02.11.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 02:11:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2419-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-2419-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2419-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0C20E28188C for ; Fri, 1 Mar 2024 10:11:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 124426A8C1; Fri, 1 Mar 2024 10:11:00 +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 424DB69D0B; Fri, 1 Mar 2024 10:10:53 +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=1709287859; cv=none; b=eotGCurQFMTnwkqfjTpWdgUz+ceTGi3/UKeSA8Lt7S1GRi4SD1hLQaMWrONgE7z0horBU34WxvI1p9ZNoKy9Ywj1eOoxwZlF5Z41/lKbl2Je6h8hk7ek1h35Uy8xVQJnt9hy32EukbBuPDAEBFsiblp1WwKfca3s28+NKoutR6w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709287859; c=relaxed/simple; bh=EzcF9ZQTKezu3ctCnmIcVfuJobPV12/FVjM3b5XLDeQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NAbXqBj9/nOVH0mn4T3TOjrFKAOCRQeuQBRt8OAY3vBR54Y0eO8biE3quGgtlnazjNyTpPcodcqE37ik2ZDMe085WOSFCi1Q2rg7yy/L/HkmKQYvMt2bJH+/whtW4Khl6D2kWnEtcXVjjYEghx/4sy8CRl8MOB2XlNPWWQu3xDk= 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 1rfzqM-002Gfn-7x; Fri, 01 Mar 2024 18:10:19 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 01 Mar 2024 18:10:33 +0800 Date: Fri, 1 Mar 2024 18:10:33 +0800 From: Herbert Xu To: Lukas Wunner Cc: David Howells , "David S. Miller" , Jonathan Cameron , keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, Andy Shevchenko , Peter Zijlstra , Dan Williams , Ard Biesheuvel , Jarkko Sakkinen , Nick Desaulniers , Nathan Chancellor Subject: Re: [PATCH v3] X.509: Introduce scope-based x509_certificate allocation Message-ID: References: <63cc7ab17a5064756e26e50bc605e3ff8914f05a.1708439875.git.lukas@wunner.de> 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: <63cc7ab17a5064756e26e50bc605e3ff8914f05a.1708439875.git.lukas@wunner.de> On Tue, Feb 20, 2024 at 04:10:39PM +0100, Lukas Wunner wrote: > > In x509_cert_parse(), add a hint for the compiler that kzalloc() never > returns an ERR_PTR(). Otherwise the compiler adds a gratuitous IS_ERR() > check on return. Introduce a handy assume() macro for this which can be > re-used elsewhere in the kernel to provide hints for the compiler. Would it be possible to move the use of assume into the kzalloc declaration instead? Perhaps by turning it into a static inline wrapper that does the "assume"? Otherwise as time goes on we'll have a proliferation of these "assume"s all over the place. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt