Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10422497ybi; Wed, 24 Jul 2019 22:57:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiUKsHKDAX2Pt+E3hAcLsqz2alzDcMlgoj58wjC8BG8sn+AOYIULlsFmMzSALRKjvppS4U X-Received: by 2002:a62:1807:: with SMTP id 7mr14650849pfy.149.1564034238725; Wed, 24 Jul 2019 22:57:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034238; cv=none; d=google.com; s=arc-20160816; b=i6D/l8e9gewNQ6/Et1v0HOunGTYE024QaYJ1q/UEQl1lg2DXTxybCAwp5b2F7/WBLz rKz+v5uwSicHx7MFfUHUrqoA/6/u+XAm3KJKi/3vipdosr3rXi6ejPURd+9lbgSsCFna 4gwuE9i00CS1WLJh0CJisnG6g0HNrPCbsS5enQ9uSXDezKWLOu00myDTBgJzgg0Tudcz 71xsKjtBaEDUcSoQsIEehFpqI2fMlTM+2A7QF164ojYkVRgQ6/603/BvbsA7pPu/j64x W5HT5W4CWU2W+WwlIfdeWYpuhUaGoTljVBC1eQdze6zgTRJt4frMxLOLduLij2woEKWX klpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0F+8kHKD/aS2vhsSL6YSp/xKk9WHnbQmXgmAk08H5Es=; b=IZID7s4B0FEiB+KjV+QYKkTAkuwpamWEwsH+Ed96Kc9nefBvCXt2jD7I8YOx2XMdYI 6XvQRz4wbI9Rn1ZVA4jbsSrVveLONPujbo9zBK2WvbDY/GIOH9m/KMqSRMmpRbYMpjm7 NPiTESt/VS3bytTNnSrQAeg50l4b82fuFGQOJLxGdgAYeqFqbRf0+u4SDxJl71/i4sgq mlZXCsg2VJ3JNbSbi2kAKEV7Hv5RUSrUmlsxbMxBnbe8gqInLvgPmBbrBbvB9KQCBLoX 0oLfKGbBdMYPNcO+qoDMa/GeNaC9173wRxpEGAXfjQA/ALrj3GYPyveM2k6bCDvnoag3 ZhlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NjjVzAPx; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j75si4539979pgc.38.2019.07.24.22.57.04; Wed, 24 Jul 2019 22:57:18 -0700 (PDT) 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=@kernel.org header.s=default header.b=NjjVzAPx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388287AbfGYFk0 (ORCPT + 99 others); Thu, 25 Jul 2019 01:40:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:54902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404352AbfGYFkX (ORCPT ); Thu, 25 Jul 2019 01:40:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DB3E322BEF; Thu, 25 Jul 2019 05:40:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033222; bh=a6iCEzeA2sbS3QcDBSU0NPMkKqGqVYc+g/zVQczZMG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NjjVzAPxrPaqEPjELK2dvYHfZ1HabYi7+g6gvfhdQAkVH2aNDeFYoVXqxWEIfWNGj DcLSP6ELBgTF/G/N3Pd0avJoELUzbZzLUooECwrf6Ei42LEmuT9HVFMxhAtgtg46WK 8dWipIT2D6RECXdfNnJH1LBTJtY/CcV7O5KMI+E4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Baruch Siach , Song Liu , Jiri Olsa , Daniel Borkmann , Geert Uytterhoeven , Linus Torvalds , Sasha Levin Subject: [PATCH 4.19 135/271] bpf: fix uapi bpf_prog_info fields alignment Date: Wed, 24 Jul 2019 21:20:04 +0200 Message-Id: <20190724191706.789855339@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 0472301a28f6cf53a6bc5783e48a2d0bbff4682f ] Merge commit 1c8c5a9d38f60 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next") undid the fix from commit 36f9814a494 ("bpf: fix uapi hole for 32 bit compat applications") by taking the gpl_compatible 1-bit field definition from commit b85fab0e67b162 ("bpf: Add gpl_compatible flag to struct bpf_prog_info") as is. That breaks architectures with 16-bit alignment like m68k. Add 31-bit pad after gpl_compatible to restore alignment of following fields. Thanks to Dmitry V. Levin his analysis of this bug history. Signed-off-by: Baruch Siach Acked-by: Song Liu Cc: Jiri Olsa Cc: Daniel Borkmann Cc: Geert Uytterhoeven Cc: Linus Torvalds Signed-off-by: Daniel Borkmann Signed-off-by: Sasha Levin --- include/uapi/linux/bpf.h | 1 + tools/include/uapi/linux/bpf.h | 1 + 2 files changed, 2 insertions(+) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 2932600ce271..d143e277cdaf 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -2486,6 +2486,7 @@ struct bpf_prog_info { char name[BPF_OBJ_NAME_LEN]; __u32 ifindex; __u32 gpl_compatible:1; + __u32 :31; /* alignment pad */ __u64 netns_dev; __u64 netns_ino; __u32 nr_jited_ksyms; diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 66917a4eba27..bf4cd924aed5 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -2484,6 +2484,7 @@ struct bpf_prog_info { char name[BPF_OBJ_NAME_LEN]; __u32 ifindex; __u32 gpl_compatible:1; + __u32 :31; /* alignment pad */ __u64 netns_dev; __u64 netns_ino; __u32 nr_jited_ksyms; -- 2.20.1