From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.49 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796285006; b=W3IYF+U4YYwfRYPNz7dP7jZFxBffuSlccoytIhNLldhltff8dSTSn9VKj3D6BymucQpQ 5IRThun00xLj69FhEUjnlyRWF+JomtxZiHdNsvbfbJE8XQdra+UNNnp9sXExV3zgZikGn OCrUfYBrC7YGDSp1zgKK19z301NUZBqrWsnCTc1mR4TUMfo2z/Ztmv/YqJxFjPmAfqKOK VsonZ0n5GFtkQu6cLUNl3kyM4OJ8pK7ErWHWoX62j4umwQQRz3EC98Qas+MKGpIJ4iIXV 4oPHoZ14SUcFR5jg4m+RWuJvPNXUokgL9VZUe8RSSpiuQSa4VFB42UeLaNJPTzLc0Gg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796285006; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=mDSnLYbme33YIR8ZYcaKfawWgilszP97sD8uGpqETnM=; b=WnClrBV+r2Jdnwjur2f3HA7gymh9SvJiKnb8yohFmOlK1mYHNg2v/fl+lSF5PvYMhvWM rkLPu3Y5gf+zbAjhqkJqD6IVtLWnhmG6qEoS5RY3DeJ7GsvZhUx00EUZZKKUfl+JfvL4N bYCNPuUnMI9/chZjL65nO64e/pDGfcvR1ExvoX49dt9axhyjAooxLYhL3obrKx9sPhX9J OvshXdUCfo5WzuJ8mGB8CRAf1e2XjfJInHho6yLZuA8oUeQEOayZNbDYvcL2GdO+7LjB7 sugEZVozLM6pA+gYlACy9W+5EycEsw4N6EifMI7az9Iz9xvHQTkk8z3YN5VkcjJ6MKA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=pereq.eu; spf=pass smtp.mailfrom=cryspen.com; dkim=pass header.d=pereq.eu header.i=@pereq.eu header.a=rsa-sha256 header.s=google header.b=RDHD5GHf; arc=none smtp.remote-ip=209.85.221.49 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1A4A606A32D for ; Thu, 3 Dec 2026 08:03:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B1A4A606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pereq.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cryspen.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pereq.eu header.i=@pereq.eu header.a=rsa-sha256 header.s=google header.b=RDHD5GHf Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-4cf418d85bbso281161f8f.2 for ; Thu, 03 Dec 2026 00:03:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pereq.eu; s=google; t=1796285004; x=1796889804; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=mDSnLYbme33YIR8ZYcaKfawWgilszP97sD8uGpqETnM=; b=RDHD5GHfzrH2JBc0Hq4Qvv2xtc5k5oSMlnYyn+s1Xyi5PCLtbsb+3fHsGUVV5x1wGa pxcC+edbEg3wni3DLuMlHp/roDhmZys71DP6Rmf9Hk4KdnRVoxm1ry82DP9vxvzLqX+i gUlsz5UvEUdWR6Dd+yYJRxre15Cpso3mKyKZVChW7zyjTVJhMnrJbB8Waf/SfVCN8di7 4oAECsyd+/3nvZfEiOJTOHbuYV6ojP5Nd5pBsRWVPvy28RpUSTUFuE33gSe/ehTnMJKP ewEoLFcIMbX5s7I0VvqL4t+rQHrBF+bJqUKM/QB6SWu0SoPcX48KUGmitsKKvcYjgIBv UZgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796285004; x=1796889804; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mDSnLYbme33YIR8ZYcaKfawWgilszP97sD8uGpqETnM=; b=BmCHJsKT69z8ezYDaKqxmouKplH9QYn1tT22B06jmFxiLa0+NZ56/QsaIvQm7AHHcj NHn+aHs8jaBFoyypso0Cy8CjL86yNabKXIqE9bScL8rtKEBZnIMNFfxVQXde7LSJvld5 RYhH2a2u2Z81BEPQnKzD5TdxU7NNcCP+EdBEHnlElSe61N/oqBu1691FhErVLHMmw1xc G9Ld8oveJ9H13HRAw14Wpeq4K4Rm4Jvh3dMUUpy8kIAHz6cvCrO63Ad9l00RVZ3sshHu Vzsjdx2N9ZtTmFnFK1YxU2wzW7xNvr+n0wkB1M4FqoGH2fhUBmn9g5Bszx+wyBUkFqM0 cGdQ== X-Forwarded-Encrypted: i=1; AL+hErFHjwkBs18GeWM8mrNh2vEL1vKW/kUgR4eMgxx/LExBK0jYl2usgFDb24BIhGtGqyJlxytMDqEv0UqV/jM=@vger.kernel.org X-Gm-Message-State: APuU4Z9JPWYEsyUep5D07lc7gOJ+f5k+xT7cs828tZu8L7piHCpIcupO ZCzD27KpCdjwaJyyqKWsR0e3x09j8YVy0Cacnbtm70bXjjgQihyTYrSSMycZ1gO4lPU= X-Gm-Gg: AZFdTZcPCtoYzEKgLxcRc32rGkICNYDoFXpG1h0NBqgXUGoI88dGVc9EXu7N3pHjE7D zxYzL3otZCrne6w1Cu9LrUvp1SU4SCgk//+AUHlBws2O0EeKbWLFjAZZNXQDnHXzQCYLVPDRtAV FdI9rwVBBBkHr27qSiyB02vE9TjzsV6A+xROn7KSOAJuxdc8ud2/uCDl9EeRhSKDn6EP8rVOcs/ Wz61GBfVqYJroc9gSGG3nbdWNGDZCiWPNa4tvvFM45ZFY19q2cYEx4F6+Lt4Ry+dE5OT4gPXP0D BqKt3NXIbLqq20Pu7zUFBSgxcNM9WZsejmCO5s5NfLQW2Kaxf5UBdzsdQ7exbPSWnOumP43zcML nxDFofl3+O8O1RhscX6ynW9L4KBlRlTRYb5Yg50pZLDdoixfk0p4mokpA+Taz8qf5TbHdNo73DD DEpVY6jHWJZYMv9HFUGbAZjvMz1Hf+fJcGCnY4wgrC9O3aJf3xnVy32tYdDVmzbK3Y5zg+VVsAj MC7x/VEF01ndulB6zuGbNcfs/fr2M8G9eRD3PISZWxbp4jAXJmctcGEonPH8V9chJWQJq10L0bw O0CR2UWolhc5Llfhyw== X-Received: by 2002:a05:6000:2283:b0:4af:e519:cccc with SMTP id ffacd0b85a97d-4b546663d5bmr64578812f8f.12.1796285003895; Thu, 03 Dec 2026 00:03:23 -0800 (PST) Received: from localhost ([2c0f:3d00:6be:8900:ce5e:9212:ea4b:f30]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6c4353d6sm78904620f8f.56.2026.12.03.00.03.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 00:03:23 -0800 (PST) Date: Thu, 3 Dec 2026 11:03:19 +0300 From: Dan Carpenter To: Fabrice Derepas Cc: Ignat Korchagin , David Howells , Lukas Wunner , Herbert Xu , "David S. Miller" , keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] crypto: asymmetric_keys - bound PE section ranges in pefile_parse_binary Message-ID: References: <20260815114533.2171445-1-fabrice.derepas@canonical.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260815114533.2171445-1-fabrice.derepas@canonical.com> On Sat, Aug 15, 2026 at 01:45:30PM +0200, Fabrice Derepas wrote: > Since we are now centralising section-table sanity in pefile_parse_binary(), > the natural fix is to reject n_sections == 0 there as well, e.g. by folding > it into the existing bound: > > if (ctx->n_sections == 0 || > ctx->n_sections > (ctx->header_size - cursor) / sizeof(*sec)) > return -ELIBBAD; > > A PE with zero sections is malformed (a signed kernel/EFI image always has > at least one), so rejecting it at parse is safe and closes the > ZERO_SIZE_PTR write too. I will include that in v3 and cover it in the KUnit > case. > > Do you prefer it folded into this patch, or kept as a separate fix for the > canon[0] write? Either way I will respin as v3 with the KUnit case once you > let me know. > It's been a few months... What's the status on this? regards, dan carpenter