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 94573A0C41; Wed, 17 Nov 2021 02:17:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 548A94068C; Wed, 17 Nov 2021 02:17:43 +0100 (CET) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by mails.dpdk.org (Postfix) with ESMTP id 7C93B40040 for ; Wed, 17 Nov 2021 02:17:41 +0100 (CET) Received: by mail-pg1-f176.google.com with SMTP id r132so705399pgr.9 for ; Tue, 16 Nov 2021 17:17:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KFWty9oa4zMLI6oxtQxWIbNErNZHfr/AcA1p1DdTXhc=; b=xZlVG6zahtIG88llQNaE1bhKZN5iyV6Z29oejA4RbNSlPe34CiX5sLbgrAaAhFbpyY wKDbKglnkpE/1ZlS++weOX4ajM1MYUD1+qLTmyOTfZVZQERRH0D/0769z9fz5Be90Qol h+C6eZKJOH/npvIDuPrWYRIIIgxuVmgAmrR53/MV5mGlhAQARbtyOd1/+JT26B70JJ37 DMD0Sf+ZEZyquCZqn7j9F2ASU7FB4QSaoF622TEWu8Sninwp8Q1MvnIYLr4xF6z9Aecc ns61yo3kxnwRR3oPN+50US83OTrhWC9tUj6MioT1a5/r9lmbX5ge4ZWnIGtmLpkS19x4 54xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KFWty9oa4zMLI6oxtQxWIbNErNZHfr/AcA1p1DdTXhc=; b=Hlyx5T7p7pbe3nEpvwTSVBjuMuuh9Ss+xVr9dLrgeAIDm1pWXvkQ4/vDyBuj+XPsjO kGRV9ta94TDBXgiQ8N3xx21jFZN2RK2YJkkQqbzcnqtB0h2vsIWD8CKSK17r6tJwgOdP uIkLYyyW8dK9HZhdrXk9vPFGHCR/cs9+5lJ09NiSjvWao7omnv8zEfFG35s/cyHS9hXi RXO4/1V8UwT3etz1EAp9hu8quD+zwrIqQys0VR3qX8X28Pk2Y8wtHI54fpTyniCIFWsj VQGOqk3b5YSe8fHkrS4isBFz27wNJ0/493hXMMAlAo3qGbTsiCwiCb697LLrSzgjYzvT 6pig== X-Gm-Message-State: AOAM531ezGvOfPMxGolT987CP+AODEf2+ZWq/pb+D8CQVZHWrswsjArc DsPFTdBH1eTKu6KxuookfKcQ6A== X-Google-Smtp-Source: ABdhPJwk8q4tvD7Hi5Ew4EctCFOFeLVC7JSIl+l7A2AO3tZOwyWr24rt7W1ayA7Ig8S+grKLvEeyqg== X-Received: by 2002:a63:790b:: with SMTP id u11mr2487433pgc.71.1637111860432; Tue, 16 Nov 2021 17:17:40 -0800 (PST) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id g21sm20488664pfc.95.2021.11.16.17.17.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Nov 2021 17:17:40 -0800 (PST) Date: Tue, 16 Nov 2021 17:17:37 -0800 From: Stephen Hemminger To: Tomasz Duszynski Cc: , Subject: Re: [PATCH 10/10] raw/cnxk_gpio: support selftest Message-ID: <20211116171737.5e81385b@hermes.local> In-Reply-To: <20211117002155.293267-11-tduszynski@marvell.com> References: <20211117002155.293267-1-tduszynski@marvell.com> <20211117002155.293267-11-tduszynski@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Wed, 17 Nov 2021 01:21:55 +0100 Tomasz Duszynski wrote: > +static int > +cnxk_gpio_open_mem(void) > +{ > + int ret = 0, fd; > + > + fd = open("/dev/mem", O_RDWR | O_SYNC); > + if (fd < 0) > + ret = -errno; > + > + return ret; > +} This is a dangerous security violation and most distributions will not allow it. Also, why are you opening it? The code is forgetting the file descriptor so it is useless anyway.