Received: by 10.223.185.116 with SMTP id b49csp3893763wrg; Mon, 26 Feb 2018 07:49:28 -0800 (PST) X-Google-Smtp-Source: AH8x225vuW0q8DLUnGJcsx1ZX2sbXGa2tjliLTCwVewjKDhAU+f+i6hhpwd+vDPpGIwv4Hzc7TZu X-Received: by 2002:a17:902:6783:: with SMTP id g3-v6mr10972353plk.179.1519660168185; Mon, 26 Feb 2018 07:49:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519660168; cv=none; d=google.com; s=arc-20160816; b=vf3wo/Dd2h6ldQZ057tPY/ZleiP6xULCQfbPr0UC70a315qrrCmzH9HP+sCgv2Q/I9 w12IE9EOcq1P3X0cdnju0JJpWu8R8yauR8R2BaE3a6Q1D5oqxbFc9JuK3kCIHNKWxDeT NkXG1Q9ooNyFbg1Dd9W2kAVYnT9m+7x0xVdB7X7XiwBp64I9noP99U1QZdbzO5xKZ9dx MZTQbdJZxBDuwYWnJfLIC5pKRufq6x1liNDQ1u8KlO4+7XLOzfuf1xlUoS/UJfMojR9n V6W+wYpVE5QXoztXRkZ1B5JY8ChE4qmhmR0psiapij8vrrD0QNHUkWv1VVPkoflDHmfP rR2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=FbL/Xktnp16vVuFHgW+EcYhaiJsYI8KtRnLumP7AnX0=; b=Ch3pm44oIaBuyiGt4GgNwY8Rq/SkGuPYUzUCByXU5FI1QvLZZlb9SGasrN6z/8QBdH S5HI1kESbfzcemKNPEFMraBsOZKojmXcisgD6XHewkboxxRlfyeS72V9ZPR/G/s5Yr3k mJF/JihDZf/rX0xmqZ5rB2/kyWwdLQ1fHEfExSEmj/YURNCxXn4xx79qLcKjMypa3SXd 2BKYxZ3e8Fz/wyAL0DaDI+p8I6WwwWzojFck/iLcvFYqu60+mRa6Uh/EAgo24ZOrXgkW 7L81+Sg35vyHUkmDn47s5lYCsaVAJVFwbs6TCVaxGAc/aY/D3tLk+fiFEXMipEHVFrsl /AlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Bb0kUN9C; 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 91-v6si5143990plh.296.2018.02.26.07.49.13; Mon, 26 Feb 2018 07:49:28 -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=Bb0kUN9C; 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 S1752106AbeBZPsV (ORCPT + 99 others); Mon, 26 Feb 2018 10:48:21 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:38590 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751706AbeBZPsT (ORCPT ); Mon, 26 Feb 2018 10:48:19 -0500 Received: by mail-lf0-f66.google.com with SMTP id i80so3591479lfg.5; Mon, 26 Feb 2018 07:48:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=FbL/Xktnp16vVuFHgW+EcYhaiJsYI8KtRnLumP7AnX0=; b=Bb0kUN9CKRavLLACqf4+n2LKu1E7ULzmrSG4h2JB4NbQBknqxcQva+WL1BztfMfKua zSCWu5qt4e36ypsezMak+ZaPpis8HUEQmvSOIvFkDkrGS/8wLUGRD+OYIytYj8Wb+2VL rXsETiIyzEPbCwrybFReuKdcYRJLsPi6cDDg+WW+c5UiBqcqxYumGInSuImfi5yb0w3R fyOOKw95PRxXzunFpRGo82A1crQTRhQ9OF1PJtw9iiPeyFQjYCu5SEuQPrgI3czXfJWs WdHkpRoshwH/Gx75mlhLd3phR/FQMhQMV9yP3APKgNr8jWEam8L0/7iM/xNFNyqoRIql pqTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=FbL/Xktnp16vVuFHgW+EcYhaiJsYI8KtRnLumP7AnX0=; b=eYICngvdSQfIp2UqVgfCOMkZQJlotZNneE5vxd/psjLx7A0iRWi5eFqySqQTCMc7xi d9k0r3s6eCEpsJ+2ZIleTRox67Mh8HOPKiBwyJr38TlF4SpKuX2tmg2zHl0sR63klZaF kY8FWKHZZ2yyL+oyQV1tq+4jdY4Tsjj+mt+lVrkLxY68WIPTXmAI+rro+0Bz3hgmS6ml NrICmY8X6UFzCWwS3Y9wz3THd3xwV2Rw7ki+gMNgwjl1ia3Y8FuOemdOE5CmMFrsujP/ lhnBjyWX4fGjmMaBTvxyZV+Fu7jBy/7+MDwVOxygBVnlaTFTl6x4RB+hoIcpf8pt2T/t yVXg== X-Gm-Message-State: APf1xPCZxO7TaSGfh8JX1Cw7G4yIF2UmSOFYubPE8RkX9+n/Ap5NX0wt AcQ6IiuszOfeZPEpm7hZ+xY= X-Received: by 10.46.99.130 with SMTP id s2mr7720151lje.17.1519660097641; Mon, 26 Feb 2018 07:48:17 -0800 (PST) Received: from localhost.localdomain ([31.44.93.2]) by smtp.gmail.com with ESMTPSA id o77sm2065465lja.43.2018.02.26.07.48.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Feb 2018 07:48:16 -0800 (PST) From: Ilya Smith To: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ilya Smith Subject: [PATCH 0/1] Additional strict check on ELF file. Date: Mon, 26 Feb 2018 18:46:58 +0300 Message-Id: <20180226154659.10218-1-blackzert@gmail.com> X-Mailer: git-send-email 2.14.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, this patch implements strict check on segments order in ELF file. Current implementation doesn't check the order of ELF segments and compute totalsize as difference between last one and the first one. If ELF file has wrong order it allows to re-mmap existing memory region with one from ELF file. Ilya Smith (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. fs/binfmt_elf.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) -- 2.14.1