Copyright in academic software in the UK
Many academics in CS publish their software and sometimes even their data, blissfully ignoring whether they are allowed to do so in their institution or not. It's unlikely to cause any trouble because institutions usually don't care too much: nobody will ever check, unless there's a potential commercial opportunity at play.

However my understanding is that IP rights for any outcome produced in the course of academic work [edited] might be shared between the institution and the author, depending on the institution/country (but IANAL of course). This doesn't mean that the institution forbids academics to publish their software/data, actually it's even very unlikely that the institution would oppose publishing open-source software, but the proper way to do this would be to ask the IP/innovation office for permission (afaik most institutions have one nowadays). 

In my research centre there is an official process that we are supposed to follow whenever we want to make something publicly available. It's a simple software disclosure form where the author indicates what the software does and what kind of license they want to apply to it. The form is supposed to be reviewed by an IP officer who in my experience always validates the request.  I've done it a few times myself: this additional administrative step is a bit annoying but it's not such a big effort.