Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp612868pxb; Tue, 5 Apr 2022 15:58:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxX7Ep60Z1Oo//WUpxmIudL4iHu1zbsl/dk3vxD/hoPX2EFeS8BURePtq803cPs+hshtoCT X-Received: by 2002:a17:90b:1e4e:b0:1c7:3512:c2ac with SMTP id pi14-20020a17090b1e4e00b001c73512c2acmr6555969pjb.61.1649199534191; Tue, 05 Apr 2022 15:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649199534; cv=none; d=google.com; s=arc-20160816; b=VyQ8jIrGm8SSBXcTMcyXYMxGvEz+PA/EmpQI1kZXK69akqQqHgvhoOVH2L+l8S4oqi svvZcoM/MyQbfSXba1j/bpYmiKcUiacD5Lw4GE5Zv1T9ZmPWQGLZxPynql0xRqI2OJLs 1zFYG0xTaX5vX9M0HcU1uiQVzHF1wvAmbCTAva19HUxXeln/BZ9V2xyWfe1DMq01spj+ XoBJQl64Zh2odNyp0iORg8wW8p+Gspgtu4lK5Mxjd/2hAFc8SEGnVydrY77BpgKdBjP4 CL2Yf/PJf1/2LEwpRkFvMJ6+v9SULfP/GCcakhyXfIRivPwngeHEYqsZm9OiHLkirS1W andw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3Ao2VMoswbcfrTWFB0x7SdLOaYpCSWG7CDUrAXkbjpk=; b=myMKIqjbM5nYJ/zYy18KB++3vcbb6CQ9A0splT5/JVXuKujOGByrt5mel2QshxzIUI N8xaW4lqfAhC9Z4my2+Bu62ZIQSN+ql03Du3Gy1jRZII5Tk2uhS1Dr/HhvoXLM5hVpSo lPefHZa6CJXb34eZEhQLlFsR2yIJOuN/QBP95k3okZRuMYsSmn8AeZmptHedDnMp31+q tWMTP6Igk67JMgkwkzMesC9XAH53owkTEZNH9haczwGJcT1njjxoEW/w3dYw9lcjxUeD 6acIvss7jCyNSLRjfDWH99jBc2neinYEMgD6HkI35WAvfodT2YojA2rYPg+AA3PyL7HP +V6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jBgWMTD2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id be3-20020a170902aa0300b00153b2d1650esi13941993plb.278.2022.04.05.15.58.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 15:58:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jBgWMTD2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6E4071700A6; Tue, 5 Apr 2022 15:40:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383214AbiDENfH (ORCPT + 99 others); Tue, 5 Apr 2022 09:35:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346623AbiDEJYb (ORCPT ); Tue, 5 Apr 2022 05:24:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4218A2D1C6; Tue, 5 Apr 2022 02:13:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4D81661673; Tue, 5 Apr 2022 09:13:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 607ABC385A4; Tue, 5 Apr 2022 09:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150027; bh=rh/sHor9Aw97ytCJh5RJpfrzwpfhvEGt5A32jaHkQXY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jBgWMTD2L9g8aAMWj1OWv3IRM/BoLxPxeSYUp2UkzOVD5ciVSboLKlNNk44x/a/0b krkZOUl6WFdMnigW/xeMxD6lnvluown0CDF0j7BKSRQw4dk8cu2bfvWPwUz7aBpaxQ 1uPlimwbpva6LF7kVNuLQpXih9v3wT23jh4kW8sM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Carlos Llamas , Christoph Hellwig , Jens Axboe Subject: [PATCH 5.16 0929/1017] loop: fix ioctl calls using compat_loop_info Date: Tue, 5 Apr 2022 09:30:42 +0200 Message-Id: <20220405070421.791439048@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Carlos Llamas commit f941c51eeac7ebe0f8ec30943bf78e7f60aad039 upstream. Support for cryptoloop was deleted in commit 47e9624616c8 ("block: remove support for cryptoloop and the xor transfer"), making the usage of loop_info->lo_encrypt_type obsolete. However, this member was also removed from the compat_loop_info definition and this breaks userspace ioctl calls for 32-bit binaries and CONFIG_COMPAT=y. This patch restores the compat_loop_info->lo_encrypt_type member and marks it obsolete as well as in the uapi header definitions. Fixes: 47e9624616c8 ("block: remove support for cryptoloop and the xor transfer") Signed-off-by: Carlos Llamas Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220329201815.1347500-1-cmllamas@google.com Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/block/loop.c | 1 + include/uapi/linux/loop.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1603,6 +1603,7 @@ struct compat_loop_info { compat_ulong_t lo_inode; /* ioctl r/o */ compat_dev_t lo_rdevice; /* ioctl r/o */ compat_int_t lo_offset; + compat_int_t lo_encrypt_type; /* obsolete, ignored */ compat_int_t lo_encrypt_key_size; /* ioctl w/o */ compat_int_t lo_flags; /* ioctl r/o */ char lo_name[LO_NAME_SIZE]; --- a/include/uapi/linux/loop.h +++ b/include/uapi/linux/loop.h @@ -45,7 +45,7 @@ struct loop_info { unsigned long lo_inode; /* ioctl r/o */ __kernel_old_dev_t lo_rdevice; /* ioctl r/o */ int lo_offset; - int lo_encrypt_type; + int lo_encrypt_type; /* obsolete, ignored */ int lo_encrypt_key_size; /* ioctl w/o */ int lo_flags; char lo_name[LO_NAME_SIZE]; @@ -61,7 +61,7 @@ struct loop_info64 { __u64 lo_offset; __u64 lo_sizelimit;/* bytes, 0 == max available */ __u32 lo_number; /* ioctl r/o */ - __u32 lo_encrypt_type; + __u32 lo_encrypt_type; /* obsolete, ignored */ __u32 lo_encrypt_key_size; /* ioctl w/o */ __u32 lo_flags; __u8 lo_file_name[LO_NAME_SIZE];