Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp912986pxb; Thu, 19 Nov 2020 17:40:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJykjGuCELu9HWC/FGmyfzuhZzGcWq89JduYQmmE48yD/O3rs/cJbaj0AoJt2jnvxJJSxoLi X-Received: by 2002:a50:fd06:: with SMTP id i6mr34584848eds.318.1605836400293; Thu, 19 Nov 2020 17:40:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605836400; cv=none; d=google.com; s=arc-20160816; b=MBgpvOA/OvsQnBuQ0km7f6yTnDbVin3Jt29/v47JtiPZ6dmT+SFzslUw7oNQ26V/QW yMVvv5lALuPlzJ5qrHB+k9AR45NCy2bDjXh7knGhsQlMCKQyoNph7k1zt+Z8dy/Z7muo kIntbk+6NUN9iMl0ipH75sU+5RUyrwI+6+4WPE6xYQv8uUQMtyYD6KA5DxeD9L2jbk7j 389i06Pqrnb/V8beldK5bWak455tCWKAm1Cyq14DwV/8Q2Ei/upEMOeXOXsEestvaXGr YvIgCsvIBCRBD2X1KLWc9Sun6aWo0CM9GHfpI+4qJZr7iRtcGMwQ9+jZ3RmI2ZTR0mEY 5scA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=oUWuzGTf/kjUaRlidqaIIAqH2OESKVaZRUCtd4BYzcw=; b=X4+epZaDmYk+qrkmpFktigIKjELydG8kTeBjMoMRsHZ4KwkIrRJvglduxSYMcl0wdd 39OvyD9kYxDrr6zKvfZlbeclETLD3NnAcp/m0B0vhAKtk6ZQHEpeQEv+2j2+CCfp1C7O JhEvsWnEA/fEzgyMYT2MqIEfTd4fBpjoLC3FEj+cezgpTu+9cmrYGhs6GcfOcJEp68Wi DE0+6T29nGFVy5WJOo76ukyr45KbpN+0Z0EfdXcRQAi3CxaJmMuK6pq+mlPzihN6zhhw tjZkr6VfSSoIqHQoqR7ZCEGroJSw7+dM0PXB66rojB9nnDJ7c0lq1irTMVTtyZPXoEgQ HB5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Bl2Vu6Gt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 12si953476edv.200.2020.11.19.17.39.37; Thu, 19 Nov 2020 17:40:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Bl2Vu6Gt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726948AbgKTBfr (ORCPT + 99 others); Thu, 19 Nov 2020 20:35:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:38180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726580AbgKTBfq (ORCPT ); Thu, 19 Nov 2020 20:35:46 -0500 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5863322254; Fri, 20 Nov 2020 01:35:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1605836144; bh=mQahlZ4oBkXPItMF4u4Zjyv8WH7f9AQL+MGPFjxwPa4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Bl2Vu6Gt2cxOBoF8QYWx3yITQmECR0Z2YJdDa2eB/UlWFYiU2LxwmQmtu7aQf3t/c FELxlAHHd25VPIMj9cSoy1JjV5rPGRiQCCOGAXbrF1u7g2usKbwJx+tIX18idLtseI M8BiV1QglGu8U/7r6Y2q1Lphj/mPSSBIgM2FRWbg= Date: Thu, 19 Nov 2020 17:35:43 -0800 From: Andrew Morton To: laniel_francis@privacyrequired.com Cc: linux-hardening@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, dja@axtens.net, keescook@chromium.org Subject: Re: [PATCH v6 0/5] Fortify strscpy() Message-Id: <20201119173543.8821881942022fc4f39c4c73@linux-foundation.org> In-Reply-To: <20201119164915.10618-1-laniel_francis@privacyrequired.com> References: <20201119164915.10618-1-laniel_francis@privacyrequired.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Nov 2020 17:49:10 +0100 laniel_francis@privacyrequired.com wrote: > From: Francis Laniel > > Hi. > > > I hope your families, friends and yourselves are fine. Thanks. You too ;) > This patch set answers to this issue: > https://github.com/KSPP/linux/issues/46 I fail to understand what this patchset has to do with that one-element-array issue :( > I based my modifications on top of two patches from Daniel Axtens which modify > calls to __builtin_object_size to ensure the true size of char * are returned > and not the surrounding structure size. > > To sum up, in my first patch I implemented a fortified version of strscpy. > This new version ensures the following before calling vanilla strscpy: > 1. There is no read overflow because either size is smaller than src length > or we shrink size to src length by calling fortified strnlen. > 2. There is no write overflow because we either failed during compilation or at > runtime by checking that size is smaller than dest size. > The second patch brings a new file in LKDTM driver to test this new version. > The test ensures the fortified version still returns the same value as the > vanilla one while panic'ing when there is a write overflow. > The third just corrects some typos in LKDTM related file. > > If you see any problem or way to improve the code, feel free to share it. Could you please send along a reworked [0/n] cover letter? Explain in your own words, without requiring that readers go off and read web pages - What problem the patchset solves - How it solves it - The value of the patchset (to kernel developers or to end-users) so that we can understand why it should be merged. Thanks.