From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F253BC2D0C0 for ; Mon, 16 Dec 2019 13:52:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF68B20684 for ; Mon, 16 Dec 2019 13:52:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fy2NAbKo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728009AbfLPNwm (ORCPT ); Mon, 16 Dec 2019 08:52:42 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:24443 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727894AbfLPNwm (ORCPT ); Mon, 16 Dec 2019 08:52:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576504361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=87rXzV1NWhfpl77XrvBudXUsnuk0dqBMGM04qX4iFnU=; b=fy2NAbKoq67Vn2yk7n1WyTwyq1BmMykzdSkeo5muVgePxhH0bcrK6TB0SKR9FvcgnPplL9 o61b9HQmCiB6XbdKPvI3wVmWrO8yqqzfVDsnCrmfHrPQWhsTrW1cLVS3P1kbSHkGlXmF1b j7C2fffQOOtT3Nqwr5g0IoIaLAMCyI0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-0BEJIaBDPTqB5of12qC6DA-1; Mon, 16 Dec 2019 08:52:40 -0500 X-MC-Unique: 0BEJIaBDPTqB5of12qC6DA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE0348017DF; Mon, 16 Dec 2019 13:52:38 +0000 (UTC) Received: from carbon (ovpn-200-37.brq.redhat.com [10.40.200.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E67E1001B07; Mon, 16 Dec 2019 13:52:31 +0000 (UTC) Date: Mon, 16 Dec 2019 14:52:30 +0100 From: Jesper Dangaard Brouer To: Toke =?UTF-8?B?SMO4aWxhbmQtSsO4cmdlbnNlbg==?= Cc: Alexei Starovoitov , Daniel Borkmann , netdev@vger.kernel.org, bpf@vger.kernel.org, brouer@redhat.com Subject: Re: [PATCH bpf-next] libbpf: Print hint about ulimit when getting permission denied error Message-ID: <20191216145230.103c1f46@carbon> In-Reply-To: <20191216124031.371482-1-toke@redhat.com> References: <20191216124031.371482-1-toke@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, 16 Dec 2019 13:40:31 +0100 Toke H=C3=B8iland-J=C3=B8rgensen wrote: > Probably the single most common error newcomers to XDP are stumped by is > the 'permission denied' error they get when trying to load their program > and 'ulimit -r' is set too low. For examples, see [0], [1]. >=20 > Since the error code is UAPI, we can't change that. Instead, this patch > adds a few heuristics in libbpf and outputs an additional hint if they are > met: If an EPERM is returned on map create or program load, and geteuid() > shows we are root, and the current RLIMIT_MEMLOCK is not infinity, we > output a hint about raising 'ulimit -r' as an additional log line. >=20 > [0] https://marc.info/?l=3Dxdp-newbies&m=3D157043612505624&w=3D2 > [1] https://github.com/xdp-project/xdp-tutorial/issues/86 >=20 > Signed-off-by: Toke H=C3=B8iland-J=C3=B8rgensen Acked-by: Jesper Dangaard Brouer This is the top #1 issue users hit again-and-again, too bad we cannot change the return code as it is UAPI now. Thanks for taking care of this mitigation. --=20 Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer