Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5294077pxu; Tue, 22 Dec 2020 13:05:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0KkZ7dKcl6DlPGEDm2Xp+OfyW5cuTUTQeykhKoSk+XSuTDVGAWZdZ/ImjbAlp5NP1/ym7 X-Received: by 2002:a05:6402:2710:: with SMTP id y16mr11727521edd.21.1608671159719; Tue, 22 Dec 2020 13:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608671159; cv=none; d=google.com; s=arc-20160816; b=nz5nyGbso6SR4FDqWkupdWgWSwV3kj/iUrjJ+K4yoDWRzIIUZciqimm8WKyBbRdPqC ULKSYiZUMC3t6EWo5ZHub0hKZWbbfH5u6cO0kf10n1/uNYiCUlyqo0Uu4yVDDvUeF9/y aJldz/BaLdlBwUGlgBM+s430aOOOq50U+GWCoerS/pyW2pByX7eAjdyXxlyjkNAuq/Zy dnZAEsnu4ROcCzMLYl88JWmsbG6DVZ8vkrrArr3ib8LXCnjd+oBNibSelwBHfI/6uzjG H3d6X6I5K4y17FBlKxo6VN3hl6O+C8iHAES6xmz5/r0jXG/CKzinEHspO+Bh3QIcvOvk nPCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=WOgnDDLT8masgIUfxisc/Vz+fHTSbfB6Pago9KBBzf0=; b=ncGuz5Z9QHj1buA7zQiFoWM2HRIN+Yfr9n78ws6J7to5bm5rSofruDJIEQmLUNdTey vlgDB0FAS0V8acfGViq+6DBNhcQXcmAnElaC0IigZJHEv38rGP6YFSZFdxy+wzKpHdAT NbaZJxQujvkMMTQh3EAtAMlGxT9IWs1wM59iB+8A18wkMUEtlKGeHYBya6cdUUkLSz9h kDA6JKpPtv3LhrS+0G48Vaymx2OxDcWrIohM7EtHnPi+Azv5c00JDfIR9awvmZ63fUVg rc23Qys5bJK8bFSWyAcAPVyN6jylq0HxP/6r1fpHYL+pw5REEHH0x/Cwb6RcabsbF6yH 4sOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YtjeHmzr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fi11si11221551ejb.378.2020.12.22.13.05.37; Tue, 22 Dec 2020 13:05:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YtjeHmzr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727851AbgLVVEe (ORCPT + 99 others); Tue, 22 Dec 2020 16:04:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727243AbgLVVEd (ORCPT ); Tue, 22 Dec 2020 16:04:33 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DD2EC0613D6 for ; Tue, 22 Dec 2020 13:03:53 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id l8so19507303ybj.16 for ; Tue, 22 Dec 2020 13:03:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=WOgnDDLT8masgIUfxisc/Vz+fHTSbfB6Pago9KBBzf0=; b=YtjeHmzrVUTCg4xBTO9RPcviRfGJRfrfiG7zUoI5se6kc4+IWHD6GrZoGb3WHv891N wZtXFLGgbJJ8iixIf8pcZUjWqXAb9dZapJbKV3Ncpv39w2ZtgAgQ6B+Ii8NSdFIOrwtS 3gt8ciHeP0tf684U2vn0KFiqMvPZ77FgPKrM1xAEKjK5hVO7HOTLwYpxpuLgP8+6bILf YJGU/88i5dnW2suVciusLv0Py33JBQ9QdoKpC4GW4aNh1jXo+pI0A6cxWYsz7wCrRbcx JaIJ0q6WJgSfWRc+vlNZU+rhYplcCYjKYSA0l4NbVdLzJVSElL4yc8hhtrsxzUpVgn0Q beYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=WOgnDDLT8masgIUfxisc/Vz+fHTSbfB6Pago9KBBzf0=; b=WyN4ZAABi4SXW22ToPfj5wuMKNq7MWX3/NSJR8aDH6SsvAfZ7hg24GKXU3oN8niDEp 9AIzCFE0GkQsEbYylM4+EwI0nlk+0QdecsM7VuCWGfaGvG+3TJqXsTZTJjTAMIstKe8D ZoyVhBkuZkexkQOVi4L4AmQMz2TQK5bhaBWYIGlocLNEEJwmnFfRkjnOecF5H3SROcF9 CB+2H0fQtBIBIRms2U8xwUj2GYK8nlUWhQMDimToOjzHucqL0YiA8Vu0yJbARvV7YbV/ agt58txcdvrIhyFpEe6dPKwm7d3u7WdU29OC4pFXpWd2Zky6negRoLODAtzVdEu//+2T 8iZA== X-Gm-Message-State: AOAM533jC09BC9KUdgPaXACilpI8pG/1DZdKFrupdTF0vCEyI65mHHZh gQGvYomb1qAaiGBoi/3PSFq3bPbh/oAiy/n45pE= Sender: "ndesaulniers via sendgmr" X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:f693:9fff:fef4:4d25]) (user=ndesaulniers job=sendgmr) by 2002:a25:1843:: with SMTP id 64mr31148965yby.80.1608671032651; Tue, 22 Dec 2020 13:03:52 -0800 (PST) Date: Tue, 22 Dec 2020 13:03:45 -0800 In-Reply-To: <55261f67-deb5-4089-5548-62bc091016ec@roeck-us.net> Message-Id: <20201222210345.2275038-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <55261f67-deb5-4089-5548-62bc091016ec@roeck-us.net> X-Mailer: git-send-email 2.29.2.729.g45daf8777d-goog Subject: [PATCH] fs: binfmt_em86: check return code of remove_arg_zero From: Nick Desaulniers To: Alexander Viro Cc: Nick Desaulniers , Masahiro Yamada , Miguel Ojeda , Guenter Roeck , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org remove_arg_zero is declared as __must_check. Looks like it can return -EFAULT on failure. Cc: Masahiro Yamada Cc: Miguel Ojeda Reported-by: Guenter Roeck Signed-off-by: Nick Desaulniers --- fs/binfmt_em86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/binfmt_em86.c b/fs/binfmt_em86.c index 06b9b9fddf70..6e98fcfca66e 100644 --- a/fs/binfmt_em86.c +++ b/fs/binfmt_em86.c @@ -63,7 +63,8 @@ static int load_em86(struct linux_binprm *bprm) * This is done in reverse order, because of how the * user environment and arguments are stored. */ - remove_arg_zero(bprm); + retval = remove_arg_zero(bprm); + if (retval < 0) return retval; retval = copy_string_kernel(bprm->filename, bprm); if (retval < 0) return retval; bprm->argc++; -- 2.29.2.729.g45daf8777d-goog