From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 668FC4195C9 for ; Mon, 20 Jul 2026 14:58:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784559517; cv=none; b=se1U3q2z3u535/1FS35Gj7bxADT0XrK8QV4GMWkCMDCGHFsUmjWtTj0MLTKbVe9mAoOp2U9zAPomg8lzqxFrmqQMOWhNpmh2fNb3jPx51nnr9ZOq9bDremkr5AVnn3CYaS7qiQ1Wbhpxyhp+aoduRpYc+9UZmiHbb1xP6Rl3f8Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784559517; c=relaxed/simple; bh=l+BJP2dTlbI6R2M/a/gl69wwhg4/sSj0g/jxUAkKdPo=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=pTkOBTq/3VHDuVknlxaUYOz2zkBfKDOlJq6BsOhOoxb1nYlLv7451SCxtu0smiaRxvUFHyZg+XvWsxDra3ysAr8VYVWe+hv4WSPCUWrk4Y6VDR9ijhfj4I0w2gqrIDvyDXsU86jTiBUP35RRx6k83/88f3IBKnjT2BWNGxqVLZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=VxpvFeSO; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VxpvFeSO" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4921eed3fa2so78364925e9.0 for ; Mon, 20 Jul 2026 07:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784559515; x=1785164315; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:content-transfer-encoding:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=3QcpbpbKJ+LK6Rusjs4UjDCzBYijN9Tg1ogvRHpP9po=; b=VxpvFeSO+g5GMjAekTgqpfjInECmI0W8ep7yJe83Id2WxYN/VLvX6KwOkg8/jC2fQT hlNcIctgOJ0BaBLPwxPtpAWGf3LkZNVxz8A2M5eg0o85voN45hg9xTGPUX8IKCSlWi04 9JdgfC7nAzjOGGnl3LZ5d2x9gVrWC94SlC7Vc6EE2QwfexDn2tMfWSXefSCg7D7BDcDg sGN8omKQ1iWs3yUWZO7uLeKTD0NOoCyr9t/hwLBDCA1FmCFrkUh5VKdKc1F4NEpjrEFR cWJ1//7p2XZoC+r/o+EJG48mDCpjNlnqVdscT200igWUzIWrP+T0eaewnMvNKOz/3pln BWPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784559515; x=1785164315; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:content-transfer-encoding:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3QcpbpbKJ+LK6Rusjs4UjDCzBYijN9Tg1ogvRHpP9po=; b=jcAYnoreNtzx7hC8PsjM06qsJDLStHAjD9O+DZOPXE+0KGQaUASikC65/kKGBl4Na2 O0zzRRnOHG6L4CSwVOB5SkdhpOepa0xLk166DeijGrBGyIxxYXR/F5CuqIFUTEXY+UPe 32OSTiK1mx/uJLfp6evh8+cONxIHNtDAwey4/NWoRb3kwOhEvlg4H7F7Nd9JNiSWUhrn O5UBrBrKJ/lIgKGvEJlGowAlvzpFY9lJtMM5CczvTt4nNFyjfayuel6u2dv2b+1JZLNX 5RNUvPm4D2CBZv5gQtLsZXvjpVHp1coOnjMw7aWtvB3FYtnE7hnYCeGEE+HHoT+j4Nbc Koog== X-Forwarded-Encrypted: i=1; AHgh+RrgDeOjpsuRr9uEraARfp3axGoiLaWLHXoMVqMMoIG2UbvswU0Duv4IV8Kj6wdCcVyT+lsM+UKh+iPimdI=@vger.kernel.org X-Gm-Message-State: AOJu0YzKCr/HqjJM946VLtVwrUsGaCPGfGtysnSWth1jJS1kKyF2w8IT i8R2UiWykGMMaexhBbyA0nid5urvmp7YQs+9sBw4dS/0SF9Y5VYfdaO46kz2LhfPETQ= X-Gm-Gg: AfdE7clKYHx/Me8S/rV27PyGvaWIBU6KX2K6tmSHchJyNmwXKakUjSiKYPjO0oJJaPf r/28dy+zr91HhSuh41iU8drTCB7yt5L9b74QVdUhIrJSnmUSSdJYMvvgFKzhgn8evwEewj5MoDS f5MLFiE6wL0GhDhCKaAjEHUsOEVzML8XdrVvfbs5PZ1tyDFMMsE5oSMIr+yXdaM3JBxHfTxhfpn 1FqX9S6uKqAR7z8mJCNilovhyeet+9hANJqQLGgXXfwzJNLN+uZxZkRmauHEkosqwrYi/mZT/8e SrKeRzi9P8IpUiXngId9KiMQu0ey8bnYJeWq55R5RrD7wFswWUv/ZvCQpwbt31Z3nSB02/b4blq pUq4PjEJS45HYKldMMQ1EzJSUYjHaRZ3HXFQE2HboZRTKJYGJubW2hHGo+Js37l2y7WdvB7l8nJ HuxsZn3qOuKrzFdYa9WjJwG1ggGCJUrZPR23woVSusU/aHJO7X+KJI5WBe5eG6y3OVl5ZI0xwr1 98QtCI= X-Received: by 2002:a05:600c:1d18:b0:495:515a:dad9 with SMTP id 5b1f17b1804b1-495515adc7fmr115346585e9.37.1784559514625; Mon, 20 Jul 2026 07:58:34 -0700 (PDT) Received: from localhost ([2a00:2381:fd67:101:3573:8c21:531b:8da6]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4954c841a0dsm244416185e9.5.2026.07.20.07.58.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jul 2026 07:58:34 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 20 Jul 2026 15:58:33 +0100 Message-Id: Cc: "Huisong Li" , , Subject: Re: [PATCH 2/3] mailbox: pcc: Check shared memory signature on request From: "Alexey Klimov" To: "Sudeep Holla" , "Jassi Brar" X-Mailer: aerc 0.20.0 References: <20260717075649.467172-1-sudeep.holla@kernel.org> <20260717075649.467172-3-sudeep.holla@kernel.org> In-Reply-To: <20260717075649.467172-3-sudeep.holla@kernel.org> On Fri Jul 17, 2026 at 8:56 AM BST, Sudeep Holla wrote: > ACPI 6.6 Tables 14.9 and 14.12 define the PCC shared memory > signature as the bitwise OR of 0x50434300 and the PCC subspace ID. > They also clarify that the signature is populated by the platform and > verified by OSPM. The signature is at byte offset 0 in the generic, > extended and reduced PCC shared memory layouts. > > Check the signature when a client requests a PCC mailbox channel, > after mapping shared memory and before binding the mailbox client. > This keeps the check in the PCC mailbox controller instead of > duplicating it in individual clients. > > Treat a signature mismatch as a warning rather than rejecting the > channel request. Making this newly added check fatal could break > existing systems whose firmware did not populate the signature > correctly even though PCC communication works. Continue to reject > shared memory that is too small to contain a signature because it > cannot be inspected safely. > > Cc: Jassi Brar > Cc: Huisong Li > Signed-off-by: Sudeep Holla > --- > drivers/mailbox/pcc.c | 36 +++++++++++++++++++++++++++++++----- [..] > +static int pcc_mbox_validate_signature(struct pcc_mbox_chan *pcc_mchan, > + int subspace_id) > +{ > + u32 expected_signature =3D PCC_SIGNATURE | subspace_id; > + u32 signature; > + > + if (pcc_mchan->shmem_size < sizeof(signature)) { > + pr_err("PCC subspace %d shared memory is too small\n", > + subspace_id); > + return -EINVAL; > + } > + > + signature =3D ioread32(pcc_mchan->shmem); > + if (signature !=3D expected_signature) > + pr_warn("PCC subspace %d invalid signature %#x expected %#x\n", > + subspace_id, signature, expected_signature); IIRC signature comes from table, so I'd even add smth like "Potentially broken firmware: PCC subspace %d invalid signature %#x expecte= d %#x\n" or "PCC subspace %d invalid signature %#x expected %#x, broken firmware\n" = or similar to encourage reader/consumer of the message to report bugs to firmware provider :) Maybe it will be even fixed. Anyhow, regardless of above: Reviewed-by: Alexey Klimov Best regards, Alexey