Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752373AbdLFQEP (ORCPT ); Wed, 6 Dec 2017 11:04:15 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:55793 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752289AbdLFQEH (ORCPT ); Wed, 6 Dec 2017 11:04:07 -0500 Date: Wed, 6 Dec 2017 17:04:00 +0100 From: Peter Zijlstra To: Cheng Jian Cc: tglx@linutronix.de, mingo@redhat.com, dvhart@infradead.org, linux-kernel@vger.kernel.org, xiexiuqi@huawei.com, huawei.libin@huawei.com Subject: Re: [PATCH] futex: use fault_in to avoid infinite loop Message-ID: <20171206160400.yzewed5juhytfwyy@hirez.programming.kicks-ass.net> References: <1512570067-79946-1-git-send-email-cj.chengjian@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1512570067-79946-1-git-send-email-cj.chengjian@huawei.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 445 Lines: 14 On Wed, Dec 06, 2017 at 10:21:07PM +0800, Cheng Jian wrote: > It will cause softlockup(infinite loop) in kernel > space when we use SYS_set_robust_list in futex which > incoming a misaligned address from user space. Urgh, we should not allow that in the first place. See how get_futex_key() does: if (unlikely(address % sizeof(u32))) return -EINVAL; That same should also be true for the robust list. Using unaligned variables is insane.