Skip to contentSkip to conversation

Patch "isdn: kcapi: avoid uninitialized data" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message Dec 21, 2017 Stable branch

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

isdn: kcapi: avoid uninitialized data

to the 3.18-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:
isdn-kcapi-avoid-uninitialized-data.patch
and it can be found in the queue-3.18 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 Thu Dec 21 10:55:04 CET 2017

From: Arnd Bergmann <[email protected]>
Date: Tue, 28 Mar 2017 12:11:07 +0200
Subject: isdn: kcapi: avoid uninitialized data

From: Arnd Bergmann <[email protected]>

[ Upstream commit af109a2cf6a9a6271fa420ae2d64d72d86c92b7d ]

gcc-7 points out that the AVMB1_ADDCARD ioctl results in an unintialized value ending up in the cardnr parameter:

drivers/isdn/capi/kcapi.c: In function 'old_capi_manufacturer':
drivers/isdn/capi/kcapi.c:1042:24: error: 'cdef.cardnr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
cparams.cardnr = cdef.cardnr;

This has been broken since before the start of the git history, so either the value is not used for anything important, or the ioctl command doesn't get called in practice.

Setting the cardnr to zero avoids the warning and makes sure we have consistent behavior.

---
 drivers/isdn/capi/kcapi.c |    1 +
 1 file changed, 1 insertion(+)
drivers/isdn/capi/kcapi.c +1 -0
@@ -1032,6 +1032,7 @@ static int old_capi_manufacturer(unsigne
 						     sizeof(avmb1_carddef))))
 				return -EFAULT;
 			cdef.cardtype = AVM_CARDTYPE_B1;
+			cdef.cardnr = 0;
 		} else {
 			if ((retval = copy_from_user(&cdef, data,
 						     sizeof(avmb1_extcarddef))))

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

queue-3.18/hwmon-asus_atk0110-fix-uninitialized-data-access.patch queue-3.18/isdn-kcapi-avoid-uninitialized-data.patch