Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4197464rwb; Tue, 8 Nov 2022 13:35:33 -0800 (PST) X-Google-Smtp-Source: AMsMyM7OFuaCL6wiUPvOJydzxMhME/12ZC/oJ48cqYuv9AvmRiOpQfxvyRTpl6bd1O5Gh1Yji6Gv X-Received: by 2002:a17:907:a053:b0:7ad:4a55:4ce0 with SMTP id gz19-20020a170907a05300b007ad4a554ce0mr52581891ejc.541.1667943333153; Tue, 08 Nov 2022 13:35:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667943333; cv=none; d=google.com; s=arc-20160816; b=cUjsnYauuM4vX+Qxl/JelQBya3eJlqOgNGlSolb6Clbk0aQcyenqYEsZ+e7z4SlpwJ 7yWKY/XN95lWyFOwfoXHcy3Mz9mNWEHtpbZCepaG7u1QRMSAF6F+kF0RjGQJC0AFeA+m HK17OzwPGPbCvkGIJCIeG4gwOyFF1SJxhiySmv2CD1xS7sZrFwAHv6NLtGNvsP7FzTJN TRD/3q81Mrdi01R14yifG1QHdm/2mzH2uDiRYoU0KiLZ6uWkIFBHLxY6hHNqupUhfLfM 9Wa4Z/9pXIoBrEYH38VYT+1v8TNn1n2hPtnBX/KkRCvuxCqoWmKidbHH0J/byIj/z/pr CNsQ== 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=AycvYHvoufUkVRSh6ahuBnwgDLm2EHTexyc8CfMqQEc=; b=coZC278lAkejr28yEz8abrA08ID8OO20hLFTav4gAe6gwxbgmE2Ejm0A7ttqTsp8T2 r+2DJFPC4o3ESePjPHI9LWxloOXyNxB7FttqDXEo68T9vSkgeO9axMKngy8yo5A3N6Fz Tmkh5TCc+/jPoLJEv2qwHioUFhmMRKBuCbcZPIrYw70isDbMeW6Ythbt3h2BoH8s20pt +PXJO6IsIyhB6MTK6xan84gchjbjmtj8H089iaufshwHtQFgm1ihp9lMy8/zpFnZfpKE 89rDU0sYbpWNCiGpCY3His7R5RtHwCd4zNStB7u+ecQNEhpv8stKTUSUYqT3j5XLLRDm Ra4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=RzZaFF3n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt16-20020a1709072d9000b0078e1d1d6005si14827096ejc.23.2022.11.08.13.35.07; Tue, 08 Nov 2022 13:35:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=RzZaFF3n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229638AbiKHVF4 (ORCPT + 91 others); Tue, 8 Nov 2022 16:05:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbiKHVFz (ORCPT ); Tue, 8 Nov 2022 16:05:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 309AC627E7; Tue, 8 Nov 2022 13:05:54 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C381161795; Tue, 8 Nov 2022 21:05:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DAA9C433C1; Tue, 8 Nov 2022 21:05:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1667941553; bh=LUZD7U4AhhxRA2fi04bqMLOfEOHk1HLyWrG2QaS70Gk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RzZaFF3nVYdl06DQIW70UTPyDAgnVC4xQWSxIV7uyPHwNya+iZSsy4QrXkFZHFvUE Wn2GbYRt84331jU3MMh3xiDbNqXkxeSD1WeCWcd5+Nvs+C3cPrjIaWv11oxaaKI3v+ MBVHDQIwkS9JZAeCsRqzTh+7rioHQxlawxxf00Ys= Date: Tue, 8 Nov 2022 13:05:51 -0800 From: Andrew Morton To: Francis Laniel Cc: linux-kernel@vger.kernel.org, Alban Crequy , Alban Crequy , Andrii Nakryiko , Mykola Lysenko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , linux-mm@kvack.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [RFC PATCH v1 1/2] maccess: fix writing offset in case of fault in strncpy_from_kernel_nofault() Message-Id: <20221108130551.85ad67b402582e3855418294@linux-foundation.org> In-Reply-To: <20221108195211.214025-2-flaniel@linux.microsoft.com> References: <20221108195211.214025-1-flaniel@linux.microsoft.com> <20221108195211.214025-2-flaniel@linux.microsoft.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 8 Nov 2022 20:52:06 +0100 Francis Laniel wrote: > From: Alban Crequy > > If a page fault occurs while copying the first byte, this function resets one > byte before dst. > As a consequence, an address could be modified and leaded to kernel crashes if > case the modified address was accessed later. > > Signed-off-by: Alban Crequy > Tested-by: Francis Laniel Reviewed-by: Andrew Morton Please merge via the bpf tree. This looks potentially nasty. Fortunately only tracing code uses it, but I'm thinking it should have cc:stable and a Fixes:?