[PATCH] SUNRPC: Add a check for gss_release_msg

2021-04-06 Thread Aditya Pakki
In gss_pipe_destroy_msg(), in case of error in msg, gss_release_msg deletes gss_msg. The patch adds a check to avoid a potential double free. Signed-off-by: Aditya Pakki --- net/sunrpc/auth_gss/auth_gss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/auth_gss

[PATCH] net/rds: Avoid potential use after free in rds_send_remove_from_sock

2021-04-06 Thread Aditya Pakki
In case of rs failure in rds_send_remove_from_sock(), the 'rm' resource is freed and later under spinlock, causing potential use-after-free. Set the free pointer to NULL to avoid undefined behavior. Signed-off-by: Aditya Pakki --- net/rds/message.c | 1 + net/rds/send.c| 2 +

[PATCH] net: Fix a potential incorrect error handling in rawsock_connect

2020-06-12 Thread Aditya Pakki
In rawsock_connect, the device is allocated by calling nfc_get_device. In case of incorrect bounds index, the device should be freed by calling nfc_put_device. The patch fixes this issue. Signed-off-by: Aditya Pakki --- net/nfc/rawsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] rocker: fix incorrect error handling in dma_rings_init

2020-06-12 Thread Aditya Pakki
In rocker_dma_rings_init, the goto blocks in case of errors caused by the functions rocker_dma_cmd_ring_waits_alloc() and rocker_dma_ring_create() are incorrect. The patch fixes the order consistent with cleanup in rocker_dma_rings_fini(). Signed-off-by: Aditya Pakki --- drivers/net/ethernet

[PATCH] net: ethernet: Fix potential memory leak caused in error handling

2020-06-12 Thread Aditya Pakki
In ethoc_probe, a failure of mdiobus_register() does not release the memory allocated by mdiobus_alloc. The patch fixes this issue. Signed-off-by: Aditya Pakki --- drivers/net/ethernet/ethoc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ethoc.c b

[PATCH] test_objagg: Fix potential memory leak in error handling

2020-06-12 Thread Aditya Pakki
In case of failure of check_expect_hints_stats(), the resources allocated by objagg_hints_get should be freed. The patch fixes this issue. Signed-off-by: Aditya Pakki --- lib/test_objagg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/test_objagg.c b/lib

[PATCH] net: ethernet: Fix phy_set_max_speed by checking for NULL

2019-03-04 Thread Aditya Pakki
phy_device can be a NULL pointer which is further dereferenced downstream in phy_set_max_speed. This patch avoids such a scenario. Signed-off-by: Aditya Pakki --- drivers/net/ethernet/broadcom/genet/bcmmii.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/broadcom

[PATCH] isdn: mISDN: Fix potential NULL pointer dereference of kzalloc

2019-03-02 Thread Aditya Pakki
Allocating memory via kzalloc for phi may fail and causes a NULL pointer dereference. This patch avoids such a scenario. Signed-off-by: Aditya Pakki --- drivers/isdn/hardware/mISDN/hfcsusb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers

[PATCH] rsi: Fix NULL pointer dereference in kmalloc

2019-03-02 Thread Aditya Pakki
kmalloc can fail in rsi_register_rates_channels but memcpy still attempts to write to channels. The patch checks and avoids such a situation. Signed-off-by: Aditya Pakki --- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/net

[PATCH] [v2] netfilter: ipset: fix a missing check of nla_parse

2019-01-05 Thread Aditya Pakki
When nla_parse fails, we should not use the results (the first argument). The fix checks if it fails, and if so, returns its error code upstream. Signed-off-by: Aditya Pakki --- net/netfilter/ipset/ip_set_core.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net

[PATCH] net: phy: phy: check return value of bus write

2018-12-26 Thread Aditya Pakki
phy_mii_ioctl() could fail when writing to the bus via mdiobus_write(). The fix adds a check and returns an error in case of failure. Signed-off-by: Aditya Pakki --- drivers/net/phy/phy.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers

[PATCH] net:phy: Add a return value check on bus write

2018-12-26 Thread Aditya Pakki
xgmiitorgmii_read_status() could fail when writing to the bus via mdiobus_write(). The fix adds a check and returns an error in case of failure. Signed-off-by: Aditya Pakki --- drivers/net/phy/xilinx_gmii2rgmii.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net

[PATCH] net: chelsio: Add a missing check on cudg_get_buffer

2018-12-24 Thread Aditya Pakki
cudbg_collect_hw_sched() could fail when the function cudg_get_buffer() returns an error. The fix adds a check to the latter function returning error on failure Signed-off-by: Aditya Pakki --- drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 4 1 file changed, 4 insertions(+) diff --git a

[PATCH] batman-adv/main: Fix check on return value of rtnl_link_register

2018-12-24 Thread Aditya Pakki
rtnl_link_register() may fail and can impact registering the device. The fix checks the return value and pushes the error upstream. Signed-off-by: Aditya Pakki --- net/batman-adv/main.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/batman-adv/main.c b/net/batman

[PATCH] ipv6/route: Add a missing check on proc_dointvec

2018-12-24 Thread Aditya Pakki
While flushing the cache via ipv6_sysctl_rtcache_flush(), the call to proc_dointvec() may fail. The fix adds a check that returns the error, on failure. Signed-off-by: Aditya Pakki --- net/ipv6/route.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/ipv6/route.c b

[PATCH] net/net_namespace: Check the return value of register_pernet_subsys()

2018-12-23 Thread Aditya Pakki
In net_ns_init(), register_pernet_subsys() could fail while registering network namespace subsystems. The fix checks the return value and sends a panic() on failure. Signed-off-by: Aditya Pakki --- net/core/net_namespace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

[PATCH] net/netlink_compat: Fix a missing check of nla_parse_nested

2018-12-23 Thread Aditya Pakki
In tipc_nl_compat_sk_dump(), if nla_parse_nested() fails, it could return an error. To be consistent with other invocations of the function call, on error, the fix passes the return value upstream. Signed-off-by: Aditya Pakki --- net/tipc/netlink_compat.c | 7 +-- 1 file changed, 5