Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp759515pxb; Tue, 12 Apr 2022 12:42:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlVC/VZuAFfxbrb7Dhxi31+l27kDZUYeTUGI8CV6QSFS+u2Atq0nw2ynwiKREAuS6eF2Tn X-Received: by 2002:a63:2006:0:b0:39d:8460:48a4 with SMTP id g6-20020a632006000000b0039d846048a4mr6079861pgg.623.1649792548059; Tue, 12 Apr 2022 12:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649792548; cv=none; d=google.com; s=arc-20160816; b=ZPMPhR4A+6JrZaC6pzKFvhDN/fte8JduQm9au1/MecrfQ8PKT2V+vbUC6tvLOBSYpC JaYwKd5nnP9nkrhsEDrpBeIseXX6+DI5r6pvJXd90LTuWqL1eKOXKY0N0WzoJKTRNiAU iEacNI53IorO7g79+8p6wCPMpp85iqd4dQedJb9hNpFKCDiU8grCCdsTmcn4liJHIhpG AQKuRFdxC03wb0xTQeQtozOPcBoBjx4A1f9pC7D1ULz/V00J9bHJIlBtOQ/KzlBDMofq dAtw+5tBV1zgn53nvJhthtEJTV5P6nte2LMJ0Qr0ZTUYjEtp7f9PTViktZt1jMOnxmf2 os2g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RuVFmwVdExl/MSNgXRVfM40+Dn5quq+Xx3wa/wo0YZg=; b=RZn86k1cbwJZ11ksB/pE2y03KKDHeJECyemCkVOJaBQGyXIfe46vjf3ar4nPP3IWOy JI/bkBxYSemx24X+kvw7k04k3QEvb7uLu6X5vbm/0ghEbnE1wIs+Se6sxF3UrZgH1GeK b77tdU4OXJtiEFmS/pn95zeihHtpM6QPc9lQGDO1fWHm3V/gC6KdlEqGU5dwskGZ2/ki 3SerRW2LmfyIfJAed7D0+1QUfCCCHnM3XywmhB2yMnfV1p1gfJpso0NCaC4OJScjppXJ 6XGCq+U1uKF0oMhPh3juolHDsLrfb2RMes6ywA7bERXL0m82BsS0FJTNy5JJVjFRwhnc WwMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=YU4IXVG5; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 5-20020a630205000000b00398009192c9si3569214pgc.869.2022.04.12.12.42.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 12:42:28 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=YU4IXVG5; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 71CA962A2B; Tue, 12 Apr 2022 12:41:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349863AbiDLQdb (ORCPT + 99 others); Tue, 12 Apr 2022 12:33:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357670AbiDLQd0 (ORCPT ); Tue, 12 Apr 2022 12:33:26 -0400 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E0E75DE72 for ; Tue, 12 Apr 2022 09:31:00 -0700 (PDT) Received: from pps.filterd (m0109332.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 23C9IF61029511 for ; Tue, 12 Apr 2022 09:30:59 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=RuVFmwVdExl/MSNgXRVfM40+Dn5quq+Xx3wa/wo0YZg=; b=YU4IXVG54QSv/U92CSB4orcEqCT+laHyTbGiLeOWy58ZTe2lEuzHgkshiyvvM2EOUK5n Apnz09nGKH5IiqPd8k3Kwac2AuPQPfPesiJY3+dWDjaB6n49LzdAbD7rfjC7i/RI3QLm agdm5/Ty+WrHTymRQjetoPqUEohL5w5XCKk= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3fd6p3t9x3-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 12 Apr 2022 09:30:59 -0700 Received: from twshared41237.03.ash8.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::c) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 12 Apr 2022 09:30:57 -0700 Received: by devbig039.lla1.facebook.com (Postfix, from userid 572232) id 5042D745606E; Tue, 12 Apr 2022 09:30:49 -0700 (PDT) From: Dylan Yudaken To: CC: , , , , Dylan Yudaken Subject: [PATCH 4/4] io_uring: verify pad field is 0 in io_get_ext_arg Date: Tue, 12 Apr 2022 09:30:42 -0700 Message-ID: <20220412163042.2788062-5-dylany@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220412163042.2788062-1-dylany@fb.com> References: <20220412163042.2788062-1-dylany@fb.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-ORIG-GUID: 3yc-rusqUW7s1ofzsnnjpcJeRllUTpFE X-Proofpoint-GUID: 3yc-rusqUW7s1ofzsnnjpcJeRllUTpFE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-12_06,2022-04-12_02,2022-02-23_01 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 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 --- fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/io_uring.c b/fs/io_uring.c index a84bfec97d0d..6b1a98697dcf 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -10711,6 +10711,8 @@ static int io_get_ext_arg(unsigned flags, const v= oid __user *argp, size_t *argsz return -EINVAL; if (copy_from_user(&arg, argp, sizeof(arg))) return -EFAULT; + if (arg.pad) + return -EINVAL; *sig =3D u64_to_user_ptr(arg.sigmask); *argsz =3D arg.sigmask_sz; *ts =3D u64_to_user_ptr(arg.ts); --=20 2.30.2