]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
isdn: Fix a sleep-in-atomic bug
authorJia-Ju Bai <baijiaju1990@163.com>
Wed, 31 May 2017 01:40:11 +0000 (09:40 +0800)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Tue, 22 Aug 2017 09:58:01 +0000 (06:58 -0300)
BugLink: http://bugs.launchpad.net/bugs/1710646
commit e8f4ae85439f34bec3b0ab69223a41809dab28c9 upstream.

The driver may sleep under a spin lock, the function call path is:
isdn_ppp_mp_receive (acquire the lock)
  isdn_ppp_mp_reassembly
    isdn_ppp_push_higher
      isdn_ppp_decompress
        isdn_ppp_ccp_reset_trans
          isdn_ppp_ccp_reset_alloc_state
            kzalloc(GFP_KERNEL) --> may sleep

To fixed it, the "GFP_KERNEL" is replaced with "GFP_ATOMIC".

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/isdn/i4l/isdn_ppp.c

index 9c1e8adaf4fc825c54ff84e9c85d36a68ecb5da7..bf3fbd00a091a166d1e6411d0d84a8ea1355405a 100644 (file)
@@ -2364,7 +2364,7 @@ static struct ippp_ccp_reset_state *isdn_ppp_ccp_reset_alloc_state(struct ippp_s
                       id);
                return NULL;
        } else {
-               rs = kzalloc(sizeof(struct ippp_ccp_reset_state), GFP_KERNEL);
+               rs = kzalloc(sizeof(struct ippp_ccp_reset_state), GFP_ATOMIC);
                if (!rs)
                        return NULL;
                rs->state = CCPResetIdle;