Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp336106pxk; Wed, 2 Sep 2020 02:41:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwy32ZttQZ5VcTFxZDGjJYzW7Cnx8umwxBVV5kiOveiKTOB7uxeDcuHPdhjFEu8IuTeIG68 X-Received: by 2002:aa7:cf0e:: with SMTP id a14mr5791354edy.81.1599039719136; Wed, 02 Sep 2020 02:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599039719; cv=none; d=google.com; s=arc-20160816; b=L5AmIoBATgS8x9cx6MUsetY40m/C6b90veZc32kGAngWmVjidfq5D+AseX5e+2hH7o DLBH/MZw0XWCMYs8QZspPMROklI8vjuXOTHmyTDohMp4tIvypFVoGsLyJOdD+KmB53r2 V7ek3ihGLx0jYsuH+zhn3OTCHp4JqkRjhKlxgSRjYuOEEY7fszvi5utZs7FH8pJEtk8G 60zv9Kj8wUzdYefEhPZb1dti64572PnJBzVh/BfBdmTu3eb5Nya84686yfCmQQ7fpOMq Z0bhp3sh/JDXxP3nB5+bWFcW+MtTnG2jUdgeaI1MZiGrAZU/GqXLhUlJD7wZ6CApQ9MA jTsg== 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:dkim-signature; bh=G3nNnXpUvYmvrenh4FE8cwukD4+JmSPNbqFBmFW6LJg=; b=QB0Wr4ongr9WdNLxYICYYXqhfoA2bf0kFWb+F5mt2aPUMwwUBpaBkilRKAsOaUCqOi yLew3veO8WmOgNRo7n5OVW6hwKcirBiSnfIMSL4yPFRF4A21dsRjCfj/YOKI4fZWYPIn uqING183m54lJ3sciKG/3SIq39C0WRg1Xy3bUi5Zm4EaAjvLM5Na89Sf+fwFyWUPekJR 0+UDr+X6OqQN5ZEvMTVrITqbWWJwunIElPTf4XUb6pYoCy8IQc43FzAZjv6F8ZtoZ64W gytFKrqtPcHIWU9pLN8gvno1xkGseCCvr5d8uleG7HnJZw9S6n1x1i2G231Eu+W+Q0KP MjNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xBe3ALm3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w4si2265308ejb.443.2020.09.02.02.41.35; Wed, 02 Sep 2020 02:41:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xBe3ALm3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726193AbgIBJkY (ORCPT + 99 others); Wed, 2 Sep 2020 05:40:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:50508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726124AbgIBJkX (ORCPT ); Wed, 2 Sep 2020 05:40:23 -0400 Received: from linux-8ccs (p57a236d4.dip0.t-ipconnect.de [87.162.54.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 637392078B; Wed, 2 Sep 2020 09:40:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599039623; bh=JesIRyeaVvb9G7U2wtfk1DCJU65SxbJ4EcS4RFuwSjs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xBe3ALm31cOyX+cTpqTOoxuO2bSvPkBh0Pv+62XnaJ7nIJVAR3Yblt1QWbwrc+6iJ UTLmz3xYniNcGObD7G8+c6OXF/6p+5r6IljQUjoDoyWSc1ebINP68somxloOVyVxXC mfui3KbQmogSX/LIHB+GnoAY+Eu3RXDb4OTLTmbc= Date: Wed, 2 Sep 2020 11:40:19 +0200 From: Jessica Yu To: Qu Wenruo Cc: linux-kernel@vger.kernel.org, jeyu@suse.de, Lucas De Marchi Subject: Re: [PATCH] module: Add more error message for failed kernel module loading Message-ID: <20200902094019.GA7287@linux-8ccs> References: <20200902064619.67343-1-wqu@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200902064619.67343-1-wqu@suse.com> X-OS: Linux linux-8ccs 5.5.0-lp150.12.61-default x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Qu Wenruo [02/09/20 14:46 +0800]: >When kernel module loading failed, user space only get one of the >following error messages: > >- ENOEXEC > This is the most confusing one. From corrupted ELF header to bad > WRITE|EXEC flags check introduced by in module_enforce_rwx_sections() > all returns this error number. > >- EPERM > This is for blacklisted modules. But mod doesn't do extra explain > on this error either. > >- ENOMEM > The only error which needs no explain. > >This means, if a user got "Exec format error" from modprobe, it provides >no meaningful way for the user to debug, and will take extra time >communicating to get extra info. > >So this patch will add extra error messages for -ENOEXEC and -EPERM >errors, allowing user to do better debugging and reporting. > >Signed-off-by: Qu Wenruo >Reviewed-by: Lucas De Marchi Applied, thanks. Jessica