Received: by 10.223.185.116 with SMTP id b49csp4912257wrg; Tue, 27 Feb 2018 04:54:18 -0800 (PST) X-Google-Smtp-Source: AH8x227PFnVHNOsSDmSG4WUR1cdKSLa5hl3Evn1dXf5OU292//wjuh7Mi6FlusBS5fa8L75Ytv1Q X-Received: by 10.101.101.5 with SMTP id x5mr10935594pgv.195.1519736058645; Tue, 27 Feb 2018 04:54:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519736058; cv=none; d=google.com; s=arc-20160816; b=MAw41K4F4Y7+180vBNQwTPTFwDHejXNklZFAllZpWdCObO5It9txc5jViTdNq/AkFl k8Grs3k3wPbpXR22Zrbb0Z+EYRigpZdzSNQTp1GvpPDmtLFbkHgmpJrY7kKUxLTyHhl8 O3a0OyR1hfcStE6eOTwdC7Q/nOVjYq1n30uZfDk++EzkVl2RsYRtLCh9fWRV7AtVMjpw 64nZwQgrtWrM1U7OjjycnA4BtlzzRa+ZfzfIzBT/AwbVme4D5aL9+B9yOO8uuSwvjbO8 HZwqUbnpe9/Q0VVooPPyInABhx1AaAohzORon/c/2dMBVd/6vO9nCBM/tLMiv8nZW9mU rpyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=dD+UcPjbKVT2VyhivIWv7onEMjsvy4KWHrWvV4BOf2s=; b=fxXW5DbT0V0g5N2jNNRYmYqRzMsYLVzg+wAPT2OXFIct9Jm2sByGSeVfwqY000ckwe Dy3wQW+cuqo/2nk52ErAM3Y6KuSaRNXbGDfSMsscQITpRXZsiNu0BBWwjkJ6OBRjZLOa 0OPlaPxRfjr5TbiSKLo0aEJrJlmPwQrZ0c3wFrKng808fl5PUSX0+vCVvb8iQJ4jja3x +9Fz1Px1vC/t72/D/ip1RodtWNeBxkLFHYyQ9zrC9+4u8mxcOb/0cjIUkNrnTePnQCDW XVTydvPVKYRG8zZmSxcAEWtX9czyY1zMSUy7CcraE2YvnXcvZOYcHQo63eSyAXpFKKTb TbZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=p6wFqCF/; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o17si7019467pgc.665.2018.02.27.04.54.03; Tue, 27 Feb 2018 04:54:18 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=p6wFqCF/; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753118AbeB0Mpk (ORCPT + 99 others); Tue, 27 Feb 2018 07:45:40 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:45178 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752193AbeB0Mpi (ORCPT ); Tue, 27 Feb 2018 07:45:38 -0500 Received: by mail-lf0-f66.google.com with SMTP id x196so27288151lfd.12; Tue, 27 Feb 2018 04:45:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=dD+UcPjbKVT2VyhivIWv7onEMjsvy4KWHrWvV4BOf2s=; b=p6wFqCF/V9RF8yuk3PvDbNwxgjolWpOEC5yazhCLCRKKaeCIp7Gp4l6xcJXIlcxKv3 OYX7x5AOaPvioO/eYeCeO0MB0zP4EK8w7bRu0Mmhal6rTrh+vM+CDV/9sKKY7W0Hncru cp1o0lY9NFvkvMWZIwMyBTm3gz2tJO9uxIvtQ7+JZhooY4fVH4vKXjVRncm6Nx+Uof9o Gf2GvUDP2eMd3YkmfXJ+xbxnvl8XrBt1RRDrDzp09AmgsothtSau7Vuiu4dFnC719ZM3 m9MI8SnS1yJzfFU6HYOp/9kgIZYXGa0O9RhDtZU62qSJIKF8GurdM0cdQdq19r5sRqIE OGbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=dD+UcPjbKVT2VyhivIWv7onEMjsvy4KWHrWvV4BOf2s=; b=IwYbsrgDGA0IMwIFEA/aGe8TaKg/5LIfgxfp7QPYS+Q9orbPcwleuegGzR/BL1wXYT Cnqt9f7Y1GoOSMkEKbM+6ezuHJpkifJsd7nU/bYgt5MwBzAoq2S02Ewp3iEkCOCG2egd PMqZl8eQyNF1crhfFk1Y2Mq9dttTokWe9dHetuRoU5/QOuh/QiZNJixj+DYnwP9mhIbb GvHnFbqr54LuoUBFLQfA4Q1fMXJFeo+dFB6g1ji/hcPHew2LNBWLmNwBnjHsl24Emd+Q 6mttUMF1ptmYFdnJfY6h31PR8z2CGjkIb+qKV8CjKNL1FDqNZO/iVW19CxdfVtK1VXut J2AQ== X-Gm-Message-State: APf1xPB3A3bi2/CLsBkU51E0eFj7iamB2rplmWq3ukkaRfvKALs/Da63 6wypqmiPbWUVrW92BcQIAF1/g1FH7Dw= X-Received: by 10.46.4.149 with SMTP id a21mr10986473ljf.138.1519735537078; Tue, 27 Feb 2018 04:45:37 -0800 (PST) Received: from [10.0.36.159] ([31.44.93.2]) by smtp.gmail.com with ESMTPSA id g10sm918395lfe.21.2018.02.27.04.45.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 04:45:35 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: [PATCH 1/1] Additional strict check on ELF file. Checks segments are followed in order of 'p_vaddr ' value ascending. It fixes erorr in total_mapping_size with computation total size. This error happens if segments in ELF file are not in order. From: Ilya Smith In-Reply-To: <16811dde-abb3-1504-003c-475d40610f9f@infradead.org> Date: Tue, 27 Feb 2018 15:45:34 +0300 Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20180226154659.10218-1-blackzert@gmail.com> <20180226154659.10218-2-blackzert@gmail.com> <16811dde-abb3-1504-003c-475d40610f9f@infradead.org> To: Randy Dunlap X-Mailer: Apple Mail (2.3445.5.20) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for that, I will fix it in next patch. Any other feedback? Thanks, Ilya > 26 =D1=84=D0=B5=D0=B2=D1=80. 2018 =D0=B3., =D0=B2 20:48, Randy Dunlap = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0)= : >=20 > On 02/26/2018 07:46 AM, Ilya Smith wrote: >> Signed-off-by: Ilya Smith >> --- >> fs/binfmt_elf.c | 51 = +++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 51 insertions(+) >>=20 >> diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c >> index bdb201230bae..970b42044240 100644 >> --- a/fs/binfmt_elf.c >> +++ b/fs/binfmt_elf.c >> @@ -524,6 +524,52 @@ static inline int arch_check_elf(struct elfhdr = *ehdr, bool has_interp, >>=20 >> #endif /* !CONFIG_ARCH_BINFMT_ELF_STATE */ >>=20 >> +/** >> + * elf_check_phdr() - common check ELF program header. >> + * @phdr: The program header to check >> + * @phdr_num: Count of program headers in @phdr from elf header. >> + * >> + * Checks ELF binary meets specification. >> + * >> + * Return: Zero to proceed with ELF load, non-zero to faile the ELF = load >=20 > fail >=20 >> + * with that return code. >> + */ >> +static int elf_check_phdr(struct elf_phdr *phdr, unsigned long = phdr_num) >> +{ >=20 > And it would be nicer/better to have all of the "intro" text in the = body of this > message instead of in another email. >=20 > thanks, > --=20 > ~Randy