Commit 19cebbcb authored by Christoph Biedl's avatar Christoph Biedl Committed by David S. Miller

isdn: Partially revert debug format string usage clean up

Commit 35a4a573 ("isdn: clean up debug format string usage") introduced
a safeguard to avoid accidential format string interpolation of data
when calling debugl1 or HiSax_putstatus. This did however not take into
account VHiSax_putstatus (called by HiSax_putstatus) does *not* call
vsprintf if the head parameter is NULL - the format string is treated
as plain text then instead. As a result, the string "%s" is processed
literally, and the actual information is lost. This affects the isdnlog
userspace program which stopped logging information since that commit.

So revert the HiSax_putstatus invocations to the previous state.

Fixes: 35a4a573 ("isdn: clean up debug format string usage")
Cc: Kees Cook <keescook@chromium.org>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: default avatarChristoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8c7188b2
...@@ -1896,7 +1896,7 @@ static void EChannel_proc_rcv(struct hisax_d_if *d_if) ...@@ -1896,7 +1896,7 @@ static void EChannel_proc_rcv(struct hisax_d_if *d_if)
ptr--; ptr--;
*ptr++ = '\n'; *ptr++ = '\n';
*ptr = 0; *ptr = 0;
HiSax_putstatus(cs, NULL, "%s", cs->dlog); HiSax_putstatus(cs, NULL, cs->dlog);
} else } else
HiSax_putstatus(cs, "LogEcho: ", HiSax_putstatus(cs, "LogEcho: ",
"warning Frame too big (%d)", "warning Frame too big (%d)",
......
...@@ -901,7 +901,7 @@ receive_emsg(struct IsdnCardState *cs) ...@@ -901,7 +901,7 @@ receive_emsg(struct IsdnCardState *cs)
ptr--; ptr--;
*ptr++ = '\n'; *ptr++ = '\n';
*ptr = 0; *ptr = 0;
HiSax_putstatus(cs, NULL, "%s", cs->dlog); HiSax_putstatus(cs, NULL, cs->dlog);
} else } else
HiSax_putstatus(cs, "LogEcho: ", "warning Frame too big (%d)", total - 3); HiSax_putstatus(cs, "LogEcho: ", "warning Frame too big (%d)", total - 3);
} }
......
...@@ -674,7 +674,7 @@ receive_emsg(struct IsdnCardState *cs) ...@@ -674,7 +674,7 @@ receive_emsg(struct IsdnCardState *cs)
ptr--; ptr--;
*ptr++ = '\n'; *ptr++ = '\n';
*ptr = 0; *ptr = 0;
HiSax_putstatus(cs, NULL, "%s", cs->dlog); HiSax_putstatus(cs, NULL, cs->dlog);
} else } else
HiSax_putstatus(cs, "LogEcho: ", "warning Frame too big (%d)", skb->len); HiSax_putstatus(cs, "LogEcho: ", "warning Frame too big (%d)", skb->len);
} }
......
...@@ -1179,7 +1179,7 @@ LogFrame(struct IsdnCardState *cs, u_char *buf, int size) ...@@ -1179,7 +1179,7 @@ LogFrame(struct IsdnCardState *cs, u_char *buf, int size)
dp--; dp--;
*dp++ = '\n'; *dp++ = '\n';
*dp = 0; *dp = 0;
HiSax_putstatus(cs, NULL, "%s", cs->dlog); HiSax_putstatus(cs, NULL, cs->dlog);
} else } else
HiSax_putstatus(cs, "LogFrame: ", "warning Frame too big (%d)", size); HiSax_putstatus(cs, "LogFrame: ", "warning Frame too big (%d)", size);
} }
...@@ -1246,7 +1246,7 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir) ...@@ -1246,7 +1246,7 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir)
} }
if (finish) { if (finish) {
*dp = 0; *dp = 0;
HiSax_putstatus(cs, NULL, "%s", cs->dlog); HiSax_putstatus(cs, NULL, cs->dlog);
return; return;
} }
if ((0xfe & buf[0]) == PROTO_DIS_N0) { /* 1TR6 */ if ((0xfe & buf[0]) == PROTO_DIS_N0) { /* 1TR6 */
...@@ -1509,5 +1509,5 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir) ...@@ -1509,5 +1509,5 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir)
dp += sprintf(dp, "Unknown protocol %x!", buf[0]); dp += sprintf(dp, "Unknown protocol %x!", buf[0]);
} }
*dp = 0; *dp = 0;
HiSax_putstatus(cs, NULL, "%s", cs->dlog); HiSax_putstatus(cs, NULL, cs->dlog);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment