Skip to contentSkip to conversation

Patch "unix_diag: fix incorrect sign extension in unix_lookup_by_ino" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Feb 29, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

unix_diag: fix incorrect sign extension in unix_lookup_by_ino

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
unix_diag-fix-incorrect-sign-extension-in-unix_lookup_by_ino.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Mon Feb 29 14:33:50 PST 2016

From: "Dmitry V. Levin" <[email protected]>
Date: Fri, 19 Feb 2016 04:27:48 +0300
Subject: unix_diag: fix incorrect sign extension in unix_lookup_by_ino

From: "Dmitry V. Levin" <[email protected]>

[ Upstream commit b5f0549231ffb025337be5a625b0ff9f52b016f0 ]

The value passed by unix_diag_get_exact to unix_lookup_by_ino has type __u32, but unix_lookup_by_ino's argument ino has type int, which is not a problem yet.
However, when ino is compared with sock_i_ino return value of type unsigned long, ino is sign extended to signed long, and this results to incorrect comparison on 64-bit architectures for inode numbers greater than INT_MAX.

This bug was found by strace test suite.

Fixes 5d3cae8bc39d ("unix_diag: Dumping exact socket core")
---
 net/unix/diag.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/unix/diag.c +1 -1
@@ -220,7 +220,7 @@ done:
 	return skb->len;
 }
 
-static struct sock *unix_lookup_by_ino(int ino)
+static struct sock *unix_lookup_by_ino(unsigned int ino)
 {
 	int i;
 	struct sock *sk;

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/unix_diag-fix-incorrect-sign-extension-in-unix_lookup_by_ino.patch