Okay, so my name is Paul Chignon, and I'm going to talk to you about some work I did on BCC, and I'm going to talk about what BCC is first with Krangary Watter. So the BCC project is a number of things. I'm not a maintainer of the BCC project. I contributed a few patches to that project, and I'm going to focus this talk on what I contributed to the BCC project. So it's mostly known for being a collection of BPF-based tracing tools for Linux. It's been demoed in a number of conferences, but it's also a library to ease the development of BPF programs. So you have a Python layer, and you can use that to develop programs. I'm going to dig a bit into what that is. But first, let's talk about quickly what BPF is. So BPF is a way to extend the Linux kernel from a high-level view. It's a bytecode that you can load in the kernel. It's a bytecode that you can load in the kernel. It's going to be attached to different hook points in the kernel. So for instance, you can attach it to drivers, to care probes, to different tracing points. That's it. And the main point about BPF is that it's statically verified in the kernel before running it. So when you load the program, it's going to be statically verified. And then at runtime, there are a few additional checks, but it's mostly static verification. So these verifications are there to prevent crashes, mostly. For most BPF programs, you have to be root to run them and to load them in the kernel. So it's there to prevent crashes. But in some cases, you can load BPF programs in the kernel, in the Linux kernel, without root privileges. So in this case, the static verification and the dynamic verifications are there to prevent also that you can't escape the BPF VM, of course. So one thing you have to know for this talk about BPF is that from the BPF VM in the bytecode, you can call external functions. So there are functions implemented in the Linux kernel outside the BPF VM. There used to do a number of things you can't do from inside the VM. So for instance, here on the left-hand side, I have three examples, two examples of functions in purple. They're used to address, to access data structures outside the BPF VM. So persistent data outside the BPF VM. Okay, so as far as tracing tools in BCC, there are a large number of them. They cover lots of different things in the Linux kernel. They go from tracing latency at the driver level to system calls. The main thing about BPF and the interest of using BPF for doing tracing is that you can aggregate data in the kernel before retrieving it in user space. So for instance, if you want to measure disc latencies, you're going to measure disc latencies in the kernel, you're going to compute something like a histogram in the kernel, and once you've finished, you're going to just send the aggregate data to user space. You don't have to go back to user space for each measurement. So at this point, I was supposed to do a demo, but since I'm not on my computer, I'm not going to be able to do a demo. The demo wasn't really, it's just to try and show you the interest of BCC. So it was just demoing like a tool to measure latencies and another one to measure packet drops. So this is one of the tools I was supposed to demo. You're not supposed to look at the details here. I'm going to go over them later. But the main thing is this is a BCC script. The part on the left-hand side is the BPF program. You can see that there is a huge string inside a Python script. So the huge string is actually a C program that's going to be compiled down to BPF, to BPF by call. On the right-hand side, you have everything you need in user space to manage a program and to retrieve statistics and display them to the user. So this interface to load programs and manage them in user space is provided by BCC and I'm going to talk about rewriting of the C code on the left-hand side. But first, let's go over how BPF works and at the high level how do we manage and load programs in the kernel. So we have user space and kernel space. First we're going to write some BPF program in C. Then we can use the BPF backend in LLVM to compile it to a bytecode in user space. We're going to load this bytecode in the kernel. For that we have to use the BPF C score. At this point it's going to be verified by the kernel and then it's going to be git-compiled if you've enabled git-compiling in the kernel for BPF. Then you can load some data structures in the kernel to be used by the BPF program. So for instance here I have some representation of an hash map. There are a number of other data structures you can use in BPF programs. They're stored outside the BPF VM. So between different calls of the BPF VM you still have this data that persists among calls. Of course calls. Then once all of this is in place you have to attach this BPF program to some hook. So you could attach it to a K-probe or to a driver or to the traffic classifier and a number of others. So in BCC we use the clonry writer which is a part of clon that is able to do a source-to-source transformation. So we use it to transform the source, the C-program at the beginning to try and provide some synthetic sugar to users to try to abstract some of the complexities of BPF away from the user. Then we transform it into another C-program that then is going to be compiled to the BPF by code. So in BCC the clonry writer is used for a number of different things. So for instance it's used to parse the map definitions in our programs. I'm going to give an example of that later. And these map definitions are parsed from the C-program and then we create from that the C-scull to load them to create them in the kernel. We also use the clonry writer to parse function names because the function names actually have different patterns in BCC and you can just say something like K-probe, underscore, underscore and the name of the function you want to trace. So we're going to parse this and then use it to attach the program to the appropriate function. Then of course we rewrite function declarations. I'm going to talk a little about this later to fit what the kernel is expecting. We rewrite map accesses. Again I'm going to show one example of this later. And the last thing is we rewrite the references of pointers to the kernel memory. So I'm going to focus this talk on this last item of the list and explain first what I mean by this. So in this example, so in the BPFVM when you want to access memory from the kernel which is something you're going to do in a lot of cases if you're doing tracing. If you want to read some data from the kernel to do your measurements. The verifier can't really verify this at load time, sorry. So it has to do it at run time. For a simple reason, all of these accesses can have variable offsets. So it's very difficult to statically verify it in the kernel before executing the program. So what you have to do in this case is you have to call an external function. So a function implemented outside the BPFVM to do this kind of accesses to the kernel memory. So for instance here, I'm going to have, so one argument prev, I'm going to put all external pointers in orange, so pointers to the kernel memory in the remaining of the slides. So for instance here I have prev that is an external pointer, so pointer to the kernel memory. And to be able to read the value, to de-reference the value of prev I have to use BPFPRO-READ that is an external function. So one other thing on this slide that you have to notice is BPF programs only take a single argument. That single argument is called the context argument. So it's the first argument of my function. And then the BCC library actually rewrites this in order to retrieve prev from the context argument. So the reason the context argument is not considered an external pointer, a pointer to kernel memory, is that it's already statically verified by the kernel because the kernel knows its length and know what it contains. But it doesn't know this for all of its members. So for the prev member, for instance, you have to do it at runtime. Okay, so this function is actually the context switches in the kernel, so between the previous process and the next process. And here I'm retrieving the previous process. So with BCC what we offer is we try to make it so that the user can use de-references as usual without caring about external pointers and the fact that they are actually pointers to the kernel memory. So what the user writes is, as usual, just prev, and then it's going to access the PRID member. And in the background, what we're going to do is rewrite the source code in order to replace this with a call to BPF pro read. And what that means is that we have to track all external pointers at the source level, at the C level. And that's what we do with clown. Okay, so before we continue, just a point about the false positive and false negatives. So we don't aim to be perfect. As I will show in the remaining slides, it's very difficult in some cases to be perfect. In some cases, we don't even have all the information to know whether pointer is a pointer to external memory, to memory outside the VM. But there are two cases where we may be wrong. So false positives means we are adding unnecessary calls to BPF pro read. So we're trying to replace some of the references with calls to BPF pro reads when we shouldn't be, because it's not needed. What that means is that we'll have some additional overhead when doing these calls to the external function instead of just doing the memory access in the VM. It's also mainly to some syntax errors because sometimes it's a bit messy when you try to rewrite something twice or things like that. I'm going to mention this in the conclusion. And false negatives are the main issue here. If we miss some BPF pro read, so if we forget to replace a difference with a call to BPF pro read, it means that the program is going to be compiled to bytecode. It's going to be loaded in the kernel. And then once in the kernel, the verifier is going to reject the program saying that it's trying to access memory outside the VM. Then it's going to send an error to the user. And since it detected this in the kernel, it's not going to have a lot of context about why this error is there. And so it's not going to provide something very user-friendly to the user. So the error message in this second case is really difficult for the user to understand. So we really want to try to avoid this issue. Okay, so first, where do external pointers come from? So I've said that they come from the context argument. So there are, for instance, members of the context structure. So for instance, Prev in my previous example. But they can also come from external functions. So for instance, here I have an external function called BPF get current task. So I'm still in the function that is doing the context switch between different processes. I have the previous one. I'm trying to retrieve the current one. And this type of function can also return external pointers. So pointers to the kernel memory. Next thing I have to decide is how do I identify variables? And in particular, how do I identify external pointers? Or how do I compare them? So I could use a very naive way to do it would be to use the variable names. But that wouldn't work if I have different variables called the same in different functions, for instance. So it really wouldn't work. So the way we do it is we use something called KrungDecl. So the declaration of the variable to try and identify it. So in this case, the task variable is identified by its declaration here in the function prototype. OK. So once we have this initial information, we need to traverse the AST to try and track all external pointers to the code. And to do so, we're going to follow all function calls. And as we go, we're going to update the state of external pointers. So for instance, if we have an assignment of an external pointer to some other pointer, obviously we have to add this new pointer to the set of external pointers. Then once we've done this first traversal to detect all external pointers, we're going to do a second traversal that's much easier just to replace all of the differences to external pointers we detected. OK. So for instance, here I'm going to pass a function declaration. So I have different arguments. When I hit the function declaration, I'm going to go look at the second argument. If it's a pointer, I'm going to add it to the set of external pointers. Then I'm going to look at the body of the function, so the different statements. When I hit, for instance, the binary operator, if it's an assignment, I'm going to check if the right-hand side is an external pointer or returns an external pointer. And then if it does, I'm going to assign the left-hand side. I'm going to say the left-hand side is also an external pointer. So I'm going to do this for the code. I have to do it also for arguments of functions and for the values written by functions. OK. So it's not that easy yet. We also have to track the number of indirections of pointers. So for instance, in my code, I could have a pointer to an external pointer. That's the case here with the variable PTR. So for instance, PTR is a pointer to the external pointer as k. When I'm doing the first dereference of PTR, I don't want to replace it with a call to BPFProBrid because that value is on the stack. But I want to replace the second one, the member access to ESCA, the address. So we don't want to rewrite all external pointers. We want to track when we should do the rewrite and at which point. So that means that we need to track all of the different address of and dereference operators in the code, which again adds to complexity. The next case is we have to track external pointers to maps. So at the beginning, I mentioned that BPF programs can use persistent data structures outside of the VM. So someone may very well store an external pointer in one of these data structures and then retrieve it in some older function later in the code. So in this example at the top of the code, I have a declaration of BPF hash. It's a kind of a map in BCC. It's actually going to be rewritten into something else and it's going to be created from this code. It's going to create the syscode to create the map. And then I have some different accesses to the map. So for instance, CURSOC update. This again is going to be rewritten by the BCC library. I'm going to store an external pointer in CURSOC and then I'm going to retrieve it in the trace exit function later on. At this point, I'm going to use it to the reference to retrieve some value from the kernel memory. So I have to rewrite this last dereference. This is a very common example because when you're doing tracing, at the trace entry, so when you're doing tracing of the entry of a function in the return of a function, you do have all of the arguments of the function you're trying to trace at the entry, but you don't have any of them at the return point. So they're not in the registers. So when you want to manipulate to read some of these parameters at the return point, some of these arguments at the return point, you have to store them somewhere and then be able to retrieve them when you hit the return point of the function. So that's exactly what we're doing here. We're storing the esca argument and then retrieving it to perform some reads on it. So the way we undo this is we did several traversals of the AST. So the first traversal is the same as usual. We just try to track all of the external pointers to the code. Then the second one is going to track all of the maps that contains external pointers. So at this point, we know where the external pointers are in the code, so we can just look for calls to Kershok Update, for instance, and say, well, if this argument is an external pointer, then I know that this map contains an external pointer. And then in the last traversal, we're doing the same as the first, except that instead of taking the context argument as sources, we're going to take the maps as sources. So for instance, we're going to look for all of the different lookups to maps. And we know that in this case, we have external pointers in these maps. And then again, we're going to probably exist through the code and do the rewrite in the last traversal. So to conclude, I think this is a bit... It's a bit of a complex approach because we're trying to do it at the source level in C. There are a number of things that are more complicated than we would hope. So for instance, we have to do several traversals of the AST. The implementation, as I said, is more complex. We struggled a lot with rewrites of the code, why we are... So for instance, all of the different calls to Clang Rewiter replace text. So we are trying to replace text as we go, and in some cases it's very difficult to manage the offsets of where we should replace. And in some cases, we try to replace text that has already been replaced and it messes things up. And despite all of this complexity it's still not complete and it probably never will be complete because in some cases we don't have all the information we need to identify all of the external pointers. So for instance, if I have two different programs separated in different files, one of them might be updating a value in a map, putting an external pointer in a map and in the second program I might be reading from that map. So in this case I'm in the second program and I have no way to identify it as an external pointer. Now the question is, are there better approaches to handle this issue? So we could do it at the bytecode level for instance, but in this case we would have to rewrite the debarser of the BPF bytecode. Maybe that's the approach to take. We could take some very extreme option where we rewrite all of the different differences of data structures in the kernel headers. So that's a bit of an extreme approach because we would rewrite a lot of other pointers that are not needed. We could ask the developers to label the different variables to say whether they are actually external pointers. But if we start doing this why wouldn't we just tell them to use BPF pro-brids and not try to do this job frame? And there may be all the solutions if you have others. Thanks for listening. The code is on GitHub. Everything I've talked about it's actually quite short where it's kind of a big file but it's a single file mostly. So it's on GitHub on the BCC project and I think I have time for questions. If you go back a slide to the possible solutions. Sorry. Sorry. It was like one of the other alternative solutions. It's like one of the second to last slides maybe. It was the second to last slide. You're at the end? Oh, okay. Sorry. Sorry. The last one before the solution would be complete. So really the second to last. This one. Oh, sorry. So I was curious about, security kind of requires kind of labeling of pointers. So like the kernel will use certain like macro defines that expand to attribute section or attribute address space. For BPF you mean? Just separate from BPF. We're already the latest kernel and it does this as a way of kind of separating these things. So I'm curious as far as like labeling external pointers of them just in the parameters. That should still give you enough information to be able to rewrite, to insert those probe calls. Yeah, you should. The user still has to be explicit about what's there or not. But then that still gives you enough information so that they don't have to spell out BPF probary every second. The issue is we're trying to abstract all of this away from the user. We're not having to care about whether this is an external pointer. So if we try to do this probably we're going to succeed. But the thing is we're going to ask the user to care about this. That's what we're trying to avoid. Well, I'm just curious like if you were to do approach where you have an always explicit kind of thing of like labeling the pointers explicitly and then like you get machinery working well for always inserting those probe reads or probe writes wherever necessary. So I'm just going to say that when you do the rewriting is you know that every frame after the first then you can have that to it. Yeah, clearly. The pointers on IR level, for example from a local instructions or local instructions. Did you use the IR level? No, we didn't try this but the main thing is... So the question was are we trying to identify these external pointers at the IR level? We haven't tried it. The main thing is it would had maybe a bit of complexity to the clang side of things this time so I'm not sure whether that would be acceptable stream. If you try to do it in BCC maybe it's a better approach but I'm not sure and we would have to do... Yeah, I haven't looked into it so I'd have to look into it to be sure. Yeah. Do you have a cushionary guard against the memory disappearing from under you? Like if there's more of a pointer in a map Yeah. And the thing it points to that appears or with recognition? Yeah, so this is why you have BPF properties. Yeah, sorry. So the question is how does the BPF machinery guard against memory disappearing below you? So for instance if you have a pointer in a map and then the pointer is not valid anymore because it's been freed the memory has been freed. How do you guard against this? So an access to an initialized memory. So the thing is it's why we use BPF properties at runtime. These BPF properties are going to check the memory to be sure that it's safe but we're not trying to read something that's not there for instance. I don't think that's something it checks. So this is what for instance. So this only works for specific structures? No, it works for everything but the thing is it's these programs need root privileges so you're not trying to guard against escape of the memory, you're only trying to guard against crashes of the BPFM on the kernel. So maybe that changes a bit of things. If you don't have root privileges to run a program, so for instance I think programs attached to your sockets don't need in some cases root privileges. In these cases you can't read memory outside the VM. So you have different restrictions based on whether you have root privileges or not. You said that you might need to modify LVM IR if you were to represent all those on the IR level. Couldn't you make this work with LVM IR address spaces and just tag the different address spaces and have a path that protects through that? Yeah. Yeah, that's a good question. We use another language rather than doing a C2C transformations. It's a good question. It's a bit over my head because it's I guess it's a bit of legacy choices. So for instance lots of people are used to doing C programs to write in the kernel, so that might be one of the reasons. But surely it's maybe another approach to use. Some projects have used that approach. So for instance the C front end is not the only in the BCC library you also have a Lua front end. Not sure it changes a lot but maybe. And you have other high level languages that are specific to tracing that have been wrote to be then compiled to BPF.


