Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2497607rdg; Mon, 16 Oct 2023 06:27:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7K+8rnifpk0Ju4fiLLnLl/ma9ZhlwN3qd94hwLgbXCo53ZcNtc6t3pvTzfu0SSqAQkKd5 X-Received: by 2002:a17:903:7c4:b0:1c9:d667:4e85 with SMTP id ko4-20020a17090307c400b001c9d6674e85mr10485722plb.40.1697462866256; Mon, 16 Oct 2023 06:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697462866; cv=none; d=google.com; s=arc-20160816; b=wLfHGn3j8Kip4Kgn+0BZWwjPcifrCaPIGXRgZ+9gW2qL/Xzdhx+M5pZ+H74bfDlPnP 0Q4pVtpd6FP3Ha2v7Sey/wVAzktunMqIkKxIYWjJTcYsMMHbUGGbelrCkjkXHMaWCHy7 Ks+mn7uKAFjGuFYIjrMCeVUb3NAXQwKLigv51nZeWYs760KpL2Bnt9r0vrD7eWrnb2ED X8DMDAPEPFS1tdr7CymEqoB7jrsOJsDRNIQpqeizIDlRldb+NApO7PraExc8cMP7QSxc aEH86ON13ccM9AJBgUkOYC/yfeqA06O9z2aH6sDKrRGQAvoh8+wyDLlydTUPq94oQlqY QJQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=fz3sXXBU3KF1msP1ClOarc7l7UaGsN2COsQOm8Si50k=; fh=VQYL3IX+cS/qgrDtdDVp5dzQDdIVOLQr8U7eERbgixI=; b=WmCqbkzCl1HPkZ/bQcA3s8DNKzM2YY4DnmAaMHY5+5ggkRNyQFFeK2/OP9492S58AA 3J3300eDA2x29/AaNmc7L+yXelQAEARPNGqR63bnJAFnKePmu9shHgUVDqbacgY7kJSF cAHdoiREJNQ46C3dXQ5w0uuemzCG/uCLZ3LfBAzF5uC4iV+kF1nBDvNyfKlSBHiT1Fdx 91f8dd+dBoMJs2KJYiRnZc1XI+LwStrLFgoG8A+YvnnVQkWjfgovI0L6+bSY+IINXgSh kSsyAAJpuNI21Ro8Q3XtFBvfZ1RicYbedmuEnnS8TMfbcAaHUYIW7E/NVfAN3AXe0A4l UVEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id i6-20020a170902c28600b001c20db25104si10052077pld.117.2023.10.16.06.27.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 06:27:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id C25368060052; Mon, 16 Oct 2023 06:27:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233440AbjJPN1f (ORCPT + 99 others); Mon, 16 Oct 2023 09:27:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231508AbjJPN1f (ORCPT ); Mon, 16 Oct 2023 09:27:35 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0CD3AD; Mon, 16 Oct 2023 06:27:33 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id A32006732D; Mon, 16 Oct 2023 15:27:30 +0200 (CEST) Date: Mon, 16 Oct 2023 15:27:30 +0200 From: Christoph Hellwig To: Milan Broz Cc: Damien Le Moal , Christoph Hellwig , linux-scsi@vger.kernel.org, jejb@linux.ibm.com, martin.petersen@oracle.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] scsi: use ATA-12 pass-thru for OPAL as fallback Message-ID: <20231016132730.GA27013@lst.de> References: <20231016070211.39502-1-gmazyland@gmail.com> <20231016070531.GA28537@lst.de> <0c7f0599-40de-417a-842d-d0aba842d115@kernel.org> <5831286b-e3d0-4b87-9c5c-dbcb420d1b67@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5831286b-e3d0-4b87-9c5c-dbcb420d1b67@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 16 Oct 2023 06:27:44 -0700 (PDT) On Mon, Oct 16, 2023 at 02:46:03PM +0200, Milan Broz wrote: > The problem is that we (for simplicity) decided to use kernel SED-ioctl interface that > internally wraps OPAL command to SCSI SECURITY command only. It means, that all devices No, it doesn't. It uses the properly specified protocol for each layer. That is NVMe uses NVMe Security Send/Receive, SCSI uses the SCSI protocol, and libata translats for ATA devices. > that can use ATA-12 just cannot work with this kernel interface (unlike userspace which > can decide which wrapper to use). It supports all devices that actually speak ATA perfectly fine, take a look at ata_scsi_security_inout_xlat. > > And IMO it is not correct - if it was designed only for some servers with directly connected > devices, then it is really not generic OPAL support. It should work for any hw that supports it. Let's get off your crack pipe before we continue. It is designed and implemented to support the security protocols exactly as spec'ed. You seem to have found devices that claim to be SCSI, but actually require ATA passthrough for security. That's no secret cabal to lock out non-server hardware but just proper protocol design. > For USB, it actually works quite nice with the patch (ignoring usual bugs in firmware). So move it into usb if you can convince the usb maintainers that they are fine with it. > >> >> Note that nowhere in your patch do you test if you are talking to an ATA device. > > Yes, I know. I expected the command to be rejected if not supported. Good luck. Cheap storage hardware trips up on unknown commands all the time. > IMO it is quite similar to discard/TRIM support... Where we also don't support weird ATA commands directly from sd for good reason.