[linux] 01/01: Add two patches needed as prerequisites for the security fixes

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Tue Mar 7 23:02:13 UTC 2017


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch wheezy-security
in repository linux.

commit d9de523fc9cd29fb10bcca3604ab76edb478ebd9
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Tue Mar 7 22:19:23 2017 +0000

    Add two patches needed as prerequisites for the security fixes
    
    ...and fix up a trivial conflict with the PREEMPT_RT series
---
 debian/changelog                                   |  2 ++
 ... list-introduce-list_first_entry_or_null.patch} | 23 ++++++++-------
 .../features/all/net-sock-add-sock_efree.patch     | 33 ++++++++++++++++++++++
 .../rt/0056-list-add-list-last-entry.patch.patch   |  6 ++--
 debian/patches/series                              |  2 ++
 5 files changed, 52 insertions(+), 14 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index e5436a9..ed341bd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -79,12 +79,14 @@ linux (3.2.86-1) UNRELEASED; urgency=medium
   [ Ben Hutchings ]
   * ipc/shm: Fix shmat mmap nil-page protection (CVE-2017-5669)
   * sctp: avoid BUG_ON on sctp_wait_for_sndbuf (CVE-2017-5986)
+  * net/sock: Add sock_efree() function
   * net/llc: avoid BUG_ON() in skb_orphan() (CVE-2017-6345)
   * packet: fix races in fanout_add() (CVE-2017-6346)
   * irda: Fix locking in hashbin_delete() (CVE-2017-6348)
   * sctp: deny peeloff operation on asocs with threads sleeping on it
     (CVE-2017-6353)
   * TTY: n_hdlc, fix lockdep false positive
+  * list: introduce list_first_entry_or_null
   * tty: n_hdlc: get rid of racy n_hdlc.tbuf (CVE-2017-2636)
 
  -- Ben Hutchings <ben at decadent.org.uk>  Tue, 07 Mar 2017 01:47:48 +0000
diff --git a/debian/patches/features/all/rt/0056-list-add-list-last-entry.patch.patch b/debian/patches/features/all/list-introduce-list_first_entry_or_null.patch
similarity index 50%
copy from debian/patches/features/all/rt/0056-list-add-list-last-entry.patch.patch
copy to debian/patches/features/all/list-introduce-list_first_entry_or_null.patch
index d6cedd3..ac5d65a 100644
--- a/debian/patches/features/all/rt/0056-list-add-list-last-entry.patch.patch
+++ b/debian/patches/features/all/list-introduce-list_first_entry_or_null.patch
@@ -1,30 +1,33 @@
-From: Peter Zijlstra <peterz at infradead.org>
-Date: Tue, 21 Jun 2011 11:22:36 +0200
-Subject: [PATCH 056/397] list-add-list-last-entry.patch
-Origin: https://git.kernel.org/cgit/linux/kernel/git/rt/linux-stable-rt.git/commit?id=7818a26c1bf070d8c2e23b08176a8598d9ba6a9c
+From: Jiri Pirko <jiri at resnulli.us>
+Date: Wed, 29 May 2013 05:02:56 +0000
+Subject: list: introduce list_first_entry_or_null
+Origin: https://git.kernel.org/linus/6d7581e62f8be462440d7b22c6361f7c9fa4902b
 
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
+non-rcu variant of list_first_or_null_rcu
+
+Signed-off-by: Jiri Pirko <jiri at resnulli.us>
+Signed-off-by: David S. Miller <davem at davemloft.net>
 ---
  include/linux/list.h | 11 +++++++++++
  1 file changed, 11 insertions(+)
 
 diff --git a/include/linux/list.h b/include/linux/list.h
