Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9983150ybi; Wed, 24 Jul 2019 13:31:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkFHAfKZmHUnDhV4C3KZYL3mtH4ttUV1bNWnhCljaHmxR7kA8Aiwjs35DnbtDrNSSfvqjp X-Received: by 2002:a17:902:b582:: with SMTP id a2mr88940281pls.128.1564000283411; Wed, 24 Jul 2019 13:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564000283; cv=none; d=google.com; s=arc-20160816; b=PQYDgV+f62rLbAq4JImo5mVtbglVDFldG4UQqZSCUP0RmB8SydNtzSMr5sKFZ2l2RW VdL3y000HzHUs3P1c0l75qpFFqJNtPObG9/r6+r8lofmbPKvgYYi9n3kKQJLH6Nslde8 qwzIeCHRWZMT39ZSgk4LaHKpk2hajPLJRbMD8Dc5VfkfaAORPWcr2th1U7brUIcAfHG2 QqUS9EiPSRlMg12USkidW/luKwSsb16Y1nVPCE5D9drkYq981xCCll+0qASrjYoOt4Fl 9sNzilnsytT9DsCunwjECoSruma7aOsEiWS1weXCl//nmKGUcvGMgrisUNre1GZ1ETbq fj6g== 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=aKBLV0uaqoLc61we+v2ezzxRNIyrXKqhQi0zyTzNKfk=; b=Dgjqpe72j3BLF5Dw+7/VMKou/o/CiFG1G26UDB8BKOSwFOc20X+W7S/Q1VZhmXm3vy W7gC7d6ILvn273ttUXAGeQIAciLP1q/jrHBzRVfDidOzzNXY3tigqJl7IiAvZ/Y0TU0C XxLeqSN28NzebrmEMHxDvkLfBJPBFl2snKYEdt2208aGwkzxJ4bO0masJL09TTqe3pgn yPFEW0BmrSeI4LLSibhYhakNIx3emRdqnwii2DXWQR6c5imZ3leKUXDGAz7FI3dagTlg ketTuCIY7cvif5BiSyq7E5Udpf47Nv0ltE3h5NjwdjRp0E5url7sJ8rJYPUPVDGjOuBw yapA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1lYeI5ZY; 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 a144si16886884pfd.72.2019.07.24.13.31.09; Wed, 24 Jul 2019 13:31:23 -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=1lYeI5ZY; 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 S2388690AbfGXTco (ORCPT + 99 others); Wed, 24 Jul 2019 15:32:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:54006 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387712AbfGXTcg (ORCPT ); Wed, 24 Jul 2019 15:32:36 -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 4318D21951; Wed, 24 Jul 2019 19:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996755; bh=46oC3J8MRY4eR326TXaTmCWpbZdv8Hu3eQw+d535RKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1lYeI5ZYaE492Zcv6srX4nk5w4IOWz9bzO35EowL3SE2jkrvfQQAHza5G2DFAs5l6 VEZRyF1r11q+BNh8MmyU47EdHzVsRbiauzzIJ6nbfr+r9yd0r6JkQ8NCJSWnbZEU44 Kg82GhwfkaRD5yp6ZbD5DSmthGkguKDgMvB620nA= 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 5.2 203/413] bpf: fix uapi bpf_prog_info fields alignment Date: Wed, 24 Jul 2019 21:18:14 +0200 Message-Id: <20190724191749.060574181@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 a8b823c30b43..29a5bc3d5c66 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -3143,6 +3143,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 a8b823c30b43..29a5bc3d5c66 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -3143,6 +3143,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