From patchwork Sun Sep 15 18:38:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 13804882 X-Patchwork-Delegate: rjw@sisk.pl Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 8EB1D2F4A; Sun, 15 Sep 2024 18:38:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425538; cv=none; b=gxav5SczadsoYMgXGoZgABKqOEOrqzjIc1l0W78Vy5/Cyk133NUaLftJnEAIB/tbdOOmgl7RtZxOf8L2cJIOOKXaI9SjnUirCXPoYPh+3bRVM8Sw3G5gseum1iRnTxi7VSPFni+PpsQprBljC2XP6/Qpvh2qKtVj3xTUuN3B8Tw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425538; c=relaxed/simple; bh=GD0hS0R0EaLqxG1C3I6hXxh4u2ZYbLcQaO14hyxtczM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XzgtfZX47UWQpf8opIeCCzembf3DqV00trAbSuir6ZGNdu052+6D1B5vZr1fwHzGKpy5Zg1axOvHz4heVs0eMJoZyGv7XbVO3sN/jceB7cEQW5iE5bodtb+unu02eORYDF+o5tKBO2DPoCufEjoRz8x6NIwFfScOATnYauyBmFY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MRs/assu; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MRs/assu" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-42cba8340beso29505135e9.1; Sun, 15 Sep 2024 11:38:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726425535; x=1727030335; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=S/QcDg3/f4nXWtxtIsOpnVBD30Dc1zURxuZ8j9D+WaM=; b=MRs/assu2K16rs283qGhfYWPmbs7HSE9wzV8US30Gc4JyZv7yh30YXI1Y14wRH7IAH /W2PBnkwL7oTrPeJ6fuGaHBp73ai/oDKpZBcdfWwzBTnYaH1iZHIIiINYaDuMQH9N7i/ v4Vex2+X4ZkFo/z6r0Y1k5iOh+Y23W4aoxvFvqr55h0/TrSI4DRhlrrJ7X7CzHqtWXuU uQ1tKr9DKepGI65OSJBKDgSxzh9/dRTjRaky50qy/uqWVOJztjyioXJEbPpUITHwO24R N4I1vRlhGuIdEUCwiEZ02qR8WUZ/Xp8/txGE0SdpbAGXoDRndM1Xn4NZigyTH0LQ+nDm 1ycQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726425535; x=1727030335; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=S/QcDg3/f4nXWtxtIsOpnVBD30Dc1zURxuZ8j9D+WaM=; b=to0ULZYMYWegnvyoeFM+C50S4dkYQC9NvV2OjShaUJ+Ppu/1Wy/heg1Uuf5wK+22Kn TUStwcA/OJo2rPoOZ5wuub0yqnIyKZOC+rOsFo8f0O53CrH0jdVTZ+8aPgGGs7mND2sc NBlJhUAXDl1XSXXnrrVqeAJSDEK/gCWlTglFVlMolfVvdW0u9hNIlP3fjgi2+/lvxmZM 3fqXfdL7bQESAxVU6JgahwsXXl7SNlLBT0AA5VCPp6HxEc/U8y/IPkqwItzr4FvGNDp6 wFDlhMVao+TICPaYuSCspTUh1tqb7J8MDmvXswiOvhLOPmHHDJQvB8F4eN+5i0b6Um04 10zg== X-Forwarded-Encrypted: i=1; AJvYcCUTCkZbRtoods8ATerFVf4SLnjq3ByxLN/Eu7TlsIGHWTP7lMDL13Ah7roqbnCkCeaPuMTlJCuOGkDA@vger.kernel.org, AJvYcCVhs4sIhda6ZzNA3ej+wV8qgWpE0JcEXNhV+XwsXudChHjkO87f/aKqmp0Vt/BhQvV6uQI0F5AJ/psXqe6/@vger.kernel.org X-Gm-Message-State: AOJu0YymAClLpI4rGaAQf8CN9IClG1zIteeart2BSFr91VEVj9N34cAz DVAAfAlz7kk3ZSP2oVaGreiLg/1WvPzOJn4LnyujNsBAVu8ivCnP X-Google-Smtp-Source: AGHT+IGZ4ci5SkLCmeXgFDWTKuBpqNZLxkTlSazVcAexk8xbCfkU8YoJe1JXz7UmvEMQzM2muXVy8w== X-Received: by 2002:a05:600c:3b27:b0:42c:b81b:c49c with SMTP id 5b1f17b1804b1-42cbddeb447mr118442605e9.10.1726425534347; Sun, 15 Sep 2024 11:38:54 -0700 (PDT) Received: from qamajeed.Home ([39.45.198.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73f2001sm5162357f8f.48.2024.09.15.11.38.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2024 11:38:53 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH 01/10] ACPI: apd: Use strscpy instead of strcpy. Date: Sun, 15 Sep 2024 23:38:13 +0500 Message-ID: <20240915183822.34588-1-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI apd driver. strcpy() has been deprecated because it is generally unsafe. Eliminating it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/acpi_apd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index 80f945cbec8a..403e9de396ae 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -86,7 +86,7 @@ static int fch_misc_setup(struct apd_private_data *pdata) if (!clk_data->name) return -ENOMEM; - strcpy(clk_data->name, obj->string.pointer); + strscpy(clk_data->name, obj->string.pointer, obj->string.length); } else { /* Set default name to mclk if entry missing in firmware */ clk_data->name = "mclk"; From patchwork Sun Sep 15 18:38:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 13804883 X-Patchwork-Delegate: rjw@sisk.pl Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 2DFBF2F4A; Sun, 15 Sep 2024 18:39:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425546; cv=none; b=OV9bI8L7J8JYxnmIToka52M5IwFwMnap/+zkPOaHfeVH2n+vEl7HF59VVgwgUOUpxNBbb1sybcNitRgpYaBdTYx2DzkiUJkFg6Vm8u2HLTHiDoIy+l1VLELKGHsSYqUHQrCAPysrm5D+yPlNoqkVASL0IKGwnMKH26qleDevFTo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425546; c=relaxed/simple; bh=ydBrSEwZEYhmEdutLXk0R2TlP1+Zip6bTFm5aEfLWFA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nlUBgGZHPSy+VeFdVktXKyTYo04jebDCNchFTIsu+7g2yAz497vpBd/zkWVVFpeToBBc+SAEPFSlLC53DBl6btOiq5Guup6V/szQadLRcfFaWo+eXXsf/PO17RhnhzqadFkRugI5kk6+0O1pDWVGyb1I/wA79QSlox8uxXodIbc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=g/CyauE6; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g/CyauE6" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-371941bbfb0so2591433f8f.0; Sun, 15 Sep 2024 11:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726425543; x=1727030343; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vXXQfTNvP9tw/3KAVWW01hLOQc2h3QS2AuRwa1s00cY=; b=g/CyauE61lb30Md3Dq8kmdMcdEkBdSD+KrwIdvnIh5pqV8X7cKBuvPS7vl7bhOvYbx UIKABcGc4bzsyI4j/e7ZNC/dYsP5fNrRntleKjmqsEziVfn/BPD+s3cZIS++BFwXNisc a/mWRGweiKAlF2cmuy1QfQg1lKcZZhqZ53uQ6fF2RZNCWh8YacGFkyjZa8lkcPCdPMCP BrkVh/RK5mVtMRDbpe8/RKBucACJI2OGMgpfpNwTKjn0wTYV9YBOehtdvCjaH83ROfok 95pOjYCo/oA8oad3B9pkV2q54wW9qgzwCAl6PNqQ7ftqI0GwyQJ4E9UDr+0QwHZ4MHIe 90wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726425543; x=1727030343; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vXXQfTNvP9tw/3KAVWW01hLOQc2h3QS2AuRwa1s00cY=; b=hgyHw3vAbAUKhuOm3xAfd0tCIXM4T87Bmh8OL6yMgZ+P1LSnN4FpbMsK5Ri8T5ZJ5U d9Pw+OO31KTvRkZXFmV4A6yvw1c00m8ZWHHiW5H6xYVcbpGs6mZxOeiMxMR+fy0Pq5hI ldjPsdDTa5WwNJI5UoeD4i6z9bylPkEk2lV1vKyCD36D2arwrwQhcVKRgVeuD7wAttYF I+1FCmAbORTrNwNkCe610gShNDomd2rbQjoVL0lVLTngOuBMY0j3sz9id8YXLNXZmyiA E7aUPobf7kCp0rXp3Lr6mxTEsdV3oWCg6sFHjqr/TBL+w38zMp4JFX+BlqOat2RyGLvl wfEA== X-Forwarded-Encrypted: i=1; AJvYcCU6cHPz3/wZKMctF103acle8LjrALIe7BkrR05PZCpoxrNBn+xLtEhdijQ/3vPltIzj+uCoU2RbrONT@vger.kernel.org, AJvYcCXsx4WTvAxl4S/ubVcUm0rjOcRb1yJRWbIgCAWEfVsW1eIoefC7OqQjIxPJVRRoBlL9trd5zYr2GYGAb2D2@vger.kernel.org X-Gm-Message-State: AOJu0YzAFlXzeBPKnH4OnVw+HnN70c2Nfex0dEXLAPTgk7+cPXg1YG7J SSSmWZGVTwMyLUWJevf581FWXgSlkYTxsL+B1g/2gjtUwK6lHfEt X-Google-Smtp-Source: AGHT+IGG5uS+gl23daPy1wzJJtGgTL69VrlGQ5EgG0cUPBKQHCZLmdT9Mw2XD63oMUeYUEbcPbg7WQ== X-Received: by 2002:a5d:4dc6:0:b0:374:c581:9f4f with SMTP id ffacd0b85a97d-378c2d58d9cmr7067632f8f.55.1726425543042; Sun, 15 Sep 2024 11:39:03 -0700 (PDT) Received: from qamajeed.Home ([39.45.198.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73f2001sm5162357f8f.48.2024.09.15.11.38.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2024 11:39:02 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH 02/10] ACPI: ec: Use strscpy instead of strcpy. Date: Sun, 15 Sep 2024 23:38:14 +0500 Message-ID: <20240915183822.34588-2-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240915183822.34588-1-qasim.majeed20@gmail.com> References: <20240915183822.34588-1-qasim.majeed20@gmail.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI ec driver. strcpy() has been deprecated because it is generally unsafe. Eliminating it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/ec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 38d2f6e6b12b..991143ef06d2 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1634,8 +1634,8 @@ static int acpi_ec_add(struct acpi_device *device) struct acpi_ec *ec; int ret; - strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_EC_CLASS); + strscpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME); + strscpy(acpi_device_class(device), ACPI_EC_CLASS); if (boot_ec && (boot_ec->handle == device->handle || !strcmp(acpi_device_hid(device), ACPI_ECDT_HID))) { From patchwork Sun Sep 15 18:38:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 13804884 X-Patchwork-Delegate: rjw@sisk.pl Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 825611C9EB5; Sun, 15 Sep 2024 18:39:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425553; cv=none; b=k8TXx/8XzAnAcD4uWItrozRja5VWgrKtLz1NkRCj8mwT8Dx5TVr3A6PbKv2+XVIM3fB9Zrw7dyG/ITIdPUj2f9yZFI8dtLfDnl1aTF1giNKPwZYqFwNE6Az5xQ2yZSpGSiLZWUY4LKdFktUECcYuIHx/PSAFzDeOEa5kkrWTAkU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425553; c=relaxed/simple; bh=v1VE8GlgbLovu7FzspWcQCNMUgl4ykznIQhRvDIkq3E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SBdcozZP85T3BE/XdKzj5MrI4sbO4PXNUHDN2iFHWutH7ZZmgHHawIArIy8HjycWVnOhdwe8FXpHvfx21ylJ8uupltVsqlH+Qls+YXZMJSmNVc2DcR1YLXdMmF0lcn0vIW9pN93XJk1PtU2XzhqXVkc5rmxJnZCTKTJrmYMHcSo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WTGJvBz6; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WTGJvBz6" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-42cde6b5094so29450675e9.3; Sun, 15 Sep 2024 11:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726425550; x=1727030350; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JbWf+7usUXPbgb2aRvoa6RRa98fE6m5NKrnKLo5X8Q4=; b=WTGJvBz6yMVpUcCNWQ4WH9yMRRebcoWq91rwyNIULQScNLFfnHXxrvRGzlBp9u+131 T35ws7/Jvvtyu1diSdZhfTla8wCubnYEytTkPykLB3SNMEDWsZyDWdeDYWLfb8+PGGSC adFBVy0DD1t/AIV4FomkBeU1iugRaVtdlgvR9WFrxJshhuI5kb4iGqFRyFMSMMhO6Lmf xw0EhG9gyCfrN4CUfN6d1wvm/ffV+pXWir729Ic12HYa11Z+lCkzDKskRQwieee9U6U+ rP5mTw8SNtKLO7XPgMshVTDCIVyS/QpmuY7g4QGnekKNC7W6EjbN8f4+Mx2GfNqnvobb NXbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726425550; x=1727030350; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JbWf+7usUXPbgb2aRvoa6RRa98fE6m5NKrnKLo5X8Q4=; b=E81ho7La4RAWFsarripzAAv+GR2It1g9Yvd0UBdkjoiCjdOCJ1eWICbQwnqoZ0ruXB wtFu9zZsdqohsNykn4kQode8XSDR6dhp6jJqCZZv1JEstweAKHTDUxj/Ypgxk75ZWohG rmmmmCwS2clMO/oBmpB/8IRZqSodkvGUFob3VuTmHbp8YVqWNBgMqKv8kMkIFfVXJ0D6 rMEhHcl8DRsqCXcfwalEEt8eNFl3USSo1rSmpuJV2/006UoTJnFrHfOQNj1AWdLqncfc X4pDiNr+s9XdCgpsOfgQZVYZOexnyne1sVx4V+fFcBSPu0AkZyAf0RJChVKJ0g9J/QHG VQXg== X-Forwarded-Encrypted: i=1; AJvYcCVld+brjwsTvMJV52LYIAcyWcvuDwKPs7nF7KWH7/ZZfbiA/ateAlBffLxIFiLFkHobhvu8dvTiyKxF8zUy@vger.kernel.org, AJvYcCWHtJUsBr4fSr0O4N+5sUm0NpDRbqj6O+0zrFEG36uXS5WjPUphcZyzEobYJsdbBEVNTNyWtzjzVbpG@vger.kernel.org X-Gm-Message-State: AOJu0Ywo62LRJDb7uw1RUwAug9vjAdIa793KGpF4VLAoATxObgTDcUd6 RMkmFZmBB9Ydu9NzIA2RMhI/mQoyCosBK1SLu6Sy1DchzTzmC6hXlKqcrrwB X-Google-Smtp-Source: AGHT+IGEvH8eOSC8DXIKx7aa71EenGGMFszWRvai88KhFWatglY4FAVQj6u688jRL9Q+CdUVhOEDOg== X-Received: by 2002:a05:600c:46c5:b0:42c:b843:792b with SMTP id 5b1f17b1804b1-42cdb531b96mr94952455e9.2.1726425549515; Sun, 15 Sep 2024 11:39:09 -0700 (PDT) Received: from qamajeed.Home ([39.45.198.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73f2001sm5162357f8f.48.2024.09.15.11.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2024 11:39:09 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH 03/10] ACPI: event: Use strscpy instead of strcpy. Date: Sun, 15 Sep 2024 23:38:15 +0500 Message-ID: <20240915183822.34588-3-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240915183822.34588-1-qasim.majeed20@gmail.com> References: <20240915183822.34588-1-qasim.majeed20@gmail.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI event driver. strcpy() has been deprecated because it is generally unsafe. Eliminating it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/event.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c index d199a19bb292..96a9aaaaf9f7 100644 --- a/drivers/acpi/event.c +++ b/drivers/acpi/event.c @@ -28,8 +28,8 @@ int acpi_notifier_call_chain(struct acpi_device *dev, u32 type, u32 data) { struct acpi_bus_event event; - strcpy(event.device_class, dev->pnp.device_class); - strcpy(event.bus_id, dev->pnp.bus_id); + strscpy(event.device_class, dev->pnp.device_class); + strscpy(event.bus_id, dev->pnp.bus_id); event.type = type; event.data = data; return (blocking_notifier_call_chain(&acpi_chain_head, 0, (void *)&event) From patchwork Sun Sep 15 18:38:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 13804885 X-Patchwork-Delegate: rjw@sisk.pl Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 960801CA6AD; Sun, 15 Sep 2024 18:39:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425555; cv=none; b=REAO5uPwPcqp7R6aoriSp/2ho2DjikRBNgp4ZC7tnjgkdObjYVOAVJsXzZqr54iRSmXo9jJ2Os11AUewKyMeNIEPPoqWQQA7umh6RG2ognNQ4t+R0Yp2E50++SknGJJKuDxt90CznXvnv+zsaFChrV7Ixok9dz+49YjdDw5McEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425555; c=relaxed/simple; bh=dB+ck7mCzPqh9iQGEzxZtqVXuGGnstUJLE6atS57J9k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P6zCF1RtEgGJXI8ueKxPYp3acc6fxiJUYwlU/FmCGUXuY8ULWS6RORng5Y9gEInjDemUIA3TY41nvYcxW5FHv8BHWrrAzOfx2YpmRLPKX1+ot/57/iWsLi/AXSAMe9gruYA29HzMu0Vi7XAmM00jizgJTRT2yz27t5y5n6/ro20= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QUsCy9Kr; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QUsCy9Kr" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-3787ddbd5a2so2240642f8f.0; Sun, 15 Sep 2024 11:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726425552; x=1727030352; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DezwI2dAdBPfxx7uR9AzXDV/o4jNlzsYm/PAE+1Iick=; b=QUsCy9Krfuywk6o1lyy+6gFKVDIhhZgw05yhvi3lRz+wvBLSqcgxIPWvJo3Adv4jj0 +ev760w1i0dVls+F7SMlLnE/WbgEIIqU1G5yuQqNNNN9W5UoaR+0nconoXJk6a17QYdO E9/37jHK1ZAk8w01+vLGdGGTXEdiQ4CSpxKXAAD3lh+LJdMC8u/2OBn4XkgxcpPOVbM7 y06NwgbpM2m2Uy8vA0GDiXiDYuIepzjRc2ha9Nn9hlyUxe20NOHRQXbQgTXf27xnnYZH 4iSC+PgBhAXFo0YOAERadaDehNK6fFShjhNvcrnkEJwiiux5SQkqApu9hKJX37BS3I9Y g3Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726425552; x=1727030352; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DezwI2dAdBPfxx7uR9AzXDV/o4jNlzsYm/PAE+1Iick=; b=IcyXmRZf9HG2ivbXByUFDrGKOMQixjBdTkguBE+VfPDhwgMoS5NJcgJtALFkO7590/ +MLYkM3vFb7XYmlBY4gO3VI8c/4lJ+qpA/PBWMGnhcowyXMAi+qv/LbD/7YtKeUDjloU EA+QzIyPbuqX4f8V/ArkZ86XjFU5X2XotLUYGERVXO982Vm5HdGHsVlIh/L6n6arj72n 9sIbFoTglFgOilFl5+RtTWiBp0GpUO8Awr2+VUV+qN//y2wxjAlXScRp6s0nHPI30Uun zyjAuNkNlGenSG4IeNS7FMJQUT8pjm2BfBzmIj5e2uYWR5FVp8/ikIYAlZyFMJLtHmz1 t9IA== X-Forwarded-Encrypted: i=1; AJvYcCV5lxIBMPWjbaudCO9oEaSyxcwkV712duaaF9929WOOObbjtTf29K2O2tTDwvsOJQubJyxByFrLm44o@vger.kernel.org, AJvYcCXuCveBS/g3AYkft5E1Lubk+s3uJwBfQbkRsio6mMHkIGRsMqsdxMN0u25ftoM5IMAqJQfI0hxLcpP0Yvze@vger.kernel.org X-Gm-Message-State: AOJu0YwbNDpdCUJAk+FY8MgsE7R5t5UtgRl+u1RM7chCeXHVhuoi7Ysf stXIQyrcJ4mUUo58mzeCge9sZyjdC5YS9kMAxa6TIDXqvvAyLOzxlzX4S4T7 X-Google-Smtp-Source: AGHT+IF5U0HHjNRcC9kN3bE+yuznkwZkE2b8wB6ECzpnSb0eTb3lk5mRKU4inyyvuCq03us7KkuDzg== X-Received: by 2002:a5d:4806:0:b0:36d:2984:ef6b with SMTP id ffacd0b85a97d-378c2cfea88mr6860563f8f.11.1726425551651; Sun, 15 Sep 2024 11:39:11 -0700 (PDT) Received: from qamajeed.Home ([39.45.198.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73f2001sm5162357f8f.48.2024.09.15.11.39.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2024 11:39:11 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH 04/10] ACPI: pci_link: Use strscpy instead of strcpy. Date: Sun, 15 Sep 2024 23:38:16 +0500 Message-ID: <20240915183822.34588-4-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240915183822.34588-1-qasim.majeed20@gmail.com> References: <20240915183822.34588-1-qasim.majeed20@gmail.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI pci_link driver. strcpy() has been deprecated because it is generally unsafe. Eliminating it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/pci_link.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index aa1038b8aec4..e68942664b61 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -714,8 +714,8 @@ static int acpi_pci_link_add(struct acpi_device *device, return -ENOMEM; link->device = device; - strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS); + strscpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME); + strscpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS); device->driver_data = link; mutex_lock(&acpi_link_lock); From patchwork Sun Sep 15 18:38:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 13804886 X-Patchwork-Delegate: rjw@sisk.pl Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 6ADC31CB305; Sun, 15 Sep 2024 18:39:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425557; cv=none; b=UF5hRYe5bj15iM5aCNBLfYzYLkjTO/PKqGdpEOTBWudoMtZP2AYgAaOrxtDuR8RGlF9kRFlt0pKJRjwYMt0EcetDDtswreVHBodbApA1ksw0pxqqCCs6Haj2go7WW6NRXztotjoLuP2MPJv6ZETxUPBMNla5SJW0HGSKGfaqoUE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425557; c=relaxed/simple; bh=vsw4VlosWx3TOjVGtEP+SF0UkVD2Ut0zdhdnxz1BVuU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qeuNqXe4gWj8nS9+P3GHe9m/qjm9UxatnodSYWHr0zY/gUK5ZpYVHxqLB7Zub3qFdvER1R6W4lGpC/+8dRmQG1jQvOj0q+D1gqJcwmovJ5872fRTrqljP3PHc2u5yPeSwlrbxMHrIcs4bLeo29+g0JnkO1xQm0IsysJHnl0ew/Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CpJSiQdH; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CpJSiQdH" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-374c5bab490so3188741f8f.1; Sun, 15 Sep 2024 11:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726425554; x=1727030354; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=omNSK/K1b/yVIWDRt5RBipClGzi9V4Xr720SCbqQvCY=; b=CpJSiQdHwoYO5R1V2JDHOBJsn+Nzn8s4p+8aPy5xiSOCl6FGj9q79A91XhYpkyA8Gm 0A0U3ARqXfhf27LSN3y8q6DROFwzvvgTTGzS3R5p3HoB/JlMHX3NNRtRc1K5Cnu7Ltne faVXF10TqoqO5wQUPeM6fRFh8TUKMOWte/oBJdOVglzw54yroW+uWOU3OPXN56tOzulI jpF1XrzopuRa1XZKAI3R+6sNhHvzeRmYXm1Lhdy27CO7rSYk8vleyGc8VkJU6rClrnyJ ENBtzBwjaXVmyRg5hgUCtYa9LrhaE/ovSl2cQLseZ/i7W1mACba1aWK5r3CHs7niKo3g 79iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726425554; x=1727030354; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=omNSK/K1b/yVIWDRt5RBipClGzi9V4Xr720SCbqQvCY=; b=Qd3/llqieCrGTCoidDZJPNUfLCTP6674FzmNb79yhTLhE5fnTQVN8nccXvv1mq/liM y1g1f+GYAXZpEUCKZGEa8TGYveY9a9Ylj0dD5vbwFdQmGuOn/ceZFzeRLhZ+nnB6XMBO 7KG4TaJFbrShUqTrEM/bmpVSvnlrBdx69Vg+zPDaXMdXf26Kaalk/IaygV/Ze8aST4jy CmkUjjBjk3Go5rIZpDY661LeglM+1rQW9u9+IFsxUvotK+IvgI6sQx+3/le3CzdKu4g9 FSianCCO8Rjh9O87mRyqp38vJpQ0835/z8Zf+AfBKqGx7bZIjSd9Gl27XbOY6kq65AjY dKDw== X-Forwarded-Encrypted: i=1; AJvYcCV+pufp9UPsXqltX9WUSrzZ6bON1wNUnNEGKCHjwCeuvwT78fqPTxTsyX7RDk99cHRoEta4xNVGNfscjKoP@vger.kernel.org, AJvYcCXF8wOt6Go9OKxlzG/6odvf9swzp3F3xomIvh45aqQVe4zilUKsXHbhmIU6xwb4LnIw7+r36gtgajSY@vger.kernel.org X-Gm-Message-State: AOJu0Yz2BGuXybk0cG8s13s07h7yt9UBHar6h6CCtpcqk3GLLGen2LMO r1hbWFpzJnehLruIXpjjCSznDNboYe2flhDdoosNa5KzuXaS4dVB X-Google-Smtp-Source: AGHT+IEdO325oEONbhdFkRchx2jRN8hMK93gNwFipthgutWHSGciUxIK52QSSf4Mtfuf+FgcBes1dw== X-Received: by 2002:adf:fdc7:0:b0:374:bfd8:eeee with SMTP id ffacd0b85a97d-378c27a8612mr7616903f8f.10.1726425553644; Sun, 15 Sep 2024 11:39:13 -0700 (PDT) Received: from qamajeed.Home ([39.45.198.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73f2001sm5162357f8f.48.2024.09.15.11.39.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2024 11:39:13 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH 05/10] ACPI: pci_root: Use strscpy instead of strcpy. Date: Sun, 15 Sep 2024 23:38:17 +0500 Message-ID: <20240915183822.34588-5-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240915183822.34588-1-qasim.majeed20@gmail.com> References: <20240915183822.34588-1-qasim.majeed20@gmail.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI pci_root driver. strcpy() has been deprecated because it is generally unsafe. Eliminating it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/pci_root.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index d0bfb3706801..d0b6a024daae 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -689,8 +689,8 @@ static int acpi_pci_root_add(struct acpi_device *device, root->device = device; root->segment = segment & 0xFFFF; - strcpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); + strscpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME); + strscpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); device->driver_data = root; if (hotadd && dmar_device_add(handle)) { From patchwork Sun Sep 15 18:38:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 13804887 X-Patchwork-Delegate: rjw@sisk.pl Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 47FF61CB323; Sun, 15 Sep 2024 18:39:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425558; cv=none; b=CrIpdT4ghEVCpuTBoclEF/1Y/arMX/E2I8QVk5PQXiUVjQNC7o9/0imzywv+eat6RajAquLTAOSNS0fXRUM2aplnMuBRZO4pr3/82Y1Z4V3suW1oCBTfozD60Dd6JFsYy9Wo9r8OkvMOPjf5yTzht7Fjl8DVeL1DYJMGTXW9e4c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425558; c=relaxed/simple; bh=TH+xzJ+fO/3074TWmc0YMuXz689v0ptV3ZDCbmLrg2c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rAzUPYV5/2RWNdyzVRrjYOPif+HCZvR3/XyQrKxOBvssQku17K4XSkO9N5tdDVLvcq9++d3cNKyuL+ezYM4pT2dhO7J/s1H7Eyhy4zI0uyzTSji+N4Gx9iQKfzbZOa6aEJokkhaxt7/VMyzSeFgQaOOZkku65YWg+scLdWKFshc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dnHs8QzV; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dnHs8QzV" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-374c3400367so2192338f8f.2; Sun, 15 Sep 2024 11:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726425555; x=1727030355; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gCOqSnFdieDXJHHHRmdhpnL3kHmXkF8GysKNDS7ghhk=; b=dnHs8QzVsw6SIkKLAvoilGGce1JYWMLg4gPtAlAuGhgtAylHYvT1v9ZNB7/pTCoKOF Hx5HhBEvU9J1VkOrwaKj+5WcC0Rp+0AqVUtcNQH279VHNCa/jH9aUxSSKDKmQTQq84/N xaoRCKCMWMW+iESYDxingwz/ZtaUaMY6o0SKdKcOjs4lmh8QXQ53gUJSPoXtsh6M19oi 63Iz07PI2a6IWVeAqeuX4Oy75fpwTUmTonEYw0Mc2IGvha+noDzKKz8JN/WTQ8pRN13s LTnGn3g72580936pWGt2wbrmUuzLFM6EIzkNSkXc9+6fS6TOEuV1uqawn8iFr4vvvPPd nvsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726425555; x=1727030355; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gCOqSnFdieDXJHHHRmdhpnL3kHmXkF8GysKNDS7ghhk=; b=iAOVt7mUVqYFfvyHGuKoZLvAeM0OQeOMbzh3K4GH5so4hh8uW1GjlZcbs7rEOE/Yyv //ehlA+e2eebCQp414i75WwUCI9T2xh2K6VAPgPv/7NbbQnQEEASN+2CgCY2rxaIo0CH IaMIju506OZE9WYIKXO4oRLalA0LkaNdzbZ/YHkSc4kf+sZ4Ox+2ZraNedtibQvZ/QNM 7MLNh/1HRcd63AdHv+xbjNgE2weMgmqhwMYOCxHQ7vQLo1lf2nUO0ackuaogd4bPzoHe o2qogwIKNJqa/T4B2DrQd/Xm+yV3hDudGDpTNE9X2nMVPN3fZQulWvAh2WKYlHb4Cs9l lCYw== X-Forwarded-Encrypted: i=1; AJvYcCV9b6izcgNxp+GuAOx4zB79oUgu/rLzhIehV5rzwXvjdGBjFrMm5Si5WF7622v4zsEFmqg6AM4Iu+Bz@vger.kernel.org, AJvYcCWCnCVzuR4v0gAHj895oD/x3L3EoWHhWUxUqOXhDwaCLn2IDzntauoJn12KLAAZRaqDTH89XUvSzjMqhwoz@vger.kernel.org X-Gm-Message-State: AOJu0YzGSQ1I7logcD+pTV0xa5jmwWjBQBQVlYCYKzoZfPITeyod9a/s A+y87VgCp97mgFRNjFY6Drrhnvh9K5Sk57YZrL+vuoDJgCzPQi8I X-Google-Smtp-Source: AGHT+IFqJdecjc1NuF71/KUuYxHLKyzDqEgZ0EaHyNceJX+Rwqs0idZ+JuE9R1ughh5wHQuTSA8BhA== X-Received: by 2002:adf:e6c4:0:b0:374:bd01:707c with SMTP id ffacd0b85a97d-378d6242f38mr7192092f8f.48.1726425555603; Sun, 15 Sep 2024 11:39:15 -0700 (PDT) Received: from qamajeed.Home ([39.45.198.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73f2001sm5162357f8f.48.2024.09.15.11.39.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2024 11:39:15 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH 06/10] ACPI: power: Use strscpy instead of strcpy. Date: Sun, 15 Sep 2024 23:38:18 +0500 Message-ID: <20240915183822.34588-6-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240915183822.34588-1-qasim.majeed20@gmail.com> References: <20240915183822.34588-1-qasim.majeed20@gmail.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI power driver. strcpy() has been deprecated because it is generally unsafe. Eliminating it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/power.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index c2c70139c4f1..25174c24d3d7 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -950,8 +950,8 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle) mutex_init(&resource->resource_lock); INIT_LIST_HEAD(&resource->list_node); INIT_LIST_HEAD(&resource->dependents); - strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_POWER_CLASS); + strscpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); + strscpy(acpi_device_class(device), ACPI_POWER_CLASS); device->power.state = ACPI_STATE_UNKNOWN; device->flags.match_driver = true; From patchwork Sun Sep 15 18:38:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 13804888 X-Patchwork-Delegate: rjw@sisk.pl Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 7EC9D1CB33A; Sun, 15 Sep 2024 18:39:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425561; cv=none; b=GoyPKX6GLRUN26ITMpukWuSL/4vUTTFfhnI/PenakEh+UOaT52Dcu9+pN0tO4f1hG60KNp+2IhHka9Gamq2C8lBew7PgKI9Wl7JnmwAhO/ikMkScu0rRed/DJfTexklrI5XxiUJ6B49xt/31bMPG9isUPgA1xUaRh2FaEojfADc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425561; c=relaxed/simple; bh=QoUWTZne1jWr63rOxXE6p255C+CLmqViiMc6+HGq5S4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Dj2a9wbL56Muonwv5t3R9ZGXhjSgYxJFAiKNshWZ2mBFkFFoE6Tq7SnyJyeuhPQXutj//ieSxCjyD1djnVv7WhbBen74lqIiM4J4ekpcbp84Bn+1ZoSrvbJtRPZhrCkQtx8fi1aCtACEvYIcWARcxO7A7D+IqWvW0pNHSFNV7jo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Iz/iEW0e; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Iz/iEW0e" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-42cbc22e1c4so20417505e9.2; Sun, 15 Sep 2024 11:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726425558; x=1727030358; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3sfvhHdETpIzImGnfuB66N28/eIqs9Dchf2bSTnmUN0=; b=Iz/iEW0etHLTijsmTUI2XG6+j9VX/0sRfne7OHCIkzbkufYRq9I6DHbbni0fSPVxe7 Iagy6T2J0w8sQxT7MPUa8ieVPlThDFd3UK1yGoaYJYMuwQwbIakGL80Xik6SI2I5iDcB F9pTilvGW2pn6g9FJQN+FLmi1xiO3lp/6GOS3BuIj0gSmSx+KBP0Tj6aj4tBvaWT7lnB GxKLdwUU9ZdnDl6zRxklG/2Z+iY/MaT5R9KmHANnHUEij2O1AdtegK284iJ/iqG2Y8jX +F2i+u7+wuPoFzWuBJgtUCmiDc3TK9kv4us//THw44JGoY4gjf1UyZshIrLvXMer4txD h+dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726425558; x=1727030358; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3sfvhHdETpIzImGnfuB66N28/eIqs9Dchf2bSTnmUN0=; b=lzxQl3V8pZEGd30+O49OxrhFCLo4hS34Dk4478MPRRWpFJlZ6kCq4K3uMQNskIkh3R A/4+e0WsaPm+kP+c9ES98LAFDsIn04l7sX3FJHMMzp25Xvz1A73JO1NrrMScFxvN7bPM EMF/Wogdcvfm0vhQe3eQ98Zw8hGEn6A5ttVHz3elWXFQyKgakm48aGqVmE7WZNJvserq 8unHLaEQdpm53HvUA11ZZcKPXwpLTXE5aOkTMYZO0/nKd/GlyzNOGQiOvYAYc6kBLPei oXhCHkE71CWoDYbvy5RLb+gpqJYDa4WvSbW3oM6GWVanI0RliDu6VH8QPnuaLAh181AP Jj6w== X-Forwarded-Encrypted: i=1; AJvYcCUwYMKjrKcowUpwO4pSN4PHNs5VySpZmWqtjPZTKaIoK8rGpzE7dg3A0pvAiSeIaCnIACtT8Uf64KGh@vger.kernel.org, AJvYcCW/bWIZGttvbvbzMeF5YIiolbFP4CcOG5cfRv6lJz9DojcuhfRbhWWZo6Ho2Gxj/yeAedBxrmruvsOQtaEz@vger.kernel.org X-Gm-Message-State: AOJu0Yx/Z/YXvwSx45UbVydJ4WmyLsak83FvZ31s2pyoI2X/Da2waUsz Yu2sWM9C2ondsPDnd9jOyIbWqhAr50wY7C8/SE6LFJr7Rsm1fCcH X-Google-Smtp-Source: AGHT+IE8jgabBx8WeBP1L+viW4h4KJj3z8nr0KA+qF64OBxZL7TGrFTSZs+otQltJcxpKHA12An1Vg== X-Received: by 2002:adf:ec05:0:b0:374:c793:7bad with SMTP id ffacd0b85a97d-378d61e2843mr5255345f8f.16.1726425557790; Sun, 15 Sep 2024 11:39:17 -0700 (PDT) Received: from qamajeed.Home ([39.45.198.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73f2001sm5162357f8f.48.2024.09.15.11.39.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2024 11:39:17 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH 07/10] ACPI: sbs: Use strscpy instead of strcpy. Date: Sun, 15 Sep 2024 23:38:19 +0500 Message-ID: <20240915183822.34588-7-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240915183822.34588-1-qasim.majeed20@gmail.com> References: <20240915183822.34588-1-qasim.majeed20@gmail.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI sbs driver. strcpy() has been deprecated because it is generally unsafe. Eliminating it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/sbs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index 7a0914055fca..a3f95a3fffde 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c @@ -644,8 +644,8 @@ static int acpi_sbs_add(struct acpi_device *device) sbs->hc = acpi_driver_data(acpi_dev_parent(device)); sbs->device = device; - strcpy(acpi_device_name(device), ACPI_SBS_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_SBS_CLASS); + strscpy(acpi_device_name(device), ACPI_SBS_DEVICE_NAME); + strscpy(acpi_device_class(device), ACPI_SBS_CLASS); device->driver_data = sbs; result = acpi_charger_add(sbs); From patchwork Sun Sep 15 18:38:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 13804889 X-Patchwork-Delegate: rjw@sisk.pl Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 EDC0B1CB526; Sun, 15 Sep 2024 18:39:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425563; cv=none; b=OQrgp7lhs2ZVSEXUb0s2BhnCOhauAkQoI3MEvPvPuQLdRiBGXVdnLsqdyhF3dCneKD6P9FRg9OM/fPm0T/H2mgACA3TfMdH+pgjt4eMG6S1pAlstqcmg4jVuyGhfQSaKFKK9bBzjrjDh+NF43llgal1pfYpx53DvMVw146nzd2E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425563; c=relaxed/simple; bh=77ScDo/H8XfauKgfDfyBcDt73P5mP0LNk72Aymjn6vU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c1OoJwc0+HgjPD7Cl2NKwlhwbb+ijE4xWoqLIncf/wWHKwGsdprFGxW/BAX2Jg7UJOZIpE8F8opRKFfX8ieNyd+WI3NMA3psmxiv8oQheTEiU8ylPgKcypK8gkshuqoY/YEPhfoEdtGEyAggkh7iABq4bCMSb32Y9LfTAoy+hU0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QPmRTXsM; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QPmRTXsM" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-42e5e1e6d37so6366455e9.3; Sun, 15 Sep 2024 11:39:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726425560; x=1727030360; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4zJjfctgmHb5rq29kJFRVJL5UzIqHrkvzW9kdGp1IUQ=; b=QPmRTXsM+Nt072SymxALoktiY6nDba3FUrqZ7RZob3h8RLWi79WrOyOSNESdeQ8wFy Kr9ourRp+j+V5t2rrEq15nQJ7rgF2BUAeaIIqfVfjgoCAO8pH4AeSg9RBxhdxD8Bj8xZ 3nGBJoqiRRgvRDgfDSvJPV3x1KKK0dZ3Eum7Q4WG+yMLl4lcN33Bc0qcMrf17hPpcnz0 bu/RfiKEIgFZbfeb8XnaE6tUm0CWY8e+5WwQtg/X8Y2E6vsjP988DEDMk/2P+FHEefUb AEVtM+fYX+u/p5ACo29IyBnMS48i1KnJeROvN5eRrDpA4tNf0y5EMFceeU6Mloj4hGw6 17SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726425560; x=1727030360; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4zJjfctgmHb5rq29kJFRVJL5UzIqHrkvzW9kdGp1IUQ=; b=jmDEY9j7uFwNi7be/uz3pCOKGREUqPkH7TWV/PA6sxmH2Ln1Kvr1J/p6eC0tuicTEG q4HffbUskfajuvEDJ5FdmoZSFqPIeOO4Q9HStbA1PcmqlJu9g68XNYCdpeGltIHK8PZa 6l/HR5CzYT9FRfeq1caZZBLev58Z3Zqbv3oA4Nqw/Cf4f3ZU5PmF4ueABvaA8Wih2jPT uDmALKJee4UcMbU87KX1NtCQkg/BImYCoCreW7edb9Gig6KQt3+8cv3CFcwDfzyeHXwL IshefwizLt6xYDElidxIQmyyB/eV9JnNF3MCik7akXt/Qg2YUgZAN8q2aBkmI5ukIa/0 TSew== X-Forwarded-Encrypted: i=1; AJvYcCUxV86BUq3B8rI53nGSoBeWi7jyJSZdbDzyiSA2rPfG4H7E3i4F3IDwb7/JNxDveWDAxN0E/AFicn9dWgTb@vger.kernel.org, AJvYcCWngLqR+nrHiM86C5jB5yaIN2eVOkn/1XZnHVjCNoF7CVmCrWza/5GkmvcxWye3aKhXJoa9mt1j3Aim@vger.kernel.org X-Gm-Message-State: AOJu0YwjJefg0uwIAdA5m8t9fnyawCZ7qdFRU7ZNM3gcZnIf/XlYAyjw eUv+lHd+POwPYZq3Iy12X5m6IkKxIEZQjqhzXThRxRQ1SzoJOk9y X-Google-Smtp-Source: AGHT+IErZTgyigxk6edPyw3No2PEfK3oK4pb+YmwhvE0s1hGJ1HE5N8zJQsBSnMW8V18vCJUHr8vyg== X-Received: by 2002:adf:8b9e:0:b0:374:c03e:22d4 with SMTP id ffacd0b85a97d-378c2cfeb7amr7213531f8f.1.1726425559993; Sun, 15 Sep 2024 11:39:19 -0700 (PDT) Received: from qamajeed.Home ([39.45.198.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73f2001sm5162357f8f.48.2024.09.15.11.39.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2024 11:39:19 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH 08/10] ACPI: sbshc: Use strscpy instead of strcpy. Date: Sun, 15 Sep 2024 23:38:20 +0500 Message-ID: <20240915183822.34588-8-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240915183822.34588-1-qasim.majeed20@gmail.com> References: <20240915183822.34588-1-qasim.majeed20@gmail.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI sbshc driver. strcpy() has been deprecated because it is generally unsafe. Eliminating it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/sbshc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c index 16f2daaa2c45..7e2ddc74a1f0 100644 --- a/drivers/acpi/sbshc.c +++ b/drivers/acpi/sbshc.c @@ -257,8 +257,8 @@ static int acpi_smbus_hc_add(struct acpi_device *device) return -EIO; } - strcpy(acpi_device_name(device), ACPI_SMB_HC_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_SMB_HC_CLASS); + strscpy(acpi_device_name(device), ACPI_SMB_HC_DEVICE_NAME); + strscpy(acpi_device_class(device), ACPI_SMB_HC_CLASS); hc = kzalloc(sizeof(struct acpi_smb_hc), GFP_KERNEL); if (!hc) From patchwork Sun Sep 15 18:38:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 13804890 X-Patchwork-Delegate: rjw@sisk.pl Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 031741CB52B; Sun, 15 Sep 2024 18:39:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425565; cv=none; b=txZ49Z+4G+X1eZfVx7U7uBC2N7zhDx2mxYPxZs6nArlQCbbBwO6iVaRL5+go/G9+sXw/LfbhXxtOQCaKmZoQSOn5IoxG9vETcm3zao9cubTFXWjvyHEAQXQ2jNkY/f9ZhpSZalUGr4D4tSJsJBFYzBZiN3xDgOYKfm0BuVzCx8Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425565; c=relaxed/simple; bh=OnJ05WaDShiGNVjIgf9Nqis6sYSVm0mgO+tOmfk+c+0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F6tUwC5QEu7sUuJ41QPSpmIFHm7tn/TgMICCZtQdji8g5vRfsz1xNLvQU+VYXOnBt0Gscm4Qq5sMnEx1CFtzptNkKz0yV580B5OqkMGh4pORLGRrQj0oAjI8j+rpPi6OW0Eh2Y5gZL4UwdFqYV78p6AoioB7sHru38HYJEVTOVg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gDJZcsGc; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gDJZcsGc" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-42e5e758093so4101965e9.1; Sun, 15 Sep 2024 11:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726425562; x=1727030362; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ELjpz1rBiExxDnOz7HNOv+Qd7/rDFxM45ncqcBQusKM=; b=gDJZcsGcaZKCdaCZILZk93nZ5OJfh49B8aDrE0F7gMQqVtkxWlSx3QxjWFMB2xcQ3O 2T0forKhWJfjRX5YX4OM4rolmnmCyQklO6i3yUfLXwZMZ8vZXfvb+wbfRRq8OrCiQm0C S7hURR6IsZbQ4N5n98HSK47gMl/efweqA3TwiNMqO+t1HpQwkwUnnvSD6ZilWstx/Guu +mY9eF0KDsiG78OCcS6x9NnI2l7uoiOOhjNi4F/z2aUSPatw7zXzRQH2qiQiRPOWIBeU iTCjnAuqNCtkIXLQke0iem6fWw2g0Yv8TbZy3KGh4pcbMvBdwagPbp6x/2fvgQwHcGC4 PWpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726425562; x=1727030362; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ELjpz1rBiExxDnOz7HNOv+Qd7/rDFxM45ncqcBQusKM=; b=Pe4oZm9dm7RxgoCoAzCww5exEGLYmU8AbN8xDZE6W7cV5QeAmUzL3+or9UGhkoxEXS nEZw607JEBrV2Y/8CS9CLxOD/JAOzbmzPw73XRPMQkJhVG1FmZ3WxZc5do0HWHDjW4DM HpaTlcpILee0eeUdZ+BKrrMywrkAnqRVfNpnj0WnjgXc3fCPW5z/afEkJeGD5G8aja9C ahreNe9n3E2pb+SIMaf9E+l08FAfT3xCDXJRsu2fbnOfd8uyMMsv/irPVBMXamvvKm7K 8o/4hZcJwrZ6bKUGsTtI+XAcYzbL+kKdnFR2+ca1kZwiV1wQ/esZeCPsRE2qg9JjypbL HDwQ== X-Forwarded-Encrypted: i=1; AJvYcCXEn4c7zkCFmVTZ3rPs7N1Gkoh5AKJx/XVJgIAopnpg49pM78BsIkZvxyNpIphMFzBMej2y1O23u0Xt@vger.kernel.org, AJvYcCXHqQNwnDw7P3Lv4yu/4l3AhsdDYxM8MoCmn1e67AmFq+19rtR1aXEVfhdVGEax4LEkXSccpGZTGTvjKo5g@vger.kernel.org X-Gm-Message-State: AOJu0YzCQJHWxWekn/vx6KoQVqukaYzIITX5Eo+hJ5jbYmv+0MIGmk0I tobW1xM+6lqKqfJjnevRvpXl3gkqCxJxeYas5z4yWOsMLOZU4Vd4 X-Google-Smtp-Source: AGHT+IGc+8EVYbbHRnc+S9A51fe6p45mZnlxDkSKI0VSBuoApwbj05Y4YqLOpH0KR8uWuJPX+1HBoQ== X-Received: by 2002:adf:ec0c:0:b0:375:133e:27f3 with SMTP id ffacd0b85a97d-378d61711d5mr5251133f8f.0.1726425562084; Sun, 15 Sep 2024 11:39:22 -0700 (PDT) Received: from qamajeed.Home ([39.45.198.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73f2001sm5162357f8f.48.2024.09.15.11.39.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2024 11:39:21 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH 09/10] ACPI: scan: Use strscpy instead of strcpy. Date: Sun, 15 Sep 2024 23:38:21 +0500 Message-ID: <20240915183822.34588-9-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240915183822.34588-1-qasim.majeed20@gmail.com> References: <20240915183822.34588-1-qasim.majeed20@gmail.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI scan driver. strcpy() has been deprecated because it is generally unsafe. Eliminating it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/scan.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 22ae7829a915..61cfd8106f3e 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1179,19 +1179,19 @@ static void acpi_device_get_busid(struct acpi_device *device) * TBD: Shouldn't this value be unique (within the ACPI namespace)? */ if (!acpi_dev_parent(device)) { - strcpy(device->pnp.bus_id, "ACPI"); + strscpy(device->pnp.bus_id, "ACPI"); return; } switch (device->device_type) { case ACPI_BUS_TYPE_POWER_BUTTON: - strcpy(device->pnp.bus_id, "PWRF"); + strscpy(device->pnp.bus_id, "PWRF"); break; case ACPI_BUS_TYPE_SLEEP_BUTTON: - strcpy(device->pnp.bus_id, "SLPF"); + strscpy(device->pnp.bus_id, "SLPF"); break; case ACPI_BUS_TYPE_ECDT_EC: - strcpy(device->pnp.bus_id, "ECDT"); + strscpy(device->pnp.bus_id, "ECDT"); break; default: acpi_get_name(device->handle, ACPI_SINGLE_NAME, &buffer); @@ -1202,7 +1202,7 @@ static void acpi_device_get_busid(struct acpi_device *device) else break; } - strcpy(device->pnp.bus_id, bus_id); + strscpy(device->pnp.bus_id, bus_id); break; } } @@ -1453,8 +1453,8 @@ static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, acpi_object_is_system_bus(handle)) { /* \_SB, \_TZ, LNXSYBUS */ acpi_add_id(pnp, ACPI_BUS_HID); - strcpy(pnp->device_name, ACPI_BUS_DEVICE_NAME); - strcpy(pnp->device_class, ACPI_BUS_CLASS); + strscpy(pnp->device_name, ACPI_BUS_DEVICE_NAME); + strscpy(pnp->device_class, ACPI_BUS_CLASS); } break; From patchwork Sun Sep 15 18:38:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 13804891 X-Patchwork-Delegate: rjw@sisk.pl Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 D0EAF1CBE98; Sun, 15 Sep 2024 18:39:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425568; cv=none; b=q9kDWy3iy4la7IbdUoTUjFXVQ9GD/fhk4vpJdRfInmdWe8QM/NuyAS6WQx2tCbyj7rcD3JLQqajYTEqux700Yk5Yt09YEXfuDy2biNZe+wAw5nsYZN5xtMHyU+ygCZKVbhIqqlGB41v9pgBn2yoBv95ygXcdReXMwmXgoU8WDYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726425568; c=relaxed/simple; bh=keCmrGqn8EZjR2v9MgON+1inwuqXRtWmcwOAfBJ62fM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KKY5gbqvKVa9FT9/lmohVmsNfV7nSCeX/q5boPCP9Ww3jiMgQ9lpXGNCEkYS9dMy+7kODco5IoxvSW2AcBJ1Uurh74zE7Ryp1k03RyWTwYEXMH7It4wWH05eDAzJPPNXJGpA/YhmiEjpgCRVepT7sckFUiNCWDobiAI0qIyAhzc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=m3QH7CVi; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m3QH7CVi" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-42cbaf9bfdbso20146245e9.0; Sun, 15 Sep 2024 11:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726425564; x=1727030364; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BubB76Gm/+PXngcewf3UxvETcuLALREaZF3VY8gFJww=; b=m3QH7CVioXUZlTcXez1tzURS1g2ZGIPYCCLn5W8BouYFQSZE8lWseUj0S7IaAbWzE1 +46OwoCjbzpWNn8NcIKdb460s1/SqlMz5DUTCDakLJkS+x/B0zhHKhMQiJZV7IQq2P+v 2TV+ua/LrdePzqUfYk/uuVIdzxIB1RlrF60N0IjCPfEPW/6xylT658jA5LioAkSvTABn ZyT1AMDsgcmDMAr067CS2MrYcfcgmC8KoJguyGFg3X6lTSDFOJ61HRUtZ0kn2HT1LT8V cch2kEIn85VLpiaoJMUhOIWPzz60aJm9qTLvWSDrjAMK7xjpkCkBhlUnJAU9CYk6UtWa VkLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726425564; x=1727030364; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BubB76Gm/+PXngcewf3UxvETcuLALREaZF3VY8gFJww=; b=U9KY/Dc2n/qdKOUGbaJtg3ZtjdnrYVt2+C5r5EFPHinERXiuhyie+cnNNOVLmFqDOg JiRtlGN1tnpEmi67xalJ9JNbO6MdvnXgUutETZB6qPXPfTTkF0RPSLvRY8mWC2Cj28iI cGWcps98UwWYHuTjpjzBITpnaObLzEVhq0cmL7B8zrkPVb0S9SFrVE81Kq7wjbmP098H qcA0KZnejiN7/1NtzqUNweVHHyz4mjquBOuUZWKglxolktaRHqzY6ne4HguI9WmYtnRV E4SShEhfH3yl+G3G/6g19RuE+97tw4ukafgDiAyh7o8h2lhEMzCnqB8oQ8jHtL0NNyU4 QvGA== X-Forwarded-Encrypted: i=1; AJvYcCVsQVPGaL8JFzSSDrdPHp4gQZOZVVyD/heKx9NhLbChuU/kjad7YRGdZO6/PzT1QDwkPUw5N4ESYsvMaVSW@vger.kernel.org, AJvYcCVxBLYZAGYi01hEDXOZQNaKTUbbgFnREkY6B1FccrR8IE7lloW+Aeo0U68kGAvsfKwUA5A35XCZBqu2@vger.kernel.org X-Gm-Message-State: AOJu0YwcM0uj7KL+vg4jQk/ujDjNp0+kGGOiM8VRgOiBFhnlcrEEJR6y cQeue3IBKxbqEpr4Rh+RbqB5M8WfmSbVAQbLIAK+fY9Y7UFubfr1CKBhqQ== X-Google-Smtp-Source: AGHT+IGdVWZbZlZqMEbwDjELGdMIn/gX+FexnG/400I907lv+zs3oygPi8/fEv/56/0oF1wxM0Mrfg== X-Received: by 2002:a05:600c:4e94:b0:42c:b34d:720c with SMTP id 5b1f17b1804b1-42d9070a587mr52572485e9.4.1726425564444; Sun, 15 Sep 2024 11:39:24 -0700 (PDT) Received: from qamajeed.Home ([39.45.198.72]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73f2001sm5162357f8f.48.2024.09.15.11.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2024 11:39:24 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH 10/10] ACPI: thermal: Use strscpy instead of strcpy. Date: Sun, 15 Sep 2024 23:38:22 +0500 Message-ID: <20240915183822.34588-10-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240915183822.34588-1-qasim.majeed20@gmail.com> References: <20240915183822.34588-1-qasim.majeed20@gmail.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI thermal driver. strcpy() has been deprecated because it is generally unsafe. Eliminating it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/thermal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index a0cfc857fb55..0c69d04fbac9 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -842,9 +842,9 @@ static int acpi_thermal_add(struct acpi_device *device) return -ENOMEM; tz->device = device; - strcpy(tz->name, device->pnp.bus_id); - strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS); + strscpy(tz->name, device->pnp.bus_id); + strscpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); + strscpy(acpi_device_class(device), ACPI_THERMAL_CLASS); device->driver_data = tz; acpi_thermal_aml_dependency_fix(tz);