Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753087AbbL2K6f (ORCPT ); Tue, 29 Dec 2015 05:58:35 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:57666 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752684AbbL2K6c (ORCPT ); Tue, 29 Dec 2015 05:58:32 -0500 X-Sasl-enc: Vvkgpxy0JORKpe1HV1ImY1weltOra/x/3h9tzZQgz1sa 1451386711 Subject: Re: [PATCH] af_unix: Fix splice-bind deadlock To: Rainer Weikusat , David Miller References: <87y4cftztp.fsf@doppelsaurus.mobileactivedefense.com> Cc: dvyukov@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, viro@ZenIV.linux.org.uk From: Hannes Frederic Sowa Message-ID: <56826754.2060003@stressinduktion.org> Date: Tue, 29 Dec 2015 11:58:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <87y4cftztp.fsf@doppelsaurus.mobileactivedefense.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1612 Lines: 51 Hello Rainer, On 27.12.2015 21:13, Rainer Weikusat wrote: > -static int unix_mknod(const char *sun_path, umode_t mode, struct path *res) > +static int unix_mknod(struct dentry *dentry, struct path *path, umode_t mode, > + struct path *res) > { > - struct dentry *dentry; > - struct path path; > - int err = 0; > - /* > - * Get the parent directory, calculate the hash for last > - * component. > - */ > - dentry = kern_path_create(AT_FDCWD, sun_path, &path, 0); > - err = PTR_ERR(dentry); > - if (IS_ERR(dentry)) > - return err; > + int err; > > - /* > - * All right, let's create it. > - */ > - err = security_path_mknod(&path, dentry, mode, 0); > + err = security_path_mknod(path, dentry, mode, 0); > if (!err) { > - err = vfs_mknod(d_inode(path.dentry), dentry, mode, 0); > + err = vfs_mknod(d_inode(path->dentry), dentry, mode, 0); > if (!err) { > - res->mnt = mntget(path.mnt); > + res->mnt = mntget(path->mnt); > res->dentry = dget(dentry); > } > } > - done_path_create(&path, dentry); > + The reordered call to done_path_create will change the locking ordering between the i_mutexes and the unix readlock. Can you comment on this? On a first sight this looks like a much more dangerous change than the original deadlock report. Can't this also conflict with splice code deep down in vfs layer? Thanks, Hannes -- 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/