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: <4B80FA08.8080304@windriver.com>
Date:	Sun, 21 Feb 2010 17:16:56 +0800
From:	DDD <dongdong.deng@...driver.com>
To:	Américo Wang <xiyou.wangcong@...il.com>
CC:	rusty@...tcorp.com.au, davem@...emloft.net,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	jason.wessel@...driver.com, lenb@...nel.org, dwmw2@...radead.org,
	mdharm-usb@...-eyed-alien.net, bfields@...ldses.org,
	robert.richter@....com
Subject: Re: [PATCH] module param_call: fix potential NULL pointer dereference

Américo Wang wrote:
> On Sun, Feb 21, 2010 at 3:24 PM, Dongdong Deng
> <dongdong.deng@...driver.com> wrote:
>> The param_set_fn() function will get a parameter which is a NULL
>> pointer when insmod module with params via following method:
>>
>> $insmod module.ko module_params
>>
>> BTW: the normal method usually as following format:
>> $insmod module.ko module_params=example
>>
>> If the param_set_fn() function didn't check that parameter and used
>> it directly, it could caused an OOPS due to NULL pointer dereference.
>>
>> The solution is simple:
>> Just checking the parameter before using in param_set_fn().
>>
>> Example:
>> int set_module_params(const char *val, struct kernel_param *kp)
>> {
>>        /*Checking the val parameter before using */
>>        if (!val)
>>                return -EINVAL;
>>        ...
>> }
>> module_param_call(module_params, set_module_params, NULL, NULL, 0644);
>>
> 
> Why not just checking all of them in the generic code?

It is no problem that we check the params before invoking param_set_fn().

But I trend to do the checking in param_set_*fn(), because we can offer 
some special prompt infos to user if we want and handle some special 
cases like param_set_bool().

Thanks,
Dongdong


> How about my _untested_ patch below?
> 
> Thanks.
> 
> -----------
> 
> When a module parameter "foo" is not bool, 

we shouldn't accept arguments
> like this "insmod ./foo.ko foo". However, currently only standard
> ->set functions
> check this, several non-standard ->set functions ignore this, thus could cause
> NULL def oops.
> 
> Reported-by: Dongdong Deng <dongdong.deng@...driver.com>
> Signed-off-by: WANG Cong <xiyou.wangcong@...il.com>
> 
> ---
> 

--
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