[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 3/7] xen/console: use memcpy() in conring_puts()
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: dmukhin@xxxxxxxx
- Date: Thu, 16 Jul 2026 23:18:11 -0700
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ford.com; dkim=pass (signature was verified) header.d=saarlouis.ford.com; dkim=pass (signature was verified) header.d=ford.com; arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wTbv5APj0X4h+JTSNP+IH6Ed93/aqOG9yhDTnqNdTgE=; b=ah5huPgCsHr9tMrLQQkl6MGpVS8KcjUBugR+OrLvsughge9loHKq6WSwSi9ggxIdNZPSRsbn1S9wFEYlpJOQbPhC+IEl6UPwLwFrHawG0SlRl33YEPlu3iXz7bH44x/AHc2ATuYM6ZExNzNi5eDrYquHIQlMJQTeDZ2vHsEQU0fRj+UL7Yt11nUajBVJR92n2mK7OGKwkzAIodmc2bhZmyUqNWeDJbQU7RhUTEVshrBF/0XtLM61kz8+f3/fyD9u1siYEKk12L/W8kL8dRwz8gM0iJ0HFthMVpNnpm1KNaOQGM+x6HSi2T8Tmqm3DZGNBoGFXmE7La82YacagS9ZzQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=G1zGPxhjgv5mguwRsmaPEAO2rnzy0I4YfnjB2S3Z4PAPFEF6dlKmqtCuaPgG8JGhY9tH0g1QDze2masjoFqzRUyDF2Apgy6jWbUHucdlEYJrkOqzt53/PyxD01/PsjxlRCZqugdNY1UoES3p+eSMHRKLJERLl8UM3vPIW4Gxx3lTQi3SSJ4VDnCLahYTt9pTAsG1IqzbENgFpn1ICKYASflscg+x4fGCTJN5LvZvmUnbqmMHATbruhFYBwhE+hCeJoCAFH0PUo6E+9o7rEL8ARG3OjpwELyUS6hSVMsbciaOA2Nqw2lgayMuevr7ogFNOM8wfPedoTsJZ4rvvEOwWg==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
- Cc: dmukhin@xxxxxxxx, andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, julien@xxxxxxx, michal.orzel@xxxxxxx, roger.pau@xxxxxxxxxx, sstabellini@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Fri, 17 Jul 2026 06:18:40 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Pser-m365-app: SER-APP
On Thu, Jul 16, 2026 at 06:08:01PM +0200, Jan Beulich wrote:
> On 13.07.2026 20:16, dmukhin@xxxxxxxx wrote:
> > --- a/xen/drivers/char/console.c
> > +++ b/xen/drivers/char/console.c
> > @@ -360,12 +360,22 @@ static DECLARE_SOFTIRQ_TASKLET(conring_tasklet,
> > conring_notify, NULL);
> > /* NB: Do not send conring VIRQs during panic. */
> > static bool conring_no_notify;
> >
> > -static void conring_puts(const char *str, size_t len)
> > +static void conring_puts(const char *str, unsigned int len)
> > {
> > + unsigned int src = likely(len < conring_size) ? 0 : len - conring_size;
>
> Isn't the attempt to handle strings longer than conring_size pretty much in
> vain? Things look correct as far as the rest of the logic in the function
> goes, but is this useful? It certainly warrants at least a brief comment imo.
Thanks for taking a look!
I don't think there ever will callers of conring_puts() with strings longer
than conring_size... and I could not decide whether to keep the extra check
or not.
Will update the code with a commentary.
|