Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3793523ybi; Mon, 29 Jul 2019 12:44:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5PjoI0ts4h3xUlFAKk7VR70c01JTagZu+WfjbZ7z/E4ZW41eWUbmBKzGUPwoLxLy80FAt X-Received: by 2002:a17:902:7c90:: with SMTP id y16mr113478500pll.238.1564429482056; Mon, 29 Jul 2019 12:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429482; cv=none; d=google.com; s=arc-20160816; b=Qb1SE1qkGUeirgSG1DNH8IY78EQhTY7tzPx5YufkOnDs5Z8ZA8NSNrY+1lXJDo5z+b frJ7iOeJJFfycP8mrkp5gRYCe2hngA/uexRMsQtTgnrxvNWviBVzDIpQn4QJuQE+PVcE IanZtN0BrXy1Nltius+a0PtyBoUlcWOGYncGxWLFkXZzKSPM2s409F3/CPsBRGueU9IP fdlMVnlqCv8VvY5QizjSvz+XTmab2caF3+EnYIKP8qr2ymiV7DE5oLcK7xDGHGCHd310 0QC9IKrLq1bIGWDpV2jghvcwPfHc1gCuQJ0Hzv8ZfMpV/BGKh6LoZ5PxIzOEdthGa5uu lU5A== 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=osKZgMMEUpbTxD6EwcH/6SzuKUIksiTjZwNmjMXISlA=; b=Hho2T6VJ9bOoCPAxyr/41zsz6KHvaG/2BtXYMmH1PWFwZJBwt+f3TfJatHHiIAtNg1 x4/VW277uTSkmI+LKaEu8OSdQBSsNh7nQMlAOYJH/I/nvHkmqQIa/zysqqEqp/Rr8crO ZZHNhT1KaWhR0aaWP7hZ6zgGV+7JYb546erBHAGYFEZDg7+RBF9y5ELv1k+kHpGtZf9M /pARfzlu/C7lZ/wuLfQV0fcj6HAI11qIcpKaE2DSyoIgMbfeRk5hHPUdRnDvDXupYyQf eZ2+xmdwt2tFaBBB5WHyDwHH8gazUwQElm0axfsimFx+uydvI8+3ZDoVa4PTT0l9w1Vp OGVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MyqU3jKu; 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 64si24708533plw.37.2019.07.29.12.44.26; Mon, 29 Jul 2019 12:44:42 -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; dkim=pass header.i=@kernel.org header.s=default header.b=MyqU3jKu; 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 S2389626AbfG2TnP (ORCPT + 99 others); Mon, 29 Jul 2019 15:43:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:59396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389618AbfG2TnO (ORCPT ); Mon, 29 Jul 2019 15:43:14 -0400 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 B67AF21655; Mon, 29 Jul 2019 19:43:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429393; bh=ZeySQA67f8U0g3QtOJ+NqwzjKd7z3D+xJ9QnjPk48ZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MyqU3jKuLUs7kPDK+aCdAbOTuHxFT5mWojv35hWGKsQUPDHY12tqSN3CD359K4elO oUEWgfWfD+ucP53uwWbv45N45U1KIFi/AzNDFmALRF/UOb7jTMGuifDN4E7c6LjB/d HsPwv7e93BiCc4WXBFbKQtzp3VyjsLnGTsKjhT3s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , Kees Cook , Sami Tolvanen , Nick Desaulniers , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 4.19 084/113] 9p: pass the correct prototype to read_cache_page Date: Mon, 29 Jul 2019 21:22:51 +0200 Message-Id: <20190729190715.635757732@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190655.455345569@linuxfoundation.org> References: <20190729190655.455345569@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit f053cbd4366051d7eb6ba1b8d529d20f719c2963 ] Fix the callback 9p passes to read_cache_page to actually have the proper type expected. Casting around function pointers can easily hide typing bugs, and defeats control flow protection. Link: http://lkml.kernel.org/r/20190520055731.24538-5-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Cc: Sami Tolvanen Cc: Nick Desaulniers Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- fs/9p/vfs_addr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index e1cbdfdb7c68..197069303510 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c @@ -50,8 +50,9 @@ * @page: structure to page * */ -static int v9fs_fid_readpage(struct p9_fid *fid, struct page *page) +static int v9fs_fid_readpage(void *data, struct page *page) { + struct p9_fid *fid = data; struct inode *inode = page->mapping->host; struct bio_vec bvec = {.bv_page = page, .bv_len = PAGE_SIZE}; struct iov_iter to; @@ -122,7 +123,8 @@ static int v9fs_vfs_readpages(struct file *filp, struct address_space *mapping, if (ret == 0) return ret; - ret = read_cache_pages(mapping, pages, (void *)v9fs_vfs_readpage, filp); + ret = read_cache_pages(mapping, pages, v9fs_fid_readpage, + filp->private_data); p9_debug(P9_DEBUG_VFS, " = %d\n", ret); return ret; } -- 2.20.1