From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88378C433E0 for ; Thu, 25 Feb 2021 11:30:49 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D27B464F11 for ; Thu, 25 Feb 2021 11:30:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D27B464F11 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 41C2E16A4; Thu, 25 Feb 2021 12:29:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 41C2E16A4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614252647; bh=h9rTv1EErYulsutc4VpD5Hy6xXNeL4UzoWw1B14Og+A=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=X86Rng7+VEiuCDSeumB2i4L2y/MroiARxc/jqC6uL/TQhH4IswlNSRLXfMEeJnbPi gopEWUSGAfiKMsYRn45a/vXGgmhuU+oCYhiIVk0LdCY9Qdq69H5zmj7c3vgogeqgLn C14vlZ88DnZGbQGqpcyeR3L6qtqznj00cx5VXRDI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DDC2BF804E0; Thu, 25 Feb 2021 12:25:57 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 41860F8016A; Tue, 23 Feb 2021 10:31:40 +0100 (CET) Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D980BF800B4 for ; Tue, 23 Feb 2021 10:31:30 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D980BF800B4 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="swbR//Pf" Received: by mail-ot1-x329.google.com with SMTP id c16so14955978otp.0 for ; Tue, 23 Feb 2021 01:31:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DVFCa2/tt2H+LD0hRmA62OWnetDkcRuJ237RaPObmX8=; b=swbR//PfErd8XhgqzDSvvUK5jzVq9I8ZOx5107KVbKYg6OqJq5hU9Y7+FdR1SBeUja XJmX1+I6H5AglonFmbvrr81dNBwM3QnXE4EuG7TJWhIi/6FE1+8He3sEPJbO4INmoKra 9iOMcrz+CTsosmGPpFBUPjF+flTGoUO7NFRfH/pMaTjMhY28cNzYuNdI2H+2agFc87TG NNcg1BKrJzAhg+GQMv7+q2S3lhDlcToJGSD5Pj4TUA/3WGlfjh98Gwmyxaz51z2EFPhd TSDFq9glzNWUmQSNEfoHH4rl6gUgulaH0LvJ5akCuSta4YkpTYqMt9yAEiC7zavZGd35 C9qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DVFCa2/tt2H+LD0hRmA62OWnetDkcRuJ237RaPObmX8=; b=g7uRH5PHe/Jlq4bLrfAVuamhtjDK0aDa8HbU8ArcK0ngJfXq9H6susS8sGGtFv2j7/ jjJPDs4mRqcS3igkGPiIjtb/VJTyBThCuOs1eD4fKpNFZtI3WLRZMR+iA4cZLw2nwd5+ 4EjptEWJYA+o2uRtf1ejfB3eHlrfN2xpGvtbw5Be5l+RLAD8vfv93D6cmd/rk7Eo8ox3 2aXdMY8NZFEti+RUbHpxaMoaOGcZgWo/TxbHK705yCkC6klnt36rsgwC7I9DQWLP3wuu VbrUGBP4gV025TCcqbpJLFsX9aB/5TOWvy1V5OwezCYklRnXxX/GLlgKE0yE/smu3i8D xHGA== X-Gm-Message-State: AOAM531ziUem/yD9uBPEgXFEjWbVpVEn6ckOQIZSYHyCcvpFXg5r7Ije LPO41Nqn7d2k7Xg54rzcTzIVqbe3R3IrnZ4UldY= X-Google-Smtp-Source: ABdhPJw119jqyynvn6i6tP3tXQai/RxjO4NuMQBdVlW9Zg6eOFuI0kMlNL/nUCHjxtta9WlCiGOPHrcAz/7jkLcfzHw= X-Received: by 2002:a9d:67cb:: with SMTP id c11mr19768599otn.290.1614072687320; Tue, 23 Feb 2021 01:31:27 -0800 (PST) MIME-Version: 1.0 References: <20210222151231.22572-1-romain.perier@gmail.com> <936bcf5e-2006-7643-7804-9efa318b3e2b@linuxfoundation.org> In-Reply-To: <936bcf5e-2006-7643-7804-9efa318b3e2b@linuxfoundation.org> From: Romain Perier Date: Tue, 23 Feb 2021 10:31:15 +0100 Message-ID: Subject: Re: [PATCH 00/20] Manual replacement of all strlcpy in favor of strscpy To: Shuah Khan X-Mailman-Approved-At: Thu, 25 Feb 2021 12:25:31 +0100 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: alsa-devel@alsa-project.org, target-devel@vger.kernel.org, Kernel Hardening , Valentina Manea , Mimi Zohar , "J. Bruce Fields" , netdev , Zefan Li , Jiri Slaby , Sumit Semwal , linux-watchdog@vger.kernel.org, linux-s390@vger.kernel.org, Benjamin Block , Herbert Xu , linux-scsi@vger.kernel.org, Shuah Khan , "Rafael J. Wysocki" , Christian Borntraeger , Ingo Molnar , Geert Uytterhoeven , Guenter Roeck , linux-media@vger.kernel.org, Kees Cook , Vasily Gorbik , Linux Kernel Mailing List , Heiko Carstens , Johannes Weiner , Steven Rostedt , linaro-mm-sig@lists.linaro.org, linux-m68k@lists.linux-m68k.org, dri-devel@lists.freedesktop.org, Jiri Pirko , cgroups@vger.kernel.org, Wim Van Sebroeck , linux-integrity@vger.kernel.org, linux-hwmon@vger.kernel.org, Felipe Balbi , linux-nfs@vger.kernel.org, "Martin K. Petersen" , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Takashi Iwai , "David S. Miller" , Chuck Lever , Dmitry Kasatkin , linux-crypto@vger.kernel.org, Jessica Yu , Tejun Heo , Steffen Maier , =?UTF-8?Q?Christian_K=C3=B6nig?= X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Le lun. 22 f=C3=A9vr. 2021 =C3=A0 17:36, Shuah Khan a =C3=A9crit : > > Cool. A quick check shows me 1031 strscpy() calls with no return > checks. All or some of these probably need to be reviewed and add > return checks. Is this something that is in the plan to address as > part of this work? > > thanks, > -- Shuah > Hi, Initially, what we planned with Kees is to firstly replace all calls with error handling codes (like this series does), and then replace all other simple calls (without error handling). However, we can also start a discussion about this topic, all suggestions are welcome. I am not sure that it does make sense to check all returns code in all cases (for example in arch/alpha/kernel/setup.c, there are a ton of other examples in the kernel). But a general review (as you suggest), would make sense. Regards, Romain From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: ** X-Spam-Status: No, score=2.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C54A0C433DB for ; Tue, 23 Feb 2021 09:31:30 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 65C7264E4B for ; Tue, 23 Feb 2021 09:31:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65C7264E4B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D5C76E1CD; Tue, 23 Feb 2021 09:31:29 +0000 (UTC) Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4BB636E1CD for ; Tue, 23 Feb 2021 09:31:27 +0000 (UTC) Received: by mail-ot1-x32a.google.com with SMTP id s3so11724622otg.5 for ; Tue, 23 Feb 2021 01:31:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DVFCa2/tt2H+LD0hRmA62OWnetDkcRuJ237RaPObmX8=; b=swbR//PfErd8XhgqzDSvvUK5jzVq9I8ZOx5107KVbKYg6OqJq5hU9Y7+FdR1SBeUja XJmX1+I6H5AglonFmbvrr81dNBwM3QnXE4EuG7TJWhIi/6FE1+8He3sEPJbO4INmoKra 9iOMcrz+CTsosmGPpFBUPjF+flTGoUO7NFRfH/pMaTjMhY28cNzYuNdI2H+2agFc87TG NNcg1BKrJzAhg+GQMv7+q2S3lhDlcToJGSD5Pj4TUA/3WGlfjh98Gwmyxaz51z2EFPhd TSDFq9glzNWUmQSNEfoHH4rl6gUgulaH0LvJ5akCuSta4YkpTYqMt9yAEiC7zavZGd35 C9qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DVFCa2/tt2H+LD0hRmA62OWnetDkcRuJ237RaPObmX8=; b=Y5rfHSuxYequ9olAPMF1y5/bLvQZhpKgXWbJj+FqNRya8BjasBn1l7Je7w2hX4eu/e 5P0YMqCCYxbbRsy/+Q2RBJUYVn0AbUSn0khMK7x+eU+NxDtQk8z83gLC6BNEcMLMwsuV LGCPSAJrodzCaCxPrL86iqbFmA0Ncu659GRWafhzFSZHStyxZmu0Q9YAJGDCnFmwkCk7 b9ufZ3dyzySZ5ZLKjSJ8BBBCczUiR25nr5twggRdDWGv+HS7KClvRGLLt2yNvTQex36b s/Uoh9nfy76djhnF8YM3g4PxoeKp+oMpWnuCLPKGzGE6f/JN9Lb3laLTCGwyE5dvj+Oq /NWw== X-Gm-Message-State: AOAM533+0X15BXG9bH4jiZjCEJte5OemBxuB0IUUtklp4Z4AOt/G+jNR AmshVAt734k/BLyRVm8euOmzcNo9peGSGyTDuPs= X-Google-Smtp-Source: ABdhPJw119jqyynvn6i6tP3tXQai/RxjO4NuMQBdVlW9Zg6eOFuI0kMlNL/nUCHjxtta9WlCiGOPHrcAz/7jkLcfzHw= X-Received: by 2002:a9d:67cb:: with SMTP id c11mr19768599otn.290.1614072687320; Tue, 23 Feb 2021 01:31:27 -0800 (PST) MIME-Version: 1.0 References: <20210222151231.22572-1-romain.perier@gmail.com> <936bcf5e-2006-7643-7804-9efa318b3e2b@linuxfoundation.org> In-Reply-To: <936bcf5e-2006-7643-7804-9efa318b3e2b@linuxfoundation.org> From: Romain Perier Date: Tue, 23 Feb 2021 10:31:15 +0100 Message-ID: Subject: Re: [PATCH 00/20] Manual replacement of all strlcpy in favor of strscpy To: Shuah Khan X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, target-devel@vger.kernel.org, Kernel Hardening , Valentina Manea , Mimi Zohar , Jaroslav Kysela , "J. Bruce Fields" , netdev , Zefan Li , Jiri Slaby , linux-watchdog@vger.kernel.org, linux-s390@vger.kernel.org, Benjamin Block , Herbert Xu , linux-scsi@vger.kernel.org, Shuah Khan , "Rafael J. Wysocki" , Christian Borntraeger , Ingo Molnar , Geert Uytterhoeven , Guenter Roeck , linux-media@vger.kernel.org, Kees Cook , Vasily Gorbik , Linux Kernel Mailing List , Heiko Carstens , Johannes Weiner , Steven Rostedt , linaro-mm-sig@lists.linaro.org, linux-m68k@lists.linux-m68k.org, dri-devel@lists.freedesktop.org, Jiri Pirko , cgroups@vger.kernel.org, Wim Van Sebroeck , linux-integrity@vger.kernel.org, linux-hwmon@vger.kernel.org, Felipe Balbi , linux-nfs@vger.kernel.org, "Martin K. Petersen" , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Takashi Iwai , "David S. Miller" , Chuck Lever , Dmitry Kasatkin , linux-crypto@vger.kernel.org, Jessica Yu , Tejun Heo , Steffen Maier , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: multipart/mixed; boundary="===============1946149301==" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --===============1946149301== Content-Type: multipart/alternative; boundary="0000000000002b63e105bbfd9544" --0000000000002b63e105bbfd9544 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le lun. 22 f=C3=A9vr. 2021 =C3=A0 17:36, Shuah Khan a =C3=A9crit : > > Cool. A quick check shows me 1031 strscpy() calls with no return > checks. All or some of these probably need to be reviewed and add > return checks. Is this something that is in the plan to address as > part of this work? > > thanks, > -- Shuah > Hi, Initially, what we planned with Kees is to firstly replace all calls with error handling codes (like this series does), and then replace all other simple calls (without error handling). However, we can also start a discussion about this topic, all suggestions are welcome. I am not sure that it does make sense to check all returns code in all cases (for example in arch/alpha/kernel/setup.c, there are a ton of other examples in the kernel). But a general review (as you suggest), would make sense. Regards, Romain --0000000000002b63e105bbfd9544 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Le=C2=A0lun. 22 f=C3=A9vr. 2021 =C3=A0=C2=A017:36, Shuah Khan <skhan@linuxfoundation.org>= ; a =C3=A9crit=C2=A0:

