From patchwork Tue Dec 6 00:41:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 30049 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2554441wrr; Mon, 5 Dec 2022 16:43:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ukIoBVNILVQwV3HRfYmeu3FT6MzS9dkH1OxT6ZZId0tFF/ZG8Hp2FBnkDcHD9jsqyJy+2 X-Received: by 2002:aa7:d551:0:b0:468:fb2c:6c8c with SMTP id u17-20020aa7d551000000b00468fb2c6c8cmr74479242edr.340.1670287423329; Mon, 05 Dec 2022 16:43:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670287423; cv=none; d=google.com; s=arc-20160816; b=daYo0gQqmD0Xs/vjQA7ffPzdIzHiBBvt1U2MsYBOUAfYAqQnhIwC+dWQ1rlsQ158kb Vc9fG5xfmnc8+t6P+Wm9gm5t+3x3uVuG/eYxbUNDyvbdZcyiJaLu4CWbOrMttyo2yONv dNeV8Rju3kd0rVyCvbQ3yHeDCj9rY5vs0h8/8ugKSEEdypNpnel/4h7/JPKrV9NK1Pid 7PQeiDYBHCycT/13VpO1PSkeV4eO/CVWas0YPqOB948Q+ikf/HWF1RJED3QimD+YW4xb qIBIUy6VwRROzdoETXlniaLYhCux7/ShhYivKV4Z2kC8jsOGSfFSn/C45sRlyfjQNz0x blog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=g1HJHevNxrj1Nq/NT7g6yR6y+nhBZjMl2neMxR4W590=; b=DEvmZoGhBtHi17+PwnZd93Ow6V0Nkc8hLdP9A5Bv4zNJyg93gedbnbKazB7vM4QygD ZvD6BAH5afJBybzfAEnIZcrnahZwhyYgEQPW6gAVPbDAlijxGsWIxuOvBQtSjid/9P4V QAQKVaTYkZZwEaRl3Cq/y4Xmx13bLC8R5uUUl97BY4kksOCDyrO1qp9lsD3S0aU1OqFw AR8YWc2pdFbAB2J+lN7H3OFCNlkUwlIrBxGRa7dUFfIuKR96xUTkTQm8fZonM+gnE1Yn oK7uJhpIF2kDYG8ip9ClhY9e+R5URxWuho+DCpyRir2NgazR0tYlnvbWTepbUJPMukSN 86TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=m5t9TolE; 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=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a170906498200b0078dcddc1b8csi10697565eju.788.2022.12.05.16.43.20; Mon, 05 Dec 2022 16:43:43 -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=@chromium.org header.s=google header.b=m5t9TolE; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233062AbiLFAlk (ORCPT + 99 others); Mon, 5 Dec 2022 19:41:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233056AbiLFAl0 (ORCPT ); Mon, 5 Dec 2022 19:41:26 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DFA31137 for ; Mon, 5 Dec 2022 16:41:25 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id x66so13068824pfx.3 for ; Mon, 05 Dec 2022 16:41:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=g1HJHevNxrj1Nq/NT7g6yR6y+nhBZjMl2neMxR4W590=; b=m5t9TolEhunsnLAs8ghRCY5jduXJTUVrI828QMb9aaMDHIl9N52I0BcpPgXmJWJwHJ 8O/axD8BEanTUffxKBpeoT/71MR//Ncm3X2gdqz7aFSVJrBM1Wbfryc+Rv8pyLm6oklN hdck+j11IhNQpknHmA6Td97jo/v98RGjlHlkI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=g1HJHevNxrj1Nq/NT7g6yR6y+nhBZjMl2neMxR4W590=; b=VsrXkXQbesFO69SBczsP3dJKOpm6euQXrbq+tN45z6xg2/lUnQLLKfdyeyGSVoEf4I YD0oYVy9K2KYyeQIY22V7tdcXmWFWoB0mrHjEkerau+W+CMeZmM3qfgtX4pcBhmdT9KU HZP6/cD9+TNhGyFfOoGgN5HsDs/u+41gvRERqNQO6yjxpExxwLwc720BNCGAE7KU23mm Xk3raSnzhuL8Rlhvu067/BL7P9Qk5mRLlUeteKPdfgUuUah+RDSUaZ0IKpYFiyy+Jdpn Mmi0NeSyXvqy+vAx3A1U5RhzZH+fswxz7qha/VmcKFzZjFLHX38lKttAoakRNYeZeuEn m9+w== X-Gm-Message-State: ANoB5pmrK4nF5gmMrK2PsZXzSAAw4fYhEjXlF4yr7uVwV4EZM7Wn/7mV YnKU9uZrGSf1LXE36/O5zHnhKA== X-Received: by 2002:a63:1824:0:b0:46e:baf4:ab7a with SMTP id y36-20020a631824000000b0046ebaf4ab7amr79923468pgl.37.1670287284417; Mon, 05 Dec 2022 16:41:24 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b7-20020a170902650700b00186b549cdc2sm11187939plk.157.2022.12.05.16.41.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Dec 2022 16:41:24 -0800 (PST) Date: Mon, 5 Dec 2022 16:41:23 -0800 From: Kees Cook To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Alexander Viro , Alexey Dobriyan , Alexey Izbyshev , Andrei Vagin , Bernd Edlinger , Bo Liu , Christian Brauner , David Hildenbrand , Dmitry Safonov <0x7f454c46@gmail.com>, Eric Biederman , Florian Weimer , Kees Cook , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Liu Shixin , Li Zetao , Rolf Eike Beer , Wang Yufen Subject: [GIT PULL] execve updates for v6.2-rc1 Message-ID: <202212051637.93142F409@keescook> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751423305322800690?= X-GMAIL-MSGID: =?utf-8?q?1751423305322800690?= Hi Linus, Please pull these execve updates for v6.2-rc1. Most are small refactorings and bug fixes, but three things stand out: switching timens (which got reverted before) looks solid now, FOLL_FORCE has been removed (no failures seen yet across several weeks in -next), and some whitespace cleanups (which are long overdue). The latter does end up conflicting with changes from Al[1], but should be trivial to resolve. Thanks! -Kees [1] https://lore.kernel.org/linux-next/20221128143704.3fe8f7b1@canb.auug.org.au/ The following changes since commit 9abf2313adc1ca1b6180c508c25f22f9395cc780: Linux 6.1-rc1 (2022-10-16 15:36:24 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git tags/execve-v6.2-rc1 for you to fetch changes up to 6a46bf558803dd2b959ca7435a5c143efe837217: binfmt_misc: fix shift-out-of-bounds in check_special_flags (2022-12-02 13:57:04 -0800) ---------------------------------------------------------------- execve updates for v6.2-rc1 - Add timens support (when switching mm). This version has survived in -next for the entire cycle (Andrei Vagin). - Various small bug fixes, refactoring, and readability improvements (Bernd Edlinger, Rolf Eike Beer, Bo Liu, Li Zetao Liu Shixin). - Remove FOLL_FORCE for stack setup (Kees Cook). - Whilespace cleanups (Rolf Eike Beer, Kees Cook). ---------------------------------------------------------------- Andrei Vagin (2): fs/exec: switch timens when a task gets a new mm selftests/timens: add a test for vfork+exit Bernd Edlinger (1): exec: Copy oldsighand->action under spin-lock Bo Liu (1): binfmt_elf: replace IS_ERR() with IS_ERR_VALUE() Kees Cook (3): exec: Add comments on check_unsafe_exec() fs counting binfmt: Fix whitespace issues exec: Remove FOLL_FORCE for stack setup Li Zetao (1): fs/binfmt_elf: Fix memory leak in load_elf_binary() Liu Shixin (1): binfmt_misc: fix shift-out-of-bounds in check_special_flags Rolf Eike Beer (4): ELF uapi: add spaces before '{' exec: simplify initial stack size expansion binfmt_elf: fix documented return value for load_elf_phdrs() binfmt_elf: simplify error handling in load_elf_phdrs() Wang Yufen (1): binfmt: Fix error return code in load_elf_fdpic_binary() fs/binfmt_elf.c | 35 +++---- fs/binfmt_elf_fdpic.c | 7 +- fs/binfmt_misc.c | 8 +- fs/exec.c | 38 +++++--- include/linux/nsproxy.h | 1 + include/uapi/linux/elf.h | 14 +-- kernel/fork.c | 9 -- kernel/nsproxy.c | 23 ++++- tools/testing/selftests/timens/.gitignore | 1 + tools/testing/selftests/timens/Makefile | 2 +- tools/testing/selftests/timens/vfork_exec.c | 139 ++++++++++++++++++++++++++++ 11 files changed, 219 insertions(+), 58 deletions(-) create mode 100644 tools/testing/selftests/timens/vfork_exec.c