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]
Date:	Thu, 06 Dec 2007 23:49:59 +0530
From:	Balbir Singh <balbir@...ux.vnet.ibm.com>
To:	Kamalesh Babulal <kamalesh@...ux.vnet.ibm.com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, greg@...ah.com, rsa@...ibm.com,
	apw@...dowen.org, balbir@...ibm.com
Subject: Re: 2.6.24-rc4-mm1 kobject changes broken with hvcs driver on powerpc

Kamalesh Babulal wrote:
> Hi Andrew,
> 
> The 2.6.24-rc4-mm1 kernel build fails with build failure,
> 
>   CC      drivers/char/hvcs.o
> drivers/char/hvcs.c: In function ‘hvcs_open’:
> drivers/char/hvcs.c:1180: error: wrong type argument to unary exclamation mark
> make[2]: *** [drivers/char/hvcs.o] Error 1
> make[1]: *** [drivers/char] Error 2
> make: *** [drivers] Error 2
> 
> The kref_get begin void return type, check for the kobject return type
> as in the previous kobject_get()
> 
>         if (!kref_get(&hvcsd->kref)) {
>                 spin_unlock_irqrestore(&hvcsd->lock, flags); 
>                 printk(KERN_ERR "HVCS: Kobject of open"
>                         " hvcs doesn't exist.\n");
>                 return -EFAULT; /* Is this the right return value? */
>         }
> 
> I have tested for the build failure only.
> 
> Signed-off-by: Kamalesh Babulal <kamalesh@...ux.vnet.ibm.com>
> --
> --- linux-2.6.24-rc4/drivers/char/hvcs.c	2007-12-05 12:17:37.000000000 +0530
> +++ linux-2.6.24-rc4/drivers/char/~hvcs.c	2007-12-05 19:17:12.000000000 +0530
> @@ -1177,12 +1177,8 @@ fast_open:
>  	hvcsd = tty->driver_data;
> 
>  	spin_lock_irqsave(&hvcsd->lock, flags);
> -	if (!kref_get(&hvcsd->kref)) {
> -		spin_unlock_irqrestore(&hvcsd->lock, flags);
> -		printk(KERN_ERR "HVCS: Kobject of open"
> -			" hvcs doesn't exist.\n");
> -		return -EFAULT; /* Is this the right return value? */
> -	}
> +	kref_get(&hvcsd->kref);
> +	spin_unlock_irqrestore(&hvcsd->lock, flags);
> 

Why release the spinlock here? It's done after the count is incremented.
This patch does not seem correct.

>  	hvcsd->open_count++;
> 


-- 
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL
--
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