• R/O
  • HTTP
  • SSH
  • HTTPS

linux-2.4.36: コミット

2.4.36-stable kernel tree


コミットメタ情報

リビジョンa86164be2f5448d27c2ae9eaf69ce21ea2dec33d (tree)
日時2007-04-15 00:39:47
作者Willy Tarreau <w@1wt....>
コミッターWilly Tarreau

ログメッセージ

[DECNet] fib: Fix out of bound access of dn_fib_props[]

Backported from 2.6. Found and fixed from Thomas Graf :

Fixes a typo which caused fib_props[] to have the wrong size
and makes sure the value used to index the array which is
provided by userspace via netlink is checked to avoid out of
bound access.

Signed-off-by: Thomas Graf <tgraf@suug.ch>

変更サマリ

差分

--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -61,7 +61,7 @@ static struct
6161 {
6262 int error;
6363 u8 scope;
64-} dn_fib_props[RTA_MAX+1] = {
64+} dn_fib_props[RTN_MAX+1] = {
6565 { 0, RT_SCOPE_NOWHERE }, /* RTN_UNSPEC */
6666 { 0, RT_SCOPE_UNIVERSE }, /* RTN_UNICAST */
6767 { 0, RT_SCOPE_HOST }, /* RTN_LOCAL */
@@ -257,6 +257,9 @@ struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r, struct dn_kern_rta
257257 struct dn_fib_info *ofi;
258258 int nhs = 1;
259259
260+ if (r->rtm_type > RTN_MAX)
261+ goto err_inval;
262+
260263 if (dn_fib_props[r->rtm_type].scope > r->rtm_scope)
261264 goto err_inval;
262265
旧リポジトリブラウザで表示