Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3337663ybl; Sun, 11 Aug 2019 21:30:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3o1AfDe1mj52dWW7fYKahL85CfuJwEbjMKbAKEWeBZ/eYhoUg5nx6kBabE4InxmjikCql X-Received: by 2002:a17:902:b212:: with SMTP id t18mr24457110plr.246.1565584220342; Sun, 11 Aug 2019 21:30:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565584220; cv=none; d=google.com; s=arc-20160816; b=ji//VQOU6MCW+0TCkgAJa42x9A1inD8cQnaym6gIiuNHAmioewyIeQXxgBLukoAfXr PgeV3EXoZlUunYPlNqOgnlEPwAz0TyFJRVQ8s8hmSptfLUcyvvfge2fv2DBDTpaqIzGs YdSXCDRq9DZynbMGb63u426Vi71oLm5/NLQzEZA6OKBtzuEwlc4ipBVO3R2c6kn7Zjoa 6ULCXU/whnWj9HQHtzGOQ6RWGDCorssuDlvcUAUdpm4otVJ3dHVTlEnIjpy1n+DJ0uvo +y5nBZTXf9a/jdnX1fM6QkcT9GhHf8VjF47FFzDOJkbsZ+ncMeu3LSRuyw7Lj53SvDU+ L3Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=RSAZCfHV+PTbL1i32DkAR/S1MG8exH6iGWKJnOYgLz0=; b=dfawBtl1BakiI3j8Euti7qfdw5Dgm6c6y/KuOpcKQhRzHPiLSs5Yn9sIB6FO220c3b YeMAwKArhmoAoLMzlk0RE3YsKnl5//EobhkYfpi53IiNZAufnz1UXWo142byOkOdtOGW xQP4iLYtkj+EJ418FaHQDSBlnZ5jm43okwukCg5nkkO9oNqrmrruj0wAE9+zI12+jmMw ZzF+v1a8LvA0v0U0puij/SHdw+6JNfl72x0hh7MoeIpWuviRhab/RdVWFNgaAc7mczbv ABhim0hBaHxo8rnZaX4h+SDF5/cCpkNpvCQbkxGx5qioLqYGPiEv/Vv7ktsB+UxqjToH GuRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10si4844082plo.384.2019.08.11.21.30.04; Sun, 11 Aug 2019 21:30:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726483AbfHLE3a (ORCPT + 99 others); Mon, 12 Aug 2019 00:29:30 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:38566 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbfHLE3a (ORCPT ); Mon, 12 Aug 2019 00:29:30 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 7F9FC145487CD; Sun, 11 Aug 2019 21:29:29 -0700 (PDT) Date: Sun, 11 Aug 2019 21:29:28 -0700 (PDT) Message-Id: <20190811.212928.1681769879219779999.davem@davemloft.net> To: dhowells@redhat.com Cc: netdev@vger.kernel.org, jaltman@auristor.com, linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] rxrpc: Fix local refcounting From: David Miller In-Reply-To: <156538726702.16201.13552536596121161945.stgit@warthog.procyon.org.uk> References: <156538726702.16201.13552536596121161945.stgit@warthog.procyon.org.uk> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 11 Aug 2019 21:29:29 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Howells Date: Fri, 09 Aug 2019 22:47:47 +0100 > Fix rxrpc_unuse_local() to handle a NULL local pointer as it can be called > on an unbound socket on which rx->local is not yet set. > > The following reproduced (includes omitted): > > int main(void) > { > socket(AF_RXRPC, SOCK_DGRAM, AF_INET); > return 0; > } > > causes the following oops to occur: > > BUG: kernel NULL pointer dereference, address: 0000000000000010 > ... > RIP: 0010:rxrpc_unuse_local+0x8/0x1b > ... > Call Trace: > rxrpc_release+0x2b5/0x338 > __sock_release+0x37/0xa1 > sock_close+0x14/0x17 > __fput+0x115/0x1e9 > task_work_run+0x72/0x98 > do_exit+0x51b/0xa7a > ? __context_tracking_exit+0x4e/0x10e > do_group_exit+0xab/0xab > __x64_sys_exit_group+0x14/0x17 > do_syscall_64+0x89/0x1d4 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > > Reported-by: syzbot+20dee719a2e090427b5f@syzkaller.appspotmail.com > Fixes: 730c5fd42c1e ("rxrpc: Fix local endpoint refcounting") > Signed-off-by: David Howells > cc: Jeffrey Altman Applied.