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: <47B929EE.7080202@cn.fujitsu.com>
Date:	Mon, 18 Feb 2008 14:47:10 +0800
From:	Li Zefan <lizf@...fujitsu.com>
To:	balbir@...ux.vnet.ibm.com
CC:	YAMAMOTO Takashi <yamamoto@...inux.co.jp>,
	akpm@...ux-foundation.org, containers@...ts.linux-foundation.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] memcgroup: fix typo in VM_BUG_ON()

Balbir Singh wrote:
> YAMAMOTO Takashi wrote:
>>> Li Zefan wrote:
>>>> No need for VM_BUG_ON(pc), since 'pc' is the list entry. This should
>>>> be VM_BUG_ON(page).
>>>>
>>>> Signed-off-by: Li Zefan <lizf@...fujitsu.com>
>>>> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
>>> pc is of type page_cgroup and we use list_for_each_entry_safe_reverse. Not sure
>>> why we can't bug on pc.
>> pc is dereferenced before this VM_BUG_ON.
>>
>> YAMAMOTO Takashi
>>
> 
> OK, so the VM_BUG_ON needs to move to an earlier location. Agreed.
> 

No, 'pc' has been dereferenced in list_for_each_entry_safe_reverse().


#define list_for_each_entry_safe_reverse(pos, n, head, member)		\
	for (pos = list_entry((head)->prev, typeof(*pos), member),	\
		n = list_entry(pos->member.prev, typeof(*pos), member);	\
                               ^^^^^^^^^^^
	     &pos->member != (head); 					\
              ^^^^^^^^^^^
	     pos = n, n = list_entry(n->member.prev, typeof(*n), member))

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