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: <51DF4391.4010609@asianux.com>
Date:	Fri, 12 Jul 2013 07:45:21 +0800
From:	Chen Gang <gang.chen@...anux.com>
To:	Chen Gang F T <chen.gang.flying.transformer@...il.com>
CC:	Rusty Russell <rusty@...tcorp.com.au>, khali@...ux-fr.org,
	David.Woodhouse@...el.com,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kernel/params.c: print failure information instead of
 'KOBJ_ADD' to user space, when sysfs_create_file() fails.

On 07/10/2013 11:01 AM, Chen Gang F T wrote:
> 
>> > Hmm..., do we need call kobject_get() before kobject_put() in failure
>> > processing block ?
>> > 
> Oh, sorry for what I said for kobject_get/put() items above, it is
> incorrect.
> 
> What about the diff below for kobject_get() ?
> 
> -------------------------------diff begin-------------------------------
> 
> diff --git a/kernel/params.c b/kernel/params.c
> index 440e65d..ef8d720 100644
> --- a/kernel/params.c
> +++ b/kernel/params.c
> @@ -754,11 +754,11 @@ static struct module_kobject * __init locate_module_kobject(const char *name)
>  				name, err);
>  			return NULL;
>  		}
> -
> -		/* So that we hold reference in both cases. */
> -		kobject_get(&mk->kobj);
>  	}
>  
> +	/* So that we hold reference in both cases. */
> +	kobject_get(&mk->kobj);
> +
>  	return mk;
>  }
> 
> -------------------------------diff end---------------------------------
> 

Sorry again, this diff is incorrect, the original implementation has no
issues.


> And it also need add additional kobject_put(), if we really need
> process the failure in version_sysfs_builtin().

If need process failure, we really need it, but now, we only use
BUG_ON() is enough.


Thanks.
-- 
Chen Gang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