From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 3FE433B8BC2 for ; Wed, 4 Feb 2026 09:51:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770198706; cv=none; b=LVX5rlIxdN8wr0AQHdYYiSgfID6469ISsZwV4W2zRaiyUoNWIZXWKihgACWvFqVeoJfowT5Io1Fokq4sTWhioCJH3hMvjWoaVdjXUv4CqCt1r0MeifvzagYVP78gY0xOWCeiw5sQXxbTcL+eeRKBnCjptbyLZ0SHn42NrwZRdJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770198706; c=relaxed/simple; bh=ezthpWKnElCR0TA+hKS8v39gnjtVM/93Fiq5mpvui68=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Y1vG9BmrZQaYej7dWES1Rks0Y8+641Tzr4w/1jojZC3pkrElcAIJz8XJNeWV1yYXCxo14ApXw2Dxw6VUlcXpFpOlLipM3IgpZU+qxQYEtmkgDB1QdE3Y39HLU9uMAF331JKwMLzIgkwupXnFSU4IehXHQBmp4E41cMNn7APt2K4= 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=RzcXywoR; arc=none smtp.client-ip=209.85.221.43 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="RzcXywoR" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-42fbc305882so4057049f8f.0 for ; Wed, 04 Feb 2026 01:51:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770198704; x=1770803504; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Y+pphTL/bI4DAfxN8hx2U5FFoYBqSIHv0mUwG+qB2tM=; b=RzcXywoRCciFoYw1FYsLuEdau9zufsRTnGBHUuRSLPfmYeoZmKPHBp2Hsn56ACHBDI +yZRF63hcJzhdbmO/0VXYLFKCYGBrds5C//ZmahZjD6i57Pjm0lk3hQGyhrY3Q9pJlPs UeR0JH1tUufQEHgF8soV9n5H4KYPLiTUi/d4N9DWLmhQfrn2WPXJArp/qI3oum5VCXCP usuQQbXKybm/EGV+EzXfgM4SR5zQ6nu+3wPBpn13Es6wF+3Y30ZTulDAdCTEXYQLF0Ag I3/uZNdFAJ3QlsHmw69y0eYcxzmZ2AMnVIBkkcnsezZGem5sa9aAxtLp0iZgeCGC88Q9 lHtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770198704; x=1770803504; h=in-reply-to:content-disposition: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; bh=Y+pphTL/bI4DAfxN8hx2U5FFoYBqSIHv0mUwG+qB2tM=; b=Ob+iw1MQgRoEm7GUdVipscMzU78Utr6A1m61G/eb0AxWP4/TzRZ+sHxNpnYVcdWnhN gvNhxl2JaGSCqfIqugQoZrjefnWGhYrnnl1bw1ysUS+n6W2BDHxOCyvkCfms1xhrVo11 UzeJuQHiSK+F/HBucJ14BpjZ/wyVNKDeHjL1DxN/ZYpyL/JZ6HWfGRK6bD8mz/zHIsfs Bk8WP1JpV5byFlOaW/onJ/XxGkioEqhIUjDqelDvUlG0TJ3E4KrwqwDhO2+82ERFgAfv ci/QSDcNGdj93M9sYFXDdy0k+EZrMmaeK9eFO/JltxKAGra81LYTOLDQCzFDwJvIv+Vi 2N8Q== X-Forwarded-Encrypted: i=1; AJvYcCVHKzGvYugnXUQKfNJHVogbT5Lwh6M1xxe5YWZZizK/WGpSxbzQjjwRU3BztYBmgH8tD+UHeMwTWpr5bPI=@vger.kernel.org X-Gm-Message-State: AOJu0Yz87MmHegQFsbrjVVrvxdsxGh0SVV55eXsQPyF2qyoOOZZTiHFF LF0Heg+mwjC4KpI1roWMIXD8iHT1tl1YvWBPfmyD+8yasVt8E0+3d2jn4FeUMOEEijU= X-Gm-Gg: AZuq6aLVY7dqc0jdFHdW+0Gkwz2+7fCoF8x6eXaFDVeRUSbxSD6qL232cLpvWT36MU0 Gtf3HCJgyuplJQaaqy1XqioCHaiyovDpYl1X09bVTKZ6rog2uHTiIN5/nskg4Hxg95mURfR9IWn WhaTXi9iItVLuH2moPDlhocW+4oHVQSs3DFZgbRb7UD4bC6jGik8cC2qofOHNj3A+PitnI4rb+m AZpNdeFlQtarJC06XKwiuFAyhk/cBZisiJ46gzizOwvWzldRqOoN4zw87hWTxoP/1RTAMUp5+Nd LJSmYOWyilCYRXM8k63b39CiJ0Zh+OPZZGJ7VFUsREIhD3NYUXbpriIBSJE7v/Q8EDs1k7fd6sZ Lsi7L5p8R6TCWHvBLKy2hVSUaCyAR5cHwLjGt7/PoUdKCmozYXeNBPxxWre1a2U3nTpccvRTzJv UyDoEko9hWynl9V5yA X-Received: by 2002:a05:6000:4284:b0:435:9223:c625 with SMTP id ffacd0b85a97d-43617e465b0mr3425732f8f.28.1770198704522; Wed, 04 Feb 2026 01:51:44 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-436180659b8sm4734092f8f.43.2026.02.04.01.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 01:51:44 -0800 (PST) Date: Wed, 4 Feb 2026 12:51:41 +0300 From: Dan Carpenter To: Artem Lytkin Cc: Sudip Mukherjee , Teddy Wang , Greg Kroah-Hartman , linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] staging: sm750fb: replace strcat() with memcpy() in lynxfb_setup() Message-ID: References: <20260203230758.3056-1-iprintercanon@gmail.com> 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-Disposition: inline In-Reply-To: <20260203230758.3056-1-iprintercanon@gmail.com> On Tue, Feb 03, 2026 at 11:07:55PM +0000, Artem Lytkin wrote: > Replace deprecated strcat() with memcpy() in option parsing. The > destination buffer is allocated with kzalloc (zero-filled) and the > write position is tracked via pointer, making the null-terminator > scan in strcat() redundant and potentially unsafe. > > Signed-off-by: Artem Lytkin > --- > drivers/staging/sm750fb/sm750.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c > index fecd7457e..4c6e84c03 100644 > --- a/drivers/staging/sm750fb/sm750.c > +++ b/drivers/staging/sm750fb/sm750.c > @@ -1163,7 +1163,7 @@ static int __init lynxfb_setup(char *options) > } else if (!strncmp(opt, "dual", strlen("dual"))) { > g_dualview = 1; > } else { > - strcat(tmp, opt); > + memcpy(tmp, opt, strlen(opt)); This has exactly the same security issues as the original code. regards, dan carpenter > tmp += strlen(opt); > if (options) > *tmp++ = ':'; > -- > 2.43.0 >