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>] [day] [month] [year] [list]
Date:	Sun, 25 Mar 2007 23:53:46 +0400
From:	Alexey Dobriyan <adobriyan@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	mchehab@...radead.org, video4linux-list@...hat.com
Subject: Interesting locking in vivi driver

I have some question: what's going on? How can it work?

Local spinlock _on_stack_, initialized, acquired and dropped.

drivers/media/video/vivi.c:
   271	static void gen_line(struct sg_to_addr to_addr[],int inipos,int pages,int wmax,
   272			     int hmax, int line, char *timestr)
   273	#else
   274	static void gen_line(char *basep,int inipos,int wmax,
   275			     int hmax, int line, char *timestr)
   276	#endif
   277	{
   278		int  w,i,j,pos=inipos,y;
   279		char *p,*s;
   280		u8   chr,r,g,b,color;
   281	#ifdef CONFIG_VIVI_SCATTER
   282		int pgpos,oldpg;
   283		char *basep;
   284		struct page *pg;
   285
   286		unsigned long flags;
   287	===>	spinlock_t spinlock;			<===
   288
   289	===>	spin_lock_init(&spinlock);		<===
   290
   291		/* Get first addr pointed to pixel position */
   292		oldpg=get_addr_pos(pos,pages,to_addr);
   293		pg=pfn_to_page(sg_dma_address(to_addr[oldpg].sg) >> PAGE_SHIFT);
   294	===>	spin_lock_irqsave(&spinlock,flags);	<===
   295		basep = kmap_atomic(pg, KM_BOUNCE_READ)+to_addr[oldpg].sg->offset;
   296	#endif

-
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