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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CA1DC4332F for ; Tue, 8 Nov 2022 21:05:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229896AbiKHVF4 (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: bpf@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:?