-index cc6d2aa6b415..7a9851bbef04 100644
+index 6a1f8df9144b..b83e5657365a 100644
 --- a/include/linux/list.h
 +++ b/include/linux/list.h
 @@ -362,6 +362,17 @@ static inline void list_splice_tail_init(struct list_head *list,
  	list_entry((ptr)->next, type, member)
  
  /**
-+ * list_last_entry - get the last element from a list
++ * list_first_entry_or_null - get the first element from a list
 + * @ptr:	the list head to take the element from.
 + * @type:	the type of the struct this is embedded in.
 + * @member:	the name of the list_struct within the struct.
 + *
-+ * Note, that list is expected to be not empty.
++ * Note that if the list is empty, it returns NULL.
 + */
-+#define list_last_entry(ptr, type, member) \
-+	list_entry((ptr)->prev, type, member)
++#define list_first_entry_or_null(ptr, type, member) \
++	(!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL)
 +
 +/**
   * list_for_each	-	iterate over a list
diff --git a/debian/patches/features/all/net-sock-add-sock_efree.patch b/debian/patches/features/all/net-sock-add-sock_efree.patch
new file mode 100644
index 0000000..1d4060b
--- /dev/null
+++ b/debian/patches/features/all/net-sock-add-sock_efree.patch
@@ -0,0 +1,33 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Subject: net/sock: Add sock_efree() function
+Date: Fri, 03 Mar 2017 02:32:07 +0000
+
+Extracted from commit 62bccb8cdb69 ("net-timestamp: Make the clone operation
+stand-alone from phy timestamping").
+
+Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
+---
+--- a/include/net/sock.h
++++ b/include/net/sock.h
+@@ -1117,6 +1117,7 @@ extern struct sk_buff		*sock_rmalloc(str
+ 					      gfp_t priority);
+ extern void			sock_wfree(struct sk_buff *skb);
+ extern void			sock_rfree(struct sk_buff *skb);
++void sock_efree(struct sk_buff *skb);
+ 
+ extern int			sock_setsockopt(struct socket *sock, int level,
+ 						int op, char __user *optval,
+--- a/net/core/sock.c
++++ b/net/core/sock.c
+@@ -1369,6 +1369,11 @@ void sock_rfree(struct sk_buff *skb)
+ }
+ EXPORT_SYMBOL(sock_rfree);
+ 
++void sock_efree(struct sk_buff *skb)
++{
++	sock_put(skb->sk);
++}
++EXPORT_SYMBOL(sock_efree);
+ 
+ int sock_i_uid(struct sock *sk)
+ {
diff --git a/debian/patches/features/all/rt/0056-list-add-list-last-entry.patch.patch b/debian/patches/features/all/rt/0056-list-add-list-last-entry.patch.patch
index d6cedd3..f8e42c8 100644
--- a/debian/patches/features/all/rt/0056-list-add-list-last-entry.patch.patch
+++ b/debian/patches/features/all/rt/0056-list-add-list-last-entry.patch.patch
@@ -8,12 +8,10 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
  include/linux/list.h | 11 +++++++++++
  1 file changed, 11 insertions(+)
 
-diff --git a/include/linux/list.h b/include/linux/list.h
-index cc6d2aa6b415..7a9851bbef04 100644
 --- a/include/linux/list.h
 +++ b/include/linux/list.h
-@@ -362,6 +362,17 @@ static inline void list_splice_tail_init(struct list_head *list,
- 	list_entry((ptr)->next, type, member)
+@@ -373,6 +373,17 @@ static inline void list_splice_tail_init
+ 	(!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL)
  
  /**
 + * list_last_entry - get the last element from a list
diff --git a/debian/patches/series b/debian/patches/series
index 8530546..a6670e7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1109,10 +1109,12 @@ bugfix/all/ecryptfs-fix-handling-of-directory-opening.patch
 bugfix/all/ipc-shm-fix-shmat-mmap-nil-page-protection.patch
 bugfix/all/sctp-avoid-bug_on-on-sctp_wait_for_sndbuf.patch
 bugfix/all/net-llc-avoid-bug_on-in-skb_orphan.patch
+features/all/net-sock-add-sock_efree.patch
 bugfix/all/packet-fix-races-in-fanout_add.patch
 bugfix/all/irda-fix-lockdep-annotations-in-hashbin_delete.patch
 bugfix/all/sctp-deny-peeloff-operation-on-asocs-with-threads-sleeping-on-it.patch
 bugfix/all/tty-n_hdlc-fix-lockdep-false-positive.patch
+features/all/list-introduce-list_first_entry_or_null.patch
 bugfix/all/tty-n_hdlc-get-rid-of-racy-n_hdlc.patch
 
 # ABI maintenance

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list