From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751831AbbAAPY5 (ORCPT ); Thu, 1 Jan 2015 10:24:57 -0500 Received: from mail-wg0-f50.google.com ([74.125.82.50]:54929 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750839AbbAAPYz (ORCPT ); Thu, 1 Jan 2015 10:24:55 -0500 MIME-Version: 1.0 Reply-To: sedat.dilek@gmail.com In-Reply-To: References: <1420088862-3549-1-git-send-email-waydi1@gmail.com> Date: Thu, 1 Jan 2015 16:24:53 +0100 Message-ID: Subject: Re: [PATCH] ovl: Prevent rw remount when it should be ro mount From: Sedat Dilek To: Richard Weinberger Cc: Seunghun Lee , Miklos Szeredi , linux-fsdevel , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 1, 2015 at 4:13 PM, Richard Weinberger wrote: > On Thu, Jan 1, 2015 at 6:07 AM, Seunghun Lee wrote: >> Overlayfs should be mounted read-only when upper fs is r/o or nonexistend. >> But now it can be remounted read-write and this can causes kernel panic. >> So we should prevent read-write remount when the above situation. >> >> Signed-off-by: Seunghun Lee > > This patch makes zero sense, did you use the wrong diff? > Hmm, was also my 1st thoughts when I saw squashfs_remount() in overlayfs code. - Sedat - >> --- >> fs/overlayfs/super.c | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c >> index 84f3144..1faa5e5 100644 >> --- a/fs/overlayfs/super.c >> +++ b/fs/overlayfs/super.c >> @@ -522,6 +522,14 @@ static int ovl_show_options(struct seq_file *m, struct dentry *dentry) >> return 0; >> } >> >> +static int squashfs_remount(struct super_block *sb, int *flags, char *data) >> +{ >> + if (!ufs->upper_mnt || (ufs->upper_mnt->mnt_sb->s_flags & MS_RDONLY)) >> + *flags |= MS_RDONLY; >> + >> + return 0; >> +} >> + >> static const struct super_operations ovl_super_operations = { >> .put_super = ovl_put_super, >> .statfs = ovl_statfs, >> -- >> 2.1.3 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> Please read the FAQ at http://www.tux.org/lkml/ > > > > -- > Thanks, > //richard > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html