From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E6AA0A00C2; Thu, 8 Dec 2022 15:29:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3D0040E28; Thu, 8 Dec 2022 15:29:47 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2062.outbound.protection.outlook.com [40.107.220.62]) by mails.dpdk.org (Postfix) with ESMTP id 17FD740A7E for ; Thu, 8 Dec 2022 15:29:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q1ojV4NAe8gyepCIwB0g2g7oNW++TqmxUl1a3hjFApvoith43ONuZfiy+fSJ3hT9FRq1SGJ3zRWnnQk+Tky7Fdgm2ZhBincuVKWKco/TGHcaf8BQ4l11PJffJa4sW2M7vJaL8RMjb0DZ9GgojYpzxLVypWxUbR/5F9yxLxOiFvDND1BFk94aaYwWK0CbVAMgPy8E1HwmmXHRFhI7iPJbUEQMJP8wB1sg+OpWINkj/7mR2niEiG9p0X7I28QbZ5q3GN+ouVhasKtSgM1ezZSTsh57by2Duyq+k3KRDU/RtJghGW2E8JZBGheF7HDO6ahtLC2slYd2ePxhXgFydeTzlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7Cz2qK50lVR9j2G9o+/rqKjtF3BgRQbR2jes4cq/tIY=; b=VcsO2i47aeWtKEOeIeM3xVXtAut5TqpCQqcfaaAwtDGPsaT4dCuFr4ES2HgKokDRtCvOkUhHYX2B21iOEODTeVjKV8sJNB6o5UT635Vv1GPDBsHTqun59HFxKAvtu/I3PVSw0Oyb+s6Yv5mGJrQOxbjf84by2dGC3bX3nCpxgSvQ4Sq8YfBGkFz9hsGT5BaFnKqZwysO1BhoSBrnz+wbRwtuyO0TQgbGmqdnMbcKMTChRk6YTzMuO5IAmsPOQ4FTLqet4NdcZRAJv6NwC+VbVahlnJQ04lc//8DdPkDkV5ktEbQMSSI3SkT2EPi3WL7HUv2JMeJVyRF8ATORGi1Ttg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7Cz2qK50lVR9j2G9o+/rqKjtF3BgRQbR2jes4cq/tIY=; b=AllhT5iXVwYhalB5H+SBuwCTQ0KSsVEIJscNcWY23KFOa+yBpDEKvbLoMsqfPOhGdFJTEUhTyzWI1DmDiCwfzlZ5OWT7kIz+09skJlmBoyz9hkHvSeiUtq0ZOHkwLCrBXlApkCEL46KzC5Ec3IPNX71PLDiKzsK9dxs+RhUgLHU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by PH0PR12MB8127.namprd12.prod.outlook.com (2603:10b6:510:292::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Thu, 8 Dec 2022 14:29:43 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::b482:d5bd:c7d0:3842]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::b482:d5bd:c7d0:3842%8]) with mapi id 15.20.5880.014; Thu, 8 Dec 2022 14:29:43 +0000 Message-ID: Date: Thu, 8 Dec 2022 14:29:37 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v2] net/memif: change socket listener owner uid/gid To: Junxiao Shi Cc: dev@dpdk.org, Thomas Monjalon , David Marchand References: <7046cb75-75e7-8be6-9efc-f37b70a1f2df@amd.com> Content-Language: en-US From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO2P265CA0019.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::31) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH0PR12MB8127:EE_ X-MS-Office365-Filtering-Correlation-Id: 8261c75a-cbfc-45ad-5e8a-08dad928a547 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +gWmY0r0A4nwXs987adcHzFqVkOsUAIQKlHvdpry588GH+NN0FxC2dC3YHaH0b5uro6HnKxpUMPt4+iNWySbeG+IwaZ8rdPgVkU05vNJvm8rhvwTRFm17saFguJHq17yzyhTIGdP+4yhMJudmJCUDPno3a4whe45BmObE/4c8Wtm7K0hT/Jxp0fe+mWJGNP0YiRTNlWlX2N6Inv1Yts/Q+WUKXSinjGws1nlvQOC7sJNWDEBko4hgd63pZmvM9px6Sx2uoV1mFGvk/cBqEYaeqtWFpafpvR5aZSr2UeNy2m1HQXTiFQ0CgDkUQyzIf63C9xqgG0vsiPXwNlUpgxgFKzZT0A208gTgSvaOGG+cWhxNQIJ6BV5SKInRmVNJcIZiMmZkEcp2U89d1MIePrzyQHbUj203Yp2AT7kDf5lmAwyF8207sLZ3FRu9dSsKsuzwzse5QwvL7uAxU579odFMFNwf2/Pgc7B/r717DKur+4e/dKw9su1KqnyucuIEogx5v2L4XWjuN7tTIaynhiSNTmvtf7D0sXskSTLRH4BzxuDvjfDL+Y1cYQyKS9z8eViUihc/l3MfIk6+eIaLfNvWSPB+pE7tuG18FnuuprDG8Ey1jejQRCbGxzXityjRhHhkR+fP5T1OILINH+DuNtXObx4+FBxlzvp2D54jtHcIgyyFcXMdro6EsuTpXA77rVSQImo+hU7DeAPVBR9Y6yYbeIhbWKbgVx7KrZ1UqcPK6BRFAGXfRkPmZ5pN72QH96tPvowTAW13DUFyJqi3lzWQk9xPuGp5S9lu7HKi1hAj38= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(366004)(396003)(376002)(136003)(39860400002)(346002)(451199015)(66556008)(2906002)(31686004)(66946007)(5660300002)(36756003)(4326008)(83380400001)(41300700001)(6916009)(316002)(54906003)(44832011)(8936002)(8676002)(478600001)(6486002)(31696002)(6512007)(966005)(86362001)(66476007)(6666004)(6506007)(26005)(53546011)(186003)(2616005)(38100700002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Y1M2dnJidmxNVnBNUHZ1aVluZjdYcEx1YVRtY2hCOVBweENVM25TeEgvZjJQ?= =?utf-8?B?QnpYcVNESDU0c0ZOSklXOG92RzJZays4VUE2NVJ3U05POFF6b0ZGclBnM2ly?= =?utf-8?B?L0JOTUt1eGNQcERYNm91blgrTUtTaHJ5bVVDTmFSQVV5TUtOOEluZjQ4SFhF?= =?utf-8?B?b3VvNW94NXNmRUdXZUUvQ2o3dzNrWHBVTER6M3lDZmlkVXErem9YbCtlM0Yv?= =?utf-8?B?YVFOcGQwUklhQStuSEJxVEFad2lKYTdHQXlNNkJOVzluTTZVd0pyNUN5UUVC?= =?utf-8?B?QjdNWjQ0WG5qVUljMlI4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8?Q?wIlfM4hQgc+8hbn9wK1zjOgcX?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8261c75a-cbfc-45ad-5e8a-08dad928a547 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2022 14:29:43.6660 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: te64Nri6Kxou6+0996btdKD5Up5M4bkCPNlnODrpy+PCLJb4J62fjZbN4nwnES75 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8127 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 12/7/2022 5:48 PM, Junxiao Shi wrote: > Hi Ferruh > >> On 12/7/2022 2:41 PM, Junxiao Shi wrote: >> > This allows a DPDK application running with root privilege to create a >> > memif socket listener with non-root owner uid and gid, which can be >> > connected from client applications running without root privilege. >> > >> >> Do you have an easy way to test unprivileged memif client? > > This has been tested with NDN-DPDK software. > https://github.com/usnistgov/ndn-dpdk > revision > 311de078aa4dc3ea28db5f8858e70a1bef7b9ccd > Thanks for the info. Do you want this project to be included in DPDK web page [1], if so you can request this in web mail list (web@dpdk.org). [1] https://www.dpdk.org/ecosystem/#projects > The systemd service is running as root and it uses DPDK with the > owner-uid and owner-gid args. > The ndndpdk-godemo command is running as unprivileged process. > Directory /run/ndn still needs to be created by root. > > These commands can perform a full test: > > git clone https://github.com/usnistgov/ndn-dpdk.git > > cd ndn-dpdk > ./docs/ndndpdk-depends.sh --dpdk-patch=26031 > corepack pnpm install > make > sudo make install > sudo dpdk-hugepages.py --setup 8G > sudo ndndpdk-ctrl systemd start > jq -n {} | ndndpdk-ctrl activate-forwarder > sudo mkdir -p /run/ndn > ndndpdk-godemo pingserver --name /A > ndndpdk-godemo pingclient --name /A > > You can see packets flowing through. > Run `ls -l /run/ndn` and check the uid:gid of socket files too. > It is good to record these steps, but for now I will rely on your testing :), thanks. > >> >> > Signed-off-by: Junxiao Shi > >> >> <...> >> >> > @@ -1827,47 +1859,58 @@ rte_pmd_memif_probe(struct rte_vdev_device > *vdev) >> >       flags |= ETH_MEMIF_FLAG_SOCKET_ABSTRACT; >> > >> >       kvlist = rte_kvargs_parse(rte_vdev_device_args(vdev), > valid_arguments); >> > +     if (kvlist == NULL) { >> > +             MIF_LOG(ERR, "Invalid kvargs key"); >> > +             ret = -EINVAL; >> > +             goto exit; >> > +     } >> >> Thanks Junxiao for updating this, but since it is not really related to >> this patch, can you please separate it to another patch? > > These are reverted and will be submitted separately in the future. ack