Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2500719ybp; Thu, 10 Oct 2019 08:16:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJtBnMBtnv2QfyXVzL3aNKluLguUDKfFEW3ucYcpdKtbXao3AlOciQX+Ud0sYvlDJZPXFQ X-Received: by 2002:a50:c2c2:: with SMTP id u2mr8781723edf.133.1570720594102; Thu, 10 Oct 2019 08:16:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570720594; cv=none; d=google.com; s=arc-20160816; b=o+M7VDQOeObsCvyCe6L3Ob08AEflF+jp/Vf/WSEfFg2I4n6iWF/H9aEo6+D55wkinu SBP2ekfHtOdRIQ3cBv4Lw+a4a8sFf8MDGgvPJcQo5NB/2/PO7Y3+o9z6xZYA7Z/8Drfy a8BE1hKPqN9alKxw9omZislie6DbNrhXsaGgqOzdBPgJOIpWMPPENevTQ3uygo7OGSYB 8xgWCgYgRUB0m6CUuMSP19iDYSFx1wN7bRrn4KyiBm7yKI69Wx5KbfZ4NmR2eeYQ19UC X/aNwY0CvrJoobXfO5DNs0UaYYZRYZLKhfs+PcUX1cAtcKLsNH0cHnaF/FUw/WLNp0JJ mvxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Yj00wr/r7gE40cwOzV0PuhbBsjDvBx0GJDLohZkvokM=; b=TqQy6kLi4KC0Q3qctcYvgVleqtu2iUBJs8HXxA98qrOKisx/80r885gThtqg8f3cUi e7WuRQ55h97bcCAF45wOpHO4MNajDHsmAkqkLA2d7JP/8Y4aeO2xh7uUIPx6Z0Rxdgc4 b4UwFsxeTflAJ4sX0iFeuhNgiJJ75YTP1VK64W+HdXqsoMZSSRFdaiSypUiuY6kQTEey A3nw28/6KyeZskVsEcoVwEme3Myb6/ujGFk8EPa9qeCTFQfzOeMSmc8QY77rHj7w98xF yqctQiFXPVrrMKyR4g0GLOq7Ut3Qoe/dl4m2s0anDbPYwNjinfzuVOn9v7N4H/c4LVWO j/9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e14si4057121eda.104.2019.10.10.08.16.09; Thu, 10 Oct 2019 08:16:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726365AbfJJPPK (ORCPT + 99 others); Thu, 10 Oct 2019 11:15:10 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:37020 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbfJJPPK (ORCPT ); Thu, 10 Oct 2019 11:15:10 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iIa9h-0005FP-MT; Thu, 10 Oct 2019 15:15:05 +0000 Date: Thu, 10 Oct 2019 16:15:05 +0100 From: Al Viro To: David Laight Cc: 'Nathan Chancellor' , Linus Torvalds , Christian Brauner , Linux Kernel Mailing List Subject: Re: [GIT PULL] usercopy structs for v5.4-rc2 Message-ID: <20191010151505.GH26530@ZenIV.linux.org.uk> References: <20191004104116.20418-1-christian.brauner@ubuntu.com> <20191004194330.GA1478788@archlinux-threadripper> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 07, 2019 at 01:11:46PM +0000, David Laight wrote: > From: Nathan Chancellor > > Sent: 04 October 2019 20:44 > ... > > > IOW, the code should have just been > > > > > > ret = test(umem_src == NULL, "kmalloc failed"); > > > if (ret) ... > > > > Yes, I had this as the original fix but I tried to keep the same > > intention as the original author. I should have gone with my gut. Sorry > > for the ugliness, I'll try to be better in the future. > > This rather begs the question about why 'usercopy' is ever calling kmalloc() at all. Do you even bother to read what you are commenting upon, or is it simply the irresistable pleasure of being seen[*]? When a function called 'test_copy_struct_from_user' starts with a couple of allocations, one called 'umem_src' and another - 'expected', what could that possibly be about? Something to do with testing copy_struct_from_user(), perhaps? And, taking a wild guess, maybe allocating a buffer or two to be somehow used in setting the test up? Or you could just go and read the damn function, you twit. [*] sensu Monty Python, if we are lucky enough