Received: by 10.213.65.68 with SMTP id h4csp788668imn; Tue, 13 Mar 2018 23:17:38 -0700 (PDT) X-Google-Smtp-Source: AG47ELvIP3Q8QqG07rnTTR2YhE/jSoDzujSciO4xZPGPxqmILlpx8mhLdeWKnn7AQmiQA9jF2SjF X-Received: by 10.98.133.193 with SMTP id m62mr3194282pfk.74.1521008258712; Tue, 13 Mar 2018 23:17:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521008258; cv=none; d=google.com; s=arc-20160816; b=iQeN2N71+e6QVI61rIgGRdk2kBunQabMAP6sB1oWhqcNPYIukPI2NwjFurIUSqheYR ZaVxbM2cw7GozfAcOgCuDJDoAeISsWuFojzU8ILir6CHubK71wowtyiFCX+95B0DyNF/ bdy8NLJWbNfyyw6u1QeeU+5oZgp98K42XRSOfaJD+BPns1YCnWrJtcprIlGoBZgvMePu 205FbxRZOUvFV5iLnCy6Szp/wJhGiboua4PAGUo76OJlR6LXczi2R8zhQc66dS0t97oK rYGn6SUiK0ecwKCnM7LbMxxqP+AiCo03cWw+m/etOfCk7b8tyMrT+qfaBiyxW1cCtTJZ CrNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=pNWB3V26amu8SEzlj6URss0RWGQilAUVlQ03mz9ViGE=; b=NSEFpG8lVJ2hKBUaENZTHagbCfPVqm++WxJMQKPOtHkBlxBcTHgEf8NT650HzNVHmJ PA3lE0FaP21UdYJZIMxQkDcrZLbd+GsMhk4GoWInDX988ksKAbBT5qmqAhP/vaijOPA/ eJlVKlszVeiQE0qDSJ33zGjMmaeXWBdYpHu9s/nf5BeqYJYKuJj04eUchP013vne3ljM lWdHGigqeHWZq33Gi3a8CikI/rI0BmKjYk7dANceLvaMsquYsaRLltGV8V/fKZm1jc6L g9KfgpGj/UjDGVj37dcs71cKPHbJQHFPPAKNmUty2uuGwLIXBk2BWAsCMbJmrJRDm7Ev 5v6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si1355973pgq.48.2018.03.13.23.17.24; Tue, 13 Mar 2018 23:17:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933047AbeCNGQP (ORCPT + 99 others); Wed, 14 Mar 2018 02:16:15 -0400 Received: from mx-rz-2.rrze.uni-erlangen.de ([131.188.11.21]:33964 "EHLO mx-rz-2.rrze.uni-erlangen.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751272AbeCNGQO (ORCPT ); Wed, 14 Mar 2018 02:16:14 -0400 Received: from mx-rz-2.rrze.uni-erlangen.de (mx-rz-2.rrze.uni-erlangen.de [IPv6:2001:638:a000:1025::15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx-rz-2.rrze.uni-erlangen.de (Postfix) with ESMTPS id 401M1848jXzPjyG; Wed, 14 Mar 2018 07:16:12 +0100 (CET) Authentication-Results: mx-rz-2.rrze.uni-erlangen.de; dkim=none reason="no signature"; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Quarantine-ID: X-Virus-Scanned: amavisd-new at boeck1.rrze.uni-erlangen.de (RRZE) X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-RRZE-Flag: Not-Spam X-RRZE-Submit-IP: 2003:d5:3e7:2500:bfbd:dba3:49d6:7204 Received: from fau.de (p200300D503E72500BFBDDBA349D67204.dip0.t-ipconnect.de [IPv6:2003:d5:3e7:2500:bfbd:dba3:49d6:7204]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: U2FsdGVkX19DrXKTSD1d4JptPk+iEYlmHgTtXCRHdQA=) by smtp-auth.uni-erlangen.de (Postfix) with ESMTPSA id 401M134mrdzPlNb; Wed, 14 Mar 2018 07:16:07 +0100 (CET) From: Jonas Rabenstein To: Jonas Rabenstein , Scott Bauer , Jonathan Derrick , Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 8.0/8.4] block: sed-opal: check size of shadow mbr Date: Wed, 14 Mar 2018 07:15:41 +0100 Message-Id: X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180313154416.sgptuw7jcn7l76vn@sbauer-Z170X-UD5> References: <20180313154416.sgptuw7jcn7l76vn@sbauer-Z170X-UD5> References: <20180313154416.sgptuw7jcn7l76vn@sbauer-Z170X-UD5> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I managed to extract the usable shadow mbr size out of my 850Evos OPAL_TABLE_TABLE and added an appropriate check into the write function. As this involves more than just a few lines, I decided to split the v2 of this subpatch into 4 separate patches. I am unsure what whould be the best practice for such an situation but hope it is okay like this. Also the userspace exported pointer is replaced with an u64 value. Jonas Rabenstein (4): block: sed-opal: ioctl for writing to shadow mbr block: sed-opal: unify retrieval of table columns block: sed-opal: get metadata about opal-sed tables block: sed-opal: check size of shadow mbr block/opal_proto.h | 18 ++++ block/sed-opal.c | 245 ++++++++++++++++++++++++++++-------------- include/linux/sed-opal.h | 1 + include/uapi/linux/sed-opal.h | 8 ++ 4 files changed, 189 insertions(+), 83 deletions(-) -- 2.16.1