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] [day] [month] [year] [list]
Date:   Mon, 12 Feb 2018 19:40:45 +0800
From:   Yisheng Xie <xieyisheng1@...wei.com>
To:     <gregkh@...uxfoundation.org>
CC:     <labbott@...hat.com>, <sumit.semwal@...aro.org>,
        <devel@...verdev.osuosl.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] staging: android: ion: Avoid NULL point in error path

Hi Greg,

JFYI, I have rebase this patchset to v4.15-rc1.[1]

[1] https://lkml.org/lkml/2018/2/12/204

Thanks
Yisheng

On 2018/2/1 20:34, Yisheng Xie wrote:
> If we failed to create debugfs for ion at ion_device_create, the
> debug_root of ion_device will be NULL, and then when try to create debug
> file for shrinker of heap it will be create on the top of debugfs. If we
> also failed to create this the debug file, it call dentry_path to found
> the path of debug_root, then a NULL point will occur.
> 
> Fix this by avoiding call dentry_path, but show the debug name only when
> failed to create debug file for shrinker.
> 
> Signed-off-by: Yisheng Xie <xieyisheng1@...wei.com>
> ---
>  drivers/staging/android/ion/ion.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
> index f480885..3e41644 100644
> --- a/drivers/staging/android/ion/ion.c
> +++ b/drivers/staging/android/ion/ion.c
> @@ -570,13 +570,9 @@ void ion_device_add_heap(struct ion_heap *heap)
>  		debug_file = debugfs_create_file(
>  			debug_name, 0644, dev->debug_root, heap,
>  			&debug_shrink_fops);
> -		if (!debug_file) {
> -			char buf[256], *path;
> -
> -			path = dentry_path(dev->debug_root, buf, 256);
> -			pr_err("Failed to create heap shrinker debugfs at %s/%s\n",
> -			       path, debug_name);
> -		}
> +		if (!debug_file)
> +			pr_err("Failed to create ion heap shrinker debugfs at %s\n",
> +			       debug_name);
>  	}
>  
>  	dev->heap_cnt++;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