Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp359143rwb; Wed, 9 Nov 2022 03:32:53 -0800 (PST) X-Google-Smtp-Source: AMsMyM7WAexLD58MubAAdyDsdMSIHTU9CkruYlDK1y3bI6+40Go6laOtnnjiquPXZ+4RNoqbGr7Q X-Received: by 2002:a17:906:1c0e:b0:7ad:c648:a4af with SMTP id k14-20020a1709061c0e00b007adc648a4afmr51905576ejg.277.1667993573663; Wed, 09 Nov 2022 03:32:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667993573; cv=none; d=google.com; s=arc-20160816; b=TEWn7rBmdPkEG8+MRQ4u0pflkv2qjEcQOHBZoaaCtxuXYWhrKIm31Rdj8gbaKCa+kV czXrp4IICBqnX7Wpz2rKQmoNTNvUbk2Js9wBOb5FNCpTeB0NCyzBvL8kSaXvoxqmJY95 5Zc/c/oBovkyY4bdTCkbwxSyh8cGJR91aJlPGRpR+QRxqPEz0NaFCKc+7HhSyiRIRXtp aptskiEnxfkfMAhlu5p8+CeSZWK6TjkiOEwW/bTH9ZUxPeMwalNkoXP2alPFmGaZyVTR 4sluaOP4jBkMUttMJQGmGvzOQL89S6W1WPkTl3wRedBppxbFDSOdlLjNVHsyQFrqTaZN hHRA== 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:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=xjS3RSgFinUTnn09YzQPAUOcc5Q2nF9iD2L4KzdBxww=; b=Qrf9w0n3xeMcyHLJFkIu9YJQKNsZ4j1ABq7bgOMulGehIbDwrjPVpy1quD3M8cyOaF B36WbPOCOjHYjyiVJk7MwsB11N2M6FwcwJZcLHJGwL1a7WvQVOJUgvOrhZyjNT+AJSe5 3UXf45eNJS1/AJPk/FP0xtm1T0C4Pj7nb8BdkUUNQh3YCsEk7u4V1V8mtBS8jn4rKnUA 9gkxxBpqvqkpEe+mG15x4BXtT0h0lgPvpzruLOBSfqlDqt24CsXnU6U/cXIblY9jDYkD omZo8QYOan/dzznG6sW85IhDrSl5C/E+DDSFesH7SJ/Xk/22vKlMjXpfT3n/gkgVwaB6 8YMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="gf/R1SCt"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jz19-20020a170906bb1300b007addbdb9fbbsi13639352ejb.558.2022.11.09.03.32.30; Wed, 09 Nov 2022 03:32:53 -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.microsoft.com header.s=default header.b="gf/R1SCt"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230171AbiKILEe (ORCPT + 93 others); Wed, 9 Nov 2022 06:04:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbiKILEc (ORCPT ); Wed, 9 Nov 2022 06:04:32 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 909B7644C; Wed, 9 Nov 2022 03:04:30 -0800 (PST) Received: from pwmachine.localnet (85-170-25-210.rev.numericable.fr [85.170.25.210]) by linux.microsoft.com (Postfix) with ESMTPSA id E10EA20B929F; Wed, 9 Nov 2022 03:04:26 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E10EA20B929F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1667991870; bh=xjS3RSgFinUTnn09YzQPAUOcc5Q2nF9iD2L4KzdBxww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gf/R1SCtcGFF4CgzLlMsIc28oU4/5u8K8PB3INvwTTeVUNeluS7YQDzb7WkVZBGXM aTE3sOLwkcICATx7N4IcHvqtFxt3hZH5a9ZuqjcrhWmR/tnPzX5NnDMaAnbb243Fdt a+TEzsT3R21bijzQv3l8DC5BsrleqV8rqMp/comQ= From: Francis Laniel To: Andrew Morton 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() Date: Wed, 09 Nov 2022 12:04:24 +0100 Message-ID: <2655397.mvXUDI8C0e@pwmachine> In-Reply-To: <20221108130551.85ad67b402582e3855418294@linux-foundation.org> References: <20221108195211.214025-1-flaniel@linux.microsoft.com> <20221108195211.214025-2-flaniel@linux.microsoft.com> <20221108130551.85ad67b402582e3855418294@linux-foundation.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, USER_IN_DEF_DKIM_WL 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 Hi. Le mardi 8 novembre 2022, 22:05:51 CET Andrew Morton a =E9crit : > On Tue, 8 Nov 2022 20:52:06 +0100 Francis Laniel=20 wrote: > > From: Alban Crequy > >=20 > > If a page fault occurs while copying the first byte, this function rese= ts > > 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. > >=20 > > Signed-off-by: Alban Crequy > > Tested-by: Francis Laniel >=20 > Reviewed-by: Andrew Morton >=20 > Please merge via the bpf tree. >=20 > This looks potentially nasty. Fortunately only tracing code uses it, > but I'm thinking it should have cc:stable and a Fixes:? Thank you for the review! Sorry, I thought to add stable list but forgot to add it when sending the=20 series... I will sent a v2 with your review and without rfc tag to, among others,=20 stable.