Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755544Ab3CTOef (ORCPT ); Wed, 20 Mar 2013 10:34:35 -0400 Received: from mail-oa0-f53.google.com ([209.85.219.53]:46603 "EHLO mail-oa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752020Ab3CTOee (ORCPT ); Wed, 20 Mar 2013 10:34:34 -0400 Message-ID: <5149C900.6020709@gmail.com> Date: Wed, 20 Mar 2013 10:34:40 -0400 From: Sasha Levin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130310 Thunderbird/17.0.4 MIME-Version: 1.0 To: Ming Lei CC: Hillf Danton , Dave Jones , Greg Kroah-Hartman , Linux Kernel Subject: Re: use after free in sysfs_find_dirent References: <20130307052854.GA23745@redhat.com> <20130307060230.GA31738@kroah.com> <20130307062626.GA25095@redhat.com> <51429D7A.30906@gmail.com> <5142ABD3.4040106@gmail.com> <51448AC9.7080105@gmail.com> <5144BB15.3020002@gmail.com> <5145D236.70203@gmail.com> <5147C821.6070703@gmail.com> <51489242.9020801@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1052 Lines: 30 On 03/19/2013 09:02 PM, Ming Lei wrote: > Hi Sasha, > > On Wed, Mar 20, 2013 at 12:28 AM, Sasha Levin wrote: >> On 03/19/2013 07:54 AM, Ming Lei wrote: >> >> With v3 of the patch: >> >> [ 1275.665758] sysfs_dir_pos-973 sysfs_dirent use after free: tun(tun)-uevent, 2-1472641949 > > Thanks again for your test. > > Looks it is caused by another bug in sysfs_readdir: if filldir() returns > failure(such as small buffer length passed from userspace, very probably > for trinity) in case of 'if (filp->f_pos == 0 or 1)', > filp->private_data still will > point to one refcount-balanced sysfs_dirent object. > > V4 adds fix for this situation, please test attachment v4 patch. With this one it didn't happen at all during overnight tests so looks like it did the job. Thanks! -- 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/