From patchwork Mon Dec 16 17:47:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181777 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4663225ile; Mon, 16 Dec 2019 10:14:52 -0800 (PST) X-Google-Smtp-Source: APXvYqxzdXKonQukg8cm0d5vuJTmjWqk6CLbAvsjw6r7cz7j4UMz2EJFV1iWMB7Pps2EkDXple1s X-Received: by 2002:aca:5582:: with SMTP id j124mr249579oib.20.1576520092597; Mon, 16 Dec 2019 10:14:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576520092; cv=none; d=google.com; s=arc-20160816; b=zPECbofDfxGerI3yLp15NSaE0tpUW+SQgrkAuzDycgiv++ON9iof+22mV7ww47Pe6R 5QpdvxReWEFIQ7aMx2OIFVCkHsUF3MhEi+VBzCJW3bPcTnkiuQKx1tvzWC0h3/js4bT+ rJ+OdZI/QJgJSBPLnWy0kHIbOrSbqEUUUzLeDF9aFSm/knQqXGGE1HQIkn7RSrFq5cOJ IMEYgwsMw1mgZqvC5Lk7mIuc8Eq+IYHzV5yXLhrPPdlv25On7L86KfAKQHXt79dDY+09 9ogiirJbetK9D91eeJhl1Wdam5WYkjQnEAXITRoGpsQczCXQ3q4y80Ol7WmJ6ECdFudT L+sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iyjZME+lw7IsPYqyZ0lf+oZ8erQKFAibjhO6aCA+oRk=; b=yvp5ygA5s8LtBx+wHQ6R0KzgF0Zbw1T6W4dtD8D9xUmRIuJ3YMGu43x2tF9eAaGpOH Fmn0ngzl9QBMZpEUa2LGbaIN9dPeqgFKdxek7zHg+w8yYvjS/fqCTa7ARVaFNhR7yBWU jNjQ8M6m3vJY/wpaGNlYoNwQpfZNkO5Olyr+qSgZlYwFb/FgWZfY6x5byhEo8YmUe4a9 +tUIS7SDVAq/eRyqivleQEfRBU/SY7/Taiu2Fi2Hx0tiSR4DsGgFeneyTK02BzwBfaUu /jRQewcwR+0hNV8S2mdyIwu5IFfhSA8egYmLB9+XPd4LWOAVQIVD0kdSrZ9ACX83Lu/f TXyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HcwkN8dR; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 w11si10151684oig.45.2019.12.16.10.14.52; Mon, 16 Dec 2019 10:14:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HcwkN8dR; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730995AbfLPSOv (ORCPT + 14 others); Mon, 16 Dec 2019 13:14:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:34728 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730990AbfLPSOt (ORCPT ); Mon, 16 Dec 2019 13:14:49 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 67E0C206E0; Mon, 16 Dec 2019 18:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576520088; bh=LlivjxT72g1WSfdls0+LCRODihuebIfcJGAQ7u9gnkA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HcwkN8dRxop8xzX2uZSQX96MJG5wp7ElVjcGEX0uYYR4hdk55tTQjVN+VlD6f8Sk5 AFlciW72Hg9GbGt6iEnSyPX647vpeaMxmvTeCaK3UWGkeQQ4stgvHxqfy6/KVj6ImN Cek7t+PU2gABsdbI2NU3AaElZmrd1msQW/tciaic= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Yan, Zheng" , Arnd Bergmann Subject: [PATCH 5.4 012/177] ceph: fix compat_ioctl for ceph_dir_operations Date: Mon, 16 Dec 2019 18:47:48 +0100 Message-Id: <20191216174815.527496174@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174811.158424118@linuxfoundation.org> References: <20191216174811.158424118@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann commit 18bd6caaef4021803dd0d031dc37c2d001d18a5b upstream. The ceph_ioctl function is used both for files and directories, but only the files support doing that in 32-bit compat mode. On the s390 architecture, there is also a problem with invalid 31-bit pointers that need to be passed through compat_ptr(). Use the new compat_ptr_ioctl() to address both issues. Note: When backporting this patch to stable kernels, "compat_ioctl: add compat_ptr_ioctl()" is needed as well. Reviewed-by: "Yan, Zheng" Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- fs/ceph/dir.c | 1 + fs/ceph/file.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -1809,6 +1809,7 @@ const struct file_operations ceph_dir_fo .open = ceph_open, .release = ceph_release, .unlocked_ioctl = ceph_ioctl, + .compat_ioctl = compat_ptr_ioctl, .fsync = ceph_fsync, .lock = ceph_lock, .flock = ceph_flock, --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -2188,7 +2188,7 @@ const struct file_operations ceph_file_f .splice_read = generic_file_splice_read, .splice_write = iter_file_splice_write, .unlocked_ioctl = ceph_ioctl, - .compat_ioctl = ceph_ioctl, + .compat_ioctl = compat_ptr_ioctl, .fallocate = ceph_fallocate, .copy_file_range = ceph_copy_file_range, };