Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1561722948-28289-1-git-send-email-nitin.r.gote@intel.com>
Date: Fri, 28 Jun 2019 17:25:48 +0530
From: Nitin Gote <nitin.r.gote@...el.com>
To: keescook@...omium.org,
	jannh@...gle.com
Cc: kernel-hardening@...ts.openwall.com,
	Nitin Gote <nitin.r.gote@...el.com>
Subject: [PATCH] checkpatch: Added warnings in favor of strscpy().

Added warnings in checkpatch.pl script to :

1. Deprecate strcpy() in favor of strscpy().
2. Deprecate strlcpy() in favor of strscpy().
3. Deprecate strncpy() in favor of strscpy() or strscpy_pad().

Signed-off-by: Nitin Gote <nitin.r.gote@...el.com>
---
 scripts/checkpatch.pl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 342c7c7..bb0fa11 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -595,6 +595,9 @@ our %deprecated_apis = (
 	"rcu_barrier_sched"			=> "rcu_barrier",
 	"get_state_synchronize_sched"		=> "get_state_synchronize_rcu",
 	"cond_synchronize_sched"		=> "cond_synchronize_rcu",
+	"strcpy"				=> "strscpy",
+	"strlcpy"				=> "strscpy",
+	"strncpy"				=> "strscpy or strscpy_pad",
 );

 #Create a search pattern for all these strings to speed up a loop below
--
2.7.4

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.