From patchwork Fri Dec 12 03:32:52 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 13644 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.176.167]) by ozlabs.org (Postfix) with ESMTP id EECBDDE050 for ; Fri, 12 Dec 2008 14:32:58 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753275AbYLLDc5 (ORCPT ); Thu, 11 Dec 2008 22:32:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754871AbYLLDc5 (ORCPT ); Thu, 11 Dec 2008 22:32:57 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:36838 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752309AbYLLDc4 (ORCPT ); Thu, 11 Dec 2008 22:32:56 -0500 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id mBC3WqYG010157 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 11 Dec 2008 19:32:53 -0800 Received: from localhost.localdomain (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id mBC3WqJg009789; Thu, 11 Dec 2008 19:32:52 -0800 Message-Id: <200812120332.mBC3WqJg009789@imap1.linux-foundation.org> Subject: + ext3-ensure-link-targets-are-null-terminated.patch added to -mm tree To: mm-commits@vger.kernel.org Cc: duaneg@dghda.com, linux-ext4@vger.kernel.org From: akpm@linux-foundation.org Date: Thu, 11 Dec 2008 19:32:52 -0800 X-Spam-Status: No, hits=-2.908 required=5 tests=AWL,BAYES_00 X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org The patch titled ext3: ensure link targets are NULL-terminated has been added to the -mm tree. Its filename is ext3-ensure-link-targets-are-null-terminated.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: ext3: ensure link targets are NULL-terminated From: "Duane Griffin" Ensure link targets are NUL-terminated, even if corrupted on-disk. Signed-off-by: Duane Griffin Cc: Signed-off-by: Andrew Morton --- fs/ext3/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff -puN fs/ext3/inode.c~ext3-ensure-link-targets-are-null-terminated fs/ext3/inode.c --- a/fs/ext3/inode.c~ext3-ensure-link-targets-are-null-terminated +++ a/fs/ext3/inode.c @@ -2817,9 +2817,10 @@ struct inode *ext3_iget(struct super_blo inode->i_op = &ext3_dir_inode_operations; inode->i_fop = &ext3_dir_operations; } else if (S_ISLNK(inode->i_mode)) { - if (ext3_inode_is_fast_symlink(inode)) + if (ext3_inode_is_fast_symlink(inode)) { inode->i_op = &ext3_fast_symlink_inode_operations; - else { + ((char *) ei->i_data)[inode->i_size] = '\0'; + } else { inode->i_op = &ext3_symlink_inode_operations; ext3_set_aops(inode); }