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 7B8A0A0093; Thu, 21 Apr 2022 16:54:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 592AE40042; Thu, 21 Apr 2022 16:54:49 +0200 (CEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id C16A240040 for ; Thu, 21 Apr 2022 16:54:47 +0200 (CEST) Received: by mail-pl1-f175.google.com with SMTP id q3so5113757plg.3 for ; Thu, 21 Apr 2022 07:54:47 -0700 (PDT) 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=sFgSfZ5WZoyQ4QK1j0pXNNGIzJO1w0sKqWm/kGjylXY=; b=PyfQB6rWLkt157/4qZH0Z7gtrec5lVw8Y1f7fg3q1F0c05ibOGUpOeBkAwHJ+/BDWg dY1TRjKoT+sMrKz2cYZyd6qm1VKpGbVodF48OUbIXn5gfduSBnCORo3Tx9Z8oX5U7N1l Gp3tkHo0CB4sfGKcm+kaxDlGGJwRY1OxTsYuGjlV0YR3vso4NkItZrVaDnr9bOWXNVMv 4tSUS24NfInEP7u51uSCNmW784DeStaiftMIODr2qiJc38QihZ+Zc15T6H8imAjzyPQI g8z03YJ6fy/FyR76UburHnosDDIz3VDInjVQLINYnEsrWeyBNLFTv9y9UxXRzCzSGtw1 yw8A== 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=sFgSfZ5WZoyQ4QK1j0pXNNGIzJO1w0sKqWm/kGjylXY=; b=eanDszmM0nDd6gTUhkcY5QlfCib3WXFXxAVjf84bBXDjukrcv4eyYc3Zfy+y9ykuqb fGJ5xyya+2ckfIq33fepiaPkdF+ODJ/ctExX9U6WBDOoxizXzpHuJshhCWeF3vKHIqsT 1tpovPOtuUIm2gvUVNDKxIBfaPaaGdDOU5e14K7C2ZnRYjzuy/D+P0hoKBm7RuZ/0r9u GeVl6WLxDxim92FDobFCch6bn5NULcGZ4pfAD5i1qMn7vGp2V7/tVSLPg5cve/2A6Bee UtBbmi2IguF6d7iOiYTRHGyAxL7TeiZYXOLtqpHO4ZraDFYsCwXEZAlqCokXjr9gIyyj xfeQ== X-Gm-Message-State: AOAM5311uWjgYGsqClcgHR/osqw1jO2hsXrYLv5Uvb2ERSztFVCsxJAI n4vkFePTFpok6arRztNmow1Wtw== X-Google-Smtp-Source: ABdhPJy8fWKcMF5y+tTfoE9zum7Mw13amMKi7OXOjr/j9X2moe/yyI4bta00m2XVlgQrH+m4tfGICg== X-Received: by 2002:a17:903:246:b0:153:857c:a1f6 with SMTP id j6-20020a170903024600b00153857ca1f6mr25816831plh.153.1650552886797; Thu, 21 Apr 2022 07:54:46 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id f16-20020a056a00239000b004fa7103e13csm25405608pfc.41.2022.04.21.07.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 07:54:46 -0700 (PDT) Date: Thu, 21 Apr 2022 07:54:44 -0700 From: Stephen Hemminger To: Stephen Coleman Cc: dev@dpdk.org, Ray Kinsella , Ferruh Yigit Subject: Re: kni: check abi version between kmod and lib Message-ID: <20220421075444.6f872836@hermes.local> In-Reply-To: References: 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 Thu, 21 Apr 2022 12:38:26 +0800 Stephen Coleman wrote: > KNI ioctl functions copy data from userspace lib, and this interface > of kmod is not compatible indeed. If the user use incompatible rte_kni.ko > bad things happen: sometimes various fields contain garbage value, > sometimes it cause a kmod soft lockup. > > Some common distros ship their own rte_kni.ko, so this is likely to > happen. > > This patch add abi version checking between userland lib and kmod so > that: > > * if kmod ioctl got a wrong abi magic, it refuse to go on > * if userland lib, probed a wrong abi version via newly added ioctl, it > also refuse to go on > > Bugzilla ID: 998 Kernel API's are supposed to be 99% stable. If this driver was playing by the upstream kernel rules this would not have happened.