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] [day] [month] [year] [list]
Date:	Tue, 09 Jun 2015 17:13:12 -0700
From:	Davidlohr Bueso <dave@...olabs.net>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Manfred Spraul <manfred@...orfullife.com>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH 1/5] ipc,shm: move BUG_ON check into shm_lock

On Tue, 2015-06-09 at 15:28 -0700, Andrew Morton wrote:
> --- a/ipc/shm.c~ipcshm-move-bug_on-check-into-shm_lock-fix
> +++ a/ipc/shm.c
> @@ -155,14 +155,11 @@ static inline struct shmid_kernel *shm_l
>  {
>  	struct kern_ipc_perm *ipcp = ipc_lock(&shm_ids(ns), id);
>  
> -	if (IS_ERR(ipcp)) {
> -		/*
> -		 * We raced in the idr lookup or with shm_destroy(),
> -		 * either way, the ID is busted.
> -		 */
> -		BUG();
> -		return (struct shmid_kernel *)ipcp;
> -	}
> +	/*
> +	 * We raced in the idr lookup or with shm_destroy().  Either way, the
> +	 * ID is busted.
> +	 */
> +	BUG_ON(IS_ERR(ipcp));
>  
>  	return container_of(ipcp, struct shmid_kernel, shm_perm);
>  }
> 
> One benefit of the code you sent is that the unreachable `return' will
> prevent a compile warning when CONFIG_BUG=n, but CONFIG_BUG=n is silly
> and I never worry about it.

I took a closer look and the above looks Ok, and I don't care either way
about CONFIG_BUG=n.

Thanks,
Davidlohr

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