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 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 553FDC0650E for ; Mon, 1 Jul 2019 18:22:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3AC4D21721 for ; Mon, 1 Jul 2019 18:22:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727298AbfGASWn (ORCPT ); Mon, 1 Jul 2019 14:22:43 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:36700 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726668AbfGASWn (ORCPT ); Mon, 1 Jul 2019 14:22:43 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hi0wp-0004Qk-JX; Mon, 01 Jul 2019 18:22:39 +0000 Date: Mon, 1 Jul 2019 19:22:39 +0100 From: Al Viro To: Eric Biggers Cc: David Howells , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [PATCH] vfs: move_mount: reject moving kernel internal mounts Message-ID: <20190701182239.GA17978@ZenIV.linux.org.uk> References: <20190629202744.12396-1-ebiggers@kernel.org> <20190701164536.GA202431@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190701164536.GA202431@gmail.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Jul 01, 2019 at 09:45:37AM -0700, Eric Biggers wrote: > On Sat, Jun 29, 2019 at 01:27:44PM -0700, Eric Biggers wrote: > > > > Reproducer: > > > > #include > > > > #define __NR_move_mount 429 > > #define MOVE_MOUNT_F_EMPTY_PATH 0x00000004 > > > > int main() > > { > > int fds[2]; > > > > pipe(fds); > > syscall(__NR_move_mount, fds[0], "", -1, "/", MOVE_MOUNT_F_EMPTY_PATH); > > } > > David, I'd like to add this as a regression test somewhere. > > Can you point me to the tests for the new mount syscalls? > > I checked LTP, kselftests, and xfstests, but nothing to be found. FWIW, it's not just move_mount(2) - I'd expect int fds[2]; char s[80]; pipe(fds); sprintf(s, "/dev/fd/%d", fds[0]); mount(s, "/dev/null", NULL, MS_MOVE, 0); to step into exactly the same thing. mount(2) does follow symlinks - always had...