From patchwork Tue Feb 21 23:10:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 142382 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5DB56B6EF3 for ; Wed, 22 Feb 2012 10:10:14 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755366Ab2BUXKN (ORCPT ); Tue, 21 Feb 2012 18:10:13 -0500 Received: from shards.monkeyblade.net ([198.137.202.13]:33400 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754792Ab2BUXKM (ORCPT ); Tue, 21 Feb 2012 18:10:12 -0500 Received: from localhost (nat-pool-rdu.redhat.com [66.187.233.202]) (authenticated bits=0) by shards.monkeyblade.net (8.14.4/8.14.4) with ESMTP id q1LNA8AR018769 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Tue, 21 Feb 2012 15:10:09 -0800 Date: Tue, 21 Feb 2012 18:10:07 -0500 (EST) Message-Id: <20120221.181007.225442485550765553.davem@davemloft.net> To: jurij@wooyd.org Cc: mroos@linux.ee, sparclinux@vger.kernel.org Subject: Re: silo trouble with ext3 From: David Miller In-Reply-To: <20120221225108.GA4293@wooyd.org> References: <20120221.143640.17519868920156239.davem@davemloft.net> <20120221225108.GA4293@wooyd.org> X-Mailer: Mew version 6.4 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (shards.monkeyblade.net [198.137.202.13]); Tue, 21 Feb 2012 15:10:10 -0800 (PST) Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org From: Jurij Smakov Date: Tue, 21 Feb 2012 22:51:08 +0000 > If needed, the version can be rolled back pretty easily in > testing/unstable (will take just a couple of days), but that will > minimize the chances of the new version getting any mileage. Given > that the next Debian release is something like 6 months to a year away > and the fixes will be forthcoming sooner than that :-), I don't really > see a reason to do such a rollback, especially considering that vast > majority of the Debian sparc users, who followed the default > installation procedure, will not be affected by it. Default install > still creates a small ext2 partition at the beginning of the disk for > kernels and initrds (legacy of the sparc32 days, when kernel would > refuse to boot if it was further than 1GB away from the beginning of > the disk, or something like that). That was the reason why I did not > get any problem reports and have not seen any problems on my machine. The assumption here is that it has something to do with ext3 or some ext3 specific feature, but it might not. For example, I just found a bug with symlink handling in path traversal fixed by the following patch. So if there are symlinks involved in Meelis's setup that would be the cause rather than not specifically using ext2 for the boot partition. -------------------- ext2: Fix symlink being overwritten. When the symlink length is small, it's contained in the block list part of the inode. But we still need to copy the symlink into the caller's buffer in that case because this string is used for path traversal which will read an inode and thus overwrite the inode the symlink string is inside of. Also, forcefully NULL terminate the symlink string. Signed-off-by: David S. Miller --- second/fs/ext2.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/second/fs/ext2.c b/second/fs/ext2.c index 710695a..53f2b5e 100644 --- a/second/fs/ext2.c +++ b/second/fs/ext2.c @@ -450,9 +450,11 @@ static char *read_symlink(struct silo_ext2_state *s, struct ext2_inode *ip, char __u32 isize = ext2_to_cpu_32(ip->i_size); if (isize <= 60) - return (char *) &ip->i_block[0]; + strncpy(namebuf, (char *) &ip->i_block[0], isize); + else + read_data(s, ext2_to_cpu_32(ip->i_block[0]), 0, isize, namebuf); - read_data(s, ext2_to_cpu_32(ip->i_block[0]), 0, isize, namebuf); + namebuf[isize] = '\0'; return namebuf; }