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: <20200113080801.GA15986@amd>
Date:   Mon, 13 Jan 2020 09:08:02 +0100
From:   Pavel Machek <pavel@...x.de>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Aditya Pakki <pakki001@....edu>,
        Johannes Berg <johannes.berg@...el.com>,
        Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 41/84] rfkill: Fix incorrect check to avoid NULL
 pointer dereference

Hi!

> From: Aditya Pakki <pakki001@....edu>
> 
> [ Upstream commit 6fc232db9e8cd50b9b83534de9cd91ace711b2d7 ]
> 
> In rfkill_register, the struct rfkill pointer is first derefernced
> and then checked for NULL. This patch removes the BUG_ON and returns
> an error to the caller in case rfkill is NULL.

I don't see the dereference; address of field in structure is taken,
but that does not need a dereference. Not sure if it is valid C, but
I'm pretty sure it does not cause any problems.

Plus I wonder if this is a good idea. Noone should be doing
rfkill_register(NULL)...

Best regards,
								Pavel

> @@ -1014,10 +1014,13 @@ static void rfkill_sync_work(struct work_struct *work)
>  int __must_check rfkill_register(struct rfkill *rfkill)
>  {
>  	static unsigned long rfkill_no;
> -	struct device *dev = &rfkill->dev;
> +	struct device *dev;
>  	int error;
>  
> -	BUG_ON(!rfkill);
> +	if (!rfkill)
> +		return -EINVAL;
> +
> +	dev = &rfkill->dev;
>  
>  	mutex_lock(&rfkill_global_mutex);
>  

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