Cool. A quick check shows me 1031 strscpy() calls with no return
checks. All or some of these probably need to be reviewed and add
return checks. Is this something that is in the plan to address as
part of this work?

thanks,
-- Shuah

Hi,

Initially, what we planned with Kees is t= o firstly replace all calls with error handling codes (like this series doe= s),
and then replace all other simple calls (without error handli= ng). However, we can also start a discussion about this topic, all suggesti= ons are welcome.

I am not sure that it does make s= ense to check all returns code in all cases (for example in arch/alpha/kern= el/setup.c, there are a ton of other examples in the kernel). But a general= review (as you suggest), would make sense.

Re= gards,
Romain
=C2=A0
--0000000000002b63e105bbfd9544-- --===============1946149301== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1946149301==-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B61FCC433DB for ; Tue, 23 Feb 2021 09:31:50 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 67EC964E02 for ; Tue, 23 Feb 2021 09:31:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 67EC964E02 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-20812-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 7955 invoked by uid 550); 23 Feb 2021 09:31:40 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 7929 invoked from network); 23 Feb 2021 09:31:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DVFCa2/tt2H+LD0hRmA62OWnetDkcRuJ237RaPObmX8=; b=swbR//PfErd8XhgqzDSvvUK5jzVq9I8ZOx5107KVbKYg6OqJq5hU9Y7+FdR1SBeUja XJmX1+I6H5AglonFmbvrr81dNBwM3QnXE4EuG7TJWhIi/6FE1+8He3sEPJbO4INmoKra 9iOMcrz+CTsosmGPpFBUPjF+flTGoUO7NFRfH/pMaTjMhY28cNzYuNdI2H+2agFc87TG NNcg1BKrJzAhg+GQMv7+q2S3lhDlcToJGSD5Pj4TUA/3WGlfjh98Gwmyxaz51z2EFPhd TSDFq9glzNWUmQSNEfoHH4rl6gUgulaH0LvJ5akCuSta4YkpTYqMt9yAEiC7zavZGd35 C9qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DVFCa2/tt2H+LD0hRmA62OWnetDkcRuJ237RaPObmX8=; b=LFdxoEUFDWrf5okSGkx44CAFg3OzvUai+y52EX3f3EQIRvPQFUf73SnsoRHWCaGTlu QczhsIYATGFLkcQGRDVgZ7phBgkbTgP52C8kRxS0GFCsZF8y5CbcKNgjGU8CQ/+xwo4O kV4oxMsZn/odWOKLerBJ+XT9dTODYr+QBXMqvP1GwaI5PVirDltS5PkCEZqY4+ZagNUc g3yAJ4BR1XRoZXiLYxVuflpCQ7vcGzu6KMERrQ0SqSFhFt8oA6qKVAnSclBdlUcYOjir oVJGfUQT62uZfUgCj7xvajoapt4WsnvVoSGPkVrfFpRN6NUgdHNDQvhMlIlTSRvFVyFg CLfw== X-Gm-Message-State: AOAM532c5npEuNpvj5hRBOItX+qHeRyRrM+2ZRhOk+BVdW9nRKK0x7cq jHQstNR1ofVk5jFd9hcTBeSbpe6YLXXc2Djy4NM= X-Google-Smtp-Source: ABdhPJw119jqyynvn6i6tP3tXQai/RxjO4NuMQBdVlW9Zg6eOFuI0kMlNL/nUCHjxtta9WlCiGOPHrcAz/7jkLcfzHw= X-Received: by 2002:a9d:67cb:: with SMTP id c11mr19768599otn.290.1614072687320; Tue, 23 Feb 2021 01:31:27 -0800 (PST) MIME-Version: 1.0 References: <20210222151231.22572-1-romain.perier@gmail.com> <936bcf5e-2006-7643-7804-9efa318b3e2b@linuxfoundation.org> In-Reply-To: <936bcf5e-2006-7643-7804-9efa318b3e2b@linuxfoundation.org> From: Romain Perier Date: Tue, 23 Feb 2021 10:31:15 +0100 Message-ID: Subject: Re: [PATCH 00/20] Manual replacement of all strlcpy in favor of strscpy To: Shuah Khan Cc: Kees Cook , Kernel Hardening , Tejun Heo , Zefan Li , Johannes Weiner , Herbert Xu , "David S. Miller" , Jiri Pirko , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Greg Kroah-Hartman , Mimi Zohar , Dmitry Kasatkin , "J. Bruce Fields" , Chuck Lever , Geert Uytterhoeven , Jessica Yu , Guenter Roeck , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Steffen Maier , Benjamin Block , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Steven Rostedt , Ingo Molnar , Jiri Slaby , Felipe Balbi , Valentina Manea , Shuah Khan , Wim Van Sebroeck , cgroups@vger.kernel.org, linux-crypto@vger.kernel.org, netdev , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, "Rafael J. Wysocki" , linux-integrity@vger.kernel.org, linux-nfs@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-hwmon@vger.kernel.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, alsa-devel@alsa-project.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Linux Kernel Mailing List Content-Type: multipart/alternative; boundary="0000000000002b63e105bbfd9544" --0000000000002b63e105bbfd9544 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le lun. 22 f=C3=A9vr. 2021 =C3=A0 17:36, Shuah Khan a =C3=A9crit : > > Cool. A quick check shows me 1031 strscpy() calls with no return > checks. All or some of these probably need to be reviewed and add > return checks. Is this something that is in the plan to address as > part of this work? > > thanks, > -- Shuah > Hi, Initially, what we planned with Kees is to firstly replace all calls with error handling codes (like this series does), and then replace all other simple calls (without error handling). However, we can also start a discussion about this topic, all suggestions are welcome. I am not sure that it does make sense to check all returns code in all cases (for example in arch/alpha/kernel/setup.c, there are a ton of other examples in the kernel). But a general review (as you suggest), would make sense. Regards, Romain --0000000000002b63e105bbfd9544 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Le=C2=A0lun. 22 f=C3=A9vr. 2021 =C3=A0=C2=A017:36, Shuah Khan <skhan@linuxfoundation.org>= ; a =C3=A9crit=C2=A0:

