lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87d0ycfec4.fsf@notabene.neil.brown.name>
Date:   Fri, 04 May 2018 10:34:51 +1000
From:   NeilBrown <neilb@...e.com>
To:     James Simmons <jsimmons@...radead.org>
Cc:     Oleg Drokin <oleg.drokin@...el.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Andreas Dilger <andreas.dilger@...el.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Lustre Development List <lustre-devel@...ts.lustre.org>
Subject: Re: [PATCH 10/10] staging: lustre: fix error deref in ll_splice_alias().

On Wed, May 02 2018, James Simmons wrote:

>> d_splice_alias() can return an ERR_PTR().
>> If it does while debugging is enabled, the following
>> CDEBUG() will dereference that error and crash.
>> 
>> So add appropriate checking, and provide a separate
>> debug message for the error case.
>
> Yeah!!! It fixed the issues. Thank you.

:-)
So I've made it "Reported-and-tested-by: James"

Thanks,
NeilBrown


>
> Reviewed-by: James Simmons <jsimmons@...radead.org>
>  
>> Reported-by: James Simmons <jsimmons@...radead.org>
>> Fixes: e9d4f0b9f559 ("staging: lustre: llite: use d_splice_alias for directories.")
>> Signed-off-by: NeilBrown <neilb@...e.com>
>> ---
>>  drivers/staging/lustre/lustre/llite/namei.c |    8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c
>> index 6c9ec462eb41..24a6873d86a2 100644
>> --- a/drivers/staging/lustre/lustre/llite/namei.c
>> +++ b/drivers/staging/lustre/lustre/llite/namei.c
>> @@ -442,11 +442,15 @@ struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de)
>>  	} else {
>>  		struct dentry *new = d_splice_alias(inode, de);
>>  
>> +		if (IS_ERR(new))
>> +			CDEBUG(D_DENTRY, "splice inode %p as %pd gives error %lu\n",
>> +			       inode, de, PTR_ERR(new));
>>  		if (new)
>>  			de = new;
>>  	}
>> -	CDEBUG(D_DENTRY, "Add dentry %p inode %p refc %d flags %#x\n",
>> -	       de, d_inode(de), d_count(de), de->d_flags);
>> +	if (!IS_ERR(de))
>> +		CDEBUG(D_DENTRY, "Add dentry %p inode %p refc %d flags %#x\n",
>> +		       de, d_inode(de), d_count(de), de->d_flags);
>>  	return de;
>>  }
>>  
>> 
>> 
>> 

Download attachment "signature.asc" of type "application/pgp-signature" (833 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