From patchwork Mon Apr 10 17:43:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Lehner X-Patchwork-Id: 13206546 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 72E4AC77B61 for ; Mon, 10 Apr 2023 17:44:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229970AbjDJRo3 (ORCPT ); Mon, 10 Apr 2023 13:44:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230362AbjDJRo2 (ORCPT ); Mon, 10 Apr 2023 13:44:28 -0400 Received: from mx.der-flo.net (mx.der-flo.net [193.160.39.236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 768012700 for ; Mon, 10 Apr 2023 10:44:21 -0700 (PDT) From: Florian Lehner To: bpf@vger.kernel.org Cc: x86@kernel.org, davem@davemloft.net, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, peterz@infradead.org, keescook@chromium.org, tglx@linutronix.de, hsinweih@uci.edu, rostedt@goodmis.org, vegard.nossum@oracle.com, gregkh@linuxfoundation.org, alan.maguire@oracle.com, dylany@meta.com, riel@surriel.com, Florian Lehner Subject: [v2 bpf-next 0/2] Fix copy_from_user_nofault() Date: Mon, 10 Apr 2023 19:43:43 +0200 Message-Id: <20230410174345.4376-1-dev@der-flo.net> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net The original patch got submitted by Alexei Starovoitov with [0] and fixes issues that got also reported in [1]. This resubmission adds !pagefault_disabled() to the check in check_heap_object(). Changelog: v1->v2: Addressed comments from Alexei Starovoitov - move pagefault_disabled() check into first patch - keep __copy_from_user_inatomic() in copy_from_user_nofault() [0] https://lore.kernel.org/all/20230118051443.78988-1-alexei.starovoitov@gmail.com/ [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1033398 Alexei Starovoitov (2): mm: Fix copy_from_user_nofault(). perf: Fix arch_perf_out_copy_user(). arch/x86/include/asm/perf_event.h | 2 -- arch/x86/lib/Makefile | 2 +- arch/x86/lib/usercopy.c | 55 ------------------------------- kernel/events/internal.h | 16 +-------- mm/maccess.c | 52 ++++++++++++++++++++++++----- mm/usercopy.c | 2 +- 6 files changed, 47 insertions(+), 82 deletions(-) delete mode 100644 arch/x86/lib/usercopy.c