Cool. A quick check shows me 1031 strscpy() calls with no return
checks. All or some of these probably need to be reviewed and add
return checks. Is this something that is in the plan to address as
part of this work?

thanks,
-- Shuah

Hi,

Initially, what we planned with Kees is t= o firstly replace all calls with error handling codes (like this series doe= s),
and then replace all other simple calls (without error handli= ng). However, we can also start a discussion about this topic, all suggesti= ons are welcome.

I am not sure that it does make s= ense to check all returns code in all cases (for example in arch/alpha/kern= el/setup.c, there are a ton of other examples in the kernel). But a general= review (as you suggest), would make sense.

Re= gards,
Romain
=C2=A0
--0000000000002b63e105bbfd9544-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Romain Perier Subject: Re: [PATCH 00/20] Manual replacement of all strlcpy in favor of strscpy Date: Tue, 23 Feb 2021 10:31:15 +0100 Message-ID: References: <20210222151231.22572-1-romain.perier@gmail.com> <936bcf5e-2006-7643-7804-9efa318b3e2b@linuxfoundation.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000002b63e105bbfd9544" Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DVFCa2/tt2H+LD0hRmA62OWnetDkcRuJ237RaPObmX8=; b=swbR//PfErd8XhgqzDSvvUK5jzVq9I8ZOx5107KVbKYg6OqJq5hU9Y7+FdR1SBeUja XJmX1+I6H5AglonFmbvrr81dNBwM3QnXE4EuG7TJWhIi/6FE1+8He3sEPJbO4INmoKra 9iOMcrz+CTsosmGPpFBUPjF+flTGoUO7NFRfH/pMaTjMhY28cNzYuNdI2H+2agFc87TG NNcg1BKrJzAhg+GQMv7+q2S3lhDlcToJGSD5Pj4TUA/3WGlfjh98Gwmyxaz51z2EFPhd TSDFq9glzNWUmQSNEfoHH4rl6gUgulaH0LvJ5akCuSta4YkpTYqMt9yAEiC7zavZGd35 C9qg== In-Reply-To: <936bcf5e-2006-7643-7804-9efa318b3e2b@linuxfoundation.org> To: Shuah Khan Cc: Kees Cook , Kernel Hardening , Tejun Heo , Zefan Li , Johannes Weiner , Herbert Xu , "David S. Miller" , Jiri Pirko , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Greg Kroah-Hartman , Mimi Zohar , Dmitry Kasatkin , "J. Bruce Fields" , Chuck Lever , Geert Uytterhoeven , Jessica Yu , Guenter Roeck , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Steffen Maier --0000000000002b63e105bbfd9544 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le lun. 22 f=C3=A9vr. 2021 =C3=A0 17:36, Shuah Khan a =C3=A9crit : > > Cool. A quick check shows me 1031 strscpy() calls with no return > checks. All or some of these probably need to be reviewed and add > return checks. Is this something that is in the plan to address as > part of this work? > > thanks, > -- Shuah > Hi, Initially, what we planned with Kees is to firstly replace all calls with error handling codes (like this series does), and then replace all other simple calls (without error handling). However, we can also start a discussion about this topic, all suggestions are welcome. I am not sure that it does make sense to check all returns code in all cases (for example in arch/alpha/kernel/setup.c, there are a ton of other examples in the kernel). But a general review (as you suggest), would make sense. Regards, Romain --0000000000002b63e105bbfd9544 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Le=C2=A0lun. 22 f=C3=A9vr. 2021 =C3=A0=C2=A017:36, Shuah Khan <skhan@linuxfoundation.org>= ; a =C3=A9crit=C2=A0:

Cool. A quick check shows me 1031 strscpy() calls with no return
checks. All or some of these probably need to be reviewed and add
return checks. Is this something that is in the plan to address as
part of this work?

thanks,
-- Shuah

Hi,

Initially, what we planned with Kees is t= o firstly replace all calls with error handling codes (like this series doe= s),
and then replace all other simple calls (without error handli= ng). However, we can also start a discussion about this topic, all suggesti= ons are welcome.

I am not sure that it does make s= ense to check all returns code in all cases (for example in arch/alpha/kern= el/setup.c, there are a ton of other examples in the kernel). But a general= review (as you suggest), would make sense.

Re= gards,
Romain
=C2=A0
--0000000000002b63e105bbfd9544--