The final item of business is members' business debate on motion 10404, in the name of Alex Neil, on dog attack figures. This debate will be concluded without any questions being put, and I would ask those members who wish to speak in the debate to press the request to speak buttons. I call on Alex Neil to open the debate for around seven minutes, please, Mr Neil. Thank you very much indeed, Deputy Presiding Officer. In moving this motion on dog attack figures in my name, I would like to make mention of four organisations that have brought this subject back to our attention and who have run a magnificent campaign on the need for us to review the control of dogs act 2010.  Radio Clyde has given already a lot of airtime to this subject and elicited a lot of additional information that we weren't aware of. Secondly, once again, as with the original legislation, many thanks so far to the Scottish Society for the protection of animals and, in particular, the role played by Mike Flynn. Thirdly, the communication workers union who have been running a very substantial campaign across the United Kingdom on this very subject to protect their own workers and their own members, led by Dave Joyce, and, most importantly, to the victims and the families of people who have been the subject of dog bites and dog attacks down the years. It is necessary to reopen the debate for three fundamental reasons. First of all, the problem of dog bites and dog attacks is still not only with us but is getting worse. When you look at the NHS health board figures that are available, only seven of the 14 territorial boards have been able to provide us with figures, but even among those seven boards that cover half of Scotland, if you look at the number of attacks for the latest figures, it is running at a rate of well over 4,000 attacks a year. That is up from 1,900 attacks in 2015, in greater Glasgow, for example, to 2,027 in 2016. The number is high and rising. Secondly, if you look at the number of dog control notices that have been issued under the 2010 act, that accounts for 290 of the incidents, so that is much less than even 10 per cent of all the incidents that are leading to dog control notices. That shows that the act is not being implemented properly, which is the second issue. For example, if you look at enforcement and the number of animal control wardens, the biggest local authority in Scotland, Glasgow City Council, has one animal control warden for a population of nearly 600,000 people. Meanwhile, a council like Renfrewshire, which has a population of 175,000 people, has two control wardens. If you look at some of the other figures, for example, in Dundee, which is another city afflicted by this problem, nine in 10 dangerous dog reports in Dundee go unpunished. Not only is the problem bad and rising, but the implementation of the 2010 act is very variable indeed from local authority to local authority. That is not good enough, because whether you are attacked by a dog in Dundee, Glasgow or Renfrewshire or anywhere else should not matter. If you are attacked by a dog, appropriate action should be taken and appropriate action by the local authority under this legislation is particularly important. The third issue is that many of the powers at the moment are, quite frankly, not powerful. Many of the measures are not powerful enough. The reason why we needed the 2010 act was because the 1991 act introduced at Westminster concentrated on the breed of dog, not the deed. One of the objectives of the 2010 act was to ensure that irrespective of the breed, if the deed was anti-social and threatening people, not only children but people delivering mail, people working in parks and elsewhere, that is the deed that matters more than the breed. Even those breeds not listed in the 91 act are incapable of doing as much damage to human tissue as any of the breeds listed in the act. The three problems are getting worse. The measures that exist in the statute book are not being properly implemented and the powers that are available, particularly to the police, are not sufficient. One of the deficiencies is that under the current legislation, basically a dog is entitled to one bite before it is punished. Very often it is the first bite that should be punished, because it is the first bite that leads to so much damage, for example, to children. It is not just about attacks on humans. There is a wider problem about attacks on farm animals, attacks of dogs on dogs and attacks on human beings. Obviously, my primary concern in this debate is with human beings. From the Royal College of Surgeons in Edinburgh, a leading plastic surgeon Dr Judy Evans says that the emotional trauma can be so difficult to deal with because it is on-going. They have to deal with the trauma of the attack and of the constant operations to repair the damage. She says that I have seen young children who have had massive bite marks and scarring to their face and have seen tearing of the flesh. It can be so tricky to repair this sort of damage. There is also a massive risk of infection because of the nature of the injury. If you listen to the Royal Mail and Communications Workers Union, which officially backs the Radio Clyde Lead the Way campaign, it has recorded 231 attacks on its employees alone in 2017. It desperately feels the need for additional measures. As I said earlier, the importance of the legislation cannot be overestimated. We therefore need a fundamental review of the operation of current legislation, particularly but not only the 2010 act. We also need to identify where additional measures are required to ensure enforcement of existing and future provisions, as well as to give additional powers to the authorities where they are necessary. That is a very important debate. It represents the views and the need for us to speak out on behalf of all those who are threatened by dog attacks or who have been the victims of dog attacks, because sometimes the threat can be as damaging to the psyche, particularly of children, as an actual attack itself. I hope that members will agree with me on the need for action. I hope that when the minister sums up, she will give a favourable response to the need for us to look at this issue again and ensure that more robust action is taken by this Parliament to protect our people from dogs that are out of control. We move to the open debate. I say that there are many people who wish to speak in this debate, so strict timings of absolutely no more than four minutes per contribution please. I call Christine Grahame, followed by Finlay Carson. Thank you, Deputy Presiding Officer. I congratulate Alex Neil on securing this debate. As I was the member in charge of the control of dogs Scotland act 2010, a piece of legislation where the heavy lifting was done by Alex Neil, who passed the bill to me on his elevation to the front bench. He may yet return, who knows. Of itself, it's legislation that was urgently required for three reasons. Firstly, because of the highly flawed dangerous dogs act referred to by my colleague, an act to prohibit persons from having in their possession or custody dogs belonging to types bred for fighting, in other words, the breed. Secondly, it applied only in public places. Section 10 of the Neil Graham control, I think that I'll call it the Graham Neil control of dogs Scotland act 2010, amended the dangerous dogs act 1991 by extending the offence contained in section 3 of that act so that it became a criminal offence to allow any dog to be dangerously out of control in any place that is private or public. Indeed, many attacks take place within the home or gardens that were taking place in private. Secondly, as Alex Neil has said, it applied to deed not breed, that is the owner or the person in charge of the dog. Thirdly, the control of dogs act applied before a dog becomes dangerous when it puts someone or another animal in a state of alarm or apprehensiveness, with a dog control notice being issued if necessary. Those have been on the increase, they are recognised, the numbers quoted, but there have been previously warnings perhaps to owners, which are also recorded preceding any dog control notice. It's a big but. To be effective, A, the public has to know that this is the law. B, there have to be enough local authority dog wardens or environmental wardens to implement it and see that those personnel should be trained in dog behaviour. With hand on heart, I have to say that the legislation has been filled in all three counts. The public at large have no idea of the legislation. I met farming journalists recently who are lobbying me on the increase in sheepwaring and they'd never heard of the legislation. I know that there are a few dog wardens employed across local authorities, some quoted by my colleague. Of course, I suspect that very few have been trained in accordance with the Government guidance about dog control. It's all very disappointing to say the least and I would submit contributing to those worrying figures. I welcome post-legislative scrutiny and review and, in particular, the activities of local authorities. I have to say that I am also asking the corporate body if funding could be provided once a member's bill has been passed by Parliament to publicise it as the Government cannot. The member may bring forward legislation with the whole heart his support of this chamber, but they have no funding to publicise it unless they plunder their various office costs. I believe that that is part of the problem. After all, everyone knows about minimum unit pricing and about the ban on smoking, but they do not know about the control of dogs Scotland Act. However, I am also bringing forward a bill now out for consultation on responsible dog ownership, which I also hope will lead to a decrease in out-of-control dogs. Many of whom are like that because they are with the wrong people, wrongly handed and quite often simply lack exercise. After all, the key thing here—we must all remember—is the deed, not the breed. Therefore, I welcome review, in particular, enforcement by local authorities and publicising this legislation to see if that will take us further. I thank the member again for bringing forward this debate. I have Finlay Carson, followed by Kenneth Gibson. Thank you, Deputy Presiding Officer. As my party's spokesman in animal welfare, I would like to congratulate Alex Neil for bringing this very important and topical debate to the chamber this evening. One of the oldest phrases is, dogs are our man's best friend, with the first recording of this cliché said to date back to Prussian times. However, from the figures that Alex Neil has highlighted, as well as the figures from the communications workers union briefing, which represent the largest number of victims of dog attacks in Scotland and across the United Kingdom, dogs are sadly increasingly becoming something other than our best friends. While the control of dog acts passed in 2010 was an important piece of legislation, it is clear now that with the increasing number of workers and individuals and, indeed, sheep and other animals attacked by dogs, this law has not been effective in bringing about more responsible dog ownership. I would like to raise a case from my own area of Dumfries from last year, which was truly shocking and resulted in a jail sentence being handed down. Two Dumfries women aged 73 and 62 were bitten by a staffisher across terrier while visiting their chemist, and two days later the same dog bit a policeman. All three required medical attention. In this case, the owner was found guilty after admitting that the dog was out of control, but that outcome is not always the case when it comes to applying the law on dangerous dogs in Scotland. Legislation currently requires proof that the person in charge of the dog believes that music could attack a person and that corroborating evidence exists of a previous bite or poor temperament, the so-called one free bite rule. The question must be asked, is this law fit for purpose? The legislation must provide much more consistent outcomes for victims. I welcome a post-legislative review of the control of dog Scotland act, including the degree to which the act is being effectively enforced by local authorities. Our review should also give us the opportunity to look at other factors and try to prevent such attacks. In my constituency, we continue to face serious problems relating to puppy farming, particularly the Port of Cain-Ryann. Researchers from Newcastle university have shown that dogs' bread on intensive puppy farms grew up to be more aggressive, fearful and anxious pets than from reputable breeders. The result of the study, coupled with the worrying increase in number of puppies farmed producing large numbers of dogs for sale, requires that we must ensure that all dogs are properly cared for and that owners are aware of their responsibilities not only to their pets but to other members of the community. Finally, I would like to mention that the current take a lead campaign being led by the NFU Scotland in Scottish Farmer, a campaign to pressure the Scottish Government to review legislation around responsible dog ownership and support the mandatory use of leads around livestock. Despite a demonstration of cross-party support for the campaign, the Scottish Government says that it has no plans to review the law. It is somewhat disappointing but not surprising that Emma Harper, the PLO to Fergus Ewing, who originally backed the campaign, has now backed off and supports the Far from Satisfactory postcode lottery option of additional local authority by law powers. When the councils are already hard pressed and currently failing to issue existing control dog control notices under the current legislation, we need a national solution for a national problem. I hope that Alex Neil's debate tonight will put the issue very much in the spotlight and ensure that the protection is there for our workers, individuals and other animals from dog attacks that have come to common place in our society. Presiding Officer, I would first like to congratulate my colleague, Alex Neil, on securing the debate and also on the Clyde news for the lead the way campaign and its investigation into the worrying extent of dog attacks. Much of the drive to secure the debate has come from the communication workers union, which among its 200,000 members counts 8,500 royal mail and parcel force employees in Scotland. Most posties could tell you about a recent year miss with a dog or about mail that has gone undelivered because of concerns regarding a dangerous animal. Last year alone, there were 230 reported dog attacks on postal workers in Scotland. I myself received 22 stitches and a rather tender part of my anatomy back in 1992, whilst delivering leaflets for the cause. Two other activists I know have been hospitalised after being bitten. Of course, we have all seen in the media some truly awful pictures of young children who have been attacked, mauled and, in some cases, the attacks have proven fatal through dog attacks. Nobody deserves to work or fear of being attacked by an animal. Those who are unfortunately attacked should feel confident that the police and justice system will listen to them and act to ensure that it does not happen again. Given concerns raised by the CW regarding impunity for owners of dangerous dogs, coupled with the rising number of dog attacks that are revealed by Clyde News, we must ask ourselves whether the dangerous dogs act will go far enough, and already tonight we have heard that it does not. When a dog attack is reported, the Crown Office and Procurator Fiscal Service consider the facts and circumstances to assess whether there is sufficient evidence to prosecute enough so whether action would be in the public interest. Dog attacks are covered on section 3 of the Dangerous Dog Act 1991, which defines a dog as being dangerously out of control, and I quote, on an occasion on which there are grounds for reasonable apprehension that I will injure any person or assistance dog whether or not it actually does so. For prosecution to occur, the Crown Office must prove that there were such grounds at the relevant time, and actual injury is not an essential, low and aggravating factor. In reality, that means that if there is no evidence to the person and the charge of the dog at the time of the attack believed that it would attack, the Crown cannot prosecute. The Control of Dogs Scotland Act 2010 gave new powers to local authorities to act against it of controlled dogs and enforce measures to improve behaviour. However, in most cases, councils aim to work with dog owners and informally resolve any issues, giving appropriate advice and guidance and issuing a warning letter rather than a dog control notice to escalate the matter further. While I agree that there is a time and a place for constructive discussions with dog owners on how to handle the dogs better, with at least 2,500 postal workers attacked in Scotland since the control of dogs act was passed, Scotland requires a more decisive mechanism to secure justice for people attacked. Irresponsible dog ownership does not just affect humans, of course. Between 31 March and 23 April this year, around 20 youths and their unborn lambs were killed by dogs on farmland near Scirmallate in my constituency. Not only do those attacks have a financial and emotional impact on the farmer, they also cause immense and needless suffering to the animals. Such deaths are easily avoidable if dog owners do not place their dogs in situations where they may cause harm or upset. Responsible dog owners keep their animals under control and look for early signs of aggression. It is not a dog's fault if their owner does not take heed that they feel threatened or territorial. Dog owners should ensure that their dog is under control when the post arrives, especially if a door must be open to sign for mail or a parcel. Dog has a tendency to grab the mail as it arrives through a litter box, installing a wire basket on the inside of the door, not only protects mail, but most importantly at the postman or women's fingers. Scotland's postal workers do an excellent job and it is right that all who benefit from their services should keep them out of harm's way. The problem cannot be solved by the Government or local authorities working in isolation, only with a collaborative and considerate effort to change attitudes in favour of responsible dog ownership and accountability, and a tightening up of legislation. Can we reverse the trend of rising dog attack figures? Liam Kerr, followed by Clare Haughey. Deputy Presiding Officer, and thanks to Alex Neil for securing this debate, it is not before time. I have not actually intended speaking today, but I got the briefing through from the communication workers union and it made me recall some of my own experiences. It reminded me that all of us, without exception, are here because we and an army of committed volunteers dutifully get out and deliver leaflets and information. I suspect that many of us and those volunteers have nearly had our hands taken off when doing so. Kenny Gibson just told us about his own experience. I came really close about six months ago, but, fortunately, because of an early experience, I wore leather gloves. The dog got a mouth full of leather and I got away with a few scratches, but so many of our postmen and women in particular are not so lucky. While I remember the 2016 Holyrood election, I went on one of our campaign days of veteran stalwart turned up unusually without his wife. On questioning this, I discovered the week before she had posted something and a dog had grabbed her hand in the letter box and sliced her open. Hospital, injections, operations and rehabilitation were to follow. I remember this at the time because I was furious. What can be done? I said, well, not really anything came the response. I have seen it a thousand times, you have just got to deal with it. He told me briefly about this one free bite rule, the idea that uniquely in Scotland, because you need to prove the person in charge believed the dog would attack and the dog has previous, the first attack is unlikely to secure a conviction. If it is very brief, please. Christine Grahame, the member is not the first person to refer to the one in three bites. That is not under the control of dogs Scotland. Let me clarify that. There is no such rule under that act. That act is a preemptive strike against any dog that is out of control long before it gets into the biting stage. I understand that and thank you for the clarification, but we also have to look at the fact that a private prosecution in Scotland appears to be very challenging. I do not understand that, because if the test for a criminal prosecution is more complex in Scotland, then wouldn't it be easier to at least run a civil action? It is not more difficult, apparently, than the rest of the UK, where, according to the CW, it is a straightforward process. Posting things through your letter box is something that happens all the time, be it pizza flyers, the church magazine, a political pamphlet or a professional postal operation. In the rest of the UK, the onus is on the owner of the dog to take steps to ensure that the dog won't attack people. If you have a dog that might get excited by the post, put a cage on the back of the letter box, as Kenny Gibson said, and keep it out of the part of the house. It has to be very brief. I thank the member for that. I have been hearing the debate tonight in Alex Neil and Kenny Gibson, particularly talking about the postal workers in now Liam Kerr. I just wanted to put to say that my future father-in-law was one of those postal workers who was attacked last year, and he talked quite a lot about the psychological effects. Does the member think that the royal male and other employers has got a role to play in treating psychological effects? I can give you a wee bit extra time, Mr Kerr. You have been very, very good. Thank you, Presiding Officer. Does the royal male have a role in treating the psychological effects? I certainly think that it is worth looking at, but I think that what the member has done very importantly is to highlight the psychological effects of these dog attacks, which I think has been clear from the evidence and, indeed, the debate tonight, just how considerable those psychological impacts will be. However, briefly, while I was jotting down some notes for today, I look back at the figures that Mr Neil has put in the motion, particularly in relation to children being bitten. Then I got the absolutely heartbreaking briefing about the children being injured in dog attacks. Around a year ago, I took my young family to Tirebagger, which is near Inverruri. According to its website, it is the place to enjoy the grandeur and peace of a mature forest, with specific routes designed for toddlers and buggies, with cycling and horse riding. It is excellent, and it is a wonderful place to spend the day. However, this day, I was struck, as we walked around by the number of excited dogs on the loose, barking, bounding, play-fighting, jumping up, getting my genes dirty. It is intimidating enough for a five-year-old, but even worse when one starts stalking her. It crouched, growling, about 18 feet behind her, and began padding towards her. It broke wide to get her from a side that I was not on. I picked her up, and we waited until it went past. Shortly after, as the owners went past, they chuckled and said, do not mind him, he is only playing, he always does that. Does he indeed? How often does he have to do it before my daughter or anyone else's daughter ends up in one of the briefings that we have? It is irresponsible, inappropriate and inconsiderate. If owners will not voluntarily control their dogs, whether in the home or outside, they need to be compelled. Alex Neil's motion is absolutely spot on calling this debate. The statistics are terrifying, and it is clear from the briefings today's contributions and bitter experience that something is not working. The sooner his call for review and more robust legislation is he did, the better. Before I call Ms Hockey, due to the number of members who still wish to speak in this debate, I will accept a motion without notice under rule 8.14.3. That would extend the debate by up to 30 minutes. I now invite Alex Neil. Presiding Officer, I am happy to move such a motion. The question is that the debate be extended by up to 30 minutes. Are we all agreed? That is there for the great. Scotland truly is a country of dog lovers. The Pet Food Manufacturing Association estimates that around 471,000 households in Scotland owned at least one dog in 2017. However, our love of animals cannot and should not stop us from taking measures to protect the safety of the public from the most dangerous. Be it workers who are attacked by dogs, people in their homes or kids at the park, it is an incredibly serious issue that many perceive is not being treated as seriously as it should be. I, too, would like to add my thanks to the Communication Workers Union for their briefings to prepare for today's debate. I wish to quote a sentence that they used, which I fully agree with. Sadly, the cartoon caricatures and jokes about dogs biting postman still prevail, but in reality nothing could be further from the truth as he is terrifying a tax result in serious physical and psychological injuries, some of which are life changing and full recovery is never achieved. Workers like postmen and delivery drivers are understandably often worried about their safety. However, from my conversations with constituents, many of them are worried about dog attacks while enjoying local green places. Over the past 18 months, I have been working very closely with friends of the Calder from Blantyre in my constituency of Rutherglen. Dr Susan Lindner Kelly from the group contacted me highlighting instances where members of the public, including children as young as three, had been left shaken after dogs had run towards them in a number of Blantyre parks. Several of the incidents that were reported to the friends of the Calder occurred when a dog was being walked by a professional dog walker and often went off the lead. At least one of those incidents resulted in someone being bitten. I fully understand Alex Neil's position in calling for a post-legislative review of the control of dogs act. However, I also hope that the regulation or licensing of professional dog walkers could perhaps be considered too. Following on from the concerns raised with me, last year I sent a freedom of information request to every local authority in Scotland to ascertain the number of complaints made to them about professional dog walkers and whether their conduct had been investigated by the council. Of the 25 authorities who responded to my FOI requests, nine of them noted that they had received at least one complaint in the last five years. However, unfortunately, many councils, including my own of South Lanarkshire, were unable to disclose the information, either due to cost or the way that the information is recorded. As such, I believe that we do not know the true extent of the problems that are faced across Scotland regarding professional dog walkers and whether the experiences of the Friends of the Calder are unique. As is the case with the vast majority of individual dog owners, the vast majority of professional dog walkers conduct their business in a responsible and ethical way. However, as evidenced in Blantire, even though those dogs are not frequently attacking people, they are still causing many fear and alarm. The control of dogs sent out a clear message that the actions of irresponsible owners would not be tolerated and that there would be serious consequences should they flout the law. However, eight years have passed and dog attacks are sadly still occurring. My hope is that we send out an even louder message by saying how we can not only better prosecute in instances of violent dog attacks but by reducing their frequency and the risk in the first place. Johann Lamont, followed by Liz Smith. I congratulate Alex Neil on securing the debate and the way in which he highlighted and clarified precisely why the debate is important. We need action. I look forward to the minister's response to the debate. I also thank the CWU for its briefing and its persistence as a union in ensuring that it stands up for its members. When you think about dogs and the threat of attack, any one of us in here who has been, as Liz Smith said, campaigning, leafleting, canvassing, immediately has empathy for those who do this job day and daily. How many of us have gone out and said who would be a postie after our most recent experience of a dog sighing behind the door just as the leaflet goes in? Also, as a mother, I can remember wrestling with how I would make sure that my child was comfortable around dogs, not fearful and unnecessarily scared of them because a dog can be such a great companion, but also really frightened that a dog might attack the child. I think that families very often wrestle with that, too. There is empathy and I am concerned about this issue. However, how hard it must be as a postie who suffers from such attacks to discover that, in large part, we still regard it as a music hall joke. Something has already been said, a cartoon of the postie being chased by the dog. I have no doubt in real life that there are those who find it amusing to have their dogs set upon others and enjoy seeing that kind of fear. That in itself is something that, as a society, we have to address. We know that it is an increasing problem for postal workers because of the nature of postal services changing. More likely there has to be face-to-face contact with homeowners in order to get signatures. That is a growing and serious issue. Indeed, in the briefing that we have been informed, that 2,500 postal workers have been attacked since the control of dogs Scotland act was implemented. That is simply not good enough. It is no longer something that is a side issue, but it should be central to the thinking of the Government around animal welfare and safety. Pet welfare is important, too. We recognise that sometimes animals are left in circumstances that make them aggressive and dangerous. We have to have a focus on responsible ownership. It is important that dogs are not put in a position where they do not know how to behave and then we have to have enforcement. However, we should be absolutely clear that the issue of culpability is one thing, but the people who are certainly not to blame are the victims themselves. That is not something that we can just simply move on. In the Petitions Committee, which I convene, we have been doing some work around the whole question of puppy farms and what strikes me is the extent to which dogs have become modified. They become accessories, they are not treated and cared and trained for necessarily in the way that they should. I think that the context of attacks by dogs should be placed in that broader context and any review should reflect on how we might deal with those matters. We have to be concerned, as CWU highlights, that it is more difficult to get a conviction in Scotland than elsewhere. Although there has been a debate about the implications or the reality of the one free bite rule, I have certainly been told by the CWU that that is a fact and a matter that has to be dealt with. Perhaps the review would look at where the legislation would need to be changed in order to address that question. I was struck by the number of ideas from CWU and others about making sure that dog owners are more responsible. I want to urge the minister in her review to confirm that she is willing to review the dog control legislation in its broader context, to look at enforcement and to understand that it may not be satisfactory to have enforcement at a local level. It may be that there needs to be something at a national level, too. It would also seek confirmation from her that, when she does review the work, she will look at the charities in the sector, but critically, with the CWU and others who have a direct responsibility for their members. Liz Smith, followed by Colin Beattie. I add my own congratulations to Alex Neil, not only for bringing the debate but for his articulate speech this evening, but also to all other members who have read some extremely salient points in what has to be done. I add myself to the list of MSPs who have suffered an attack from a dog, but, in my case, what has been much worse was my witnessing of a councillor colleague who was really savaged by a dog that had her in hospital for some time and who has been scarred for life as a result. I cannot stress how important that issue is. I want to focus my remarks on what uncontrolled dogs can mean for a rural community like mine, and it is particularly relevant just now because of the growing incidence of sheepwaring in both Persia and Fife. Members will have seen the issue reported in the press. Farmers who have lost thousands of pounds of livestock because a dog has been allowed to run riot in a field of use and lambs. It is too upsetting for me to describe what I was asked to witness by a constituent who rang me to look at the result of a recent attack. In terms of what I had to see in that field, it was awful. In Fife, I have noticed reports of a farmer who had to endure two such attacks on farm animals in the space of only 36 hours, resulting in £12,000 of damage. That, Deputy Presiding Officer, is somebody's livelihood. The rural statistics make for shocking reading too. Last year, across Scotland, there were 175 reported cases of sheepwaring, but only 19 convictions. In Persia, there were 14 cases last year and no convictions. The most recent attack that took place just last week in Cults was Monday or Tuesday last week, which resulted in one sheep being found dead and another being put down due to the severity of his injuries. On 15 April, a dog was shot by a farmer. Legal right to do that, but in the Fertivia area of Persia, that was after persistent worrying of his flock. A few days before that, on 13 April, another U in the Glen Craig area was put down after it was found that seriously injured a whole lot of lambs in a field. It goes on. At the meeting of the local Persia NFUS just on Friday, the whole issue was debated in full. I was able to brief the members on the discussions that I had been having with local police about that, which are very concerned, naturally, and the representatives from other aspects of the farming community. I very much hope that we will shortly be afforded a meeting with Minister Fergus Ewing, who I know is genuinely very concerned about that. It cannot go on. We need much tighter controls in place, and I think that Clare Haughey is absolutely right to raise the possibility of looking at other issues. We need to raise public awareness of what has been happening across the countryside, and I think that farmers are virtually unanimous in their view that they want to see a very full debate about the respective mirrors of licensing, microchipping and DNA sampling in order to help police to convict the guilty parties. It has also been said that we need to review the Scottish outdoor access code, because it has too many loopholes within it, allowing irresponsible walkers and ramblers to get away with it. Personally, I think that that cannot come soon enough. In my most recent trips into the Scottish hills and mountains, I have seen two clear examples of highly irresponsible behaviour by dog owners, one of which replicates what Liam Kerr said, but which could have resulted very high on the hill if anything had happened, mountain rescue as well. There is a big job to be done to educate the public and raise awareness of just what can happen when dogs are not properly controlled. We have already heard of the untold damage that can be done to humans, and Alex Neil is absolutely right to pursue that. I urge, however, that measures include those to address the concerns on the countryside and the awful implications for the livelihoods of those affected. I firmly believe that we need a very full debate on that whole issue. The last two speakers in the open debate are Colin Beattie, to be followed by John Scott. Let me first thank Alex Neil for securing this very important debate. In my constituency of Midlothian North and Musselborough, I have been made all too aware of the prevalence of dog attacks, both on residents and on other dogs. Her a number of constituents come forward to tell me their stories, and some of what they describe is horrific. How to control dogs attacking other dogs, sometimes with fatal results, dreadful injuries to other dogs, which require surgery and could be life changing for the victim dog. While most often I hear of injuries sustained by pet animals, there are also a significant number of human beings being injured, often while trying to save their much-loved pet from harm. One such lady suffered permanent nerve injuries to her hand when she was savaged by an attacking dog. Now she is afraid to go into parks with her dog for fear of attack. She is not alone. Many human victims of dog attacks suffer psychological trauma as a result of unprovoked attack. When I talk of life changing injuries, they are not all physical. Another recent case has come to me where a lady was forced to watch her well-loved pet dog being literally torn apart by a rotweller. One can only imagine the distress and lasting grief caused by such an attack. In Midlothian, I've had discussions with the police in the council, and it's clear that such attacks are under-reported in part due to confusion on the part of the public where to actually report incidents and which incidents require reporting to the police and which to the council. The system should be much simpler. Members of the public should not have to work out the nuances of whether this is a police matter or a dog control matter for the council. A dangerous dog is a dangerous dog. I've seen material from the communication workers union in respect to attacks on postal workers, and some of the photographs of the injuries sustained drive home the enormity of the problem. The CWU tells us that 220 postal workers were attacked and injured by dogs in the past year, and that's quite simply unacceptable. In Bonnerig, there's a community group called Brightsparks, located beside George Fifth Park. They cater for some 160 children with additional support needs. They cannot make use of the park because the children are absolutely terrified of uncontrolled aggressive dogs in the park. Instead, they remain safe behind secure high-wire fences in their play area. Is it really acceptable that it's our children who are in cages and not the creatures who cause such fear? Irresponsible professional dog walkers who sometimes bring six or seven dogs to the park and then simply let them loose are a significant part of the problem. Not just when the dog is running wild, but from the antisocial behaviour in allowing dog poo to pollute our parks. The problems again can be confined to a small number of professional dog walkers whose standards are unacceptable. On a more personal note, I myself have noted when knocking on doors at election time, firstly the number of people who have dogs, and secondly the number of dogs who exhibit aggressive tendencies. Now, it may seem that they have a down on dogs, but that's far from the truth. The vast majority of dog owners are responsible people who's well cared for pets will never cause the slightest problem. However, we have to acknowledge that a small number of owners are causing serious issues within our communities, and that cannot continue. I have received many suggestions which, as it believes, might help to control the unsocialised minority while enabling decent dog owners and their pets to continue to enjoy their lives together. Among those suggestions are bringing back a dog licensing scheme which would allow irresponsible dog owners to be deprived of the right to own the pets which they abuse, licence the professional dog walkers. Again, that would enable licences to be removed from those who fail to maintain reasonable standards, compulsory pet insurance, so that victims of attacks can seek compensation. Now, I'm uncertain whether the current deplorable situation has arisen due to present legislation being inadequate to provide the protection that is required, or indeed if present legislation is perfectly adequate, but the police and councils need to be more robust in making use of the powers that they have. Either way, there is action to be taken. My inclination would be to agree with the communication workers union that, for a start, there should be post-legislative scrutiny of the control of dogs act 2010. Only by doing so will we be able to assess how effective that act is. Presiding Officer, there is a real problem that is growing along with the expansion of dog ownership, and we cannot stand by while residents of this country and their pets are being injured. That would indeed be irresponsible. John Scott Thank you, Presiding Officer, and I'll endeavour to be brief. Can I also congratulate Alex Neil in bringing forward this motion today? I agree completely with him that the act is not working. I agree that the rising number of attacks on people and children is despairing and often disfiguring, or indeed much worse. I agree that a review of the 2010 act needs to take place and the powers available to the authorities to prevent that. I also have concerns about dog and dog attacks, and a small dog was recently destroyed by a larger one in my constituency. However, the point that I want to make is with regard to sheep worrying by dogs, not under control. I need to declare an interest here as a farmer, and my sheep flock have twice been subject to attack by dogs. That resulted in many in-lam use being killed, or almost worse, having to be put down some hours after the attack as the in-lam use in a vet's view were unlikely to survive. That was a significant loss to my business as the sheep were not insured. In addition, many others, using the flocks, aborted their lam subsequently after the attacks, as a result of the stress and exertion that those heavily pregnant youth had to endure. So, like Finlay Carson, I support the Scottish Farmer and the NFU's campaign to take a leap. I, too, would invite the Government to consider reviewing the legislation in place and to invite the strengthening of the legislation with regard particularly to sheep worrying. Of course. I am not being precious about the legislation, but the Scottish Farmer's magazine had no idea about the control of dogs act. So I am back to the position where there is no publicity to the NFU or to the Scottish Farmer about this. I completely share his concerns, but we must get publicity for this act as well as review perhaps the content. I thank Christine Grahame for her well-intentioned intervention. I am sure. Nonetheless, the campaign has been mounted by both of these organisations in good faith. They have presented us with a problem and it is up to us as politicians and the Government to resolve. I am sure that you will do all that you can to put pressure on your party to come to a satisfactory resolution if at all possible. Like Kenny Gibson, while I had forgotten my own dog bites I, too, bear the scars. Finally, I, too, make this plea for better control of dangerous dogs on behalf of our dedicated postman, particularly in air constituency, who all know where the biting dogs are on their own walks and support the CWU's position on that. Presiding Officer, the time for talking and collecting data is long past. It is now time for the Governments of all colours to act. I call Annabelle Ewing to conclude this debate for around seven minutes, please, minister. Thank you, Presiding Officer. I, too, would like to begin by congratulating Alex Neil on securing this evening's members' debate. It is indeed appropriate to reiterate that it was, of course, Alex Neil who embarked on the process that led to the control of dogs that were passed by this Parliament back in 2010. As we have heard, Alex Neil, in fact, brought forward the original members' bill proposal before other events intervened and then Christine Grahame took up the baton and brought the legislation to the Parliament and the Parliament, indeed, due to the past the dog control notice regime. I pay tribute to both of them for their hard work and perseverance in ensuring that the issue was brought before the Parliament and in securing, through the members' bill process, a legislative route to that end. The control of dogs act gave new powers to local authorities to deal with the issue of irresponsible dog ownership. The focus of the legislation, as has been mentioned, was indeed, indeed a not breed. It did that by moving away from an outdated understanding that certain breeds of dogs were inherently more dangerous than others and, instead, correctly focused on the actions of dog owners in controlling their own dogs. Of course, I think that it has been recognised that the vast majority of dog owners are indeed responsible and enjoy the companionship of having a dog and indeed the outdoor activity that having a dog, I understand, brings to your life. I don't have a dog but I see many people being dragged out for walks at all times of the day and night which is, of course, a healthy option for them. But, of course, there is a minority, a small minority of dog owners who fail to understand their responsibilities that come with owning a dog, caring for the dog, looking after the dog and indeed making sure that others, both human and animals, are safe around their dogs. The powers given to local authorities under the legislation mean that dog control notices can be used against dog owners who allow their dogs to be out of control and it is indeed for local authority authorised officers and, of course, the number of such officers in each local authority is a matter for that local authority. But for those authorised officers to use those powers to help protect our communities from out-of-control dogs, the most recent evidence shows that, as a whole, local authorities are using those powers more and more each year and in the latest year for which we have statistics on this, that is the year of February 2015 to February 2016, a record number of dog control notices were issued across Scotland, that is to say, 290 notices. However, what is also clear from the data on the use of the act is that, as has been mentioned, there is a wide variation in the use of these powers by local authorities. And I think it would be fair to say at least to a certain extent that that variation will reflect the way in which the legislation is designed to be used and, as Christine Grahame alluded, indeed it is a preventative regime seeking to resolve dog control issues before a dog actually becomes dangerous. Some local authorities, therefore, will not necessarily proceed to issue dog control notices in every case, but instead will engage with owners and give them advice on keeping their dogs under control. I wonder if the minister has had a discussion with local authorities about why there is this variation. You speculate that it might be because they are doing one thing or another. I think that we would want a reassurance that, if they are not putting out notices, they are doing something else. I think that it is that rig around us that we are asking for. There may not be a national solution but there certainly has to be a national conversation. Annabelle Ewing I entirely agree with that remark from John Lamont which is why I will be writing to each of the 32 local authorities to seek from them and update us to what exactly they do further to this legislation. I think that it is important, indeed, that we have that information in order that we can determine how best to proceed. The 2010 act also made a significant change to how the long-standing criminal offence in relation to dangerous dogs operated. The change meant that dogs dangerously out of control in private places such as the home were brought within the scope of the act and this development was very important for our essential postal workers. Indeed, this legislative change was welcomed by postal workers. Further to the comments, I think that for most members tonight about the CWU letter to us all, I can say to members that I will be seeking a meeting with the CWU to discuss in more detail their particular concerns and suggestions. In this session of Parliament members will, of course, be aware that there is a renewed focus on post-legislative scrutiny with the creation of the public audit and post-legislative scrutiny committee. I can say on behalf of the Government that if the public audit committee were to decide to look into the operation of the 2010 act, then we would certainly be very happy to be involved in that. Of course, the act has been, as has been mentioned, enforced since February 2011. And so a number of years of experience and operation could be, indeed, usefully assessed by that committee of this Parliament. And as I said also, we did very much support at the time the ethos of the legislation proposed by Alex Neil and then Christine Graham. And we felt that looking at rather the behaviour of the dog owner was the key element of ensuring that we tackled this problem of out-of-control dogs. In the end of the day, it's not the dog's fault if the dog is out of control, it's the owner's fault if the dog is out of control. And that is an important point to bear in mind. I think that it would be helpful to remind members that just to look at wider issues here that the Government did, in fact, undertake a consultation on other possible steps in 2013, including seeking views on introducing dog licensing or dog muzzling. They were mixed views offered on dog licensing with the majority of those who offered a view against reintroducing such a system. And I can say that there was, in fact, overwhelming opposition to the introduction of mandatory muzzling. However, what was clear from this consultation exercise was the importance of the preventative approach that was set forth in the 2010 act. Liz Smith No, no, you can't just shout, Ms Smith, because we need the microphones for the official report. Much as I know, you would be capable of reaching the far reaches of the chamber. Apologies, Deputy Presiding Officer. Would the minister accept, nonetheless, despite the evidence about the licensing issue that there is new technology now, there is microchipping? That this is a very important issue about using technology to control dogs and the responsibility of the owners. It's not just about licensing, it's about use of DNA, it's about use of the microchip. Would you agree to look at that? Annabelle Ewing Well, certainly, obviously technology has moved on, but I just wanted to emphasise to members that the idea that dog licensing is some sort of panacea is not shared by members of the public who actually didn't support that approach. In terms of situations where a dog control notice is issued, then there is mandatory microchipping involved. In terms of the important issue of livestock worrying that has been raised by a number of members, of course local authorities do actually have existing powers to issue dog control notices to dogs deemed out of control, and that obviously includes dogs out of control as far as livestock worrying is concerned. And indeed, there are local council bylaws in place that can allow legislation to enforce the use of leads in areas where control of dogs has been an issue. Obviously, we keep all important matters under review, and I would say to Liz Smith that I'd be happy to ensure that the Cabinet Secretary for the Rural Economy that his attention is drawn to the debate tonight, because, of course, many key pertent points were raised on that very, very important issue of livestock worrying. I think that, in conclusion, I say that I'm over my time, Presiding Officer. I think that it is fair to say that we've had a very good debate tonight. A lot of very important issues were raised, a lot of concrete ideas were raised, and what I would say again is that it would appear to me that we have created this opportunity through the parliamentary committee process to engage in post-legislative scrutiny of appropriate legislation. It would appear to me that this legislation, the 2010 act, may be ripe for such scrutiny by our Parliament's public audit and post-legislative scrutiny committee. So I do hope that that committee may reflect on the very important debate tonight, and we will ensure that their attention is drawn to the comments of all members in this debate. Thank you, Presiding Officer. That concludes the debate, and the meeting is closed.