Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3097865pxb; Mon, 18 Apr 2022 15:52:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxECTdPfsu8lH8D0xo0LIYRMm5f7w9fM8KCXjB2Wnsapem3ddFcUk+RS/TDW5Hd3rJRfipT X-Received: by 2002:a17:906:40da:b0:6ce:51b:a593 with SMTP id a26-20020a17090640da00b006ce051ba593mr11138964ejk.604.1650322370871; Mon, 18 Apr 2022 15:52:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650322370; cv=none; d=google.com; s=arc-20160816; b=klKwTDUknqxhsYKgF+5iauYh0qIk9Swsxj0+N5ba/LgiuNbNO9THhUY7takmhJEPHl K30GzkdkIUgn68X4hVcEdbvNAxyiMaUgGsqWsWSxO4+imxeh8pJwaSdzs0TTjCGCUyoo uKgkjXXuxqApi99oQKVpTouDzGkNRIkmogmOJseA6nAGlaW/qKPAFPtKMyemrN/aqp3y RcXm7pEqR2XqMUHJvPdBuI24xLdiYbGNOWZwDDE5byP34+o3sUKS+7U3I+lhZ/oDsqZN wnjBEtpO+3CbOhG1GZiuKCPMy5aCDKKuSXL34LCIo0oZ/hszfig15eY/hALFaESKNFag kLEQ== 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=AyaxRYfEFK3SCJoKrfRdCephT9QZIVGuWcI/1TEM4aU=; b=ivhUwLFi7+liDhnTF9o2GrYufp4JScOGBKKFuVxOJUjyZ+cYh+HOZie0VPSBT2M6IV C1JNMi1KuGN31BigeHxntWAsE8xjfVCV64p3sFiVNu7epS5uBaXhr1XqyjGqOhHQm7vG EiQnXNmFlfhS7bFspajk0sAwcS19yECKuHKeBumwzZgQbmiXWhdrEbXh7mBuVp5Lufp2 w4mgiiKWogxNvd3A3LfcQkZe0K/A3XiRpPw9YhRl6TIoK/4A2yeD2VjmQVttNrrNAsI1 nNcTLDHbJ2lBzIFnANqq+Su3UOyHnRW0GRdsgfb2m5Ud4s9Plr33scBGtxRjhGTULK07 KJ1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="rggj/U84"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j19-20020a1709064b5300b006e7efc7a42fsi7413516ejv.565.2022.04.18.15.52.27; Mon, 18 Apr 2022 15:52:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="rggj/U84"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239245AbiDRM2L (ORCPT + 99 others); Mon, 18 Apr 2022 08:28:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238741AbiDRM0W (ORCPT ); Mon, 18 Apr 2022 08:26:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 123B81261C; Mon, 18 Apr 2022 05:20:30 -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 A22AA60F0A; Mon, 18 Apr 2022 12:20:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C591C385A9; Mon, 18 Apr 2022 12:20:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650284429; bh=X/2BiOYQf0Z+0ANkLJl9DPyLmi79vzg8bV9C5ksUvPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rggj/U84T8lDs2trufusEq9lcdtJV1uJiTRHGUOHZs8unlzVAU1DgV2hIvXxGhKWZ h31Cr6mDdFD5xqPhFVn2UOmF1WTsydQBZCv4B4xgyXLOtCFoUhEi9WeVwUfEYZvCJW OB4Q0j3RdOQFRr4KHb2J+wVWLrg6YRHeSaiw7MNc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dylan Yudaken , Jens Axboe , Sasha Levin Subject: [PATCH 5.17 112/219] io_uring: verify pad field is 0 in io_get_ext_arg Date: Mon, 18 Apr 2022 14:11:21 +0200 Message-Id: <20220418121210.034580519@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121203.462784814@linuxfoundation.org> References: <20220418121203.462784814@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=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: Dylan Yudaken [ Upstream commit d2347b9695dafe5c388a5f9aeb70e27a7a4d29cf ] Ensure that only 0 is passed for pad here. Fixes: c73ebb685fb6 ("io_uring: add timeout support for io_uring_enter()") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220412163042.2788062-5-dylany@fb.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/io_uring.c b/fs/io_uring.c index 2838bc6cdbc8..7a652c8eeed2 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -10109,6 +10109,8 @@ static int io_get_ext_arg(unsigned flags, const void __user *argp, size_t *argsz return -EINVAL; if (copy_from_user(&arg, argp, sizeof(arg))) return -EFAULT; + if (arg.pad) + return -EINVAL; *sig = u64_to_user_ptr(arg.sigmask); *argsz = arg.sigmask_sz; *ts = u64_to_user_ptr(arg.ts); -- 2.35.1